Package kawa.lang
Class SyntaxForms
java.lang.Object
kawa.lang.SyntaxForms
Helper method and implementation classes for SyntaxForm.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectfromDatum(Object datum, SyntaxForm template) Make a SyntaxForm object with the same contextual information as this.static ObjectfromDatumIfNeeded(Object datum, SyntaxForm template) static booleanidentifierEquals(Object id1, Object id2, boolean checkBound) Utility method to implement Scheme free-identifier=? and bound-identifier=?.static booleanisIdentifier(SyntaxForm form) static ObjectmakeForm(Object datum, TemplateScope scope) static ObjectmakeWithTemplate(Object template, Object form) static ObjectmakeWithTemplate(Object template, Object datum, Object srcloc) Create a syntax object with specified datum, and given syntatic context.static Expressionstatic Expressionstatic ExpressionrewriteCar(Object x) static StringtoString(SyntaxForm sform, String id)
-
Field Details
-
DEBUGGING
public static final boolean DEBUGGING- See Also:
-
-
Constructor Details
-
SyntaxForms
public SyntaxForms()
-
-
Method Details
-
makeForm
-
makeWithTemplate
Create a syntax object with specified datum, and given syntatic context. Used to implementdatum->syntax.- Parameters:
template- If this is aSyntaxForm, use its scope; otherwise use the currentCompilation's current scope. (This means just returning the datum as-is.)datum- The value (S-expression datum) to use.srcloc- Used to set source location (line number etc). Ignored if null; otherwise should be aSourceLocator.
-
makeWithTemplate
-
identifierEquals
Utility method to implement Scheme free-identifier=? and bound-identifier=?.- Parameters:
id1- An identifier - either a symbol or a SyntaxForm whose form is a symbol. We assume it satisfies the Scheme predicate identifier?.id2- The other identifier to compare against.checkBound- true for bound-identifier=? and false for free-identifier=?.
-
isIdentifier
-
fromDatum
Make a SyntaxForm object with the same contextual information as this.- Parameters:
datum- which used for the new syntax value. Corresponds to thedatum->syntax-objectfunction.
-
fromDatumIfNeeded
-
rewrite
-
rewriteCar
-
rewriteBody
-
toString
-