C# Класс 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 ,
Наследование: AstNode, DestructuringForm
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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 .

Описание методов

AddElement() публичный Метод

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
Результат void

ArrayLiteral() публичный Метод

public ArrayLiteral ( ) : System
Результат System

ArrayLiteral() публичный Метод

public ArrayLiteral ( int pos ) : System
pos int
Результат System

ArrayLiteral() публичный Метод

public ArrayLiteral ( int pos, int len ) : System
pos int
len int
Результат System

GetDestructuringLength() публичный Метод

Returns destructuring length
public GetDestructuringLength ( ) : int
Результат int

GetElement() публичный Метод

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
Результат AstNode

GetElements() публичный Метод

Returns the element list
public GetElements ( ) : IList
Результат IList

GetSize() публичный Метод

Returns the number of elements in this Array literal, including empty elements.
public GetSize ( ) : int
Результат int

GetSkipCount() публичный Метод

Used by code generator.
Used by code generator.
public GetSkipCount ( ) : int
Результат int

IsDestructuring() публичный Метод

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
Результат bool

SetDestructuringLength() публичный Метод

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
Результат void

SetElements() публичный Метод

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 /// . ///
Результат void

SetIsDestructuring() публичный Метод

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
Результат void

SetSkipCount() публичный Метод

Used by code generator.
Used by code generator.
public SetSkipCount ( int count ) : void
count int the count of empty elements
Результат void

ToSource() публичный Метод

public ToSource ( int depth ) : string
depth int
Результат string

Visit() публичный Метод

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
Результат void