public class SyntaxForms
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SyntaxForms.PairSyntaxForm |
static class |
SyntaxForms.PairWithPositionSyntaxForm |
static class |
SyntaxForms.SimpleSyntaxForm |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUGGING |
| Constructor and Description |
|---|
SyntaxForms() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
fromDatum(java.lang.Object datum,
SyntaxForm template)
Make a SyntaxForm object with the same contextual information as this.
|
static java.lang.Object |
fromDatumIfNeeded(java.lang.Object datum,
SyntaxForm template) |
static boolean |
identifierEquals(java.lang.Object id1,
java.lang.Object id2,
boolean checkBound)
Utility method to implement Scheme free-identifier=? and bound-identifier=?.
|
static boolean |
isIdentifier(SyntaxForm form) |
static java.lang.Object |
makeForm(java.lang.Object datum,
TemplateScope scope) |
static java.lang.Object |
makeWithTemplate(java.lang.Object template,
java.lang.Object form) |
static java.lang.Object |
makeWithTemplate(java.lang.Object template,
java.lang.Object datum,
java.lang.Object srcloc)
Create a syntax object with specified datum, and given syntatic context.
|
static Expression |
rewrite(java.lang.Object x) |
static Expression |
rewriteBody(java.lang.Object x) |
static java.lang.String |
toString(SyntaxForm sform,
java.lang.String id) |
public static final boolean DEBUGGING
public static java.lang.Object makeForm(java.lang.Object datum,
TemplateScope scope)
public static java.lang.Object makeWithTemplate(java.lang.Object template,
java.lang.Object datum,
java.lang.Object srcloc)
datum->syntax.template - If this is a SyntaxForm, use its scope;
otherwise use the current Compilation'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 a SourceLocator.public static java.lang.Object makeWithTemplate(java.lang.Object template,
java.lang.Object form)
public static boolean identifierEquals(java.lang.Object id1,
java.lang.Object id2,
boolean checkBound)
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=?.public static boolean isIdentifier(SyntaxForm form)
public static java.lang.Object fromDatum(java.lang.Object datum,
SyntaxForm template)
datum - which used for the new syntax value.
Corresponds to the datum->syntax-object function.public static java.lang.Object fromDatumIfNeeded(java.lang.Object datum,
SyntaxForm template)
public static Expression rewrite(java.lang.Object x)
public static Expression rewriteBody(java.lang.Object x)
public static java.lang.String toString(SyntaxForm sform, java.lang.String id)