C# Class Rhino.Ast.ElementGet

AST node for an indexed property reference, such as foo['bar'] or foo[2] . This is sometimes called an "element-get" operation, hence the name of the node.

Node type is Rhino.Token.GETELEM .

The node bounds extend from the beginning position of the target through the closing right-bracket. In the presence of a syntax error, the right bracket position is -1, and the node ends at the end of the element expression.

Inheritance: AstNode
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
ElementGet ( ) : System.Text
ElementGet ( AstNode target, AstNode element ) : System.Text
ElementGet ( int pos ) : System.Text
ElementGet ( int pos, int len ) : System.Text
GetElement ( ) : AstNode

Returns the element being accessed

GetLb ( ) : int

Returns left bracket position

GetRb ( ) : int

Returns right bracket position, -1 if missing

GetTarget ( ) : AstNode

Returns the object on which the element is being fetched.

Returns the object on which the element is being fetched.

SetElement ( AstNode element ) : void

Sets the element being accessed, and sets its parent to this node.

Sets the element being accessed, and sets its parent to this node.

SetLb ( int lb ) : void

Sets left bracket position

SetParens ( int lb, int rb ) : void
SetRb ( int rb ) : void

Sets right bracket position, -1 if not present

SetTarget ( AstNode target ) : void

Sets target object, and sets its parent to this node.

Sets target object, and sets its parent to this node.

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

Visits this node, the target, and the index expression.

Visits this node, the target, and the index expression.

Method Details

ElementGet() public method

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

ElementGet() public method

public ElementGet ( AstNode target, AstNode element ) : System.Text
target AstNode
element AstNode
return System.Text

ElementGet() public method

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

ElementGet() public method

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

GetElement() public method

Returns the element being accessed
public GetElement ( ) : AstNode
return AstNode

GetLb() public method

Returns left bracket position
public GetLb ( ) : int
return int

GetRb() public method

Returns right bracket position, -1 if missing
public GetRb ( ) : int
return int

GetTarget() public method

Returns the object on which the element is being fetched.
Returns the object on which the element is being fetched.
public GetTarget ( ) : AstNode
return AstNode

SetElement() public method

Sets the element being accessed, and sets its parent to this node.
Sets the element being accessed, and sets its parent to this node.
/// if element is /// null ///
public SetElement ( AstNode element ) : void
element AstNode
return void

SetLb() public method

Sets left bracket position
public SetLb ( int lb ) : void
lb int
return void

SetParens() public method

public SetParens ( int lb, int rb ) : void
lb int
rb int
return void

SetRb() public method

Sets right bracket position, -1 if not present
public SetRb ( int rb ) : void
rb int
return void

SetTarget() public method

Sets target object, and sets its parent to this node.
Sets target object, and sets its parent to this node.
/// if target is /// null ///
public SetTarget ( AstNode target ) : void
target AstNode /// expression evaluating to the object upon which /// to do the element lookup ///
return void

ToSource() public method

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

Visit() public method

Visits this node, the target, and the index expression.
Visits this node, the target, and the index expression.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void