kawa.lang
Class SyntaxForm
- Externalizable
public class SyntaxForm
extends java.lang.Object
implements Externalizable
A "syntatic closure" - a syntax form with its compilation environment.
fromDatum
public SyntaxForm fromDatum(Object form)
Make a SyntaxForm object with the same contextual information as this.
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()
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.
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
rewriteBody
public static Expression rewriteBody(Object x)
toString
public String toString()
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException