C# Class Rhino.Ast.ExpressionStatement

AST node representing an expression in a statement context.
AST node representing an expression in a statement context. The node type is Rhino.Token.EXPR_VOID if inside a function, or else Rhino.Token.EXPR_RESULT if inside a script.
Inheritance: AstNode
Exibir arquivo Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
ExpressionStatement ( ) : System.Text
ExpressionStatement ( AstNode expr ) : System.Text

Constructs a new ExpressionStatement wrapping the specified expression. Sets this node's position to the position of the wrapped node, and sets the wrapped node's position to zero. Sets this node's length to the length of the wrapped node.

ExpressionStatement ( AstNode expr, bool hasResult ) : System.Text

Constructs a new ExpressionStatement wrapping the specified expression. Sets this node's position to the position of the wrapped node, and sets the wrapped node's position to zero. Sets this node's length to the length of the wrapped node.

ExpressionStatement ( int pos, int len ) : System.Text
ExpressionStatement ( int pos, int len, AstNode expr ) : System.Text

Constructs a new ExpressionStatement

GetExpression ( ) : AstNode

Returns the wrapped expression

HasSideEffects ( ) : bool

Returns true if this node has side effects

SetExpression ( AstNode expression ) : void

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

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

SetHasResult ( ) : void

Called by the parser to set node type to EXPR_RESULT if this node is not within a Function.

Called by the parser to set node type to EXPR_RESULT if this node is not within a Function.

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

Visits this node, then the wrapped statement.

Visits this node, then the wrapped statement.

Method Details

ExpressionStatement() public method

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

ExpressionStatement() public method

Constructs a new ExpressionStatement wrapping the specified expression. Sets this node's position to the position of the wrapped node, and sets the wrapped node's position to zero. Sets this node's length to the length of the wrapped node.
public ExpressionStatement ( AstNode expr ) : System.Text
expr AstNode the wrapped expression
return System.Text

ExpressionStatement() public method

Constructs a new ExpressionStatement wrapping the specified expression. Sets this node's position to the position of the wrapped node, and sets the wrapped node's position to zero. Sets this node's length to the length of the wrapped node.
public ExpressionStatement ( AstNode expr, bool hasResult ) : System.Text
expr AstNode the wrapped expression
hasResult bool /// /// true /// if this expression has side /// effects. If true, sets node type to EXPR_RESULT, else to EXPR_VOID. ///
return System.Text

ExpressionStatement() public method

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

ExpressionStatement() public method

Constructs a new ExpressionStatement
/// if /// expr /// is null ///
public ExpressionStatement ( int pos, int len, AstNode expr ) : System.Text
pos int
len int
expr AstNode /// the wrapped /// AstNode /// . /// The /// ExpressionStatement /// 's bounds are set to those of expr, /// and expr's parent is set to this node. ///
return System.Text

GetExpression() public method

Returns the wrapped expression
public GetExpression ( ) : AstNode
return AstNode

HasSideEffects() public method

Returns true if this node has side effects
/// if expression has not yet /// been set. ///
public HasSideEffects ( ) : bool
return bool

SetExpression() public method

Sets the wrapped expression, and sets its parent to this node.
Sets the wrapped expression, and sets its parent to this node.
/// } if expression is /// null ///
public SetExpression ( AstNode expression ) : void
expression AstNode
return void

SetHasResult() public method

Called by the parser to set node type to EXPR_RESULT if this node is not within a Function.
Called by the parser to set node type to EXPR_RESULT if this node is not within a Function.
public SetHasResult ( ) : void
return void

ToSource() public method

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

Visit() public method

Visits this node, then the wrapped statement.
Visits this node, then the wrapped statement.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void