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 StringgetName()ObjectgetSymbol()voidprint(Consumer out)Expressionrewrite(Object obj, Translator tr)Re-write an expression that is an "application" of this Syntax object.ExpressionrewriteForm(Pair form, Translator tr)booleanscanForDefinitions(Pair st, ScopeExp defs, Translator tr)Check if a statement is a definition, for initial pass.voidscanForm(Pair st, ScopeExp defs, Translator tr)voidsetName(Object name)voidsetName(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:
printin interfacegnu.kawa.format.Printable
-
-