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.
  • Constructor Details

    • Syntax

      public Syntax()
    • Syntax

      public Syntax(Object name)
  • Method Details

    • getName

      public final String getName()
      Specified by:
      getName in interface Named
    • getSymbol

      public Object getSymbol()
      Specified by:
      getSymbol in interface Named
    • setName

      public void setName(Object name)
    • setName

      public void setName(String name)
      Specified by:
      setName in interface Named
    • 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 check
      defs - where to add Declarations for found definitions
      tr - the compilation state
      Returns:
      true on success
    • print

      public void print(Consumer out)
      Specified by:
      print in interface gnu.kawa.format.Printable