public class FunctionCallNode extends ExpressionNodeBase implements IFunctionCallNode
flags
emptyNodeArray, parent
UNKNOWN
Modifier | Constructor and Description |
---|---|
|
FunctionCallNode(ExpressionNodeBase nameNode)
Constructor.
|
protected |
FunctionCallNode(FunctionCallNode other)
Copy constructor.
|
|
FunctionCallNode(IASToken keywordNew,
ExpressionNodeBase nameNode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
protected FunctionCallNode |
copy()
Copy the ExpressionNodeBase and its subtree.
|
IExpressionNode[] |
getArgumentNodes()
Returns an array of
IExpressionNode nodes that are passed in as
parameters to this function call |
ContainerNode |
getArgumentsNode()
Get the arguments being passed
|
IASNode |
getChild(int i)
Get a particular child of this node
|
int |
getChildCount()
Get the number of children
|
String |
getFunctionName()
The name of the function being called
|
ExpressionNodeBase |
getNameNode()
The expression being called.
|
KeywordNode |
getNewKeywordNode()
Get the new keyword, if one is present
|
ASTNodeID |
getNodeID()
Get the opcode of this node
|
boolean |
isCallToSuper()
Returns true if this function call is a call to a super expression
foo.super(); |
boolean |
isNewExpression()
Returns true if this function call is part of a new expression
new String(); |
boolean |
isSuperExpression()
Returns true if this function call is part of a super expression
super(); |
protected void |
replaceChild(NodeBase child,
NodeBase target)
Replaces the child with the given target.
|
IDefinition |
resolveCalledExpression(ICompilerProject project)
Resolves the expression being called to a definition.
|
ITypeDefinition |
resolveType(ICompilerProject project)
The type of the result of this expression.
|
protected void |
setChildren(boolean fillInOffsets)
If this node has custom children (names, arguments, etc), shove them into
the list of children.
|
void |
setNewKeywordNode(KeywordNode newNode) |
computeNamespaceReference, copyForInitializer, getASScope, getBaseExpression, getDecorationNode, getDependencyType, getMName, getParentExpression, hasParenthesis, inFilter, inWith, isDynamicExpression, isPackageReference, normalize, resolve, setHasParenthesis
isTerminal
analyze, buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTransparent, looselyContains, runPostProcess, 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, isDynamicExpression, resolve
contains, getAncestorOfType, getContainingNode, getContainingScope, getFileSpecification, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
public FunctionCallNode(IASToken keywordNew, ExpressionNodeBase nameNode)
public FunctionCallNode(ExpressionNodeBase nameNode)
protected FunctionCallNode(FunctionCallNode other)
other
- The node to copy.public ASTNodeID getNodeID()
IASNode
public int getChildCount()
IASNode
getChildCount
in interface IASNode
getChildCount
in class NodeBase
public IASNode getChild(int i)
IASNode
protected void setChildren(boolean fillInOffsets)
NodeBase
setChildren
in class NodeBase
protected void replaceChild(NodeBase child, NodeBase target)
NodeBase
replaceChild
in class NodeBase
child
- the NodeBase
to replacetarget
- the NodeBase
to replace the replacedprotected 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 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 FunctionCallNode copy()
ExpressionNodeBase
copy
in class ExpressionNodeBase
public boolean isNewExpression()
IFunctionCallNode
new String();
isNewExpression
in interface IFunctionCallNode
public ExpressionNodeBase getNameNode()
IFunctionCallNode
getNameNode
in interface IFunctionCallNode
IExpressionNode
public String getFunctionName()
IFunctionCallNode
getFunctionName
in interface IFunctionCallNode
public IDefinition resolveCalledExpression(ICompilerProject project)
IFunctionCallNode
The result may or may not be an IFunctionDefinition
.
For example, in f()
, f
might be
a variable of type Function
, and so
this function would return an IVariableDefinition
.
As another example, in new Sprite()
, Sprite
resolves to a class, not to the constructor for that class, and so
this function would return an IClassDefinition
.
resolveCalledExpression
in interface IFunctionCallNode
project
- The ICompilerProject
to use for lookups.IDefinition
or null
.public IExpressionNode[] getArgumentNodes()
IFunctionCallNode
IExpressionNode
nodes that are passed in as
parameters to this function callgetArgumentNodes
in interface IFunctionCallNode
IExpressionNode
s or an empty arraypublic boolean isSuperExpression()
IFunctionCallNode
super();
isSuperExpression
in interface IFunctionCallNode
public ContainerNode getArgumentsNode()
IFunctionCallNode
getArgumentsNode
in interface IFunctionCallNode
public KeywordNode getNewKeywordNode()
IFunctionCallNode
getNewKeywordNode
in interface IFunctionCallNode
public void setNewKeywordNode(KeywordNode newNode)
public boolean isCallToSuper()
IFunctionCallNode
foo.super();
isCallToSuper
in interface IFunctionCallNode
Copyright © 2016 The Apache Software Foundation. All rights reserved.