Package kawa.lang
Class Syntax
- java.lang.Object
-
- kawa.lang.Syntax
-
- All Implemented Interfaces:
gnu.kawa.format.Printable
,Named
- Direct Known Subclasses:
AutoloadSyntax
,begin
,BracketApply
,constant_fold
,define
,define_alias
,define_autoload
,define_class
,define_library
,define_syntax
,define_unit
,DefineNamespace
,export
,fluid_let
,IfFeature
,ImportFromLibrary
,Include
,Lambda
,let
,let_syntax
,location
,Macro
,MakeXmlElement
,MatchDef
,module_compile_options
,module_extends
,module_implements
,module_name
,module_static
,object
,prim_method
,Quote
,require
,ResolveNamespace
,Scan
,set_b
,syntax_case
,syntax_error
,syntax_rules
,thisRef
,with_compile_options
public abstract class Syntax extends Object implements gnu.kawa.format.Printable, Named
Abstract class for "syntax" objects. Builtins and macros are instances of this class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Object
getSymbol()
void
print(Consumer out)
Expression
rewrite(Object obj, Translator tr)
Re-write an expression that is an "application" of this Syntax object.Expression
rewriteForm(Pair form, Translator tr)
boolean
scanForDefinitions(Pair st, ScopeExp defs, Translator tr)
Check if a statement is a definition, for initial pass.void
scanForm(Pair st, ScopeExp defs, Translator tr)
void
setName(Object name)
void
setName(String name)
-
-
-
Constructor Detail
-
Syntax
public Syntax()
-
Syntax
public Syntax(Object name)
-
-
Method Detail
-
setName
public void setName(Object name)
-
rewrite
public Expression rewrite(Object obj, Translator tr)
Re-write an expression that is an "application" of this Syntax object.- Parameters:
obj
- the arguments to this "application" (i.e. the cdr of the macro/builtin invocation)tr
- the Translator that provides context- Returns:
- the re-written expression
-
rewriteForm
public Expression rewriteForm(Pair form, Translator tr)
-
scanForm
public void scanForm(Pair st, ScopeExp defs, Translator tr)
-
scanForDefinitions
public boolean scanForDefinitions(Pair st, ScopeExp defs, Translator tr)
Check if a statement is a definition, for initial pass. Semi-deprecated - should convert calls to use scanForm.- Parameters:
st
- the statement to checkdefs
- where to add Declarations for found definitionstr
- the compilation state- Returns:
- true on success
-
print
public void print(Consumer out)
- Specified by:
print
in interfacegnu.kawa.format.Printable
-
-