kawa.lang

Class SyntaxForm

Implemented Interfaces:
Externalizable

public class SyntaxForm
extends java.lang.Object
implements Externalizable

A "syntatic closure" - a syntax form with its compilation environment.

Field Summary

Object
form
TemplateScope
scope

Method Summary

static boolean
freeIdentifierEquals(SyntaxForm id1, SyntaxForm id2)
SyntaxForm
fromDatum(Object form)
Make a SyntaxForm object with the same contextual information as this.
SyntaxForm
fromDatumIfNeeded(Object form)
boolean
isIdentifier()
static SyntaxForm
make(Object form, TemplateScope scope)
static Object
makeWithTemplate(Object template, Object form)
Create a syntax object with specified form, and given syntatic context.
void
readExternal(ObjectInput in)
static Expression
rewrite(Object x)
static Expression
rewriteBody(Object x)
String
toString()
void
writeExternal(ObjectOutput out)

Field Details

form

public Object form

scope

public TemplateScope scope

Method Details

freeIdentifierEquals

public static boolean freeIdentifierEquals(SyntaxForm id1,
                                           SyntaxForm id2)

fromDatum

public SyntaxForm fromDatum(Object form)
Make a SyntaxForm object with the same contextual information as this.
Parameters:
form - which used for the new syntax value. Corresponds to the datum->syntax-object function.

fromDatumIfNeeded

public SyntaxForm fromDatumIfNeeded(Object form)

isIdentifier

public boolean isIdentifier()

make

public static SyntaxForm make(Object form,
                              TemplateScope scope)

makeWithTemplate

public static Object makeWithTemplate(Object template,
                                      Object form)
Create a syntax object with specified form, 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 form as-is.)
form - The value (S-expression form) to use.

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

rewrite

public static Expression rewrite(Object x)

rewriteBody

public static Expression rewriteBody(Object x)

toString

public String toString()

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException