C# Class Rhino.Ast.SwitchStatement

Switch statement AST node type.
Switch statement AST node type. Node type is Rhino.Token.SWITCH .

SwitchStatement : switch ( Expression ) CaseBlock CaseBlock : { [CaseClauses] } { [CaseClauses] DefaultClause [CaseClauses] } CaseClauses : CaseClause CaseClauses CaseClause CaseClause : case Expression : [StatementList] DefaultClause : default : [StatementList]
Inheritance: Jump
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
AddCase ( SwitchCase switchCase ) : void

Adds a switch case statement to the end of the list.

Adds a switch case statement to the end of the list.

GetCases ( ) : IList

Returns case statement list.

Returns case statement list. If there are no cases, returns an immutable empty list.

GetExpression ( ) : AstNode

Returns the switch discriminant expression

GetLp ( ) : int

Returns left paren position, -1 if missing

GetRp ( ) : int

Returns right paren position, -1 if missing

SetCases ( IList cases ) : void

Sets case statement list, and sets the parent of each child case to this node.

Sets case statement list, and sets the parent of each child case to this node.

SetExpression ( AstNode expression ) : void

Sets the switch discriminant expression, and sets its parent to this node.

Sets the switch discriminant expression, and sets its 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

SwitchStatement ( ) : System.Collections.Generic
SwitchStatement ( int pos ) : System.Collections.Generic
SwitchStatement ( int pos, int len ) : System.Collections.Generic
ToSource ( int depth ) : string
Visit ( NodeVisitor v ) : void

Visits this node, then the switch-expression, then the cases in lexical order.

Visits this node, then the switch-expression, then the cases in lexical order.

Method Details

AddCase() public method

Adds a switch case statement to the end of the list.
Adds a switch case statement to the end of the list.
/// } if switchCase is /// null ///
public AddCase ( SwitchCase switchCase ) : void
switchCase SwitchCase
return void

GetCases() public method

Returns case statement list.
Returns case statement list. If there are no cases, returns an immutable empty list.
public GetCases ( ) : IList
return IList

GetExpression() public method

Returns the switch discriminant expression
public GetExpression ( ) : 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

SetCases() public method

Sets case statement list, and sets the parent of each child case to this node.
Sets case statement list, and sets the parent of each child case to this node.
public SetCases ( IList cases ) : void
cases IList /// list, which may be /// null /// to remove all the cases ///
return void

SetExpression() public method

Sets the switch discriminant expression, and sets its parent to this node.
Sets the switch discriminant expression, and sets its parent to this node.
/// } if expression is /// null ///
public SetExpression ( AstNode expression ) : void
expression AstNode
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

SwitchStatement() public method

public SwitchStatement ( ) : System.Collections.Generic
return System.Collections.Generic

SwitchStatement() public method

public SwitchStatement ( int pos ) : System.Collections.Generic
pos int
return System.Collections.Generic

SwitchStatement() public method

public SwitchStatement ( int pos, int len ) : System.Collections.Generic
pos int
len int
return System.Collections.Generic

ToSource() public method

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

Visit() public method

Visits this node, then the switch-expression, then the cases in lexical order.
Visits this node, then the switch-expression, then the cases in lexical order.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void