Package gnu.expr
Class ChainLambdas
- All Implemented Interfaces:
SourceLocator
,SourceLocator
,Locator
Sets up the firstChild/nextSibling links of each LambdaExp.
Setup 'outer' links of ScopeExp and its sub-classes.
Also generates a class name for each ClassExp and registers each class.
Also, if lambda is bound to a unique declaration, make that its name.
This pass also checks for unreachable code, which happens if a
neverReturns expression is followed dynamically by another expression.
Doing this check after InlineCalls allows benefiting from data-flow; OTOH
checking for unreachable code this late yields less precise type inference,
but only when there actually is unreachable code, which is bogus anyway.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
Field Summary
Fields inherited from class gnu.expr.ExpVisitor
currentLambda, exitValue, messages
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
chainLambdas
(Expression exp, Compilation comp) protected void
protected Expression
visitApplyExp
(ApplyExp exp, ScopeExp scope) protected Expression
visitBeginExp
(BeginExp exp, ScopeExp scope) protected Expression
visitCaseExp
(CaseExp exp, ScopeExp scope) protected Expression
visitClassExp
(ClassExp exp, ScopeExp scope) protected Expression
visitIfExp
(IfExp exp, ScopeExp scope) protected Expression
visitLambdaExp
(LambdaExp exp, ScopeExp scope) protected Expression
visitLetExp
(LetExp exp, ScopeExp scope) protected Expression
visitScopeExp
(ScopeExp exp, ScopeExp scope) protected Expression
visitSetExp
(SetExp sexp, ScopeExp scope) Methods inherited from class gnu.expr.ExpExpVisitor
defaultValue, error, error, update
Methods inherited from class gnu.expr.ExpVisitor
error, getColumnNumber, getCompilation, getCurrentLambda, getEndColumn, getEndLine, getExitValue, getFileName, getLanguage, getLineNumber, getMessages, getPublicId, getStartColumn, getStartLine, getSystemId, isStableSourceLocation, noteError, setColumn, setContext, setFile, setLine, setLine, visit, visit, visitAndUpdate, visitBlockExp, visitDeclarationType, visitDeclarationTypes, visitDefaultArgs, visitExitExp, visitExpression, visitExps, visitExps, visitFluidLetExp, visitLangExp, visitModuleExp, visitObjectExp, visitQuoteExp, visitReferenceExp, visitSynchronizedExp, visitThisExp, visitTryExp
-
Constructor Details
-
ChainLambdas
public ChainLambdas()
-
-
Method Details
-
chainLambdas
-
maybeWarnUnreachable
-
visitBeginExp
- Overrides:
visitBeginExp
in classExpVisitor<Expression,
ScopeExp>
-
visitApplyExp
- Overrides:
visitApplyExp
in classExpVisitor<Expression,
ScopeExp>
-
visitSetExp
- Overrides:
visitSetExp
in classExpVisitor<Expression,
ScopeExp>
-
visitIfExp
- Overrides:
visitIfExp
in classExpVisitor<Expression,
ScopeExp>
-
visitCaseExp
- Overrides:
visitCaseExp
in classExpVisitor<Expression,
ScopeExp>
-
visitScopeExp
- Overrides:
visitScopeExp
in classExpVisitor<Expression,
ScopeExp>
-
visitLetExp
- Overrides:
visitLetExp
in classExpVisitor<Expression,
ScopeExp>
-
visitLambdaExp
- Overrides:
visitLambdaExp
in classExpVisitor<Expression,
ScopeExp>
-
visitClassExp
- Overrides:
visitClassExp
in classExpVisitor<Expression,
ScopeExp>
-