|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sisc.util.Util sisc.interpreter.AppContext
public class AppContext
The AppContext is the root of all data in an instance of SISC. This encapsulates mainly the procedures and data which are defined in the global environment. It is also the token used by most Java to Scheme operations.
Typically, an AppContext is created using the default constructor,
then initialized with a heap using utility methods in REPL
.
Field Summary | |
---|---|
SymbolicEnvironment |
symenv
|
SymbolicEnvironment |
toplevel_env
|
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 | |
---|---|
AppContext()
Create a new, AppContext with default values, the recommended constructor for normal usage. |
|
AppContext(java.util.Properties props)
Create a new AppContext, providing a set of properties explicitly. |
|
AppContext(SymbolicEnvironment symenv)
Create a new AppContext, providing a custom global environment. |
Method Summary | |
---|---|
void |
addDefaultHeap()
Attempts to find and load the default SISC heap into this AppContext. |
boolean |
addHeap(SeekableInputStream in)
Given a SeekableInputStream which is attached to a SISC heap file, loads the heap into this AppContext and initializes it. |
void |
defineContextEnv(Symbol s,
SymbolicEnvironment env)
|
static java.net.URL |
findHeap(java.net.URL heapLocation)
Locate a heap. |
Expression |
getExpression(Symbol name)
|
java.lang.String |
getProperty(java.lang.String name)
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String def)
|
void |
loadEnv(SeekableDataInputStream i)
|
LibraryBinding |
lookupBinding(Expression e)
|
SymbolicEnvironment |
lookupContextEnv(Symbol s)
|
static SeekableInputStream |
openHeap(java.net.URL u)
|
Expression |
resolveBinding(LibraryBinding lb)
|
void |
saveEnv(java.io.OutputStream o,
LibraryBuilder lb)
|
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 |
---|
public SymbolicEnvironment symenv
public SymbolicEnvironment toplevel_env
Constructor Detail |
---|
public AppContext()
public AppContext(java.util.Properties props)
props
- Properties which govern the
underlying Scheme environment.public AppContext(SymbolicEnvironment symenv)
symenv
- the global environmentMethod Detail |
---|
public Expression getExpression(Symbol name)
public void loadEnv(SeekableDataInputStream i) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void saveEnv(java.io.OutputStream o, LibraryBuilder lb) throws java.io.IOException
java.io.IOException
public SymbolicEnvironment lookupContextEnv(Symbol s)
public void defineContextEnv(Symbol s, SymbolicEnvironment env)
public java.lang.String getProperty(java.lang.String name)
public java.lang.String getProperty(java.lang.String name, java.lang.String def)
public Expression resolveBinding(LibraryBinding lb) throws java.io.IOException
java.io.IOException
public LibraryBinding lookupBinding(Expression e) throws java.io.IOException
java.io.IOException
public boolean addHeap(SeekableInputStream in) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void addDefaultHeap() throws java.io.IOException
java.io.IOException
findHeap(URL)
public static SeekableInputStream openHeap(java.net.URL u) throws java.io.IOException
java.io.IOException
public static java.net.URL findHeap(java.net.URL heapLocation)
heapLocation
- The URL for the heap file. When
this is null it defaults to the value of the
sisc.heap system property and, if that is not present,
"sisc.shp"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |