Package gnu.expr
Class LetExp
-
- All Implemented Interfaces:
gnu.kawa.format.Printable,Named,SourceLocator,SourceLocator,Locator
- Direct Known Subclasses:
CatchClause,FluidLetExp,PatternScope,TemplateScope
public class LetExp extends ScopeExp
Class used to implement "let" syntax (and variants) for Scheme.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
-
Field Summary
Fields Modifier and Type Field Description static intIS_BODY_SCOPE-
Fields inherited from class gnu.expr.Expression
applyMethodExpression, flags, NEXT_AVAIL_FLAG, noExpressions, type, VALIDATED
-
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
-
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
-
Constructor Summary
Constructors Constructor Description LetExp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(CallContext ctx)Evaluate the expression.protected TypecalculateType()voidcompile(Compilation comp, Target target)protected ObjectevalVariable(Declaration decl, CallContext ctx)ExpressiongetBody()protected booleanmustCompile()voidprint(gnu.kawa.io.OutPort out)voidprint(gnu.kawa.io.OutPort out, String startTag, String endTag)voidsetBody(Expression body)protected <R,D>
Rvisit(ExpVisitor<R,D> visitor, D d)protected <R,D>
voidvisitChildren(ExpVisitor<R,D> visitor, D d)<R,D>
voidvisitInitializers(ExpVisitor<R,D> visitor, D d)-
Methods inherited from class gnu.expr.ScopeExp
add, add, addDeclaration, addDeclaration, addDeclaration, clearCallList, countDecls, currentLambda, currentModule, duplicateDeclarationError, firstDecl, getDefine, getNoDefine, getOuter, getVarScope, isClassGenerated, lastDecl, lookup, lookup, nestedIn, nesting, popScope, remove, remove, replaceFollowing, setIndexes, setOuter, topLevel, toString
-
Methods inherited from class gnu.expr.Expression
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, deepCopy, 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, side_effects, validateApply, valueIfConstant
-
Methods inherited from class gnu.mapping.Procedure
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
-
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
-
-
-
Field Detail
-
IS_BODY_SCOPE
public static final int IS_BODY_SCOPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBody
public Expression getBody()
-
setBody
public void setBody(Expression body)
-
mustCompile
protected boolean mustCompile()
- Specified by:
mustCompilein classExpression
-
evalVariable
protected Object evalVariable(Declaration decl, CallContext ctx) throws Throwable
- Throws:
Throwable
-
apply
public void apply(CallContext ctx) throws Throwable
Description copied from class:ExpressionEvaluate the expression. This is named apply rather than eval so it is compatible with the full-tail-call calling convention, and we can stash an Expression in CallContext's proc field. FIXME - are we making use of this?- Overrides:
applyin classExpression- Throws:
Throwable
-
compile
public void compile(Compilation comp, Target target)
- Specified by:
compilein classExpression
-
calculateType
protected final Type calculateType()
- Overrides:
calculateTypein classExpression
-
visit
protected <R,D> R visit(ExpVisitor<R,D> visitor, D d)
-
visitInitializers
public <R,D> void visitInitializers(ExpVisitor<R,D> visitor, D d)
-
visitChildren
protected <R,D> void visitChildren(ExpVisitor<R,D> visitor, D d)
- Overrides:
visitChildrenin classExpression
-
print
public void print(gnu.kawa.io.OutPort out)
- Specified by:
printin classExpression
-
-