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
파일 보기 프로젝트 열기: hazzik/Rhino.Net 1 사용 예제들

공개 메소드들

메소드 설명
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