kawa.lang

Class SyntaxForm

public class SyntaxForm extends Object implements Externalizable

A "syntatic closure" - a syntax form with its compilation environment.
Field Summary
Objectform
TemplateScopescope
Method Summary
static booleanfreeIdentifierEquals(SyntaxForm id1, SyntaxForm id2)
SyntaxFormfromDatum(Object form)
Make a SyntaxForm object with the same contextual information as this.
SyntaxFormfromDatumIfNeeded(Object form)
booleanisIdentifier()
static SyntaxFormmake(Object form, TemplateScope scope)
static ObjectmakeWithTemplate(Object template, Object form)
Create a syntax object with specified form, and given syntatic context.
voidreadExternal(ObjectInput in)
static Expressionrewrite(Object x)
static ExpressionrewriteBody(Object x)
StringtoString()
voidwriteExternal(ObjectOutput out)

Field Detail

form

public Object form

scope

public TemplateScope scope

Method Detail

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)

rewrite

public static Expression rewrite(Object x)

rewriteBody

public static Expression rewriteBody(Object x)

toString

public String toString()

writeExternal

public void writeExternal(ObjectOutput out)