|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sisc.util.Util sisc.data.Expression
public abstract class Expression
The base class for any and all expressions. An expression is anything in Scheme that can evaluate to a value. In SISC, an expression can be annotated. An annotation is any key/value pair attached to an expression for the duration of its lifetime. Annotations are used to implement procedure properties and source-tracked debugging.
Field Summary | |
---|---|
java.util.Map |
annotations
|
protected static java.util.Set |
EMPTYSET
|
Fields inherited from class sisc.util.Util |
---|
BACKQUOTE, BEGIN, bundles, caseSensitive, EMPTYLIST, EMPTYVEC, EOF, ERRORK, EVAL, EXPSC, EXPTOP, FALSE, FCONT, FIVE, JEXCEPTION, LAMBDA, LOCATION, maxFloatPrecision, MESSAGE, minFloatPrecision, NAME, OTHER, PARENT, permitInterrupts, QUOTE, QUOTESYM, REPORT, SETBANG, SISC, SISC_SPECIFIC, SISCB, SOURCE_COLUMN, SOURCE_FILE, SOURCE_LINE, SYMENV, THIS, TOPLEVEL, TRUE, UNQUOTE, UNQUOTE_SPLICING, VOID, ZV |
Fields inherited from interface sisc.util.Version |
---|
VERSION |
Constructor Summary | |
---|---|
Expression()
|
Method Summary | |
---|---|
void |
deserialize(Deserializer s)
All Expressions must implement a default (no-argument) constructor. |
void |
deserializeAnnotations(Deserializer s)
|
abstract void |
eval(Interpreter r)
All expressions can be evaluated to some Scheme value. |
abstract Value |
express()
A debugging function, express returns a Scheme value that describes this expression. |
Value |
getAnnotation(Symbol key)
|
Value |
getAnnotation(Symbol key,
Value def)
|
java.util.Set |
getAnnotationKeys()
|
Pair |
getAnnotations()
|
Symbol |
getName()
|
Value |
getValue(Interpreter r)
If an expression implements the Immediate interface, it must override getValue, which returns as a Value, the immediate value of this expression. |
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Object |
readResolve()
|
void |
serialize(Serializer s)
All Expressions must implement a default (no-argument) constructor. |
void |
serializeAnnotations(Serializer s)
|
Value |
setAnnotation(Symbol key,
Value val)
|
Value |
setAnnotation(Symbol key,
Value val,
Value def)
|
void |
setName(Symbol s)
The following helpers set the 'name annotation, which is used for naming procedures, environments, etc. |
boolean |
visit(ExpressionVisitor v)
|
boolean |
visitAnnotations(ExpressionVisitor v)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class sisc.util.Util |
---|
annotated, annotatedAppEval, append, argCheck, argsToSymbols, assq, bininport, bininstream, binoutport, binoutstream, box, character, charinport, charinreader, charoutport, charoutwriter, charsetFromString, chr, cont, currentClassLoader, env, error, error, error, error, error, error, error, expr, getDefaultCharacterSet, immutablePair, immutableVector, inport, javaExceptionToString, javaWrap, justify, length, liMessage, liMessage, liMessage, liMessage, liMessage, liMessage, liMessage, list, list, list, list, list, makeURL, mapcar, memq, nlib, num, outport, pair, pairToExpressions, pairToExpVect, pairToValues, proc, read, registerBundle, reverse, reverseInPlace, simpleErrorToString, sourceAnnotations, str, string, sym, symbol, symval, truePair, truth, truth, typeError, typeError, updateName, url, url, url, valArrayToList, valArrayToList, valArrayToVec, vec, warn, warn, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.Set EMPTYSET
public java.util.Map annotations
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public Value getAnnotation(Symbol key, Value def)
public Value getAnnotation(Symbol key)
public Value setAnnotation(Symbol key, Value val, Value def)
public Value setAnnotation(Symbol key, Value val)
public java.util.Set getAnnotationKeys()
public Pair getAnnotations()
public void serializeAnnotations(Serializer s) throws java.io.IOException
java.io.IOException
public void deserializeAnnotations(Deserializer s) throws java.io.IOException
java.io.IOException
public boolean visitAnnotations(ExpressionVisitor v)
public void setName(Symbol s)
public Symbol getName()
public abstract void eval(Interpreter r) throws ContinuationException
r
- the Interpreter
ContinuationException
public Value getValue(Interpreter r) throws ContinuationException, OptimismUnwarrantedException
r
- the Interpreter
ContinuationException
OptimismUnwarrantedException
public abstract Value express()
public void serialize(Serializer s) throws java.io.IOException
s
- the Serializer
java.io.IOException
public void deserialize(Deserializer s) throws java.io.IOException
s
- the Deserializer
java.io.IOException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
java.io.IOException
public java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
public boolean visit(ExpressionVisitor v)
visit
in interface ExpressionVisitee
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |