Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

selectionNode Class Reference

Selection statement. More...

#include <ast.h>

Inheritance diagram for selectionNode::

stmtNode Node ifNode switchNode List of all members.

Public Methods

 selectionNode (NodeType typ, exprNode *expr, stmtNode *stmt, const Coord coord)
 Create a new selection statement. More...

virtual ~selectionNode ()
 Destroy a selectionNode. More...

Accessors
Methods to get and set fields in the class.

exprNodeexpr () const
exprNodeget_expr ()
void expr (exprNode *expr)
blockNodestmt () const
blockNodeget_stmt ()
void stmt (blockNode *stmt)

Private Attributes

TREE exprNode_expr
 the selection expression. More...

TREE blockNode_stmt
 the child statement. More...


Detailed Description

Selection statement.

This class provides a base class for all the control-flow selection statements. This includes the "if" statement, with and without an "else" and the "switch" statement. All three statements have a selection expression, and at least one child statement. For the if-else statements, we add another child statement to represent the false branch.

The NodeType is determined by the subclass (If or Switch).


Constructor & Destructor Documentation

selectionNode::selectionNode NodeType    typ,
exprNode   expr,
stmtNode   stmt,
const Coord    coord
 

Create a new selection statement.

The new selection statement has the given type, selection expression and child statement. This constructor is only called by the selectionNode subclass.

Parameters:
typ  the kind of selection statement
expr  the selection expression
stmt  the child statement
coord  the location of the construct in the source file.

selectionNode::~selectionNode   [virtual]
 

Destroy a selectionNode.

Warning:
Do not use the destructors to delete AST nodes. Instead, rely on the node garbage collector.


Member Function Documentation

void selectionNode::expr exprNode   expr [inline]
 

exprNode* selectionNode::expr   const [inline]
 

exprNode* selectionNode::get_expr   [inline]
 

blockNode* selectionNode::get_stmt   [inline]
 

void selectionNode::stmt blockNode   stmt [inline]
 

blockNode* selectionNode::stmt   const [inline]
 


Member Data Documentation

TREE exprNode* selectionNode::_expr [private]
 

the selection expression.

TREE blockNode* selectionNode::_stmt [private]
 

the child statement.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 12:06:33 2002 for C-Breeze by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001