public interface ILiteralNode extends IExpressionNode
An ILiteralNode
can represent null
, void
,
and literal values of the following types:
int
, uint
, and Number
types are represented more completely by the INumericLiteralNode
subinterface.
The RegExp
type is represented more completely by the
IRegExpLiteralNode
subinterrface.
The shape of an Array
literal is
ILiteralNode "Array" IExpressionNode <-- getChild(0) IExpressionNode <-- getChild(1) ...For example,
[ 1, 2, 3 ]
is represented as
ILiteralNode "Array" INumericLiteralNode 1 INumericLiteralNode 2 INumericLiteralNode 3The shape of an
Object
literal is
ILiteralNode "Object" IObjectLIteralValuePairNode <-- getChild(0) IObjectLiteralValuePairNode <-- getChild(1) ..For example,
{ a: 1, b: 2 } is represented as
ILiteralNode "Object"
IObjectLiteralValuePairNode
IIdentifierNode "a"
INumericLiteralNode 1
IObjectLiteralValuePairNode
IIdentifierNode "b"
INumericLiteralNode 2
The other types of literals nodes do not have children.
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Interface and Description
static class
ILiteralNode.LiteralType
Represents a kind of ActionScript literal
-
Field Summary
-
Fields inherited from interface org.apache.flex.compiler.common.ISourceLocation
UNKNOWN
-
Method Summary
Methods
Modifier and Type
Method and Description
ILiteralNode.LiteralType
getLiteralType()
Returns the ILiteralNode.LiteralType
that this node represents
String
getValue()
Returns the value of this literal as a String
String
getValue(boolean rawValue)
Returns the value of this literal as a String
-
Methods inherited from interface org.apache.flex.compiler.tree.as.IExpressionNode
copyForInitializer, hasParenthesis, isDynamicExpression, resolve, resolveType
-
Methods inherited from interface org.apache.flex.compiler.tree.as.IASNode
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
-
Methods inherited from interface org.apache.flex.compiler.common.ISourceLocation
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
-
-
Method Detail
-
getValue
String getValue()
Returns the value of this literal as a String
- Returns:
- the value of this literal as a String
-
getValue
String getValue(boolean rawValue)
Returns the value of this literal as a String
- Parameters:
rawValue
- True if you want the raw value, otherwise some massaging
of the value will be done before returning the value if it's a String
(enclosing quotes will be removed).
- Returns:
- the value of this literal as a String
-
getLiteralType
ILiteralNode.LiteralType getLiteralType()
Returns the ILiteralNode.LiteralType
that this node represents
Copyright © 2016 The Apache Software Foundation. All rights reserved.