gnu.expr
Class PushApply

java.lang.Object
  extended by gnu.expr.ExpVisitor<Expression,java.lang.Void>
      extended by gnu.expr.PushApply
All Implemented Interfaces:
javax.xml.transform.SourceLocator, org.xml.sax.Locator

public class PushApply
extends ExpVisitor<Expression,java.lang.Void>

Re-arranges ApplyExp where the function is a LetExp or BeginExp. Optimizes ((let (...) body) . args) to (let (...) (body . args)). Optimizes ((begin ... last) . args) to (begin ... (last . args)). This helps optimize Scheme "named let" (and some other forms) by making it more likely the application will be to a known procedure. This optimization has to be done after Declarations are bound.


Field Summary
 
Fields inherited from class gnu.expr.ExpVisitor
currentLambda, exitValue, messages
 
Constructor Summary
PushApply()
           
 
Method Summary
protected  Expression defaultValue(Expression r, java.lang.Void ignored)
           
static void pushApply(Expression exp)
           
protected  Expression update(Expression exp, Expression r)
           
protected  Expression visitApplyExp(ApplyExp exp, java.lang.Void ignored)
           
 
Methods inherited from class gnu.expr.ExpVisitor
error, getColumnNumber, getCompilation, getCurrentLambda, getExitValue, getFileName, getLineNumber, getMessages, getPublicId, getSystemId, isStableSourceLocation, noteError, setColumn, setContext, setFile, setLine, setLine, visit, visitAndUpdate, visitBeginExp, visitBlockExp, visitClassExp, visitDeclarationType, visitDeclarationTypes, visitDefaultArgs, visitExitExp, visitExpression, visitExps, visitExps, visitFluidLetExp, visitIfExp, visitLambdaExp, visitLangExp, visitLetExp, visitModuleExp, visitObjectExp, visitQuoteExp, visitReferenceExp, visitScopeExp, visitSetExp, visitSetExpValue, visitSynchronizedExp, visitThisExp, visitTryExp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushApply

public PushApply()
Method Detail

pushApply

public static void pushApply(Expression exp)

update

protected Expression update(Expression exp,
                            Expression r)
Overrides:
update in class ExpVisitor<Expression,java.lang.Void>

defaultValue

protected Expression defaultValue(Expression r,
                                  java.lang.Void ignored)
Overrides:
defaultValue in class ExpVisitor<Expression,java.lang.Void>

visitApplyExp

protected Expression visitApplyExp(ApplyExp exp,
                                   java.lang.Void ignored)
Overrides:
visitApplyExp in class ExpVisitor<Expression,java.lang.Void>