#include <ast.h>
Inheritance diagram for stmtNode::
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 () |
FlowVal * | at_exit () const |
void | at_exit (FlowVal *ae) |
text_list & | pragmas () |
Private Attributes | |
FlowVal * | _at_exit |
Dataflow analysis exit value. More... | |
string | _comment |
Comment. More... | |
text_list | _pragmas |
Pragmas. More... |
This class provides a base class for all statement nodes.
The NodeType is determined by the subclass.
|
Create a new statement. The new statement has the given NodeType. This constructor is only called by the statement subclasses.
|
|
Destroy a stmtNode.
|
|
Reimplemented in basicblockNode. |
|
Reimplemented in basicblockNode. |
|
|
|
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.
Reimplemented from Node. |
|
|
|
Output a statement.
Reimplemented in blockNode, exprstmtNode, labelNode, caseNode, ifNode, switchNode, whileNode, doNode, forNode, gotoNode, continueNode, breakNode, returnNode, attribNode, and metastmtNode. |
|
|
|
Dataflow analysis exit value.
Reimplemented in basicblockNode. |
|
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. |
|
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. |