C# Class Rhino.Ast.LetNode

AST node for let statements and expressions.
AST node for let statements and expressions. Node type is Rhino.Token.LET or Rhino.Token.LETEXPR .

 LetStatement: let ( VariableDeclarationList ) Block LetExpression: let ( VariableDeclarationList ) Expression
Note that standalone let-statements with no parens or body block, such as let x=6, y=7; , are represented as a VariableDeclaration node of type Token.LET , wrapped with an ExpressionStatement .

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

Public Methods

Method Description
GetBody ( ) : AstNode

Returns body statement or expression.

Returns body statement or expression. Body is null if the form of the let statement is similar to a VariableDeclaration, with no curly-brace. (This form is used to define let-bound variables in the scope of the current block.)

GetLp ( ) : int

Returns left paren position, -1 if missing

GetRp ( ) : int

Returns right paren position, -1 if missing

GetVariables ( ) : VariableDeclaration

Returns variable list

LetNode ( ) : System.Text
LetNode ( int pos ) : System.Text
LetNode ( int pos, int len ) : System.Text
SetBody ( AstNode body ) : void

Sets body statement or expression.

Sets body statement or expression. Also sets the body parent to this node.

SetLp ( int lp ) : void

Sets left paren position

SetParens ( int lp, int rp ) : void

Sets both paren positions

SetRp ( int rp ) : void

Sets right paren position

SetVariables ( VariableDeclaration variables ) : void

Sets variable list.

Sets variable list. Sets list parent to this node.

ToSource ( int depth ) : string
Visit ( NodeVisitor v ) : void

Visits this node, the variable list, and if present, the body expression or statement.

Visits this node, the variable list, and if present, the body expression or statement.

Method Details

GetBody() public method

Returns body statement or expression.
Returns body statement or expression. Body is null if the form of the let statement is similar to a VariableDeclaration, with no curly-brace. (This form is used to define let-bound variables in the scope of the current block.)

public GetBody ( ) : AstNode
return AstNode

GetLp() public method

Returns left paren position, -1 if missing
public GetLp ( ) : int
return int

GetRp() public method

Returns right paren position, -1 if missing
public GetRp ( ) : int
return int

GetVariables() public method

Returns variable list
public GetVariables ( ) : VariableDeclaration
return VariableDeclaration

LetNode() public method

public LetNode ( ) : System.Text
return System.Text

LetNode() public method

public LetNode ( int pos ) : System.Text
pos int
return System.Text

LetNode() public method

public LetNode ( int pos, int len ) : System.Text
pos int
len int
return System.Text

SetBody() public method

Sets body statement or expression.
Sets body statement or expression. Also sets the body parent to this node.
public SetBody ( AstNode body ) : void
body AstNode /// the body statement or expression. May be /// null /// . ///
return void

SetLp() public method

Sets left paren position
public SetLp ( int lp ) : void
lp int
return void

SetParens() public method

Sets both paren positions
public SetParens ( int lp, int rp ) : void
lp int
rp int
return void

SetRp() public method

Sets right paren position
public SetRp ( int rp ) : void
rp int
return void

SetVariables() public method

Sets variable list.
Sets variable list. Sets list parent to this node.
/// if variables is /// null ///
public SetVariables ( VariableDeclaration variables ) : void
variables VariableDeclaration
return void

ToSource() public method

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

Visit() public method

Visits this node, the variable list, and if present, the body expression or statement.
Visits this node, the variable list, and if present, the body expression or statement.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void