C# Class Rhino.Ast.IfStatement

If-else statement.
If-else statement. Node type is Rhino.Token.IF .

IfStatement : if ( Expression ) Statement else Statement if ( Expression ) Statement
Inheritance: AstNode
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
GetCondition ( ) : AstNode

Returns if condition

GetElsePart ( ) : AstNode

Returns statement to execute if condition is false

GetElsePosition ( ) : int

Returns position of "else" keyword, or -1

GetLp ( ) : int

Returns left paren offset

GetRp ( ) : int

Returns right paren position, -1 if missing

GetThenPart ( ) : AstNode

Returns statement to execute if condition is true

IfStatement ( ) : System.Text
IfStatement ( int pos ) : System.Text
IfStatement ( int pos, int len ) : System.Text
SetCondition ( AstNode condition ) : void

Sets if condition.

Sets if condition.

SetElsePart ( AstNode elsePart ) : void

Sets statement to execute if condition is false

SetElsePosition ( int elsePosition ) : void

Sets position of "else" keyword, -1 if not present

SetLp ( int lp ) : void

Sets left paren offset

SetParens ( int lp, int rp ) : void

Sets both paren positions

SetRp ( int rp ) : void

Sets right paren position, -1 if missing

SetThenPart ( AstNode thenPart ) : void

Sets statement to execute if condition is true

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

Visits this node, the condition, the then-part, and if supplied, the else-part.

Visits this node, the condition, the then-part, and if supplied, the else-part.

Method Details

GetCondition() public method

Returns if condition
public GetCondition ( ) : AstNode
return AstNode

GetElsePart() public method

Returns statement to execute if condition is false
public GetElsePart ( ) : AstNode
return AstNode

GetElsePosition() public method

Returns position of "else" keyword, or -1
public GetElsePosition ( ) : int
return int

GetLp() public method

Returns left paren offset
public GetLp ( ) : int
return int

GetRp() public method

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

GetThenPart() public method

Returns statement to execute if condition is true
public GetThenPart ( ) : AstNode
return AstNode

IfStatement() public method

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

IfStatement() public method

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

IfStatement() public method

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

SetCondition() public method

Sets if condition.
Sets if condition.
/// if /// condition /// is /// null /// . ///
public SetCondition ( AstNode condition ) : void
condition AstNode
return void

SetElsePart() public method

Sets statement to execute if condition is false
public SetElsePart ( AstNode elsePart ) : void
elsePart AstNode /// statement to execute if condition is false. /// Can be /// null /// . ///
return void

SetElsePosition() public method

Sets position of "else" keyword, -1 if not present
public SetElsePosition ( int elsePosition ) : void
elsePosition int
return void

SetLp() public method

Sets left paren offset
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, -1 if missing
public SetRp ( int rp ) : void
rp int
return void

SetThenPart() public method

Sets statement to execute if condition is true
/// if thenPart is /// null ///
public SetThenPart ( AstNode thenPart ) : void
thenPart AstNode
return void

ToSource() public method

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

Visit() public method

Visits this node, the condition, the then-part, and if supplied, the else-part.
Visits this node, the condition, the then-part, and if supplied, the else-part.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void