public class ApplyExp extends Expression
SourceLocator.Simple
Modifier and Type | Field and Description |
---|---|
int |
firstKeywordArgIndex
Index of argument for first keyword argument.
|
int |
firstSpliceArg
Index of first argument that is a MakeSplice.
|
static int |
INLINE_IF_CONSTANT |
static int |
IS_SUPER_INIT |
static int |
MAY_CONTAIN_BACK_JUMP |
ApplyExp |
nextCall
The next ApplyExp in ((ReferenceExp)func).binding.firstCall list.
|
int |
numKeywordArgs |
static int |
TAILCALL |
applyMethodExpression, flags, NEXT_AVAIL_FLAG, noExpressions, type, VALIDATED
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
nameKey
Constructor and Description |
---|
ApplyExp(Expression f,
Expression... a) |
ApplyExp(Method m,
Expression... a) |
ApplyExp(Procedure p,
Expression... a) |
Modifier and Type | Method and Description |
---|---|
void |
adjustSplice(ApplyExp src,
int delta)
Copy over splice and keyword start indexes.
|
void |
apply(CallContext ctx)
Evaluate the expression.
|
protected Type |
calculateType() |
static void |
compile(ApplyExp exp,
Compilation comp,
Target target) |
void |
compile(Compilation comp,
Target target) |
static void |
compileArgsToContext(ApplyExp exp,
Method setupMethod,
Compilation comp) |
Expression |
deepCopy(IdentityHashTable mapper) |
Expression |
getArg(int i) |
int |
getArgCount() |
Expression[] |
getArgs() |
Expression |
getFunction() |
java.lang.Object |
getFunctionValue()
If getFunction() is constant, return its value; otherwise null.
|
boolean |
hasSpliceAllowingKeywords() |
Expression |
inlineIfConstant(Procedure proc,
InlineCalls visitor) |
Expression |
inlineIfConstant(Procedure proc,
SourceMessages messages)
Inline this ApplyExp if parameters are constant.
|
boolean |
isAppendValues() |
static boolean |
isInlineable(Procedure proc) |
boolean |
isSimple() |
boolean |
isSimple(int min) |
boolean |
isSimple(int min,
int max) |
boolean |
isTailCall() |
protected boolean |
mustCompile() |
void |
print(gnu.kawa.io.OutPort out) |
void |
setArg(int i,
Expression arg) |
void |
setArgs(Expression[] args) |
ApplyExp |
setFuncArgs(Expression func,
Expression[] args) |
ApplyExp |
setFuncArgs(Procedure proc,
Expression[] args) |
void |
setFunction(Expression func) |
void |
setFunction(Procedure proc) |
void |
setTailCall(boolean tailCall) |
boolean |
side_effects()
True if evaluating may have side-effects.
|
int |
spliceCount() |
java.lang.String |
toString() |
protected <R,D> R |
visit(ExpVisitor<R,D> visitor,
D d) |
void |
visitArgs(InlineCalls visitor) |
void |
visitArgs(InlineCalls visitor,
LambdaExp lexp) |
protected <R,D> void |
visitChildren(ExpVisitor<R,D> visitor,
D d) |
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, deepCopy, deepCopy, deepCopy, eval, eval, getColumnNumber, getEndColumn, getEndLine, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getStartColumn, getStartLine, getSystemId, getType, getTypeRaw, isSingleValue, isStableSourceLocation, makeWhile, maybeSetLine, neverReturns, numArgs, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLine, setLocation, setType, validateApply, valueIfConstant
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
public static final int TAILCALL
public static final int INLINE_IF_CONSTANT
public static final int MAY_CONTAIN_BACK_JUMP
public static final int IS_SUPER_INIT
public ApplyExp nextCall
public int firstKeywordArgIndex
firstKeywordArgIndex-1
is the index in the args
array of the first keyword.public int numKeywordArgs
public int firstSpliceArg
public ApplyExp(Expression f, Expression... a)
public ApplyExp(Procedure p, Expression... a)
public ApplyExp(Method m, Expression... a)
public final Expression getFunction()
public final Expression[] getArgs()
public final int getArgCount()
public void setFunction(Expression func)
public void setFunction(Procedure proc)
public void setArgs(Expression[] args)
public Expression getArg(int i)
public void setArg(int i, Expression arg)
public final boolean isTailCall()
public final void setTailCall(boolean tailCall)
public ApplyExp setFuncArgs(Expression func, Expression[] args)
public ApplyExp setFuncArgs(Procedure proc, Expression[] args)
public final java.lang.Object getFunctionValue()
public void adjustSplice(ApplyExp src, int delta)
src
- orginal ApplyExp (may be the same as this)delta
- amount to adjust indexes bypublic int spliceCount()
public boolean isSimple()
public boolean isSimple(int min)
public boolean isSimple(int min, int max)
public boolean hasSpliceAllowingKeywords()
public boolean isAppendValues()
protected boolean mustCompile()
mustCompile
in class Expression
public void apply(CallContext ctx) throws java.lang.Throwable
Expression
apply
in class Expression
java.lang.Throwable
public void compile(Compilation comp, Target target)
compile
in class Expression
public static void compile(ApplyExp exp, Compilation comp, Target target)
public static void compileArgsToContext(ApplyExp exp, Method setupMethod, Compilation comp)
public Expression deepCopy(IdentityHashTable mapper)
deepCopy
in class Expression
protected <R,D> R visit(ExpVisitor<R,D> visitor, D d)
visit
in class Expression
public void visitArgs(InlineCalls visitor)
public void visitArgs(InlineCalls visitor, LambdaExp lexp)
protected <R,D> void visitChildren(ExpVisitor<R,D> visitor, D d)
visitChildren
in class Expression
public void print(gnu.kawa.io.OutPort out)
print
in class Expression
public boolean side_effects()
Expression
side_effects
in class Expression
protected Type calculateType()
calculateType
in class Expression
public static boolean isInlineable(Procedure proc)
public final Expression inlineIfConstant(Procedure proc, InlineCalls visitor)
public final Expression inlineIfConstant(Procedure proc, SourceMessages messages)
proc
- the procedure bound to this.func.public java.lang.String toString()
toString
in class Expression