forked from rose-compiler/rose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frontendAndDump.C
24 lines (19 loc) · 791 Bytes
/
frontendAndDump.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "rose.h"
// This code demonstrates the construction of binary AST
// output to stdout. It is useful to avoid recompilation
// of source files since the AST construction can in some
// cases be significantly more time consuming than the
// input of the binary formatted AST file (which is optimized
// to be very fast). Ths makes it simpler (and quicker) to
// support tools that would operate on large ASTs.
int main(int argc, char *argv[])
{
// Read source cdoe and build ROSE AST
SgProject* sageProject = frontend(argc,argv);
// Run tests on AST
AstTests::runAllTests(sageProject);
// Write out the AST as a binary formatted file (to stdout)
AST_FILE_IO::startUp(sageProject) ;
AST_FILE_IO::writeASTToFile("/dev/stdout");
return 0;
}