C# Class Rhino.Ast.XmlElemRef

AST node for an E4X XML [expr] member-ref expression. The node type is Rhino.Token.REF_MEMBER .

Syntax:

 @opt ns:: opt [ expr ]
Examples include ns::[expr] , @ns::[expr] , @[expr] , *::[expr] and @*::[expr] .

Note that the form [expr] (i.e. no namespace or attribute-qualifier) is not a legal XmlElemRef expression, since it's already used for standard JavaScript ElementGet array-indexing. Hence, an XmlElemRef node always has either the attribute-qualifier, a non- null namespace node, or both.

The node starts at the @ token, if present. Otherwise it starts at the namespace name. The node bounds extend through the closing right-bracket, or if it is missing due to a syntax error, through the end of the index expression.

Inheritance: XmlRef
Mostrar archivo Open project: hazzik/Rhino.Net

Public Methods

Method Description
GetExpression ( ) : AstNode

Returns index expression: the 'expr' in @[expr] or @*::[expr] .

GetLb ( ) : int

Returns left bracket position, or -1 if missing.

Returns left bracket position, or -1 if missing.

GetRb ( ) : int

Returns left bracket position, or -1 if missing.

Returns left bracket position, or -1 if missing.

SetBrackets ( int lb, int rb ) : void

Sets both bracket positions.

Sets both bracket positions.

SetExpression ( AstNode expr ) : void

Sets index expression, and sets its parent to this node.

Sets index expression, and sets its parent to this node.

SetLb ( int lb ) : void

Sets left bracket position, or -1 if missing.

Sets left bracket position, or -1 if missing.

SetRb ( int rb ) : void

Sets right bracket position, -1 if missing.

Sets right bracket position, -1 if missing.

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

Visits this node, then the namespace if provided, then the index expression.

Visits this node, then the namespace if provided, then the index expression.

XmlElemRef ( ) : System.Text
XmlElemRef ( int pos ) : System.Text
XmlElemRef ( int pos, int len ) : System.Text

Method Details

GetExpression() public method

Returns index expression: the 'expr' in @[expr] or @*::[expr] .
public GetExpression ( ) : AstNode
return AstNode

GetLb() public method

Returns left bracket position, or -1 if missing.
Returns left bracket position, or -1 if missing.
public GetLb ( ) : int
return int

GetRb() public method

Returns left bracket position, or -1 if missing.
Returns left bracket position, or -1 if missing.
public GetRb ( ) : int
return int

SetBrackets() public method

Sets both bracket positions.
Sets both bracket positions.
public SetBrackets ( int lb, int rb ) : void
lb int
rb int
return void

SetExpression() public method

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

SetLb() public method

Sets left bracket position, or -1 if missing.
Sets left bracket position, or -1 if missing.
public SetLb ( int lb ) : void
lb int
return void

SetRb() public method

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

ToSource() public method

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

Visit() public method

Visits this node, then the namespace if provided, then the index expression.
Visits this node, then the namespace if provided, then the index expression.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void

XmlElemRef() public method

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

XmlElemRef() public method

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

XmlElemRef() public method

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