public class ApplyExp extends Expression
| 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 |
MAY_CONTAIN_BACK_JUMP |
ApplyExp |
nextCall
The next ApplyExp in ((ReferenceExp)func).binding.firstCall list.
|
int |
numKeywordArgs |
static int |
TAILCALL |
flags, NEXT_AVAIL_FLAG, noExpressions, type, VALIDATEDcompilerKey, compilerXKey, validateApplyKey, validateXApplyKeynameKey| 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) |
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.
|
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) |
protected <R,D> void |
visitChildren(ExpVisitor<R,D> visitor,
D d) |
apply0, checkLiteralKeyword, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, deepCopy, deepCopy, deepCopy, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, getType, getTypeRaw, isSingleValue, isStableSourceLocation, makeWhile, match0, maybeSetLine, neverReturns, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, setType, validateApply, valueIfConstantapply, check0, check1, check2, check3, check4, checkArgCount, checkN, getReturnType, getSetter, getSourceLocation, isSideEffectFree, match1, match2, match3, match4, matchN, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocationgetName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbolpublic static final int TAILCALL
public static final int INLINE_IF_CONSTANT
public static final int MAY_CONTAIN_BACK_JUMP
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)public int spliceCount()
public boolean isSimple()
public boolean isSimple(int min)
public boolean isSimple(int min,
int max)
public boolean isAppendValues()
protected boolean mustCompile()
mustCompile in class Expressionpublic void apply(CallContext ctx) throws java.lang.Throwable
Expressionapply in class Expressionjava.lang.Throwablepublic void compile(Compilation comp, Target target)
compile in class Expressionpublic static void compile(ApplyExp exp, Compilation comp, Target target)
public Expression deepCopy(IdentityHashTable mapper)
deepCopy in class Expressionprotected <R,D> R visit(ExpVisitor<R,D> visitor, D d)
visit in class Expressionpublic void visitArgs(InlineCalls visitor)
protected <R,D> void visitChildren(ExpVisitor<R,D> visitor, D d)
visitChildren in class Expressionpublic void print(gnu.kawa.io.OutPort out)
print in class Expressionpublic boolean side_effects()
Expressionside_effects in class Expressionprotected Type calculateType()
calculateType in class Expressionpublic 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