#include <ast.h>
Inheritance diagram for selectionNode::
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. | |
exprNode * | expr () const |
exprNode * | get_expr () |
void | expr (exprNode *expr) |
blockNode * | stmt () const |
blockNode * | get_stmt () |
void | stmt (blockNode *stmt) |
Private Attributes | |
TREE exprNode * | _expr |
the selection expression. More... | |
TREE blockNode * | _stmt |
the child statement. More... |
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).
|
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.
|
|
Destroy a selectionNode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
the selection expression.
|
|
the child statement.
|