kawa.lang
Class Syntax
- Named, Printable
public abstract class Syntax
extends java.lang.Object
Abstract class for "syntax" objects.
Builtins and macros are instances of this class.
Syntax
public Syntax(Object name)
getName
public final String getName()
- getName in interface Named
print
public void print(java.io.PrintWriter ps)
rewrite
public Expression rewrite(Object obj,
Translator tr)
Re-write an expression that is an "application" of this Syntax object.
obj
- the arguments to this "application" (i.e. the cdr of
the macro/builtin invokation)tr
- the Translator that provides context
- the re-written expression
scanForDefinitions
public boolean scanForDefinitions(Pair st,
java.util.Vector forms,
ScopeExp defs,
Translator tr)
Check if a statement is a definition, for initial pass.
Semi-deprecated - should convert calls to use scanForm.
st
- the statement to checkforms
- where to append the (possibly-modified) statementdefs
- where to add Declarations for found definitionstr
- the compilation state
setName
public void setName(Object name)
setName
public void setName(String name)
- setName in interface Named