gnu.expr
Class Interpreter
java.lang.Object
|
+--gnu.expr.Interpreter
- Direct Known Subclasses:
- Scheme
- public abstract class Interpreter
- extends java.lang.Object
Contains various language-dependent methods.
Also contains "global" state about the executation environment,
such as the global Environment. There can be multiple Interpreters
associated with different threads, representing mutiple top-levels.
(However, this functionality is incomplete.)
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
defaultInterpreter
public static Interpreter defaultInterpreter
trueObject
public static final java.lang.Boolean trueObject
falseObject
public static final java.lang.Boolean falseObject
undefinedObject
public static final Undefined undefinedObject
voidObject
public static final java.lang.Object voidObject
quote_sym
public static final java.lang.String quote_sym
unquote_sym
public static final java.lang.String unquote_sym
unquotesplicing_sym
public static final java.lang.String unquotesplicing_sym
quasiquote_sym
public static final java.lang.String quasiquote_sym
environ
protected Environment environ
Interpreter
public Interpreter()
isTrue
public boolean isTrue(java.lang.Object value)
- Test if a value is considered "true" in this language.
booleanObject
public java.lang.Object booleanObject(boolean b)
noValue
public java.lang.Object noValue()
- The value to return for a "void" result.
hasSeparateFunctionNamespace
public boolean hasSeparateFunctionNamespace()
- True if functions are in a separate anme space from variable.
Is true for e.g. Common Lisp, Emacs Lisp; false for Scheme.
getEnvironment
public Environment getEnvironment()
setEnvironment
public void setEnvironment(Environment environ)
define
public void define(java.lang.String sym,
java.lang.Object p)
lookup
public java.lang.Object lookup(java.lang.String name)
read
public abstract java.lang.Object read(InPort in)
throws java.io.IOException,
SyntaxException
print
public abstract void print(java.lang.Object obj,
OutPort out)
getNewEnvironment
public Environment getNewEnvironment()
getName
public abstract java.lang.String getName()
getLexer
public abstract Lexer getLexer(InPort inp,
SourceMessages messages)
getTypeFor
public abstract Type getTypeFor(java.lang.Class clas)
coerceFromObject
public java.lang.Object coerceFromObject(java.lang.Class clas,
java.lang.Object obj)
coerceToObject
public java.lang.Object coerceToObject(java.lang.Class clas,
java.lang.Object obj)