TypeNode

The root class of all type nodes.

Members

Functions

baseType
TypeNode baseType()

Returns the end type of the type chain.

hasSymbol
bool hasSymbol()

Returns true if the member 'symbol' is not null.

hasType
bool hasType()

Returns true if the member 'type' is not null.

setNext
void setNext(TypeNode n)

Sets the member 'next'. This node becomes the parent of 'n'.

Variables

next
TypeNode next;

The next type in the type chain.

parent
TypeNode parent;

The parent TypeNode of this symbol.

symbol
Symbol symbol;

Semantic symbol.

type
Type type;

The semantic type of this type 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