public class LiteralNode extends ExpressionNodeBase implements ILiteralNode
ILiteralNode.LiteralType| Modifier and Type | Field and Description |
|---|---|
protected ILiteralNode.LiteralType |
type
Type of the literal (e.g.
|
protected String |
value |
flagsemptyNodeArray, parentUNKNOWN| Modifier | Constructor and Description |
|---|---|
|
LiteralNode(ASToken t,
ILiteralNode.LiteralType type)
Constructor.
|
|
LiteralNode(ILiteralNode.LiteralType type,
String value)
Constructor.
|
|
LiteralNode(ILiteralNode.LiteralType type,
String value,
SourceLocation sourceLocation)
Constructor.
|
|
LiteralNode(ILiteralNode.LiteralType type,
antlr.Token t)
Constructor.
|
protected |
LiteralNode(LiteralNode other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
protected LiteralNode |
copy()
Copy the ExpressionNodeBase and its subtree.
|
ILiteralNode.LiteralType |
getLiteralType()
Returns the
ILiteralNode.LiteralType that this node represents |
ASTNodeID |
getNodeID()
Get the opcode of this node
|
String |
getValue()
Returns the value of this literal as a String
|
String |
getValue(boolean rawValue)
Returns the value of this literal as a String
|
boolean |
isDynamicExpression(ICompilerProject project)
Does this expression evaluate to a dynamic value
|
boolean |
isSynthetic()
Returns whether this node is synthetic.
|
boolean |
isTerminal()
Determines if this node is a terminal node, meaning it cannot have
children
|
void |
normalize(boolean fillInOffsets)
Normalize the tree.
|
ITypeDefinition |
resolveType(ICompilerProject project)
The type of the result of this expression.
|
void |
setSynthetic(boolean synthetic)
Sets whether this node is synthetic.
|
computeNamespaceReference, copyForInitializer, getASScope, getBaseExpression, getDecorationNode, getDependencyType, getMName, getParentExpression, hasParenthesis, inFilter, inWith, isPackageReference, resolve, setHasParenthesisanalyze, buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getChild, getChildCount, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTransparent, looselyContains, replaceChild, runPostProcess, setChildren, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, swapChildren, toString, tryGetOffsetLookup, verifygetColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, spanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcopyForInitializer, hasParenthesis, resolvecontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getPackageName, getParent, getSpanningStart, getSucceedingNodegetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartprotected ILiteralNode.LiteralType type
protected String value
public LiteralNode(ILiteralNode.LiteralType type, String value)
type - The type of the literal.value - The value of the literal.public LiteralNode(ILiteralNode.LiteralType type, antlr.Token t)
type - type of the literalt - tokenpublic LiteralNode(ILiteralNode.LiteralType type, String value, SourceLocation sourceLocation)
type - type of the literalvalue - value of the literalsourceLocation - object that stores location information of the
literalpublic LiteralNode(ASToken t, ILiteralNode.LiteralType type)
t - Token with text and source location.type - Literal typeprotected LiteralNode(LiteralNode other)
other - The node to copy.public ASTNodeID getNodeID()
IASNodepublic void normalize(boolean fillInOffsets)
ExpressionNodeBasenormalize in class ExpressionNodeBaseprotected boolean buildInnerString(StringBuilder sb)
NodeBasebuildOuterString().
It is overridden by subclasses to display optional node-specific
information in the middle of the string, between the node type and the
location information.buildInnerString in class NodeBasepublic boolean isTerminal()
IASNodeisTerminal in interface IASNodeisTerminal in class FixedChildrenNodepublic ITypeDefinition resolveType(ICompilerProject project)
IExpressionNoderesolveType in interface IExpressionNoderesolveType in class ExpressionNodeBaseproject - The ICompilerProject to use to do lookups.ITypeDefinition of the type this expression results in.protected LiteralNode copy()
ExpressionNodeBasecopy in class ExpressionNodeBasepublic boolean isDynamicExpression(ICompilerProject project)
IExpressionNodeisDynamicExpression in interface IExpressionNodeisDynamicExpression in class ExpressionNodeBaseproject - The ICompilerProject to use to do lookups.true if we evaluate to something dynamicpublic ILiteralNode.LiteralType getLiteralType()
ILiteralNodeILiteralNode.LiteralType that this node representsgetLiteralType in interface ILiteralNodepublic String getValue()
ILiteralNodegetValue in interface ILiteralNodepublic String getValue(boolean rawValue)
ILiteralNodegetValue in interface ILiteralNoderawValue - 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).public boolean isSynthetic()
public void setSynthetic(boolean synthetic)
synthetic - true if this node is syntheticCopyright © 2016 The Apache Software Foundation. All rights reserved.