C# Class Rhino.Ast.Name

AST node for a simple name.
AST node for a simple name. A simple name is an identifier that is not a keyword. Node type is Rhino.Token.NAME .

This node type is also used to represent certain non-identifier names that are part of the language syntax. It's used for the "get" and "set" pseudo-keywords for object-initializer getter/setter properties, and it's also used for the "*" wildcard in E4X XML namespace and name expressions.

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

Public Methods

Method Description
GetDefiningScope ( ) : Scope

Returns the Scope in which this Name is defined.

GetIdentifier ( ) : string

Returns the node's identifier

GetScope ( ) : Scope

Return the Scope associated with this node. This is only used for (and set by) the code generator, so it will always be null in frontend AST-processing code. Use GetDefiningScope() to find the lexical Scope in which this Name is defined, if any.

IsLocalName ( ) : bool

Return true if this node is known to be defined as a symbol in a lexical scope other than the top-level (global) scope.

Return true if this node is known to be defined as a symbol in a lexical scope other than the top-level (global) scope.

Length ( ) : int

Return the length of this node's identifier, to let you pretend it's a string . Don't confuse this method with the AstNode.GetLength() method, which returns the range of characters that this node overlaps in the source input.

Name ( ) : Rhino
Name ( int pos ) : Rhino
Name ( int pos, int len ) : Rhino
Name ( int pos, int len, string name ) : Rhino

Constructs a new Name

Name ( int pos, string name ) : Rhino
SetIdentifier ( string identifier ) : void

Sets the node's identifier

SetScope ( Scope s ) : void

Set the Scope associated with this node. This method does not set the scope's ast-node field to this node. The field exists only for temporary storage by the code generator. Not every name has an associated scope - typically only function and variable names (but not property names) are registered in a scope.

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

Visits this node.

Visits this node. There are no children to visit.

Method Details

GetDefiningScope() public method

Returns the Scope in which this Name is defined.
public GetDefiningScope ( ) : Scope
return Scope

GetIdentifier() public method

Returns the node's identifier
public GetIdentifier ( ) : string
return string

GetScope() public method

Return the Scope associated with this node. This is only used for (and set by) the code generator, so it will always be null in frontend AST-processing code. Use GetDefiningScope() to find the lexical Scope in which this Name is defined, if any.
public GetScope ( ) : Scope
return Scope

IsLocalName() public method

Return true if this node is known to be defined as a symbol in a lexical scope other than the top-level (global) scope.
Return true if this node is known to be defined as a symbol in a lexical scope other than the top-level (global) scope.
public IsLocalName ( ) : bool
return bool

Length() public method

Return the length of this node's identifier, to let you pretend it's a string . Don't confuse this method with the AstNode.GetLength() method, which returns the range of characters that this node overlaps in the source input.
public Length ( ) : int
return int

Name() public method

public Name ( ) : Rhino
return Rhino

Name() public method

public Name ( int pos ) : Rhino
pos int
return Rhino

Name() public method

public Name ( int pos, int len ) : Rhino
pos int
len int
return Rhino

Name() public method

Constructs a new Name
public Name ( int pos, int len, string name ) : Rhino
pos int node start position
len int node length
name string /// the identifier associated with this /// Name /// node ///
return Rhino

Name() public method

public Name ( int pos, string name ) : Rhino
pos int
name string
return Rhino

SetIdentifier() public method

Sets the node's identifier
if identifier is null
public SetIdentifier ( string identifier ) : void
identifier string
return void

SetScope() public method

Set the Scope associated with this node. This method does not set the scope's ast-node field to this node. The field exists only for temporary storage by the code generator. Not every name has an associated scope - typically only function and variable names (but not property names) are registered in a scope.
public SetScope ( Scope s ) : void
s Scope /// the scope. Can be null. Doesn't set any fields in the /// scope. ///
return void

ToSource() public method

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

Visit() public method

Visits this node.
Visits this node. There are no children to visit.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void