C# Class Rhino.Ast.SwitchCase

Switch-case AST node type.
Switch-case AST node type. The switch case is always part of a switch statement. Node type is Rhino.Token.CASE .

CaseBlock : { [CaseClauses] } { [CaseClauses] DefaultClause [CaseClauses] } CaseClauses : CaseClause CaseClauses CaseClause CaseClause : case Expression : [StatementList] DefaultClause : default : [StatementList]
Inheritance: AstNode
Afficher le fichier Open project: hazzik/Rhino.Net Class Usage Examples

Méthodes publiques

Méthode Description
AddStatement ( AstNode statement ) : void

Adds a statement to the end of the statement list.

Adds a statement to the end of the statement list. Sets the parent of the new statement to this node, updates its start offset to be relative to this node, and sets the length of this node to include the new child.

GetExpression ( ) : AstNode

Returns the case expression, null for default case

GetStatements ( ) : IList

Returns statement list, which may be null .

IsDefault ( ) : bool

Return true if this is a default case.

Return true if this is a default case.

SetExpression ( AstNode expression ) : void

Sets the case expression, null for default case. Note that for empty fall-through cases, they still have a case expression. In case 0: case 1: break; the first case has an expression that is a NumberLiteral with value 0 .

SetStatements ( IList statements ) : void

Sets statement list.

Sets statement list. May be null . Replaces any existing statements. Each element in the list has its parent set to this node.

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

Visits this node, then the case expression if present, then each statement (if any are specified).

Visits this node, then the case expression if present, then each statement (if any are specified).

Method Details

AddStatement() public méthode

Adds a statement to the end of the statement list.
Adds a statement to the end of the statement list. Sets the parent of the new statement to this node, updates its start offset to be relative to this node, and sets the length of this node to include the new child.
/// } if statement is /// null ///
public AddStatement ( AstNode statement ) : void
statement AstNode a child statement
Résultat void

GetExpression() public méthode

Returns the case expression, null for default case
public GetExpression ( ) : AstNode
Résultat AstNode

GetStatements() public méthode

Returns statement list, which may be null .
public GetStatements ( ) : IList
Résultat IList

IsDefault() public méthode

Return true if this is a default case.
Return true if this is a default case.
public IsDefault ( ) : bool
Résultat bool

SetExpression() public méthode

Sets the case expression, null for default case. Note that for empty fall-through cases, they still have a case expression. In case 0: case 1: break; the first case has an expression that is a NumberLiteral with value 0 .
public SetExpression ( AstNode expression ) : void
expression AstNode
Résultat void

SetStatements() public méthode

Sets statement list.
Sets statement list. May be null . Replaces any existing statements. Each element in the list has its parent set to this node.
public SetStatements ( IList statements ) : void
statements IList
Résultat void

SwitchCase() public méthode

public SwitchCase ( ) : System.Collections.Generic
Résultat System.Collections.Generic

SwitchCase() public méthode

public SwitchCase ( int pos ) : System.Collections.Generic
pos int
Résultat System.Collections.Generic

SwitchCase() public méthode

public SwitchCase ( int pos, int len ) : System.Collections.Generic
pos int
len int
Résultat System.Collections.Generic

ToSource() public méthode

public ToSource ( int depth ) : string
depth int
Résultat string

Visit() public méthode

Visits this node, then the case expression if present, then each statement (if any are specified).
Visits this node, then the case expression if present, then each statement (if any are specified).
public Visit ( NodeVisitor v ) : void
v NodeVisitor
Résultat void