C# Class Rhino.Ast.VariableInitializer

A variable declaration or initializer, part of a VariableDeclaration expression. The variable "target" can be a simple name or a destructuring form. The initializer, if present, can be any expression.

Node type is one of Rhino.Token.VAR , Rhino.Token.CONST , or Rhino.Token.LET .

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

Public Methods

Method Description
GetInitializer ( ) : AstNode

Returns the initial value, or null if not provided

GetTarget ( ) : AstNode

Returns the variable name or destructuring form

IsDestructuring ( ) : bool

Returns true if this is a destructuring assignment.

Returns true if this is a destructuring assignment. If so, the initializer must be non- null .

SetInitializer ( AstNode initializer ) : void

Sets the initial value expression, and sets its parent to this node.

Sets the initial value expression, and sets its parent to this node.

SetNodeType ( int nodeType ) : void

Sets the node type.

Sets the node type.

SetTarget ( AstNode target ) : void

Sets the variable name or destructuring form, and sets its parent to this node.

Sets the variable name or destructuring form, and sets its parent to this node.

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

Visits this node, then the target expression, then the initializer expression if present.

Visits this node, then the target expression, then the initializer expression if present.

Method Details

GetInitializer() public method

Returns the initial value, or null if not provided
public GetInitializer ( ) : AstNode
return AstNode

GetTarget() public method

Returns the variable name or destructuring form
public GetTarget ( ) : AstNode
return AstNode

IsDestructuring() public method

Returns true if this is a destructuring assignment.
Returns true if this is a destructuring assignment. If so, the initializer must be non- null .
public IsDestructuring ( ) : bool
return bool

SetInitializer() public method

Sets the initial value expression, and sets its parent to this node.
Sets the initial value expression, and sets its parent to this node.
public SetInitializer ( AstNode initializer ) : void
initializer AstNode /// the initial value. May be /// null /// . ///
return void

SetNodeType() public method

Sets the node type.
Sets the node type.
/// if /// nodeType /// is not one of /// Rhino.Token.VAR /// , /// Rhino.Token.CONST /// , or /// Rhino.Token.LET ///
public SetNodeType ( int nodeType ) : void
nodeType int
return void

SetTarget() public method

Sets the variable name or destructuring form, and sets its parent to this node.
Sets the variable name or destructuring form, and sets its parent to this node.
/// if target is /// null ///
public SetTarget ( AstNode target ) : void
target AstNode
return void

ToSource() public method

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

VariableInitializer() public method

public VariableInitializer ( ) : System
return System

VariableInitializer() public method

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

VariableInitializer() public method

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

Visit() public method

Visits this node, then the target expression, then the initializer expression if present.
Visits this node, then the target expression, then the initializer expression if present.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void