| java.lang.Object gnu.expr.Interpreter
All known Subclasses: nice.tools.code.NiceInterpreter,
Interpreter | abstract public class Interpreter (Code) | | 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.)
|
Method Summary | |
public Type | asType(Object spec) "Coerce" a language-specific "type specifier" object to a Type. | public Object | booleanObject(boolean b) | public Object | coerceFromObject(Class clas, Object obj) | public Object | coerceToObject(Class clas, Object obj) | public Object | coerceToObject(int val) | public void | define(String sym, Object p) | public void | emitCoerceToBoolean(CodeAttr code) Generate code to test if an object is considered true.
Assume the object has been pushed on the JVM stack.
Generate code to push true or false as appropriate. | public void | emitPushBoolean(boolean value, CodeAttr code) | public Environment | getEnvironment() | abstract public FormatToConsumer | getFormat(boolean readable) | public static Interpreter | getInstance(String name) Look for an interpreter for a language with the given name or extension.
If name is null, look for the first language available. | public static Interpreter | getInstance(String langName, Class langClass) | public static Interpreter | getInterpreter() | public static String[][] | getLanguages() | abstract public Lexer | getLexer(InPort inp, gnu.text.SourceMessages messages) | abstract public String | getName() | public int | getNamespaceOf(Declaration decl) Return the namespace (e.g value or function) of a Declaration. | public Environment | getNewEnvironment() | public Consumer | getOutputConsumer(OutPort out) | public Procedure | getPrompter() | abstract public Type | getTypeFor(Class clas) | public Type | getTypeFor(String name) | public Type | getTypeFor(Expression exp) | public boolean | hasSeparateFunctionNamespace() True if functions are in a separate anme space from variable.
Is true for e.g. | public boolean | isTrue(Object value) Test if a value is considered "true" in this language. | public Object | lookup(String name) | public Object | noValue() The value to return for a "void" result. | abstract public ModuleExp | parse(Environment env, Lexer lexer) | abstract public ModuleExp | parseFile(InPort port, gnu.text.SourceMessages messages) | public void | print(Object obj, OutPort out) | public void | print(Object value, OutPort out, boolean readable) | abstract public Object | read(InPort in) | public void | setEnvironment(Environment environ) | public static Type | string2Type(String name) |
FUNCTION_NAMESPACE | final public static int FUNCTION_NAMESPACE(Code) | | |
VALUE_NAMESPACE | final public static int VALUE_NAMESPACE(Code) | | |
languages | static String[][] languages(Code) | | List of known languages and their Interpreter classes.
Each element is one or more language names, or filename extensions,
followed by the name of the Interpreter sub-class.
The table is searched from the beginning.
|
quasiquote_sym | final public static String quasiquote_sym(Code) | | |
unquotesplicing_sym | final public static String unquotesplicing_sym(Code) | | |
Interpreter | protected Interpreter()(Code) | | |
asType | public Type asType(Object spec)(Code) | | "Coerce" a language-specific "type specifier" object to a Type.
|
emitCoerceToBoolean | public void emitCoerceToBoolean(CodeAttr code)(Code) | | Generate code to test if an object is considered true.
Assume the object has been pushed on the JVM stack.
Generate code to push true or false as appropriate.
|
emitPushBoolean | public void emitPushBoolean(boolean value, CodeAttr code)(Code) | | |
getInstance | public static Interpreter getInstance(String name)(Code) | | Look for an interpreter for a language with the given name or extension.
If name is null, look for the first language available.
|
getLanguages | public static String[][] getLanguages()(Code) | | Get a list of all available languages
|
getNamespaceOf | public int getNamespaceOf(Declaration decl)(Code) | | Return the namespace (e.g value or function) of a Declaration.
Return a bitmask of all the namespces "covered" by the Declaration.
|
hasSeparateFunctionNamespace | public boolean hasSeparateFunctionNamespace()(Code) | | True if functions are in a separate anme space from variable.
Is true for e.g. Common Lisp, Emacs Lisp; false for Scheme.
|
isTrue | public boolean isTrue(Object value)(Code) | | Test if a value is considered "true" in this language.
|
noValue | public Object noValue()(Code) | | The value to return for a "void" result.
|
|
|