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
파일 보기 프로젝트 열기: hazzik/Rhino.Net 1 사용 예제들

공개 메소드들

메소드 설명
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