public class InlineCalls extends ExpExpVisitor<Type>
currentLambda, exitValue, messages
Constructor and Description |
---|
InlineCalls(Compilation comp) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Integer |
checkIntValue(Expression exp) |
static java.lang.Long |
checkLongValue(Expression exp) |
Expression |
checkType(Expression exp,
Type required) |
QuoteExp |
fixIntValue(Expression exp) |
QuoteExp |
fixLongValue(Expression exp) |
static Expression |
inlineCall(LambdaExp lexp,
Expression[] args,
boolean makeCopy)
Attempt to inline a function call.
|
static Expression |
inlineCalls(Expression exp,
Compilation comp) |
Expression |
maybeInline(ApplyExp exp,
Type required,
Procedure proc) |
Expression |
visit(Expression exp,
Type required)
Call the visit method of argument Expression.
|
protected Expression |
visitApplyExp(ApplyExp exp,
Type required) |
Expression |
visitApplyOnly(ApplyExp exp,
Type required)
Visit an ApplyExp assuming function and arguments have been visited.
|
protected Expression |
visitBeginExp(BeginExp exp,
Type required) |
protected Expression |
visitIfExp(IfExp exp,
Type required) |
protected Expression |
visitLambdaExp(LambdaExp exp,
Type required) |
protected Expression |
visitLetExp(LetExp exp,
Type required) |
protected Expression |
visitQuoteExp(QuoteExp exp,
Type required) |
protected Expression |
visitReferenceExp(ReferenceExp exp,
Type required) |
protected Expression |
visitScopeExp(ScopeExp exp,
Type required) |
protected Expression |
visitSetExp(SetExp exp,
Type required) |
protected Expression |
visitSetExpValue(Expression new_value,
Type required,
Declaration decl) |
protected Expression |
visitTryExp(TryExp exp,
Type required) |
defaultValue, update
error, getColumnNumber, getCompilation, getCurrentLambda, getExitValue, getFileName, getLineNumber, getMessages, getPublicId, getSystemId, isStableSourceLocation, noteError, setColumn, setContext, setFile, setLine, setLine, visitAndUpdate, visitBlockExp, visitClassExp, visitDeclarationType, visitDeclarationTypes, visitDefaultArgs, visitExitExp, visitExpression, visitExps, visitExps, visitFluidLetExp, visitLangExp, visitModuleExp, visitObjectExp, visitSynchronizedExp, visitThisExp
public InlineCalls(Compilation comp)
public static Expression inlineCalls(Expression exp, Compilation comp)
public Expression visit(Expression exp, Type required)
ExpVisitor
visit
in class ExpVisitor<Expression,Type>
public Expression checkType(Expression exp, Type required)
protected Expression visitApplyExp(ApplyExp exp, Type required)
visitApplyExp
in class ExpVisitor<Expression,Type>
public final Expression visitApplyOnly(ApplyExp exp, Type required)
public static java.lang.Integer checkIntValue(Expression exp)
public static java.lang.Long checkLongValue(Expression exp)
public QuoteExp fixIntValue(Expression exp)
public QuoteExp fixLongValue(Expression exp)
protected Expression visitQuoteExp(QuoteExp exp, Type required)
visitQuoteExp
in class ExpVisitor<Expression,Type>
protected Expression visitReferenceExp(ReferenceExp exp, Type required)
visitReferenceExp
in class ExpVisitor<Expression,Type>
protected Expression visitIfExp(IfExp exp, Type required)
visitIfExp
in class ExpVisitor<Expression,Type>
protected Expression visitBeginExp(BeginExp exp, Type required)
visitBeginExp
in class ExpVisitor<Expression,Type>
protected Expression visitScopeExp(ScopeExp exp, Type required)
visitScopeExp
in class ExpVisitor<Expression,Type>
protected Expression visitLetExp(LetExp exp, Type required)
visitLetExp
in class ExpVisitor<Expression,Type>
protected Expression visitLambdaExp(LambdaExp exp, Type required)
visitLambdaExp
in class ExpVisitor<Expression,Type>
protected Expression visitTryExp(TryExp exp, Type required)
visitTryExp
in class ExpVisitor<Expression,Type>
protected Expression visitSetExpValue(Expression new_value, Type required, Declaration decl)
visitSetExpValue
in class ExpVisitor<Expression,Type>
protected Expression visitSetExp(SetExp exp, Type required)
visitSetExp
in class ExpVisitor<Expression,Type>
public Expression maybeInline(ApplyExp exp, Type required, Procedure proc)
public static Expression inlineCall(LambdaExp lexp, Expression[] args, boolean makeCopy)
lexp
- function to inlineargs
- list of actual arguments of function callmakeCopy
- true if the body of lexp should of copied; false
if we can re-use lexp because it is no longer needed.