C# Class Rhino.Ast.VariableDeclaration

A list of one or more var, const or let declarations.
A list of one or more var, const or let declarations. Node type is Rhino.Token.VAR , Rhino.Token.CONST or Rhino.Token.LET .

If the node is for var or const , the node position is the beginning of the var or const keyword. For let declarations, the node position coincides with the first VariableInitializer child.

A standalone variable declaration in a statement context returns true from its IsStatement() method.

Inheritance: AstNode
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
AddVariable ( VariableInitializer v ) : void

Adds a variable initializer node to the child list.

Adds a variable initializer node to the child list. Sets initializer node's parent to this node.

GetVariables ( ) : IList

Returns variable list.

Returns variable list. Never null .

IsConst ( ) : bool

Returns true if this is a Rhino.Token.CONST declaration.

IsLet ( ) : bool

Returns true if this is a Rhino.Token.LET declaration.

IsStatement ( ) : bool

Returns true if this node represents a statement.

Returns true if this node represents a statement.

IsVar ( ) : bool

Returns true if this is a var (not const or let ) declaration.

SetIsStatement ( bool isStatement ) : void

Set or unset the statement flag.

Set or unset the statement flag.

SetType ( int type ) : Node

Sets the node type and returns this node.

Sets the node type and returns this node.

SetVariables ( IList variables ) : void

Sets variable list

ToSource ( int depth ) : string
VariableDeclaration ( ) : System
VariableDeclaration ( int pos ) : System
VariableDeclaration ( int pos, int len ) : System
Visit ( NodeVisitor v ) : void

Visits this node, then each VariableInitializer child.

Private Methods

Method Description
DeclTypeName ( ) : string

Method Details

AddVariable() public method

Adds a variable initializer node to the child list.
Adds a variable initializer node to the child list. Sets initializer node's parent to this node.
/// if v is /// null ///
public AddVariable ( VariableInitializer v ) : void
v VariableInitializer
return void

GetVariables() public method

Returns variable list.
Returns variable list. Never null .
public GetVariables ( ) : IList
return IList

IsConst() public method

Returns true if this is a Rhino.Token.CONST declaration.
public IsConst ( ) : bool
return bool

IsLet() public method

Returns true if this is a Rhino.Token.LET declaration.
public IsLet ( ) : bool
return bool

IsStatement() public method

Returns true if this node represents a statement.
Returns true if this node represents a statement.
public IsStatement ( ) : bool
return bool

IsVar() public method

Returns true if this is a var (not const or let ) declaration.
public IsVar ( ) : bool
return bool

SetIsStatement() public method

Set or unset the statement flag.
Set or unset the statement flag.
public SetIsStatement ( bool isStatement ) : void
isStatement bool
return void

SetType() public method

Sets the node type and returns this node.
Sets the node type and returns this node.
/// if /// declType /// is invalid ///
public SetType ( int type ) : Node
type int
return Node

SetVariables() public method

Sets variable list
/// if variables list is /// null ///
public SetVariables ( IList variables ) : void
variables IList
return void

ToSource() public method

public ToSource ( int depth ) : string
depth int
return string

VariableDeclaration() public method

public VariableDeclaration ( ) : System
return System

VariableDeclaration() public method

public VariableDeclaration ( int pos ) : System
pos int
return System

VariableDeclaration() public method

public VariableDeclaration ( int pos, int len ) : System
pos int
len int
return System

Visit() public method

Visits this node, then each VariableInitializer child.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void