C# Class Rhino.Ast.InfixExpression

AST node representing an infix (binary operator) expression.
AST node representing an infix (binary operator) expression. The operator is the node's Rhino.Token type.
Inheritance: AstNode
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Protected Properties

Property Type Description
left AstNode
operatorPosition int
right AstNode

Public Methods

Method Description
GetLeft ( ) : AstNode

Returns the left-hand side of the expression

GetOperator ( ) : int

Returns operator token – alias for Rhino.Node.GetType()

GetOperatorPosition ( ) : int

Returns relative offset of operator token

GetRight ( ) : AstNode

Returns the right-hand side of the expression

HasSideEffects ( ) : bool
InfixExpression ( ) : System
InfixExpression ( AstNode left, AstNode right ) : System

Constructs a new InfixExpression . Updates bounds to include left and right nodes.

InfixExpression ( int pos ) : System
InfixExpression ( int @operator, AstNode left, AstNode right, int operatorPos ) : System

Constructs a new InfixExpression .

InfixExpression ( int pos, int len ) : System
InfixExpression ( int pos, int len, AstNode left, AstNode right ) : System
SetLeft ( AstNode left ) : void

Sets the left-hand side of the expression, and sets its parent to this node.

Sets the left-hand side of the expression, and sets its parent to this node.

SetLeftAndRight ( AstNode left, AstNode right ) : void
SetOperator ( int @operator ) : void

Sets operator token – like Rhino.Node.SetType(int) , but throws an exception if the operator is invalid.

SetOperatorPosition ( int operatorPosition ) : void

Sets operator token's relative offset

SetRight ( AstNode right ) : void

Sets the right-hand side of the expression, and sets its parent to this node.

Sets the right-hand side of the expression, and sets its parent to this node.

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

Visits this node, the left operand, and the right operand.

Visits this node, the left operand, and the right operand.

Method Details

GetLeft() public method

Returns the left-hand side of the expression
public GetLeft ( ) : AstNode
return AstNode

GetOperator() public method

Returns operator token – alias for Rhino.Node.GetType()
public GetOperator ( ) : int
return int

GetOperatorPosition() public method

Returns relative offset of operator token
public GetOperatorPosition ( ) : int
return int

GetRight() public method

Returns the right-hand side of the expression
public GetRight ( ) : AstNode
return AstNode

HasSideEffects() public method

public HasSideEffects ( ) : bool
return bool

InfixExpression() public method

public InfixExpression ( ) : System
return System

InfixExpression() public method

Constructs a new InfixExpression . Updates bounds to include left and right nodes.
public InfixExpression ( AstNode left, AstNode right ) : System
left AstNode
right AstNode
return System

InfixExpression() public method

public InfixExpression ( int pos ) : System
pos int
return System

InfixExpression() public method

Constructs a new InfixExpression .
public InfixExpression ( int @operator, AstNode left, AstNode right, int operatorPos ) : System
@operator int
left AstNode
right AstNode
operatorPos int the absolute position of the operator
return System

InfixExpression() public method

public InfixExpression ( int pos, int len ) : System
pos int
len int
return System

InfixExpression() public method

public InfixExpression ( int pos, int len, AstNode left, AstNode right ) : System
pos int
len int
left AstNode
right AstNode
return System

SetLeft() public method

Sets the left-hand side of the expression, and sets its parent to this node.
Sets the left-hand side of the expression, and sets its parent to this node.
/// } if left is /// null ///
public SetLeft ( AstNode left ) : void
left AstNode the left-hand side of the expression
return void

SetLeftAndRight() public method

public SetLeftAndRight ( AstNode left, AstNode right ) : void
left AstNode
right AstNode
return void

SetOperator() public method

Sets operator token – like Rhino.Node.SetType(int) , but throws an exception if the operator is invalid.
/// if operator is not a valid token /// code ///
public SetOperator ( int @operator ) : void
@operator int
return void

SetOperatorPosition() public method

Sets operator token's relative offset
public SetOperatorPosition ( int operatorPosition ) : void
operatorPosition int offset in parent of operator token
return void

SetRight() public method

Sets the right-hand side of the expression, and sets its parent to this node.
Sets the right-hand side of the expression, and sets its parent to this node.
/// } if right is /// null ///
public SetRight ( AstNode right ) : void
right AstNode
return void

ToSource() public method

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

Visit() public method

Visits this node, the left operand, and the right operand.
Visits this node, the left operand, and the right operand.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void

Property Details

left protected property

protected AstNode left
return AstNode

operatorPosition protected property

protected int operatorPosition
return int

right protected property

protected AstNode right
return AstNode