Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
vcgASTWalker Class ReferenceInheritance diagram for vcgASTWalker:
List of all members.
|
Public Types |
enum | Order { Preorder,
Postorder,
Both
} |
| The order in which AST Nodes should be visited. More...
|
enum | Depth { Subtree,
NodeOnly
} |
| Which Nodes in the AST tree should be visited. More...
|
Public Member Functions |
| vcgASTWalker (ostream &ostr, const string &comment, string excludefilename) |
virtual | ~vcgASTWalker (void) |
Protected Types |
typedef list< string > | strings |
Protected Member Functions |
bool | excluded (procNode *proc) |
bool | excluded (Coord coord) |
void | start_graph () |
void | print_comment (const string &comment="") |
void | print_graph_attribute (const string &attribute, const string &value) |
void | print_node_attribute (const string &attribute, const string &value) |
void | print_node_attribute (const string &attribute, int value) |
void | print_node_value (const string &attribute, const string &value) |
Protected Attributes |
ostream & | graph |
strings | exclude |
bool | currently_excluded |
Private Types |
typedef pair< Node *, string > | Edge |
typedef list< Edge > | Edges |
typedef Edges::iterator | Edges_p |
typedef map< Node *, Edges > | Edge_map |
Private Member Functions |
virtual void | finalize_graph () |
void | print_node (Node *n) |
string | node_title (Node *n) |
string | node_label (Node *n) |
void | print_edge (Node *from, Node *to, string name) |
void | delayed_print_edge (void) |
string | node_name (Node *n) |
template<class S, class T> void | print_edges (S parent, list< T > &children, string name) |
void | at_unit (unitNode *the_unit, Order ord) |
void | at_decl (declNode *the_decl, Order ord) |
void | at_proc (procNode *the_proc, Order ord) |
void | at_prim (primNode *the_prim, Order ord) |
void | at_tdef (tdefNode *the_tdef, Order ord) |
void | at_ptr (ptrNode *the_ptr, Order ord) |
void | at_array (arrayNode *the_array, Order ord) |
void | at_func (funcNode *the_func, Order ord) |
void | at_sue (sueNode *the_sue, Order ord) |
void | at_suespec (suespecNode *the_suespec, Order ord) |
void | at_const (constNode *the_const, Order ord) |
void | at_id (idNode *the_id, Order ord) |
void | at_binary (binaryNode *the_binary, Order ord) |
void | at_unary (unaryNode *the_unary, Order ord) |
void | at_cast (castNode *the_cast, Order ord) |
void | at_comma (commaNode *the_comma, Order ord) |
void | at_ternary (ternaryNode *the_ternary, Order ord) |
void | at_call (callNode *the_call, Order ord) |
void | at_initializer (initializerNode *the_initializer, Order ord) |
void | at_block (blockNode *the_block, Order ord) |
void | at_exprstmt (exprstmtNode *the_exprstmt, Order ord) |
void | at_label (labelNode *the_label, Order ord) |
void | at_case (caseNode *the_case, Order ord) |
void | at_if (ifNode *the_if, Order ord) |
void | at_switch (switchNode *the_switch, Order ord) |
void | at_while (whileNode *the_while, Order ord) |
void | at_do (doNode *the_do, Order ord) |
void | at_for (forNode *the_for, Order ord) |
void | at_goto (gotoNode *the_goto, Order ord) |
void | at_continue (continueNode *the_continue, Order ord) |
void | at_break (breakNode *the_break, Order ord) |
void | at_return (returnNode *the_return, Order ord) |
void | at_attrib (attribNode *the_attrib, Order ord) |
void | at_text (textNode *the_text, Order ord) |
void | at_threeAddr (threeAddrNode *t, Order ord) |
void | at_conditiongoto (conditiongotoNode *c, Order ord) |
void | at_operand (operandNode *o, Order ord) |
Private Attributes |
node_list | nodes |
Edge_map | edges |
Member Typedef Documentation
typedef pair<Node*, string> vcgASTWalker::Edge [private]
|
|
typedef map<Node*,Edges> vcgASTWalker::Edge_map [private]
|
|
typedef list<Edge> vcgASTWalker::Edges [private]
|
|
typedef Edges::iterator vcgASTWalker::Edges_p [private]
|
|
typedef list<string> vcgWalker::strings [protected, inherited]
|
|
|
Definition at line 54 of file vcg.h. |
Member Enumeration Documentation
enum Walker::Depth [inherited]
|
|
|
Which Nodes in the AST tree should be visited.
- Enumeration values:
-
Subtree |
The entire AST should be traversed. |
NodeOnly |
Only the root Node should be visited. |
Definition at line 155 of file walker.h. |
enum Walker::Order [inherited]
|
|
|
The order in which AST Nodes should be visited.
- Enumeration values:
-
Preorder |
Nodes should be visited before their children. |
Postorder |
Nodes should be visited after their children. |
Both |
Nodes should be visited both before and after their children. |
Definition at line 147 of file walker.h.
Referenced by whileNode::walk(), unitNode::walk(), unionNode::walk(), unaryNode::walk(), threeAddrNode::walk(), textNode::walk(), ternaryNode::walk(), tdefNode::walk(), switchNode::walk(), suespecNode::walk(), subdeclNode::walk(), structNode::walk(), returnNode::walk(), ptrNode::walk(), procNode::walk(), primNode::walk(), operandNode::walk(), metastmtNode::walk(), metaexprNode::walk(), labelNode::walk(), initializerNode::walk(), ifNode::walk(), idNode::walk(), gotoNode::walk(), funcNode::walk(), forNode::walk(), exprstmtNode::walk(), enumNode::walk(), doNode::walk(), declNode::walk(), continueNode::walk(), constNode::walk(), conditiongotoNode::walk(), commaNode::walk(), castNode::walk(), caseNode::walk(), callNode::walk(), breakNode::walk(), blockNode::walk(), binaryNode::walk(), basicblockNode::walk(), attribNode::walk(), and arrayNode::walk(). |
Constructor & Destructor Documentation
vcgASTWalker::vcgASTWalker |
( |
ostream & |
ostr, |
|
|
const string & |
comment, |
|
|
string |
excludefilename |
|
) |
[inline] |
|
virtual vcgASTWalker::~vcgASTWalker |
( |
void |
|
) |
[inline, virtual] |
|
Member Function Documentation
void vcgASTWalker::at_array |
( |
arrayNode * |
the_array, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_attrib |
( |
attribNode * |
the_attrib, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_basicblock |
( |
basicblockNode * |
the_basicblock, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_binary |
( |
binaryNode * |
the_binary, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
|
Reimplemented from Walker.
Definition at line 438 of file vcgast.cc.
References Operator::ARROW, vcgWalker::currently_excluded, Operator::id(), binaryNode::left(), binaryNode::op(), Walker::Postorder, print_edge(), print_node(), binaryNode::right(), exprNode::type(), and Node::walk(). |
void vcgASTWalker::at_block |
( |
blockNode * |
the_block, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_break |
( |
breakNode * |
the_break, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_call |
( |
callNode * |
the_call, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_case |
( |
caseNode * |
the_case, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_cast |
( |
castNode * |
the_cast, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_comma |
( |
commaNode * |
the_comma, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_const |
( |
constNode * |
the_const, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_continue |
( |
continueNode * |
the_continue, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_decl |
( |
declNode * |
the_decl, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_def |
( |
defNode * |
the_def, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_do |
( |
doNode * |
the_do, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_enum |
( |
enumNode * |
the_enum, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_expr |
( |
exprNode * |
the_expr, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
|
Reimplemented in NodeLocator, and remove_stale_type_walker.
Definition at line 275 of file walker.h.
References Walker::at_node().
Referenced by Walker::at_binary(), Walker::at_call(), Walker::at_cast(), Walker::at_comma(), Walker::at_index(), Walker::at_initializer(), Walker::at_operand(), Walker::at_ternary(), Walker::at_unary(), and metaexprNode::walk(). |
void vcgASTWalker::at_exprstmt |
( |
exprstmtNode * |
the_exprstmt, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_for |
( |
forNode * |
the_for, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_func |
( |
funcNode * |
the_func, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_goto |
( |
gotoNode * |
the_goto, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_id |
( |
idNode * |
the_id, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_if |
( |
ifNode * |
the_if, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_index |
( |
indexNode * |
the_index, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_initializer |
( |
initializerNode * |
the_initializer, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_jump |
( |
jumpNode * |
the_jump, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_label |
( |
labelNode * |
the_label, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_loop |
( |
loopNode * |
the_loop, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_node |
( |
Node * |
the_node, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
|
Reimplemented in gcWalker, goto_label_walker, set_container_walker, sue_complete_walker, TreeChecker, and df_number_walker.
Definition at line 223 of file walker.h.
Referenced by Walker::at_def(), Walker::at_expr(), Walker::at_stmt(), Walker::at_text(), Walker::at_type(), and Walker::at_unit(). |
void vcgASTWalker::at_operand |
( |
operandNode * |
o, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_prim |
( |
primNode * |
the_prim, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_proc |
( |
procNode * |
the_proc, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_ptr |
( |
ptrNode * |
the_ptr, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_return |
( |
returnNode * |
the_return, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_selection |
( |
selectionNode * |
the_selection, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_stmt |
( |
stmtNode * |
the_stmt, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
|
Reimplemented in NodeLocator, W, init_flowproblem_walker, and LivenessWalker.
Definition at line 308 of file walker.h.
References Walker::at_node().
Referenced by Walker::at_attrib(), Walker::at_block(), Walker::at_exprstmt(), Walker::at_jump(), Walker::at_loop(), Walker::at_selection(), Walker::at_target(), Walker::at_threeAddr(), and metastmtNode::walk(). |
virtual void Walker::at_struct |
( |
structNode * |
the_struct, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_subdecl |
( |
subdeclNode * |
the_subdecl, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_sue |
( |
sueNode * |
the_sue, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_suespec |
( |
suespecNode * |
the_suespec, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_switch |
( |
switchNode * |
the_switch, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_target |
( |
targetNode * |
the_target, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_tdef |
( |
tdefNode * |
the_tdef, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_ternary |
( |
ternaryNode * |
the_ternary, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_text |
( |
textNode * |
the_text, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_threeAddr |
( |
threeAddrNode * |
t, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_type |
( |
typeNode * |
the_type, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_unary |
( |
unaryNode * |
the_unary, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
virtual void Walker::at_union |
( |
unionNode * |
the_union, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void vcgASTWalker::at_unit |
( |
unitNode * |
the_unit, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::at_while |
( |
whileNode * |
the_while, |
|
|
Order |
ord |
|
) |
[inline, private, virtual] |
|
void vcgASTWalker::delayed_print_edge |
( |
void |
|
) |
[inline, private] |
|
Depth Walker::depth |
( |
|
) |
const [inline, inherited] |
|
|
Return which Nodes of an AST should be visited.
A value of SubTree specifies that the entire AST should be traversed. A value of NodeOnly specifies that only the root Node in the AST should be visited.
Definition at line 211 of file walker.h.
Referenced by whileNode::walk(), unitNode::walk(), unionNode::walk(), unaryNode::walk(), threeAddrNode::walk(), ternaryNode::walk(), switchNode::walk(), suespecNode::walk(), subdeclNode::walk(), structNode::walk(), returnNode::walk(), ptrNode::walk(), procNode::walk(), operandNode::walk(), metastmtNode::walk(), metaexprNode::walk(), labelNode::walk(), initializerNode::walk(), ifNode::walk(), idNode::walk(), funcNode::walk(), forNode::walk(), exprstmtNode::walk(), enumNode::walk(), doNode::walk(), declNode::walk(), constNode::walk(), conditiongotoNode::walk(), commaNode::walk(), castNode::walk(), caseNode::walk(), callNode::walk(), blockNode::walk(), binaryNode::walk(), basicblockNode::walk(), attribNode::walk(), arrayNode::walk(), and Walker::Walker(). |
bool vcgWalker::excluded |
( |
Coord |
coord |
) |
[protected, inherited] |
|
bool vcgWalker::excluded |
( |
procNode * |
proc |
) |
[protected, inherited] |
|
virtual void vcgASTWalker::finalize_graph |
( |
|
) |
[inline, private, virtual] |
|
string vcgASTWalker::node_label |
( |
Node * |
n |
) |
[inline, private] |
|
string vcgASTWalker::node_name |
( |
Node * |
n |
) |
[inline, private] |
|
|
Definition at line 197 of file vcgast.cc.
References Array, Attrib, Binary, Block, Break, Call, Case, Cast, Comma, Condition, Const, Continue, Decl, Do, Enum, Expr, For, Func, Goto, Id, If, Initializer, constant::is_str(), Label, Meta, Operand, Prim, Proc, Ptr, Return, STRING, Struct, sueSpec, Switch, Tdef, Ternary, Text, ThreeAddr, constant::to_string(), Node::typ(), Unary, Undeclared, Union, Unit, and While.
Referenced by node_label(), and node_title(). |
string vcgASTWalker::node_title |
( |
Node * |
n |
) |
[inline, private] |
|
Order Walker::order |
( |
|
) |
const [inline, inherited] |
|
|
Return the order in which Nodes of an AST should be visited.
Nodes can be visited before their children (Preorder), after their children (Postorder), or both (Both).
Definition at line 203 of file walker.h.
Referenced by df_number_walker::at_node(), whileNode::walk(), unitNode::walk(), unionNode::walk(), unaryNode::walk(), threeAddrNode::walk(), textNode::walk(), ternaryNode::walk(), tdefNode::walk(), switchNode::walk(), suespecNode::walk(), subdeclNode::walk(), structNode::walk(), returnNode::walk(), ptrNode::walk(), procNode::walk(), primNode::walk(), operandNode::walk(), metastmtNode::walk(), metaexprNode::walk(), labelNode::walk(), initializerNode::walk(), ifNode::walk(), idNode::walk(), gotoNode::walk(), funcNode::walk(), forNode::walk(), exprstmtNode::walk(), enumNode::walk(), doNode::walk(), declNode::walk(), continueNode::walk(), constNode::walk(), conditiongotoNode::walk(), commaNode::walk(), castNode::walk(), caseNode::walk(), callNode::walk(), breakNode::walk(), blockNode::walk(), binaryNode::walk(), basicblockNode::walk(), attribNode::walk(), and arrayNode::walk(). |
void vcgWalker::print_comment |
( |
const string & |
comment = "" |
) |
[protected, inherited] |
|
void vcgASTWalker::print_edge |
( |
Node * |
from, |
|
|
Node * |
to, |
|
|
string |
name |
|
) |
[inline, private] |
|
|
Definition at line 164 of file vcgast.cc.
References Node::coord(), Edge, vcgWalker::excluded(), Node::typ(), and Unit.
Referenced by at_array(), at_attrib(), at_binary(), at_call(), at_case(), at_cast(), at_comma(), at_conditiongoto(), at_const(), at_decl(), at_do(), at_exprstmt(), at_for(), at_func(), at_id(), at_if(), at_initializer(), at_label(), at_operand(), at_proc(), at_ptr(), at_return(), at_switch(), at_ternary(), at_threeAddr(), at_unary(), at_while(), and print_edges(). |
template<class S, class T> |
void vcgASTWalker::print_edges |
( |
S |
parent, |
|
|
list< T > & |
children, |
|
|
string |
name |
|
) |
[inline, private] |
|
void vcgWalker::print_graph_attribute |
( |
const string & |
attribute, |
|
|
const string & |
value |
|
) |
[protected, inherited] |
|
void vcgASTWalker::print_node |
( |
Node * |
n |
) |
[inline, private] |
|
|
Definition at line 83 of file vcgast.cc.
References Array, Attrib, Binary, Block, Break, Call, Case, Cast, Comma, Condition, Const, Continue, Node::coord(), Decl, Do, Enum, vcgWalker::excluded(), Expr, For, Func, Goto, vcgWalker::graph, Id, If, Initializer, Label, Meta, node_label(), node_title(), Operand, Prim, vcgWalker::print_node_attribute(), vcgWalker::print_node_value(), Proc, Ptr, Return, Struct, sueSpec, Switch, Tdef, Ternary, Text, ThreeAddr, Node::typ(), Unary, Undeclared, Union, Unit, and While.
Referenced by at_array(), at_attrib(), at_binary(), at_block(), at_break(), at_call(), at_case(), at_cast(), at_comma(), at_conditiongoto(), at_const(), at_continue(), at_decl(), at_do(), at_exprstmt(), at_for(), at_func(), at_goto(), at_id(), at_if(), at_initializer(), at_label(), at_operand(), at_prim(), at_proc(), at_ptr(), at_return(), at_sue(), at_suespec(), at_switch(), at_tdef(), at_ternary(), at_text(), at_threeAddr(), at_unary(), at_unit(), and at_while(). |
void vcgWalker::print_node_attribute |
( |
const string & |
attribute, |
|
|
int |
value |
|
) |
[protected, inherited] |
|
void vcgWalker::print_node_attribute |
( |
const string & |
attribute, |
|
|
const string & |
value |
|
) |
[protected, inherited] |
|
void vcgWalker::print_node_value |
( |
const string & |
attribute, |
|
|
const string & |
value |
|
) |
[protected, inherited] |
|
void vcgWalker::start_graph |
( |
|
) |
[inline, protected, inherited] |
|
Member Data Documentation
bool vcgWalker::currently_excluded [protected, inherited]
|
|
|
Definition at line 62 of file vcg.h.
Referenced by at_array(), at_attrib(), at_binary(), at_block(), at_break(), vcgCCGWalker::at_call(), at_call(), at_case(), at_cast(), at_comma(), at_conditiongoto(), at_const(), at_continue(), at_decl(), at_do(), at_exprstmt(), at_for(), at_func(), at_goto(), at_id(), at_if(), at_initializer(), at_label(), at_operand(), at_prim(), vcgCCGWalker::at_proc(), at_proc(), vcgWalker::at_proc(), at_ptr(), at_return(), at_sue(), at_suespec(), at_switch(), at_tdef(), at_ternary(), at_text(), vcgCCGWalker::at_threeAddr(), at_threeAddr(), at_unary(), and at_while(). |
strings vcgWalker::exclude [protected, inherited]
|
|
ostream& vcgWalker::graph [protected, inherited]
|
|
The documentation for this class was generated from the following file:
|