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

stmtNode Class Reference

Statement. More...

#include <ast.h>

Inheritance diagram for stmtNode::

Node attribNode blockNode exprstmtNode jumpNode loopNode metastmtNode selectionNode targetNode List of all members.

Public Methods

 stmtNode (NodeType typ, const Coord coord)
 Create a new statement. More...

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

virtual void output (output_context &ct, Node *par)
 Generate C code. More...

virtual void output_stmt (output_context &ct, Node *par)=0
 Output a statement. More...

void output_comment (output_context &ct)
Accessors
Methods to get and set fields in the class.

string & comment ()
FlowValat_exit () const
void at_exit (FlowVal *ae)
text_listpragmas ()

Private Attributes

FlowVal_at_exit
 Dataflow analysis exit value. More...

string _comment
 Comment. More...

text_list _pragmas
 Pragmas. More...


Detailed Description

Statement.

This class provides a base class for all statement nodes.

The NodeType is determined by the subclass.


Constructor & Destructor Documentation

stmtNode::stmtNode NodeType    typ,
const Coord    coord
 

Create a new statement.

The new statement has the given NodeType. This constructor is only called by the statement subclasses.

Parameters:
typ  the kind of statement
coord  the location of the construct in the source file.

stmtNode::~stmtNode   [virtual]
 

Destroy a stmtNode.

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


Member Function Documentation

void stmtNode::at_exit FlowVal   ae [inline]
 

Reimplemented in basicblockNode.

FlowVal* stmtNode::at_exit   const [inline]
 

Reimplemented in basicblockNode.

string& stmtNode::comment   [inline]
 

void stmtNode::output output_context   ct,
Node   parent
[virtual]
 

Generate C code.

Each subclass overrides this method to define how to produce the output C code. To use this method, pass an output_context and a null parent.

Parameters:
ct  the output context which describes the formatting.
par  the parent node (or null, if at the top of a subtree).

Reimplemented from Node.

void stmtNode::output_comment output_context   ct
 

virtual void stmtNode::output_stmt output_context   ct,
Node   parent
[pure virtual]
 

Output a statement.

Reimplemented in blockNode, exprstmtNode, labelNode, caseNode, ifNode, switchNode, whileNode, doNode, forNode, gotoNode, continueNode, breakNode, returnNode, attribNode, and metastmtNode.

text_list& stmtNode::pragmas   [inline]
 


Member Data Documentation

FlowVal* stmtNode::_at_exit [private]
 

Dataflow analysis exit value.

Reimplemented in basicblockNode.

string stmtNode::_comment [private]
 

Comment.

Each statement may have a comment string associated with it. If the string is non-empty, then the C code generator will output the comment right before the statement. The generator provides the comment delimiters automatically, so there is no need to put them in the string.

text_list stmtNode::_pragmas [private]
 

Pragmas.

This list will contain any pragmas that precede the given statement. During parsing, they are collected into the CBZ::pragmas list and then placed here in the stmtNode constructor.


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