Statement

The root class of all statements.

abstract
class Statement : Node {}

Inherited Members

From Node

State
enum State

The possible semantic states of a Node.

kind
NodeKind kind;

The kind of this node.

children
Node[] children;

List of subnodes. (May be removed to save space.)

end
Token* end;

The begin and end tokens of this node.

state
State state;

The semantic state of this node.

setTokens
void setTokens(Token* begin, Token* end)

Sets the begin and end tokens.

setLoc
void setLoc(Node other)

Sets the location tokens (begin and end) using another node.

addChild
void addChild(Node child)

Adds a child node.

addOptChild
void addOptChild(Node child)

Adss a child node if not null.

addChildren
void addChildren(N children)

Adds a list of child nodes.

addOptChildren
void addOptChildren(N children)

Adds a list of child nodes if not null.

toText
cstring toText()

Returns the text spanned by the begin and end tokens. Warning: The Tokens must refer to the same piece of text.

Is
Class Is()

Returns a reference to Class if this node can be cast to it.

to
Class to()

Casts this node to Class.

copy
Node copy()

Returns a deep copy of this node.

dup
Node dup()

Returns a shallow copy of this object.

set_kind
enum set_kind;

This string is mixed into the constructor of a class that inherits from Node. It sets the member kind. E.g.: this.kind = NodeKind.IfStmt;

isDeclaration
bool isDeclaration()

Returns true if Declaration.

isStatement
bool isStatement()

Returns true if Statement.

isExpression
bool isExpression()

Returns true if Expression.

isType
bool isType()

Returns true if Type.

isParameter
bool isParameter()

Returns true if Parameter.

Meta