public abstract class ExpressionNodeBase extends FixedChildrenNode implements IExpressionNode
Modifier and Type | Field and Description |
---|---|
protected int |
flags |
emptyNodeArray, parent
UNKNOWN
Modifier | Constructor and Description |
---|---|
|
ExpressionNodeBase()
Constructor.
|
protected |
ExpressionNodeBase(ExpressionNodeBase other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
INamespaceReference |
computeNamespaceReference()
Generate an INamespaceReference that can serve as the namespace reference for something
like a namespace initializer.
|
protected abstract ExpressionNodeBase |
copy()
Copy the ExpressionNodeBase and its subtree.
|
ExpressionNodeBase |
copyForInitializer(IScopedNode scopedNode)
Return a copy of this IExpressionNode and all it's children that can be used
by VariableDefinition to resolve it's initial value without having to hold onto
the entire syntax tree for a source file.
|
ASScope |
getASScope()
Get the scope this Node uses for name resolution as an ASScope.
|
ExpressionNodeBase |
getBaseExpression()
Get the base expression, if any.
|
ExpressionNodeBase |
getDecorationNode()
Get the appropriate node at which to start decoration.
|
DependencyType |
getDependencyType()
Compute the type of dependency between two compilation unit this
expression node creates.
|
Name |
getMName(ICompilerProject project)
Gets the AET
Name object to be used for an expression. |
protected ExpressionNodeBase |
getParentExpression()
Get the parent of this Node as an ExpressionNodeBase.
|
boolean |
hasParenthesis()
Determines whether this expression is surrounded by parenthesis.
|
boolean |
inFilter()
Check if the expression is inside a filter expression.
|
boolean |
inWith() |
boolean |
isDynamicExpression(ICompilerProject project)
Does this expression evaluate to a dynamic value
|
boolean |
isPackageReference()
Determine if this node is a reference to a package
|
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 |
setHasParenthesis(boolean hasParens) |
isTerminal
analyze, buildInnerString, 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, 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
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
public ExpressionNodeBase()
protected ExpressionNodeBase(ExpressionNodeBase other)
other
- The node to copy.public void normalize(boolean fillInOffsets)
public ASScope getASScope()
NodeBase
getASScope
in class NodeBase
public IDefinition resolve(ICompilerProject project)
IExpressionNode
resolve
in interface IExpressionNode
project
- The ICompilerProject
to use to do lookups.IDefinition
this expression refers to.public ITypeDefinition resolveType(ICompilerProject project)
IExpressionNode
resolveType
in interface IExpressionNode
project
- The ICompilerProject
to use to do lookups.ITypeDefinition
of the type this expression results in.public boolean isDynamicExpression(ICompilerProject project)
IExpressionNode
isDynamicExpression
in interface IExpressionNode
project
- The ICompilerProject
to use to do lookups.true
if we evaluate to something dynamicpublic ExpressionNodeBase copyForInitializer(IScopedNode scopedNode)
IExpressionNode
copyForInitializer
in interface IExpressionNode
IExpressionNode
that is not tied to the syntax tree it came
from. If a copy can not be generated, null
is returned.public boolean hasParenthesis()
IExpressionNode
hasParenthesis
in interface IExpressionNode
true
if surrounded by parenthesisprotected abstract ExpressionNodeBase copy()
public Name getMName(ICompilerProject project)
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.
project
- The ICompilerProject
to use to do lookups.Name
object.public void setHasParenthesis(boolean hasParens)
public boolean isPackageReference()
public ExpressionNodeBase getBaseExpression()
a.b
, or
a.@b
, or a.c::b
, the base of b
is
a
.public boolean inWith()
public ExpressionNodeBase getDecorationNode()
public final boolean inFilter()
xmlData.(getName() == "hello")
getName() == "hello"
is in a filter.
The implementation walks up the parent nodes till the first
ScopedBlockNode
. If a MemberAccessExpressionNode
with
ASTNodeID.E4XFilterID
is found, this node is inside a filter
expression.
protected ExpressionNodeBase getParentExpression()
public INamespaceReference computeNamespaceReference()
public DependencyType getDependencyType()
Copyright © 2016 The Apache Software Foundation. All rights reserved.