C# Class Rhino.Ast.XmlRef

Base class for E4X XML attribute-access or property-get expressions.
Base class for E4X XML attribute-access or property-get expressions. Such expressions can take a variety of forms. The general syntax has three parts:

  1. optional: an @
  2. (specifying an attribute access)
  3. optional: a namespace (a Name ) and double-colon
  4. required: either a Name or a bracketed [expression]
The property-name expressions (examples: ns::name , @name ) are represented as XmlPropRef nodes. The bracketed-expression versions (examples: ns::[name] , @[name] ) become XmlElemRef nodes.

This node type (or more specifically, its subclasses) will sometimes be the right-hand child of a PropertyGet node or an XmlMemberGet node. The XmlRef node may also be a standalone primary expression with no explicit target, which is valid in certain expression contexts such as company..employee.(@id < 100) - in this case, the @id is an XmlRef that is part of an infix '<' expression whose parent is an XmlDotQuery node.

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

Protected Properties

Property Type Description
@namespace Name
atPos int
colonPos int

Public Methods

Method Description
GetAtPos ( ) : int

Returns position of @ -token, or -1 if this is not an attribute-access expression.

GetColonPos ( ) : int

Returns position of :: token, or -1 if not present. It will only be present if the namespace node is non- null .

GetNamespace ( ) : Name

Return the namespace.

Return the namespace. May be @null .

IsAttributeAccess ( ) : bool

Returns true if this expression began with an @ -token.

SetAtPos ( int atPos ) : void

Sets position of @ -token, or -1

SetColonPos ( int colonPos ) : void

Sets position of :: token, or -1 if not present

SetNamespace ( Name @namespace ) : void

Sets namespace, and sets its parent to this node.

Sets namespace, and sets its parent to this node. Can be null .

XmlRef ( ) : Rhino.Ast
XmlRef ( int pos ) : Rhino.Ast
XmlRef ( int pos, int len ) : Rhino.Ast

Method Details

GetAtPos() public method

Returns position of @ -token, or -1 if this is not an attribute-access expression.
public GetAtPos ( ) : int
return int

GetColonPos() public method

Returns position of :: token, or -1 if not present. It will only be present if the namespace node is non- null .
public GetColonPos ( ) : int
return int

GetNamespace() public method

Return the namespace.
Return the namespace. May be @null .
public GetNamespace ( ) : Name
return Name

IsAttributeAccess() public method

Returns true if this expression began with an @ -token.
public IsAttributeAccess ( ) : bool
return bool

SetAtPos() public method

Sets position of @ -token, or -1
public SetAtPos ( int atPos ) : void
atPos int
return void

SetColonPos() public method

Sets position of :: token, or -1 if not present
public SetColonPos ( int colonPos ) : void
colonPos int
return void

SetNamespace() public method

Sets namespace, and sets its parent to this node.
Sets namespace, and sets its parent to this node. Can be null .
public SetNamespace ( Name @namespace ) : void
@namespace Name
return void

XmlRef() public method

public XmlRef ( ) : Rhino.Ast
return Rhino.Ast

XmlRef() public method

public XmlRef ( int pos ) : Rhino.Ast
pos int
return Rhino.Ast

XmlRef() public method

public XmlRef ( int pos, int len ) : Rhino.Ast
pos int
len int
return Rhino.Ast

Property Details

@namespace protected property

protected Name,Rhino.Ast @namespace
return Name

atPos protected property

protected int atPos
return int

colonPos protected property

protected int colonPos
return int