kawa.lang
Class SyntaxForms

java.lang.Object
  extended by kawa.lang.SyntaxForms

public class SyntaxForms
extends java.lang.Object

Helper method and implementation classes for SyntaxForm.


Field Summary
static boolean DEBUGGING
           
 
Constructor Summary
SyntaxForms()
           
 
Method Summary
static boolean freeIdentifierEquals(SyntaxForm id1, SyntaxForm id2)
           
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 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)
          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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUGGING

public static final boolean DEBUGGING
See Also:
Constant Field Values
Constructor Detail

SyntaxForms

public SyntaxForms()
Method Detail

makeForm

public static java.lang.Object makeForm(java.lang.Object datum,
                                        TemplateScope scope)

makeWithTemplate

public static java.lang.Object makeWithTemplate(java.lang.Object template,
                                                java.lang.Object form)
Create a syntax object with specified datum, and given syntatic context. Used to implement datum->syntax-object in the syntax-case API.

Parameters:
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.)
form - The value (S-expression datum) to use.

freeIdentifierEquals

public static boolean freeIdentifierEquals(SyntaxForm id1,
                                           SyntaxForm id2)

isIdentifier

public static boolean isIdentifier(SyntaxForm form)

fromDatum

public static java.lang.Object fromDatum(java.lang.Object datum,
                                         SyntaxForm template)
Make a SyntaxForm object with the same contextual information as this.

Parameters:
datum - which used for the new syntax value. Corresponds to the datum->syntax-object function.

fromDatumIfNeeded

public static java.lang.Object fromDatumIfNeeded(java.lang.Object datum,
                                                 SyntaxForm template)

rewrite

public static Expression rewrite(java.lang.Object x)

rewriteBody

public static Expression rewriteBody(java.lang.Object x)

toString

public static java.lang.String toString(SyntaxForm sform,
                                        java.lang.String id)