An AST node representing a
var
or
const
declaration.
The shape of this node is:
IVariableNode IMetaTagsNode <-- getMetaTagsNode() INamespaceDecorationNode <-- getNamespaceNode() IKeywordNode <-- getKeywordNode() IExpressionNode <-- getNameExpressionNode() IExpressionNode <-- getVariableTypeNode() IExpressionNode <-- getAssignedValueNode() IVariableNode <-- ??? IVariableNode ...
For example,
[Foo] [Bar] public var i:int = 1, j:int = 2;
is represented as
IVariableNode IMetaTagsNode IMetaTagNode "Foo" IMetaTagNode "Bar" INamespaceDecorationNode "public" IKeywordNode "var" IIdentifierNode "i" IIdentifierNode "int" INumericLiteralNode 1 IVariableNode IIdentifierNode "j" IIdentifierNode "int" INumericLiteralNode 2
If there is no metadata, the corresponding child node is not present.
If there is no namespace, the corresponding child node is not present.
If there is no type annotation, an implicit IIdentifierNode
for "*"
is produced.
If there is no initial value, the corresponding child node is not present.
If multiple variables or constants are declared, then additional children of type IVariable
are present. These will not have metadata, or a namespace, or a keyword.