Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (40 loc) · 1.65 KB

File metadata and controls

53 lines (40 loc) · 1.65 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ROSE is a tool for building preprocessors, this file is an example preprocessor built with ROSE.
// rose.C: Example (default) ROSE Preprocessor: used for testing ROSE infrastructure
#include "rose.h"
using namespace std;
int
main ( int argc, char* argv[] )
{
ios::sync_with_stdio(); // Syncs C++ and C I/O subsystems!
// Initialize and check compatibility. See Rose::initialize
ROSE_INITIALIZE;
if (SgProject::get_verbose() > 0)
printf ("In preprocessor.C: main() \n");
SgProject* project = frontend(argc,argv);
ROSE_ASSERT (project != NULL);
// AST diagnostic tests
AstTests::runAllTests(const_cast<SgProject*>(project));
// test statistics
if (project->get_verbose() > 1)
{
cout << AstNodeStatistics::traversalStatistics(project);
cout << AstNodeStatistics::IRnodeUsageStatistics();
}
if (project->get_verbose() > 0)
printf ("Generate the pdf output of the SAGE III AST \n");
generatePDF ( *project );
if (project->get_verbose() > 0)
printf ("Generate the DOT output of the SAGE III AST \n");
generateDOT ( *project );
Rose_STL_Container<SgNode*> nodeList;
// nodeList = NodeQuery::querySubTree (project,V_SgType,NodeQuery::ExtractTypes);
nodeList = NodeQuery::querySubTree (project,V_SgForStatement);
printf ("\nnodeList.size() = %zu \n",nodeList.size());
Rose_STL_Container<SgNode*>::iterator i = nodeList.begin();
while (i != nodeList.end())
{
printf ("Query node = %p = %s = %s \n",*i,(*i)->sage_class_name(),(*i)->unparseToString().c_str());
i++;
}
return 0;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.