public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNode
IIdentifierNode.IdentifierType
flags
emptyNodeArray, parent
UNKNOWN
Modifier | Constructor and Description |
---|---|
|
IdentifierNode(IASToken token)
Constructor.
|
protected |
IdentifierNode(IdentifierNode other)
Copy constructor.
|
|
IdentifierNode(String name)
Constructor.
|
|
IdentifierNode(String name,
IASToken token)
Constructor.
|
|
IdentifierNode(String name,
antlr.Token token)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
analyze(EnumSet<PostProcessStep> set,
ASScope scope,
Collection<ICompilerProblem> problems) |
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
protected boolean |
canEarlyBind(ICompilerProject project,
IDefinition def)
Can this Node be early bound to the Definition it refers to.
|
INamespaceReference |
computeNamespaceReference()
Generate an INamespaceReference that can serve as the namespace reference for something
like a namespace initializer.
|
protected IdentifierNode |
copy()
Copy the ExpressionNodeBase and its subtree.
|
static IdentifierNode |
createEmptyIdentifierNodeAfterToken(antlr.Token token)
Create a dummy
IdentifierNode after the given token. |
protected void |
fillInOffsets()
If the start and end offsets haven't been set explicitly, fill them in
based on the offsets of the children.
|
IIdentifierNode.IdentifierType |
getIdentifierType()
Returns of the type of this identifier.
|
Name |
getMName(ICompilerProject project)
Gets the AET
Name object to be used for an expression. |
String |
getName()
Gets the full name of this identifier
|
ASTNodeID |
getNodeID()
Get the opcode of this node
|
IScopedNode |
getScopeNode()
Get the nearest containing scope for this node.
|
protected boolean |
isAttributeIdentifier()
Determine if this identifier is an attribute reference (e.g.
|
boolean |
isDynamicExpression(ICompilerProject project)
Does this expression evaluate to a dynamic value
|
boolean |
isImplicit()
Determines if this identifier is actually implicit and does not exist in source.
|
boolean |
isLegacyCodegen(ICompilerProject project) |
boolean |
isMemberRef()
Is this a reference that should be resolve in another object e.g. the
node for 'b' in a.b would return true
|
boolean |
isTerminal()
Determines if this node is a terminal node, meaning it cannot have
children
|
protected boolean |
isTypeRef()
Is this a type reference - e.g. a base class ref, type anno, etc
|
static boolean |
isXMLish(IDefinition def,
ICompilerProject project)
Determine if the definition passed in is one of the XML types (XML or
XMLList) These classes are unrelated, but behave in similar manners.
|
void |
normalize(boolean fillInOffsets)
Normalize the tree.
|
IDefinition |
resolve(ICompilerProject project)
If this expression is statically known to refer to a definition return a
reference to that definition.
|
ITypeDefinition |
resolveType(ICompilerProject project)
The type of the result of this expression.
|
void |
setReferenceValue(IDefinition definition) |
copyForInitializer, getASScope, getBaseExpression, getDecorationNode, getDependencyType, getParentExpression, hasParenthesis, inFilter, inWith, isPackageReference, setHasParenthesis
buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getChild, getChildCount, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTransparent, looselyContains, replaceChild, runPostProcess, setChildren, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, swapChildren, toString, tryGetOffsetLookup, verify
getColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copyForInitializer, hasParenthesis
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getPackageName, getParent, getSpanningStart, getSucceedingNode
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
public IdentifierNode(String name)
public IdentifierNode(String name, antlr.Token token)
public IdentifierNode(IASToken token)
protected IdentifierNode(IdentifierNode other)
other
- The node to copy.public static IdentifierNode createEmptyIdentifierNodeAfterToken(antlr.Token token)
IdentifierNode
after the given token. This is used
to repair the AST where an identifier node is expected.token
- The empty ID node will have start offset following this
token.public static boolean isXMLish(IDefinition def, ICompilerProject project)
def
- the IDefinition
to checkproject
- the ICompilerProject
in which to look up typespublic ASTNodeID getNodeID()
IASNode
public boolean isTerminal()
IASNode
isTerminal
in interface IASNode
isTerminal
in class FixedChildrenNode
protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
public void normalize(boolean fillInOffsets)
ExpressionNodeBase
normalize
in class ExpressionNodeBase
protected void fillInOffsets()
NodeBase
fillInOffsets
in class NodeBase
public IScopedNode getScopeNode()
NodeBase
getScopeNode
in class NodeBase
protected boolean buildInnerString(StringBuilder sb)
NodeBase
buildOuterString()
.
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 NodeBase
public IDefinition resolve(ICompilerProject project)
IExpressionNode
resolve
in interface IExpressionNode
resolve
in class ExpressionNodeBase
project
- The ICompilerProject
to use to do lookups.IDefinition
this expression refers to.public ITypeDefinition resolveType(ICompilerProject project)
IExpressionNode
resolveType
in interface IExpressionNode
resolveType
in class ExpressionNodeBase
project
- The ICompilerProject
to use to do lookups.ITypeDefinition
of the type this expression results in.protected IdentifierNode copy()
ExpressionNodeBase
copy
in class ExpressionNodeBase
public boolean isDynamicExpression(ICompilerProject project)
IExpressionNode
isDynamicExpression
in interface IExpressionNode
isDynamicExpression
in class ExpressionNodeBase
project
- The ICompilerProject
to use to do lookups.true
if we evaluate to something dynamicpublic Name getMName(ICompilerProject project)
ExpressionNodeBase
Name
object to be used for an expression.
For all expression nodes except for the identifier nodes and member
access nodes, this method returns null
.
This is the method that the code generator calls to determine what name to emit into the ABC file. It will handle resolving the identifier if necessary and generating the appropriate qname or multiname.
getMName
in class ExpressionNodeBase
project
- The ICompilerProject
to use to do lookups.Name
object.public INamespaceReference computeNamespaceReference()
ExpressionNodeBase
computeNamespaceReference
in class ExpressionNodeBase
public String getName()
IIdentifierNode
getName
in interface IIdentifierNode
public IIdentifierNode.IdentifierType getIdentifierType()
IIdentifierNode
getIdentifierType
in interface IIdentifierNode
IIdentifierNode.IdentifierType
public void setReferenceValue(IDefinition definition)
public boolean isImplicit()
protected boolean isAttributeIdentifier()
public boolean isMemberRef()
protected boolean canEarlyBind(ICompilerProject project, IDefinition def)
project
- project to resolve things indef
- the definition this node resolved toprotected boolean isTypeRef()
public boolean isLegacyCodegen(ICompilerProject project)
Copyright © 2016 The Apache Software Foundation. All rights reserved.