C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Walker Class Reference
[AST Traversal functional classes.]

A functional class to traverse an AST, and perform some function at each of its Nodes. More...

#include <walker.h>

Inheritance diagram for Walker:

AllocToMemWalker asm_gen_walker Assignment_walker callGraph clear_ids_walker GetDefsWalker count_walker DefUseWalker df_number_walker dummy_reg_alloc_walker enum_value_walker fix_goto_walker fixPointerWalker gcWalker goto_label_walker has_struct_walker identify_inlinees init_flowproblem_walker Linker lir_flow_walker lir_gen_walker LivenessComments LivenessWalker NodeLocator print_walker procedureDB ProcWalker reachingDefinitionsWalker reachingGenKillWalker GetDefsWalker ref_fix_walker RegAllocWalker remove_stale_type_walker renumber_walker RequiresGatherer scope_walker semcheck_walker set_container_walker sue_complete_walker TreeChecker UnificationBasedPtr findVarAssign UnitWalker unreachableCodeRemover vcgWalker W List of all members.

"at_" methods

These methods define the functions that should be performed when different classes of Nodes are encountered in the AST. The most specific "at_" method that matches a given Node's class will be called.

virtual void at_node (Node *the_node, Order ord)
virtual void at_unit (unitNode *the_unit, Order ord)
virtual void at_def (defNode *the_def, Order ord)
virtual void at_decl (declNode *the_decl, Order ord)
virtual void at_subdecl (subdeclNode *the_subdecl, Order ord)
virtual void at_proc (procNode *the_proc, Order ord)
virtual void at_type (typeNode *the_type, Order ord)
virtual void at_prim (primNode *the_prim, Order ord)
virtual void at_tdef (tdefNode *the_tdef, Order ord)
virtual void at_ptr (ptrNode *the_ptr, Order ord)
virtual void at_array (arrayNode *the_array, Order ord)
virtual void at_func (funcNode *the_func, Order ord)
virtual void at_sue (sueNode *the_sue, Order ord)
virtual void at_struct (structNode *the_struct, Order ord)
virtual void at_union (unionNode *the_union, Order ord)
virtual void at_enum (enumNode *the_enum, Order ord)
virtual void at_suespec (suespecNode *the_suespec, Order ord)
virtual void at_expr (exprNode *the_expr, Order ord)
virtual void at_index (indexNode *the_index, Order ord)
virtual void at_const (constNode *the_const, Order ord)
virtual void at_id (idNode *the_id, Order ord)
virtual void at_binary (binaryNode *the_binary, Order ord)
virtual void at_unary (unaryNode *the_unary, Order ord)
virtual void at_cast (castNode *the_cast, Order ord)
virtual void at_comma (commaNode *the_comma, Order ord)
virtual void at_ternary (ternaryNode *the_ternary, Order ord)
virtual void at_call (callNode *the_call, Order ord)
virtual void at_initializer (initializerNode *the_initializer, Order ord)
virtual void at_stmt (stmtNode *the_stmt, Order ord)
virtual void at_block (blockNode *the_block, Order ord)
virtual void at_basicblock (basicblockNode *the_basicblock, Order ord)
virtual void at_exprstmt (exprstmtNode *the_exprstmt, Order ord)
virtual void at_target (targetNode *the_target, Order ord)
virtual void at_label (labelNode *the_label, Order ord)
virtual void at_case (caseNode *the_case, Order ord)
virtual void at_selection (selectionNode *the_selection, Order ord)
virtual void at_if (ifNode *the_if, Order ord)
virtual void at_switch (switchNode *the_switch, Order ord)
virtual void at_loop (loopNode *the_loop, Order ord)
virtual void at_while (whileNode *the_while, Order ord)
virtual void at_do (doNode *the_do, Order ord)
virtual void at_for (forNode *the_for, Order ord)
virtual void at_jump (jumpNode *the_jump, Order ord)
virtual void at_goto (gotoNode *the_goto, Order ord)
virtual void at_continue (continueNode *the_continue, Order ord)
virtual void at_break (breakNode *the_break, Order ord)
virtual void at_return (returnNode *the_return, Order ord)
virtual void at_attrib (attribNode *the_attrib, Order ord)
virtual void at_operand (operandNode *the_oper, Order ord)
virtual void at_conditiongoto (conditiongotoNode *the_condgoto, Order ord)
virtual void at_threeAddr (threeAddrNode *the_3addr, Order ord)
virtual void at_text (textNode *the_text, Order ord)

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

 Walker (Order the_order, Depth depth)
 Create a new instance of a Walker.


Private Attributes

Order _order
 The order in which AST Nodes should be visited.

Depth _depth
 Which Nodes in the AST should be visited.


Detailed Description

A functional class to traverse an AST, and perform some function at each of its Nodes.

A Walker is a functional class that traverses an abstract syntax tree, and performs some function at each of its Nodes. At each Node, the function it performs depends on the class of the Node.

Corresponding to each class in the Node hierarchy, Walker defines an "at_" method. To specify the function that should be performed for Nodes of a particular class, create a subclass of Walker that overrides the "at_" method corresponding to that class. By default, the "at_" methods perform no action. Thus, a Walker subclass only needs to override the "at_" methods corresponding to Node types that are relevant to that walker.

As the AST is traversed, the most specific "at_" method that has been defined for each Node will be called on that Node. For example, if a Walker subclass overrides "at_decl()", but not "at_subdecl()," then the "at_decl()" method wil be called for all declNodes and subDeclnodes encountered in the AST. However, if a Walker subclass overrides both "at_decl()" and "at_subdecl," then the "at_decl()" method will be called for all declNodes encountered in the AST, and the "at_subdecl()" method will be called for all subdeclNodes encountered in the AST. If you wish for both "at_subdecl()" and "at_decl()" to be called for subdeclNodes, then you should explicitly call the "at_decl()" method from "at_subdecl()."

As the walker traverses the AST, the "at_" methods for a Node can be called before its children have been visited, after its children have been visited, or both before and after its children have been visited. When the "at_" methods for a Node are called before its children, they are said to be called in "preorder." When the "at_" methods for a Node are called after its children, they are said to be called in "postorder." If "at_" methods are called both in preorder and in postorder, then the preorder call will always preceed the postorder call.

When a new Walker is created, the order(s) that Nodes are visited in should be specified. In general, all instances of a given subclass of Walker will visit Nodes in the same order. However, it may occasionally be useful to specify different orders for two different instances of the same subclass of Walker.

New instances of Walker can also specify the "depth" of the traversal. If the depth is "SubTree," then a Walker will visit the entire AST rooted at the Node that it is called on. If the depth is "NodeOnly," then the Walker will only call the "at_" method for Node it is called on, and not for any of its sub-Nodes. Thus, a Walker with a depth of NodeOnly functions as if it were a Visitor. If a Walker subclass will always use a depth of NodeOnly, then it should be written as a Visitor instead. The depth value is provided because it can occasionally be useful to use a Walker subclass that was designed to traverse an entire AST to simply visit one Node. In this case, you can simply instantiate the Walker subclass with a depth of NodeOnly.

It is possible for a Walker to modify the fields of the Nodes it visits. However, Walkers should not modify the structure of the AST that is being traversed. In other words, Walkers should only modify Node fields that do not contain sub-Nodes. If the structure of the traversed AST needs to be modified as it is traversed, then a Changer should be used instead of a Walker.

Currently, Walkers traverse the AST in a depth-first order. Preorder calls to the "at_" methods are called before descending into a Node's children, and postorder calls to the "at_" method are called after returning from the children in the traversal. At the leaves, the postorder calls to the "at_" methods immediately follow the preorder calls. However, this ordering is subject to change, and should not be relied upon. The only aspects of the AST traversal ordering which are guaranteed are:

  • The preorder call to a Node's "at_" method is called before any of the calls to the "at_" methods of the Node's descendants.
  • The postorder call to a Node's "at_" method is called after any of the calls to the "at_" methods of the Node's descendants.
  • The preorder call to a Node's "at_" method is called before the postorder call to a Node's "at_" method is called.

Walkers should never be used to traverse ASTs containing cycles; since they detect no mechanism to detect cycles, this would cause an infinite loop.

To use a walker "my_walker" to traverse an AST rooted at "my_node," use the code:

  my_node->walk(my_walker);
  

See also:
Visitor

Changer

Node::walk

Definition at line 142 of file walker.h.


Member Enumeration Documentation

enum Walker::Depth
 

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
 

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

Walker::Walker Order    the_order,
Depth    depth
[inline]
 

Create a new instance of a Walker.

This constructor is usually called by a subclass.

Parameters:
the_order The order in which AST Nodes should be visited. Nodes can be visited before their children (Preorder), after their children (Postorder), or both (Both).
depth Specifies which Nodes in the 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. In general, this parameter should never be hard-coded as NodeOnly; instead, a Visitor should be used. However, the constructor for a subclass of Walker may take a Depth as one of its arguments, and pass it to the Walker subclass.

Definition at line 187 of file walker.h.

References depth().


Member Function Documentation

virtual void Walker::at_array arrayNode   the_array,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 254 of file walker.h.

References at_type().

Referenced by arrayNode::walk().

virtual void Walker::at_attrib attribNode   the_attrib,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 365 of file walker.h.

References at_stmt().

Referenced by attribNode::walk().

virtual void Walker::at_basicblock basicblockNode   the_basicblock,
Order    ord
[inline, virtual]
 

Reimplemented in print_walker, fixPointerWalker, DefUseWalker, LivenessWalker, LivenessComments, reachingGenKillWalker, and reachingDefinitionsWalker.

Definition at line 314 of file walker.h.

References at_block().

Referenced by basicblockNode::walk().

virtual void Walker::at_binary binaryNode   the_binary,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, gcWalker, id_lookup_walker, TreeChecker, print_walker, and Assignment_walker.

Definition at line 287 of file walker.h.

References at_expr().

Referenced by binaryNode::walk().

virtual void Walker::at_block blockNode   the_block,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, scope_walker, and print_walker.

Definition at line 311 of file walker.h.

References at_stmt().

Referenced by at_basicblock(), and blockNode::walk().

virtual void Walker::at_break breakNode   the_break,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, ref_fix_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 359 of file walker.h.

References at_jump().

Referenced by breakNode::walk().

virtual void Walker::at_call callNode   the_call,
Order    ord
[inline, virtual]
 

Reimplemented in NodeLocator, W, vcgASTWalker, vcgCCGWalker, id_lookup_walker, Linker, ref_fix_walker, TreeChecker, and print_walker.

Definition at line 302 of file walker.h.

References at_expr().

Referenced by callNode::walk().

virtual void Walker::at_case caseNode   the_case,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, ref_fix_walker, semcheck_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 326 of file walker.h.

References at_target().

Referenced by caseNode::walk().

virtual void Walker::at_cast castNode   the_cast,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 293 of file walker.h.

References at_expr().

Referenced by castNode::walk().

virtual void Walker::at_comma commaNode   the_comma,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 296 of file walker.h.

References at_expr().

Referenced by commaNode::walk().

virtual void Walker::at_conditiongoto conditiongotoNode   the_condgoto,
Order    ord
[inline, virtual]
 

Reimplemented in lir_gen_walker, vcgASTWalker, TreeChecker, print_walker, LivenessWalker, LivenessComments, and findVarAssign.

Definition at line 371 of file walker.h.

References at_goto().

Referenced by conditiongotoNode::walk().

virtual void Walker::at_const constNode   the_const,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, print_walker, and count_walker.

Definition at line 281 of file walker.h.

References at_index().

Referenced by constNode::walk().

virtual void Walker::at_continue continueNode   the_continue,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, ref_fix_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 356 of file walker.h.

References at_jump().

Referenced by continueNode::walk().

virtual void Walker::at_decl declNode   the_decl,
Order    ord
[inline, virtual]
 

Reimplemented in AllocToMemWalker, NodeLocator, W, vcgASTWalker, id_lookup_walker, name_mangle_walker, semcheck_walker, TreeChecker, ProcWalker, print_walker, has_struct_walker, and UnificationBasedPtr.

Definition at line 233 of file walker.h.

References at_def().

Referenced by at_subdecl(), and declNode::walk().

virtual void Walker::at_def defNode   the_def,
Order    ord
[inline, virtual]
 

Definition at line 230 of file walker.h.

References at_node().

Referenced by at_decl(), and at_proc().

virtual void Walker::at_do doNode   the_do,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 344 of file walker.h.

References at_loop().

Referenced by doNode::walk().

virtual void Walker::at_enum enumNode   the_enum,
Order    ord
[inline, virtual]
 

Reimplemented in enum_value_walker.

Definition at line 269 of file walker.h.

References at_sue().

Referenced by enumNode::walk().

virtual void Walker::at_expr exprNode   the_expr,
Order    ord
[inline, virtual]
 

Reimplemented in NodeLocator, and remove_stale_type_walker.

Definition at line 275 of file walker.h.

References at_node().

Referenced by at_binary(), at_call(), at_cast(), at_comma(), at_index(), at_initializer(), at_operand(), at_ternary(), at_unary(), and metaexprNode::walk().

virtual void Walker::at_exprstmt exprstmtNode   the_exprstmt,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, semcheck_walker, and print_walker.

Definition at line 317 of file walker.h.

References at_stmt().

Referenced by exprstmtNode::walk().

virtual void Walker::at_for forNode   the_for,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, semcheck_walker, TreeChecker, and print_walker.

Definition at line 347 of file walker.h.

References at_loop().

Referenced by forNode::walk().

virtual void Walker::at_func funcNode   the_func,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, scope_walker, TreeChecker, print_walker, and has_struct_walker.

Definition at line 257 of file walker.h.

References at_type().

Referenced by funcNode::walk().

virtual void Walker::at_goto gotoNode   the_goto,
Order    ord
[inline, virtual]
 

Reimplemented in lir_gen_walker, vcgASTWalker, goto_label_walker, fix_goto_walker, ref_fix_walker, TreeChecker, ProcWalker, and print_walker.

Definition at line 353 of file walker.h.

References at_jump().

Referenced by at_conditiongoto(), and gotoNode::walk().

virtual void Walker::at_id idNode   the_id,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, callGraph, RequiresGatherer, clear_ids_walker, id_lookup_walker, Linker, name_mangle_walker, ref_fix_walker, TreeChecker, print_walker, renumber_walker, and count_walker.

Definition at line 284 of file walker.h.

References at_index().

Referenced by idNode::walk().

virtual void Walker::at_if ifNode   the_if,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 332 of file walker.h.

References at_selection().

Referenced by ifNode::walk().

virtual void Walker::at_index indexNode   the_index,
Order    ord
[inline, virtual]
 

Definition at line 278 of file walker.h.

References at_expr().

Referenced by at_const(), and at_id().

virtual void Walker::at_initializer initializerNode   the_initializer,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 305 of file walker.h.

References at_expr().

Referenced by initializerNode::walk().

virtual void Walker::at_jump jumpNode   the_jump,
Order    ord
[inline, virtual]
 

Definition at line 350 of file walker.h.

References at_stmt().

Referenced by at_break(), at_continue(), at_goto(), and at_return().

virtual void Walker::at_label labelNode   the_label,
Order    ord
[inline, virtual]
 

Reimplemented in lir_gen_walker, vcgASTWalker, goto_label_walker, name_mangle_walker, TreeChecker, ProcWalker, and print_walker.

Definition at line 323 of file walker.h.

References at_target().

Referenced by labelNode::walk().

virtual void Walker::at_loop loopNode   the_loop,
Order    ord
[inline, virtual]
 

Reimplemented in semcheck_walker, set_container_walker, TreeChecker, and init_flowproblem_walker.

Definition at line 338 of file walker.h.

References at_stmt().

Referenced by at_do(), at_for(), and at_while().

virtual void Walker::at_node Node   the_node,
Order    ord
[inline, virtual]
 

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 at_def(), at_expr(), at_stmt(), at_text(), at_type(), and at_unit().

virtual void Walker::at_operand operandNode   the_oper,
Order    ord
[inline, virtual]
 

Reimplemented in AllocToMemWalker, vcgASTWalker, TreeChecker, print_walker, and findVarAssign.

Definition at line 368 of file walker.h.

References at_expr().

Referenced by operandNode::walk().

virtual void Walker::at_prim primNode   the_prim,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 245 of file walker.h.

References at_type().

Referenced by primNode::walk().

virtual void Walker::at_proc procNode   the_proc,
Order    ord
[inline, virtual]
 

Reimplemented in asm_gen_walker, RegAllocWalker, dummy_reg_alloc_walker, lir_flow_walker, lir_gen_walker, W, vcgWalker, vcgASTWalker, vcgCCGWalker, id_lookup_walker, name_mangle_walker, ref_fix_walker, set_container_walker, TreeChecker, UnitWalker, print_walker, unreachableCodeRemover, DefUseWalker, init_flowproblem_walker, LivenessWalker, LivenessComments, reachingGenKillWalker, reachingDefinitionsWalker, and UnificationBasedPtr.

Definition at line 239 of file walker.h.

References at_def().

Referenced by procNode::walk().

virtual void Walker::at_ptr ptrNode   the_ptr,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 251 of file walker.h.

References at_type().

Referenced by ptrNode::walk().

virtual void Walker::at_return returnNode   the_return,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, ref_fix_walker, semcheck_walker, set_container_walker, TreeChecker, print_walker, LivenessWalker, and LivenessComments.

Definition at line 362 of file walker.h.

References at_jump().

Referenced by returnNode::walk().

virtual void Walker::at_selection selectionNode   the_selection,
Order    ord
[inline, virtual]
 

Reimplemented in semcheck_walker.

Definition at line 329 of file walker.h.

References at_stmt().

Referenced by at_if(), and at_switch().

virtual void Walker::at_stmt stmtNode   the_stmt,
Order    ord
[inline, virtual]
 

Reimplemented in NodeLocator, W, init_flowproblem_walker, and LivenessWalker.

Definition at line 308 of file walker.h.

References at_node().

Referenced by at_attrib(), at_block(), at_exprstmt(), at_jump(), at_loop(), at_selection(), at_target(), at_threeAddr(), and metastmtNode::walk().

virtual void Walker::at_struct structNode   the_struct,
Order    ord
[inline, virtual]
 

Definition at line 263 of file walker.h.

References at_sue().

Referenced by structNode::walk().

virtual void Walker::at_subdecl subdeclNode   the_subdecl,
Order    ord
[inline, virtual]
 

Definition at line 236 of file walker.h.

References at_decl().

Referenced by subdeclNode::walk().

virtual void Walker::at_sue sueNode   the_sue,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, RequiresGatherer, print_walker, and has_struct_walker.

Definition at line 260 of file walker.h.

References at_type().

Referenced by at_enum(), at_struct(), and at_union().

virtual void Walker::at_suespec suespecNode   the_suespec,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, scope_walker, semcheck_walker, sue_complete_walker, print_walker, and UnificationBasedPtr.

Definition at line 272 of file walker.h.

References at_type().

Referenced by suespecNode::walk().

virtual void Walker::at_switch switchNode   the_switch,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, set_container_walker, TreeChecker, ProcWalker, print_walker, and init_flowproblem_walker.

Definition at line 335 of file walker.h.

References at_selection().

Referenced by switchNode::walk().

virtual void Walker::at_target targetNode   the_target,
Order    ord
[inline, virtual]
 

Reimplemented in init_flowproblem_walker.

Definition at line 320 of file walker.h.

References at_stmt().

Referenced by at_case(), and at_label().

virtual void Walker::at_tdef tdefNode   the_tdef,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, RequiresGatherer, clear_ids_walker, id_lookup_walker, ref_fix_walker, TreeChecker, and print_walker.

Definition at line 248 of file walker.h.

References at_type().

Referenced by tdefNode::walk().

virtual void Walker::at_ternary ternaryNode   the_ternary,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, and print_walker.

Definition at line 299 of file walker.h.

References at_expr().

Referenced by ternaryNode::walk().

virtual void Walker::at_text textNode   the_text,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 377 of file walker.h.

References at_node().

Referenced by textNode::walk().

virtual void Walker::at_threeAddr threeAddrNode   the_3addr,
Order    ord
[inline, virtual]
 

Reimplemented in lir_gen_walker, vcgASTWalker, vcgCCGWalker, identify_inlinees, Linker, TreeChecker, print_walker, GetDefsWalker, LivenessWalker, LivenessComments, GetDefsWalker, findVarAssign, and UnificationBasedPtr.

Definition at line 374 of file walker.h.

References at_stmt().

Referenced by threeAddrNode::walk().

virtual void Walker::at_type typeNode   the_type,
Order    ord
[inline, virtual]
 

Reimplemented in W, and TreeChecker.

Definition at line 242 of file walker.h.

References at_node().

Referenced by at_array(), at_func(), at_prim(), at_ptr(), at_sue(), at_suespec(), and at_tdef().

virtual void Walker::at_unary unaryNode   the_unary,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, TreeChecker, print_walker, and fixPointerWalker.

Definition at line 290 of file walker.h.

References at_expr().

Referenced by unaryNode::walk().

virtual void Walker::at_union unionNode   the_union,
Order    ord
[inline, virtual]
 

Definition at line 266 of file walker.h.

References at_sue().

Referenced by unionNode::walk().

virtual void Walker::at_unit unitNode   the_unit,
Order    ord
[inline, virtual]
 

Reimplemented in asm_gen_walker, dummy_reg_alloc_walker, lir_gen_walker, vcgASTWalker, gcWalker, TreeChecker, print_walker, reachingGenKillWalker, and UnificationBasedPtr.

Definition at line 227 of file walker.h.

References at_node().

Referenced by unitNode::walk().

virtual void Walker::at_while whileNode   the_while,
Order    ord
[inline, virtual]
 

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 341 of file walker.h.

References at_loop().

Referenced by whileNode::walk().

Depth Walker::depth   const [inline]
 

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().

Order Walker::order   const [inline]
 

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().


Member Data Documentation

Depth Walker::_depth [private]
 

Which Nodes in the AST should be visited.

Definition at line 166 of file walker.h.

Order Walker::_order [private]
 

The order in which AST Nodes should be visited.

Definition at line 163 of file walker.h.


The documentation for this class was generated from the following file:

Generated on August 27, 2003
Back to the C-Breeze home page