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  

TreeChecker Class Reference

#include <tree_checker.h>

Inheritance diagram for TreeChecker:

Walker 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

 TreeChecker ()
 TreeChecker (bool verbose, bool warning)
virtual ~TreeChecker ()
virtual void at_node (Node *, Order)
virtual void at_unit (unitNode *, Order)
virtual void at_proc (procNode *, Order)
virtual void at_decl (declNode *, Order)
virtual void at_label (labelNode *, Order)
virtual void at_case (caseNode *, Order)
virtual void at_goto (gotoNode *, Order)
virtual void at_conditiongoto (conditiongotoNode *, Order)
virtual void at_break (breakNode *, Order)
virtual void at_continue (continueNode *, Order)
virtual void at_return (returnNode *, Order)
virtual void at_if (ifNode *, Order)
virtual void at_switch (switchNode *, Order)
virtual void at_for (forNode *, Order)
virtual void at_loop (loopNode *, Order)
virtual void at_call (callNode *, Order)
virtual void at_id (idNode *, Order)
virtual void at_const (constNode *, Order)
virtual void at_unary (unaryNode *, Order)
virtual void at_binary (binaryNode *, Order)
virtual void at_ternary (ternaryNode *, Order)
virtual void at_threeAddr (threeAddrNode *, Order)
virtual void at_operand (operandNode *, Order)
virtual void at_cast (castNode *, Order)
virtual void at_comma (commaNode *, Order)
virtual void at_initializer (initializerNode *, Order)
virtual void at_type (typeNode *, Order)
virtual void at_func (funcNode *, Order)
virtual void at_tdef (tdefNode *, Order)
virtual void at_array (arrayNode *, Order)
Accessors
Methods to get and set fields in the class.

Order order () const
 Return the order in which Nodes of an AST should be visited.

Depth depth () const
 Return which Nodes of an AST should be visited.

"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_def (defNode *the_def, Order ord)
virtual void at_subdecl (subdeclNode *the_subdecl, Order ord)
virtual void at_prim (primNode *the_prim, Order ord)
virtual void at_ptr (ptrNode *the_ptr, 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_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_selection (selectionNode *the_selection, Order ord)
virtual void at_while (whileNode *the_while, Order ord)
virtual void at_do (doNode *the_do, Order ord)
virtual void at_jump (jumpNode *the_jump, Order ord)
virtual void at_attrib (attribNode *the_attrib, Order ord)
virtual void at_text (textNode *the_text, Order ord)

Static Public Member Functions

void check ()
void check (unitNode *)

Private Member Functions

void setPreDismantled (const char *, Node *)
void setPostDismantled (const char *, Node *)
void checkTree (Node *n, const char *type)
void checkField (Node *node, Node *field, const char *type, const char *fieldName, bool isError=true)
void checkString (Node *node, string &field, const char *type, const char *fieldName, bool isError=true)
void checkConstant (Node *node, constant &field, const char *type, const char *fieldName, bool isError=true)
template<class T> void checkOperator (Node *node, Operator *field, const char *type, const char *fieldName, T check, string desc, bool isError=true)
template<class T> void checkFieldInList (Node *node, T field, const char *type, const char *fieldName, list< T > &collection, bool isError=true)
template<class T> void checkList (Node *node, list< T > &field, const char *type, const char *fieldName, bool isError=true)
template<class T> void checkFieldInList (Node *node, list< T > &field, const char *type, const char *fieldName, int count, list< T > &collection, const char *itemName, bool isError=true)

Private Attributes

map< Node *, int > _visitedNodes
goto_list _gotos
label_list _labels
proc_list _procs
proc_list _dupProcs
switch_list _switches
decl_list _decls
map< labelNode *, int > _gotoCount
map< string, int > _formals
int _typeDepth
int _arrayDepth
bool _verbose
bool _warning
bool _preDismantled
bool _postDismantled
int _errorCount

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

TreeChecker::TreeChecker  
 

Definition at line 254 of file tree_checker.cc.

TreeChecker::TreeChecker bool    verbose,
bool    warning
 

Definition at line 259 of file tree_checker.cc.

TreeChecker::~TreeChecker   [virtual]
 

Definition at line 264 of file tree_checker.cc.

References _decls, _dupProcs, _formals, _gotoCount, _gotos, _labels, _procs, _switches, and _visitedNodes.


Member Function Documentation

void TreeChecker::at_array arrayNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 754 of file tree_checker.cc.

References _arrayDepth, at_type(), checkField(), checkTree(), arrayNode::dim(), and Walker::Preorder.

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 365 of file walker.h.

References Walker::at_stmt().

Referenced by attribNode::walk().

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

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

Definition at line 314 of file walker.h.

References Walker::at_block().

Referenced by basicblockNode::walk().

void TreeChecker::at_binary binaryNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 631 of file tree_checker.cc.

References _typeDepth, checkField(), checkOperator(), checkTree(), BinaryOperator::desc(), binaryNode::left(), binaryNode::op(), Walker::Preorder, binaryNode::right(), and setPreDismantled().

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

Reimplemented in vcgASTWalker, scope_walker, and print_walker.

Definition at line 311 of file walker.h.

References Walker::at_stmt().

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

void TreeChecker::at_break breakNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 459 of file tree_checker.cc.

References checkField(), checkTree(), breakNode::container(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_call callNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 543 of file tree_checker.cc.

References _errorCount, _formals, _typeDepth, _verbose, _warning, callNode::args(), checkField(), checkList(), checkTree(), Id, idNode::name(), callNode::name(), Walker::Preorder, callNode::proc(), setPreDismantled(), and Node::typ().

void TreeChecker::at_case caseNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 361 of file tree_checker.cc.

References _switches, checkConstant(), checkField(), checkFieldInList(), checkTree(), caseNode::container(), exprNode::eval(), caseNode::expr(), Walker::Preorder, setPreDismantled(), targetNode::stmt(), and exprNode::value().

void TreeChecker::at_cast castNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 696 of file tree_checker.cc.

References _typeDepth, checkField(), checkTree(), castNode::expr(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_comma commaNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 705 of file tree_checker.cc.

References _typeDepth, checkList(), checkTree(), commaNode::exprs(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_conditiongoto conditiongotoNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 444 of file tree_checker.cc.

References checkField(), checkOperator(), checkTree(), ComparisonOperator::desc(), conditiongotoNode::left(), conditiongotoNode::op(), Walker::Preorder, conditiongotoNode::right(), and setPostDismantled().

void TreeChecker::at_const constNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 594 of file tree_checker.cc.

References checkConstant(), checkTree(), constNode::eval(), Walker::Preorder, and exprNode::value().

void TreeChecker::at_continue continueNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 467 of file tree_checker.cc.

References checkField(), checkTree(), continueNode::container(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_decl declNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 343 of file tree_checker.cc.

References checkConstant(), checkField(), checkTree(), arrayNode::dim(), exprNode::eval(), Walker::Preorder, setPreDismantled(), declNode::type(), and exprNode::value().

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

Definition at line 230 of file walker.h.

References Walker::at_node().

Referenced by Walker::at_decl(), and Walker::at_proc().

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 344 of file walker.h.

References Walker::at_loop().

Referenced by doNode::walk().

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

Reimplemented in enum_value_walker.

Definition at line 269 of file walker.h.

References Walker::at_sue().

Referenced by enumNode::walk().

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

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

Reimplemented in vcgASTWalker, semcheck_walker, and print_walker.

Definition at line 317 of file walker.h.

References Walker::at_stmt().

Referenced by exprstmtNode::walk().

void TreeChecker::at_for forNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 523 of file tree_checker.cc.

References loopNode::body(), checkField(), checkTree(), loopNode::cond(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_func funcNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 732 of file tree_checker.cc.

References _decls, funcNode::args(), at_type(), checkField(), checkFieldInList(), checkTree(), Walker::Preorder, and funcNode::returns().

void TreeChecker::at_goto gotoNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 428 of file tree_checker.cc.

References _labels, checkFieldInList(), checkString(), checkTree(), gotoNode::label(), gotoNode::name(), and Walker::Preorder.

void TreeChecker::at_id idNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 585 of file tree_checker.cc.

References _decls, checkFieldInList(), checkString(), checkTree(), idNode::decl(), idNode::name(), and Walker::Preorder.

void TreeChecker::at_if ifNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 497 of file tree_checker.cc.

References checkField(), checkTree(), selectionNode::expr(), ifNode::false_br(), Walker::Preorder, setPreDismantled(), and ifNode::true_br().

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

Definition at line 278 of file walker.h.

References Walker::at_expr().

Referenced by Walker::at_const(), and Walker::at_id().

void TreeChecker::at_initializer initializerNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 714 of file tree_checker.cc.

References _arrayDepth, checkList(), checkTree(), initializerNode::exprs(), Walker::Preorder, and setPreDismantled().

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

Definition at line 350 of file walker.h.

References Walker::at_stmt().

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

void TreeChecker::at_label labelNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 377 of file tree_checker.cc.

References _gotoCount, _gotos, _verbose, _warning, checkField(), checkFieldInList(), checkString(), checkTree(), exprstmtNode::expr(), Expr, labelNode::name(), Walker::Preorder, labelNode::references(), setPreDismantled(), targetNode::stmt(), stmt_list, blockNode::stmts(), and Node::typ().

void TreeChecker::at_loop loopNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 533 of file tree_checker.cc.

References loopNode::body(), checkField(), checkTree(), loopNode::cond(), Walker::Preorder, and setPreDismantled().

void TreeChecker::at_node Node  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 286 of file tree_checker.cc.

References checkTree(), and Walker::Preorder.

void TreeChecker::at_operand operandNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 683 of file tree_checker.cc.

References operandNode::cast(), checkField(), checkList(), checkTree(), operandNode::fields(), operandNode::index(), Walker::Preorder, setPostDismantled(), and operandNode::var().

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 245 of file walker.h.

References Walker::at_type().

Referenced by primNode::walk().

void TreeChecker::at_proc procNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 302 of file tree_checker.cc.

References _decls, _dupProcs, _errorCount, _gotoCount, _gotos, _labels, _postDismantled, _preDismantled, _switches, procNode::decl(), ProcWalker::decls(), ProcWalker::gotoCount(), ProcWalker::gotos(), ProcWalker::labels(), declNode::name(), Walker::Preorder, proc_list_p, ProcWalker::switches(), and procNode::walk().

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 251 of file walker.h.

References Walker::at_type().

Referenced by ptrNode::walk().

void TreeChecker::at_return returnNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 476 of file tree_checker.cc.

References _procs, _verbose, _warning, checkField(), checkFieldInList(), checkTree(), returnNode::expr(), Id, Walker::Preorder, returnNode::proc(), setPreDismantled(), and Node::typ().

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

Reimplemented in semcheck_walker.

Definition at line 329 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_if(), and Walker::at_switch().

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]
 

Definition at line 263 of file walker.h.

References Walker::at_sue().

Referenced by structNode::walk().

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

Definition at line 236 of file walker.h.

References Walker::at_decl().

Referenced by subdeclNode::walk().

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

Reimplemented in vcgASTWalker, RequiresGatherer, print_walker, and has_struct_walker.

Definition at line 260 of file walker.h.

References Walker::at_type().

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

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

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

Definition at line 272 of file walker.h.

References Walker::at_type().

Referenced by suespecNode::walk().

void TreeChecker::at_switch switchNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 509 of file tree_checker.cc.

References switchNode::cases(), checkField(), checkList(), checkTree(), selectionNode::expr(), Walker::Preorder, setPreDismantled(), and selectionNode::stmt().

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

Reimplemented in init_flowproblem_walker.

Definition at line 320 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_case(), and Walker::at_label().

void TreeChecker::at_tdef tdefNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 744 of file tree_checker.cc.

References at_type(), checkField(), checkString(), checkTree(), tdefNode::def(), tdefNode::name(), and Walker::Preorder.

void TreeChecker::at_ternary ternaryNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 643 of file tree_checker.cc.

References _typeDepth, checkField(), checkTree(), ternaryNode::cond(), ternaryNode::false_br(), Walker::Preorder, setPreDismantled(), and ternaryNode::true_br().

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 377 of file walker.h.

References Walker::at_node().

Referenced by textNode::walk().

void TreeChecker::at_threeAddr threeAddrNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 656 of file tree_checker.cc.

References threeAddrNode::arg_list(), checkField(), checkList(), checkTree(), Operator::FUNC_CALL, Operator::id(), Operator::is_dismantled_binary(), threeAddrNode::lhs(), threeAddrNode::op(), Walker::Preorder, threeAddrNode::rhs1(), threeAddrNode::rhs2(), setPostDismantled(), Operator::SIZEOF, and threeAddrNode::sizeof_type().

void TreeChecker::at_type typeNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 724 of file tree_checker.cc.

References _typeDepth, and Walker::Preorder.

Referenced by at_array(), at_func(), and at_tdef().

void TreeChecker::at_unary unaryNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 608 of file tree_checker.cc.

References _typeDepth, checkField(), checkOperator(), checkTree(), UnaryOperator::desc(), unaryNode::expr(), Operator::id(), unaryNode::op(), Walker::Preorder, setPreDismantled(), Operator::SIZEOF, and unaryNode::sizeof_type().

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

Definition at line 266 of file walker.h.

References Walker::at_sue().

Referenced by unionNode::walk().

void TreeChecker::at_unit unitNode  ,
Order   
[virtual]
 

Reimplemented from Walker.

Definition at line 292 of file tree_checker.cc.

References _dupProcs, _formals, _procs, UnitWalker::dupProcs(), UnitWalker::formals(), Walker::Preorder, UnitWalker::procs(), and unitNode::walk().

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

Reimplemented in vcgASTWalker, and print_walker.

Definition at line 341 of file walker.h.

References Walker::at_loop().

Referenced by whileNode::walk().

void TreeChecker::check unitNode   [static]
 

Definition at line 281 of file tree_checker.cc.

References unitNode::walk().

void TreeChecker::check   [static]
 

Definition at line 276 of file tree_checker.cc.

References CBZ::Program, and unit_list_p.

Referenced by checkOperator().

void TreeChecker::checkConstant Node   node,
constant   field,
const char *    type,
const char *    fieldName,
bool    isError = true
[private]
 

Definition at line 102 of file tree_checker.cc.

References _errorCount, constant::no_val(), and constant::to_string().

Referenced by at_case(), at_const(), and at_decl().

void TreeChecker::checkField Node   node,
Node   field,
const char *    type,
const char *    fieldName,
bool    isError = true
[private]
 

Definition at line 66 of file tree_checker.cc.

References _errorCount.

Referenced by at_array(), at_binary(), at_break(), at_call(), at_case(), at_cast(), at_conditiongoto(), at_continue(), at_decl(), at_for(), at_func(), at_if(), at_label(), at_loop(), at_operand(), at_return(), at_switch(), at_tdef(), at_ternary(), at_threeAddr(), and at_unary().

template<class T>
void TreeChecker::checkFieldInList Node   node,
list< T > &    field,
const char *    type,
const char *    fieldName,
int    count,
list< T > &    collection,
const char *    itemName,
bool    isError = true
[private]
 

Definition at line 145 of file tree_checker.cc.

References _errorCount.

template<class T>
void TreeChecker::checkFieldInList Node   node,
  field,
const char *    type,
const char *    fieldName,
list< T > &    collection,
bool    isError = true
[private]
 

Definition at line 226 of file tree_checker.cc.

References _errorCount, and _labels.

Referenced by at_case(), at_func(), at_goto(), at_id(), at_label(), and at_return().

template<class T>
void TreeChecker::checkList Node   node,
list< T > &    field,
const char *    type,
const char *    fieldName,
bool    isError = true
[private]
 

Definition at line 204 of file tree_checker.cc.

References _errorCount.

Referenced by at_call(), at_comma(), at_initializer(), at_operand(), at_switch(), and at_threeAddr().

template<class T>
void TreeChecker::checkOperator Node   node,
Operator   field,
const char *    type,
const char *    fieldName,
  check,
string    desc,
bool    isError = true
[private]
 

Definition at line 121 of file tree_checker.cc.

References _errorCount, and check().

Referenced by at_binary(), at_conditiongoto(), and at_unary().

void TreeChecker::checkString Node   node,
string &    field,
const char *    type,
const char *    fieldName,
bool    isError = true
[private]
 

Definition at line 84 of file tree_checker.cc.

References _errorCount.

Referenced by at_goto(), at_id(), at_label(), and at_tdef().

void TreeChecker::checkTree Node   n,
const char *    type
[private]
 

Definition at line 55 of file tree_checker.cc.

References _errorCount, _visitedNodes, and print_walker::print().

Referenced by at_array(), at_binary(), at_break(), at_call(), at_case(), at_cast(), at_comma(), at_conditiongoto(), at_const(), at_continue(), at_decl(), at_for(), at_func(), at_goto(), at_id(), at_if(), at_initializer(), at_label(), at_loop(), at_node(), at_operand(), at_return(), at_switch(), at_tdef(), at_ternary(), at_threeAddr(), and at_unary().

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

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 TreeChecker::setPostDismantled const char *   ,
Node  
[private]
 

Definition at line 48 of file tree_checker.cc.

References _postDismantled.

Referenced by at_conditiongoto(), at_operand(), and at_threeAddr().

void TreeChecker::setPreDismantled const char *   ,
Node  
[private]
 

Definition at line 41 of file tree_checker.cc.

References _preDismantled.

Referenced by at_binary(), at_break(), at_call(), at_case(), at_cast(), at_comma(), at_continue(), at_decl(), at_for(), at_if(), at_initializer(), at_label(), at_loop(), at_return(), at_switch(), at_ternary(), and at_unary().


Member Data Documentation

int TreeChecker::_arrayDepth [private]
 

Definition at line 70 of file tree_checker.h.

Referenced by at_array(), and at_initializer().

decl_list TreeChecker::_decls [private]
 

Definition at line 64 of file tree_checker.h.

Referenced by at_func(), at_id(), at_proc(), and ~TreeChecker().

proc_list TreeChecker::_dupProcs [private]
 

Definition at line 62 of file tree_checker.h.

Referenced by at_proc(), at_unit(), and ~TreeChecker().

int TreeChecker::_errorCount [private]
 

Definition at line 76 of file tree_checker.h.

Referenced by at_call(), at_proc(), checkConstant(), checkField(), checkFieldInList(), checkList(), checkOperator(), checkString(), and checkTree().

map<string, int > TreeChecker::_formals [private]
 

Definition at line 68 of file tree_checker.h.

Referenced by at_call(), at_unit(), and ~TreeChecker().

map<labelNode *, int> TreeChecker::_gotoCount [private]
 

Definition at line 66 of file tree_checker.h.

Referenced by at_label(), at_proc(), and ~TreeChecker().

goto_list TreeChecker::_gotos [private]
 

Definition at line 59 of file tree_checker.h.

Referenced by at_label(), at_proc(), and ~TreeChecker().

label_list TreeChecker::_labels [private]
 

Definition at line 60 of file tree_checker.h.

Referenced by at_goto(), at_proc(), checkFieldInList(), and ~TreeChecker().

bool TreeChecker::_postDismantled [private]
 

Definition at line 75 of file tree_checker.h.

Referenced by at_proc(), and setPostDismantled().

bool TreeChecker::_preDismantled [private]
 

Definition at line 74 of file tree_checker.h.

Referenced by at_proc(), and setPreDismantled().

proc_list TreeChecker::_procs [private]
 

Definition at line 61 of file tree_checker.h.

Referenced by at_return(), at_unit(), and ~TreeChecker().

switch_list TreeChecker::_switches [private]
 

Definition at line 63 of file tree_checker.h.

Referenced by at_case(), at_proc(), and ~TreeChecker().

int TreeChecker::_typeDepth [private]
 

Definition at line 69 of file tree_checker.h.

Referenced by at_binary(), at_call(), at_cast(), at_comma(), at_ternary(), at_type(), and at_unary().

bool TreeChecker::_verbose [private]
 

Definition at line 72 of file tree_checker.h.

Referenced by at_call(), at_label(), and at_return().

map<Node *, int> TreeChecker::_visitedNodes [private]
 

Definition at line 58 of file tree_checker.h.

Referenced by checkTree(), and ~TreeChecker().

bool TreeChecker::_warning [private]
 

Definition at line 73 of file tree_checker.h.

Referenced by at_call(), at_label(), and at_return().


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

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