Parameter

A function or foreach parameter.

Members

Functions

hasName
bool hasName()

Returns true if this parameter has a name.

isCVariadic
bool isCVariadic()

Returns true if this is a C-style variadic parameter. E.g.: func(...)

isDVariadic
bool isDVariadic()

Returns true if this is a D-style variadic parameter. E.g.: func(int[] values ...)

isLazy
bool isLazy()

Returns true if this parameter is lazy.

isVariadic
bool isVariadic()

Returns true if this is a D- or C-style variadic parameter.

nameStr
cstring nameStr()

Returns the name of the parameter as a string.

tokenOfLastSTC
Token* tokenOfLastSTC()

Returns the token of the storage class that comes before the type.

Variables

defValue
Expression defValue;

The default initialization value.

name
Token* name;

The name of the parameter.

stcs
StorageClass stcs;

The storage classes of the parameter.

stok
Token* stok;

Token of the last storage class.

symbol
ParameterSymbol symbol;

Semantic symbol.

type
TypeNode type;

The parameter's type.

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