public interface IFunctionCallNode extends IExpressionNode
The typical shape of this node is:
IFunctionCallNode
IExpressionNode <-- getNameNode()
IContainerNode <-- getArgumentsContainerNode()
IExpressionNode <-- getArgumentNodes()[0]
IExpressionNode <-- getArgumentNodes()[1]
...
For example, f(a, b) is represented as
IFunctionCallNode
IIdentifierNode "f"
IContainerNode
IIdentifierNode "a"
IIdentiferNode "b"
For a constructor call, the first child represents the new keyword:
IFunctionCallNode
IKeywordNode <-- getNewKeywordNode()
IExpressionNode <-- getNameNode()
IContainerNode <-- getArgumentsContainerNode()
IExpressionNode <-- getArgumentNodes()[0]
IExpressionNode <-- getArgumentNodes()[1]
...
For example, new C(a, b) is represented as
IFunctionCallNode
IKeywordNode "new"
IIdentifierNode "C"
IContainerNode
IIdentifierNode "a"
IIdentiferNode "b"
UNKNOWN| Modifier and Type | Method and Description |
|---|---|
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
|
String |
getFunctionName()
The name of the function being called
|
IExpressionNode |
getNameNode()
The expression being called.
|
KeywordNode |
getNewKeywordNode()
Get the new keyword, if one is present
|
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(); |
IDefinition |
resolveCalledExpression(ICompilerProject project)
Resolves the expression being called to a definition.
|
copyForInitializer, hasParenthesis, isDynamicExpression, resolve, resolveTypecontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartIExpressionNode getNameNode()
IExpressionNodeIDefinition resolveCalledExpression(ICompilerProject project)
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.
project - The ICompilerProject to use for lookups.IDefinition or null.String getFunctionName()
IExpressionNode[] getArgumentNodes()
IExpressionNode nodes that are passed in as
parameters to this function callIExpressionNodes or an empty arrayboolean isNewExpression()
new String(); boolean isSuperExpression()
super(); boolean isCallToSuper()
foo.super(); ContainerNode getArgumentsNode()
KeywordNode getNewKeywordNode()
Copyright © 2016 The Apache Software Foundation. All rights reserved.