|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.PropertySet gnu.mapping.Procedure gnu.mapping.Procedure0 gnu.expr.Expression gnu.expr.ScopeExp gnu.expr.LambdaExp
public class LambdaExp
Class used to implement Scheme lambda expressions.
Field Summary | |
---|---|
Expression |
body
|
Field |
closureEnvField
If non-null, this is a Field that is used for implementing lexical closures. |
Expression[] |
defaultArgs
|
LambdaExp |
firstChild
|
Keyword[] |
keywords
|
int |
max_args
Maximum number of actual arguments; -1 if variable. |
int |
min_args
Minumnum number of parameters. |
Declaration |
nameDecl
If non-null, a Declaration whose value is (only) this LambdaExp. |
protected static int |
NEXT_AVAIL_FLAG
|
LambdaExp |
nextSibling
|
static int |
NO_FIELD
|
static int |
OVERLOADABLE_FIELD
|
ApplyExp |
returnContinuation
The unique caller that calls this lambda. |
Type |
returnType
If non-null, the type of values returned by this function. |
static int |
SEQUENCE_RESULT
|
Field |
staticLinkField
Field in heapFrame.getType() that contains the static link. |
Fields inherited from class gnu.expr.ScopeExp |
---|
frameSize, id, outer |
Fields inherited from class gnu.expr.Expression |
---|
flags, noExpressions |
Fields inherited from class gnu.mapping.PropertySet |
---|
nameKey |
Constructor Summary | |
---|---|
LambdaExp()
|
|
LambdaExp(Expression body)
|
|
LambdaExp(int args)
|
Method Summary | |
---|---|
void |
allocChildClasses(Compilation comp)
|
void |
allocFrame(Compilation comp)
|
void |
apply(CallContext ctx)
Evaluate the expression. |
void |
capture(Declaration decl)
|
void |
compile(Compilation comp,
Target target)
|
void |
compileBody(Compilation comp)
|
void |
compileEnd(Compilation comp)
|
Field |
compileSetField(Compilation comp)
|
Variable |
declareClosureEnv()
|
Variable |
declareThis(ClassType clas)
|
void |
generateApplyMethods(Compilation comp)
|
int |
getCallConvention()
Specify the calling convention used for this function. |
LambdaExp |
getCaller()
For an INLINE_ONLY function, return the function it gets inlined in. |
boolean |
getCanCall()
|
boolean |
getCanRead()
|
protected ClassType |
getCompiledClassType(Compilation comp)
Return the ClassType of the Procedure this is being compiled into. |
protected java.lang.String |
getExpClassName()
|
ClassType |
getHeapFrameType()
|
boolean |
getImportsLexVars()
True iff this lambda "captures" (uses) lexical variables from outside. |
boolean |
getInlineOnly()
True iff this lambda is only "called" inline. |
Method |
getMainMethod()
Get the method that contains the actual body of the procedure. |
Method |
getMethod(int argCount)
Select the method used given an argument count. |
boolean |
getNeedsClosureEnv()
|
boolean |
getNeedsStaticLink()
True if a child lambda uses lexical variables from outside. |
LambdaExp |
getOwningLambda()
|
java.lang.Object |
getProperty(java.lang.Object key,
java.lang.Object defaultValue)
|
Type |
getReturnType()
The return type of this function, i.e the type of its returned values. |
Type |
getType()
Return the Type used to represent the values of this Expression. |
int |
incomingArgs()
Number of argument variable actually passed by the caller. |
Expression |
inline(ApplyExp exp,
InlineCalls walker,
Declaration decl,
boolean argsInlined)
Apply inlining transformations on a given ApplyExp. |
boolean |
isAbstract()
|
boolean |
isClassGenerated()
True if a class is generated for this procedure. |
boolean |
isClassMethod()
True if this is a method in an ClassExp. |
boolean |
isHandlingTailCalls()
|
boolean |
isModuleBody()
True iff this is the dummy top-level function of a module body. |
void |
loadHeapFrame(Compilation comp)
Generate code to load heapFrame on the JVM stack. |
protected boolean |
mustCompile()
|
LambdaExp |
outerLambda()
|
LambdaExp |
outerLambdaNotInline()
Return the closest outer non-inlined LambdaExp. |
void |
print(OutPort out)
|
Type |
restArgType()
Return the parameter type of the "keyword/rest" parameters. |
void |
setCanCall(boolean called)
|
void |
setCanRead(boolean read)
|
void |
setClassMethod(boolean isMethod)
|
void |
setCoercedReturnType(Type returnType)
|
void |
setExceptions(ReferenceExp[] exceptions)
|
void |
setImportsLexVars()
|
void |
setImportsLexVars(boolean importsLexVars)
|
void |
setInlineOnly(boolean inlineOnly)
|
void |
setNeedsStaticLink()
|
void |
setNeedsStaticLink(boolean needsStaticLink)
|
void |
setProperty(java.lang.Object key,
java.lang.Object value)
|
void |
setReturnType(Type returnType)
|
void |
setType(ClassType type)
|
java.lang.String |
toString()
|
boolean |
variable_args()
|
protected Expression |
walk(ExpWalker walker)
|
protected void |
walkChildren(ExpWalker walker)
|
protected void |
walkChildrenOnly(ExpWalker walker)
|
protected void |
walkProperties(ExpWalker walker)
|
Methods inherited from class gnu.expr.ScopeExp |
---|
add, add, addDeclaration, addDeclaration, addDeclaration, countDecls, currentLambda, currentModule, duplicateDeclarationError, firstDecl, getDefine, getNoDefine, getVarScope, lookup, lookup, nesting, popScope, remove, remove, replaceFollowing, setIndexes |
Methods inherited from class gnu.expr.Expression |
---|
apply0, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, isStableSourceLocation, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, side_effects, valueIfConstant |
Methods inherited from class gnu.mapping.Procedure0 |
---|
apply1, apply2, apply3, apply4, applyN, numArgs |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation |
Methods inherited from class gnu.mapping.PropertySet |
---|
getName, getSymbol, removeProperty, setName, setProperty, setSymbol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Expression body
public int min_args
public int max_args
public Keyword[] keywords
public Expression[] defaultArgs
public LambdaExp firstChild
public LambdaExp nextSibling
public ApplyExp returnContinuation
public Declaration nameDecl
public Field closureEnvField
public Field staticLinkField
public static final int NO_FIELD
public static final int SEQUENCE_RESULT
public static final int OVERLOADABLE_FIELD
protected static final int NEXT_AVAIL_FLAG
public Type returnType
Constructor Detail |
---|
public LambdaExp()
public LambdaExp(int args)
public LambdaExp(Expression body)
Method Detail |
---|
public void capture(Declaration decl)
public void setExceptions(ReferenceExp[] exceptions)
public final boolean getInlineOnly()
public final void setInlineOnly(boolean inlineOnly)
public final boolean getNeedsClosureEnv()
public final boolean getNeedsStaticLink()
public final void setNeedsStaticLink(boolean needsStaticLink)
public final boolean getImportsLexVars()
public final void setImportsLexVars(boolean importsLexVars)
public final void setImportsLexVars()
public final void setNeedsStaticLink()
public final boolean getCanRead()
public final void setCanRead(boolean read)
public final boolean getCanCall()
public final void setCanCall(boolean called)
public final boolean isClassMethod()
public final void setClassMethod(boolean isMethod)
public final boolean isModuleBody()
public final boolean isClassGenerated()
public boolean isAbstract()
public int getCallConvention()
public final boolean isHandlingTailCalls()
public final boolean variable_args()
protected ClassType getCompiledClassType(Compilation comp)
public Type getType()
Expression
getType
in class Expression
public void setType(ClassType type)
public int incomingArgs()
public final Method getMethod(int argCount)
public final Method getMainMethod()
public final Type restArgType()
public LambdaExp outerLambda()
public LambdaExp outerLambdaNotInline()
public LambdaExp getCaller()
public Variable declareThis(ClassType clas)
public Variable declareClosureEnv()
public void loadHeapFrame(Compilation comp)
public void compileEnd(Compilation comp)
public void generateApplyMethods(Compilation comp)
public Field compileSetField(Compilation comp)
public void compile(Compilation comp, Target target)
compile
in class Expression
public ClassType getHeapFrameType()
public LambdaExp getOwningLambda()
public void allocChildClasses(Compilation comp)
public void allocFrame(Compilation comp)
public void compileBody(Compilation comp)
protected Expression walk(ExpWalker walker)
walk
in class ScopeExp
protected void walkChildren(ExpWalker walker)
walkChildren
in class Expression
protected final void walkChildrenOnly(ExpWalker walker)
protected final void walkProperties(ExpWalker walker)
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 Expression inline(ApplyExp exp, InlineCalls walker, Declaration decl, boolean argsInlined)
Expression
inline
in class Expression
exp
- an application whose function expression can be simplified
to this expression.walker
- the context for the current inlining passdecl
- if non-null, a Declaration bound to this expression.argsInlined
- true iff exp.getArgs()
have been walked.
public void print(OutPort out)
print
in class Expression
protected final java.lang.String getExpClassName()
public java.lang.String toString()
toString
in class ScopeExp
public java.lang.Object getProperty(java.lang.Object key, java.lang.Object defaultValue)
getProperty
in class PropertySet
public void setProperty(java.lang.Object key, java.lang.Object value)
setProperty
in class PropertySet
public final Type getReturnType()
public final void setReturnType(Type returnType)
public final void setCoercedReturnType(Type returnType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |