C# Class Rhino.Ast.ArrayLiteral

AST node for an Array literal.
AST node for an Array literal. The elements list will always be non- null , although the list will have no elements if the Array literal is empty.

Node type is Rhino.Token.ARRAYLIT .

ArrayLiteral : [ Elisionopt ] [ ElementList ] [ ElementList , Elisionopt ] ElementList : Elisionopt AssignmentExpression ElementList , Elisionopt AssignmentExpression Elision : , Elision ,
Inheritance: AstNode, DestructuringForm
Afficher le fichier Open project: hazzik/Rhino.Net Class Usage Examples

Méthodes publiques

Méthode Description
AddElement ( AstNode element ) : void

Adds an element to the list, and sets its parent to this node.

Adds an element to the list, and sets its parent to this node.

ArrayLiteral ( ) : System
ArrayLiteral ( int pos ) : System
ArrayLiteral ( int pos, int len ) : System
GetDestructuringLength ( ) : int

Returns destructuring length

GetElement ( int index ) : AstNode

Returns element at specified index.

Returns element at specified index.

GetElements ( ) : IList

Returns the element list

GetSize ( ) : int

Returns the number of elements in this Array literal, including empty elements.

GetSkipCount ( ) : int

Used by code generator.

Used by code generator.

IsDestructuring ( ) : bool

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.

SetDestructuringLength ( int destructuringLength ) : void

Sets destructuring length.

Sets destructuring length. This is set by the parser and used by the code generator. for ([a,] in obj) is legal, but for ([a] in obj) is not since we have both key and value supplied. The difference is only meaningful in array literals used in destructuring-assignment contexts.

SetElements ( IList elements ) : void

Sets the element list, and sets each element's parent to this node.

Sets the element list, and sets each element's parent to this node.

SetIsDestructuring ( bool destructuring ) : void

Marks this node as being a destructuring form - that is, appearing in a context such as for ([a, b] in ...) where it's the target of a destructuring assignment.

SetSkipCount ( int count ) : void

Used by code generator.

Used by code generator.

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

Visits this node, then visits its element expressions in order.

Visits this node, then visits its element expressions in order. Any empty elements are represented by EmptyExpression objects, so the callback will never be passed null .

Method Details

AddElement() public méthode

Adds an element to the list, and sets its parent to this node.
Adds an element to the list, and sets its parent to this node.
/// if element is /// null /// . To indicate /// an empty element, use an /// EmptyExpression /// node. ///
public AddElement ( AstNode element ) : void
element AstNode the element to add
Résultat void

ArrayLiteral() public méthode

public ArrayLiteral ( ) : System
Résultat System

ArrayLiteral() public méthode

public ArrayLiteral ( int pos ) : System
pos int
Résultat System

ArrayLiteral() public méthode

public ArrayLiteral ( int pos, int len ) : System
pos int
len int
Résultat System

GetDestructuringLength() public méthode

Returns destructuring length
public GetDestructuringLength ( ) : int
Résultat int

GetElement() public méthode

Returns element at specified index.
Returns element at specified index.
if the index is invalid
public GetElement ( int index ) : AstNode
index int the index of the element to retrieve
Résultat AstNode

GetElements() public méthode

Returns the element list
public GetElements ( ) : IList
Résultat IList

GetSize() public méthode

Returns the number of elements in this Array literal, including empty elements.
public GetSize ( ) : int
Résultat int

GetSkipCount() public méthode

Used by code generator.
Used by code generator.
public GetSkipCount ( ) : int
Résultat int

IsDestructuring() public méthode

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.
Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.
public IsDestructuring ( ) : bool
Résultat bool

SetDestructuringLength() public méthode

Sets destructuring length.
Sets destructuring length. This is set by the parser and used by the code generator. for ([a,] in obj) is legal, but for ([a] in obj) is not since we have both key and value supplied. The difference is only meaningful in array literals used in destructuring-assignment contexts.
public SetDestructuringLength ( int destructuringLength ) : void
destructuringLength int
Résultat void

SetElements() public méthode

Sets the element list, and sets each element's parent to this node.
Sets the element list, and sets each element's parent to this node.
public SetElements ( IList elements ) : void
elements IList /// the element list. Can be /// null /// . ///
Résultat void

SetIsDestructuring() public méthode

Marks this node as being a destructuring form - that is, appearing in a context such as for ([a, b] in ...) where it's the target of a destructuring assignment.
public SetIsDestructuring ( bool destructuring ) : void
destructuring bool
Résultat void

SetSkipCount() public méthode

Used by code generator.
Used by code generator.
public SetSkipCount ( int count ) : void
count int the count of empty elements
Résultat void

ToSource() public méthode

public ToSource ( int depth ) : string
depth int
Résultat string

Visit() public méthode

Visits this node, then visits its element expressions in order.
Visits this node, then visits its element expressions in order. Any empty elements are represented by EmptyExpression objects, so the callback will never be passed null .
public Visit ( NodeVisitor v ) : void
v NodeVisitor
Résultat void