kawa.lang
Class Lambda

java.lang.Object
  extended by kawa.lang.Syntax
      extended by kawa.lang.Lambda
All Implemented Interfaces:
Named, Printable
Direct Known Subclasses:
lambda

public class Lambda
extends Syntax
implements Printable

The Syntax transformer that re-writes the lambda builtin.


Field Summary
 Expression defaultDefault
           
 java.lang.Object keyKeyword
           
 java.lang.Object optionalKeyword
           
 java.lang.Object restKeyword
           
 
Constructor Summary
Lambda()
           
 
Method Summary
 void print(java.io.PrintWriter ps)
           
 void rewrite(LambdaExp lexp, java.lang.Object formals, java.lang.Object body, Translator tr, TemplateScope templateScopeRest)
          Higher-level constructor, that does the re-writing.
 Expression rewrite(java.lang.Object obj, Translator tr)
          Re-write an expression that is an "application" of this Syntax object.
 java.lang.Object rewriteAttrs(LambdaExp lexp, java.lang.Object body, Translator tr)
           
 void rewriteBody(LambdaExp lexp, java.lang.Object body, Translator tr)
           
 void rewriteFormals(LambdaExp lexp, java.lang.Object formals, Translator tr, TemplateScope templateScopeRest)
           
 void setKeywords(java.lang.Object optional, java.lang.Object rest, java.lang.Object key)
           
 java.lang.Object skipAttrs(LambdaExp lexp, java.lang.Object body, Translator tr)
           
 
Methods inherited from class kawa.lang.Syntax
getName, getSymbol, rewriteForm, rewriteForm, scanForDefinitions, scanForm, setName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

optionalKeyword

public java.lang.Object optionalKeyword

restKeyword

public java.lang.Object restKeyword

keyKeyword

public java.lang.Object keyKeyword

defaultDefault

public Expression defaultDefault
Constructor Detail

Lambda

public Lambda()
Method Detail

setKeywords

public void setKeywords(java.lang.Object optional,
                        java.lang.Object rest,
                        java.lang.Object key)

rewrite

public Expression rewrite(java.lang.Object obj,
                          Translator tr)
Description copied from class: Syntax
Re-write an expression that is an "application" of this Syntax object.

Overrides:
rewrite in class Syntax
Parameters:
obj - the arguments to this "application" (i.e. the cdr of the macro/builtin invokation)
tr - the Translator that provides context
Returns:
the re-written expression

rewrite

public void rewrite(LambdaExp lexp,
                    java.lang.Object formals,
                    java.lang.Object body,
                    Translator tr,
                    TemplateScope templateScopeRest)
Higher-level constructor, that does the re-writing.

Parameters:
formals - the formal parameter list (or symbol)
body - the body of the procedure
tr - the (Scheme) Translator

rewriteFormals

public void rewriteFormals(LambdaExp lexp,
                           java.lang.Object formals,
                           Translator tr,
                           TemplateScope templateScopeRest)

rewriteAttrs

public java.lang.Object rewriteAttrs(LambdaExp lexp,
                                     java.lang.Object body,
                                     Translator tr)

skipAttrs

public java.lang.Object skipAttrs(LambdaExp lexp,
                                  java.lang.Object body,
                                  Translator tr)

rewriteBody

public void rewriteBody(LambdaExp lexp,
                        java.lang.Object body,
                        Translator tr)

print

public void print(java.io.PrintWriter ps)
Specified by:
print in interface Printable
Overrides:
print in class Syntax