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

loopNode Class Reference

Loop node. More...

#include <ast.h>

Inheritance diagram for loopNode::

stmtNode Node doNode forNode whileNode List of all members.

Public Methods

 loopNode (NodeType typ, exprNode *cond, stmtNode *body, const Coord coord)
 Create a new loop. More...

 loopNode (NodeType typ, const Coord coord)
 Create an empty loop. More...

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

Accessors
Methods to get and set fields in the class.

exprNode * cond () const
exprNode * get_cond ()
void cond (exprNode *cond)
blockNode * body () const
blockNode * get_body ()
void body (blockNode *body)
FlowVal * at_loop_head () const
void at_loop_head (FlowVal *ae)
FlowVal * at_loop_tail () const
void at_loop_tail (FlowVal *ae)

Private Attributes

TREE exprNode * _cond
 the loop condition expression. More...

TREE blockNode * _body
 the loop body. More...

FlowVal * _at_loop_head
 loop head dataflow analysis value. More...

FlowVal * _at_loop_tail
 loop tail dataflow analysis value. More...


Detailed Description

Loop node.

This class provides a base class for all the kinds of loop statements.

The NodeType is determined by the subclass (While, Do, or For)


Constructor & Destructor Documentation

loopNode::loopNode (  NodeType    typ,
exprNode *    cond,
stmtNode *    body,
const Coord    coord
) 
 

Create a new loop.

The new loop has the given type, condition expression and body. This constructor is only called by the subclasses (whileNode, doNode, and forNode).

Parameters:
typ  the type of loop (While, Do, or For)
cond  the loop condition
body  the loop body
coord  the location of the construct in the source file.

loopNode::loopNode (  NodeType    typ,
const Coord    coord
) 
 

Create an empty loop.

The new loop has no condition expression or body

Parameters:
typ  the type of loop (While, Do, or For)
coord  the location of the construct in the source file.

loopNode::~loopNode (    )  [virtual]
 

Destroy a loopNode.

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


Member Function Documentation

void loopNode::at_loop_head (  FlowVal *    ae )  [inline]
 

FlowVal* loopNode::at_loop_head (    )  const [inline]
 

void loopNode::at_loop_tail (  FlowVal *    ae )  [inline]
 

FlowVal* loopNode::at_loop_tail (    )  const [inline]
 

void loopNode::body (  blockNode *    body )  [inline]
 

blockNode* loopNode::body (    )  const [inline]
 

void loopNode::cond (  exprNode *    cond )  [inline]
 

exprNode* loopNode::cond (    )  const [inline]
 

blockNode* loopNode::get_body (    )  [inline]
 

exprNode* loopNode::get_cond (    )  [inline]
 


Member Data Documentation

FlowVal* loopNode::_at_loop_head [private]
 

loop head dataflow analysis value.

This field is used by the dataflow analysis framework to hold the flow value at the head of the loop.

FlowVal* loopNode::_at_loop_tail [private]
 

loop tail dataflow analysis value.

This field is used by the dataflow analysis framework to hold the flow value at the end (tail) of the loop.

TREE blockNode* loopNode::_body [private]
 

the loop body.

TREE exprNode* loopNode::_cond [private]
 

the loop condition expression.


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