sisc.ser
Class LibraryAE
java.lang.Object
sisc.util.Util
sisc.data.Expression
sisc.data.Value
sisc.env.MemorySymEnv
sisc.ser.LibraryAE
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable, Immediate, NamedValue, SymbolicEnvironment, ExpressionVisitee, Version
public class LibraryAE
- extends MemorySymEnv
An SymEnv backed by a random-access library. It can operate in two
modes:
1) "observe" - keep track of bindings from which to later create a
library
2) "retrieve" - access bindings in a library
- See Also:
- Serialized Form
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 |
Methods inherited from class sisc.env.MemorySymEnv |
asValue, define, deserializeSidecar, display, expand, getSidecarEnvironment, lookup, lookup, serializeSidecar, set, setParent, trim, visitSidecar |
Methods inherited from class sisc.data.Value |
apply, displayNamedOpaque, equals, eqv, eval, express, getValue, synopsis, synopsis, toString, valueEqual, valueHashCode, write, writeReplace |
Methods inherited from class sisc.data.Expression |
deserializeAnnotations, getAnnotation, getAnnotation, getAnnotationKeys, getAnnotations, getName, readExternal, readResolve, serializeAnnotations, setAnnotation, setAnnotation, setName, visitAnnotations, writeExternal |
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
lb
protected LibraryBuilder lb
base
protected Library base
addressMap
protected java.util.Map addressMap
bindWatch
protected java.util.Set bindWatch
parentIdx
protected int parentIdx
LibraryAE
public LibraryAE(Symbol name,
LibraryBuilder lb)
- Operate in "observe" mode.
- Parameters:
name
- the name of the SymEnvlb
- the library serializer
LibraryAE
public LibraryAE(SymbolicEnvironment parent,
LibraryBuilder lb)
- Operate in "observe" mode.
- Parameters:
parent
- the name of the parent SymEnvlb
- the library serializer
LibraryAE
public LibraryAE(Library base)
- Operate in "retrieve" mode.
- Parameters:
base
- the library from which to retrieve bindings
LibraryAE
public LibraryAE()
getParent
public SymbolicEnvironment getParent()
- Specified by:
getParent
in interface SymbolicEnvironment
- Overrides:
getParent
in class MemorySymEnv
addSymbolicBindings
public void addSymbolicBindings(Library lib,
Pair s)
addBinding
public void addBinding(Library lib,
Symbol sym,
int ep)
undefine
public void undefine(Symbol s)
- Specified by:
undefine
in interface SymbolicEnvironment
- Overrides:
undefine
in class MemorySymEnv
getLoc
public int getLoc(Symbol s)
- Specified by:
getLoc
in interface SymbolicEnvironment
- Overrides:
getLoc
in class MemorySymEnv
store
public int store(Symbol s,
Value v)
- Catch all occurences of sets and note them for when we serialize
- Overrides:
store
in class MemorySymEnv
- Parameters:
s
- the key being setv
- the value associated with the key
- Returns:
- index of binding
deserialize
public void deserialize(Deserializer d)
throws java.io.IOException
- Description copied from class:
Expression
- All Expressions must implement a default (no-argument) constructor.
Those that wish to b serialized to a heap must implement both this
and the serialize method. The Expression may use any method of the
DataInput stream and the Deserializer serialization context
to read its state.
- Specified by:
deserialize
in interface SymbolicEnvironment
- Overrides:
deserialize
in class MemorySymEnv
- Parameters:
d
- the Deserializer
- Throws:
java.io.IOException
serialize
public void serialize(Serializer s)
throws java.io.IOException
- Description copied from class:
Expression
- All Expressions must implement a default (no-argument) constructor.
Those that wish to be serialized to a heap must implement both this
and the deserialize method. The Expression may use any method of
the Serializer, which implements java.io.DataOutput
to write its state.
- Specified by:
serialize
in interface SymbolicEnvironment
- Overrides:
serialize
in class MemorySymEnv
- Parameters:
s
- the Serializer
- Throws:
java.io.IOException
visit
public boolean visit(ExpressionVisitor v)
- Specified by:
visit
in interface ExpressionVisitee
- Overrides:
visit
in class MemorySymEnv