RoseAst
Interface for iterating over an AST.
Synopsis
Declared in <src/midend/abstractLayer/RoseAst.h>
class RoseAst;
Types
Name |
Description |
AST iterator. |
|
Member Functions
Name |
Description |
|
Defines the starting node for traversal. |
Iterator positioned at root of subtree. |
|
Iterator positioned at the end of the traversal. |
|
Static Member Functions
Name |
Description |
deprecated, use isSubTypeOf instead |
|
determines based on VariantT whether a ROSE‐AST node is a subtype of another node type. |
|
determines whether a node is used to represent the root node of a template instantiation |
|
determines whether a node is used to represent the root node of a template. |
Protected Static Member Functions
Name |
Private Data Members
Description
The iterator follows the STL iterator pattern and is implemented as a depth‐first, pre‐order traversal that mtaintsins its own stack. The iterator performs the exact same traversal as the traversal classes in ROSE (it is using the same underlying information).
#include <RoseAst.h>
SgNode *node = .... // any subtree
RoseAst ast(node);
for (RoseAst::iterator i = ast.begin(); i != ast.end(); ++i)
std::cout <<"We are here: " <<(*i)->class_name() <<"\n";
Created with MrDocs