C# Класс 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]
Наследование: AstNode
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Описание методов

AddStatement() публичный Метод

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
Результат void

GetExpression() публичный Метод

Returns the case expression, null for default case
public GetExpression ( ) : AstNode
Результат AstNode

GetStatements() публичный Метод

Returns statement list, which may be null .
public GetStatements ( ) : IList
Результат IList

IsDefault() публичный Метод

Return true if this is a default case.
Return true if this is a default case.
public IsDefault ( ) : bool
Результат bool

SetExpression() публичный Метод

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
Результат void

SetStatements() публичный Метод

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
Результат void

SwitchCase() публичный Метод

public SwitchCase ( ) : System.Collections.Generic
Результат System.Collections.Generic

SwitchCase() публичный Метод

public SwitchCase ( int pos ) : System.Collections.Generic
pos int
Результат System.Collections.Generic

SwitchCase() публичный Метод

public SwitchCase ( int pos, int len ) : System.Collections.Generic
pos int
len int
Результат System.Collections.Generic

ToSource() публичный Метод

public ToSource ( int depth ) : string
depth int
Результат string

Visit() публичный Метод

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
Результат void