kawa.standard
Class Scheme

java.lang.Object
  extended by gnu.expr.Language
      extended by gnu.kawa.lispexpr.LispLanguage
          extended by kawa.standard.Scheme
Direct Known Subclasses:
BRL, Q2

public class Scheme
extends LispLanguage


Field Summary
static ApplyToArgs applyToArgs
           
static LangPrimType booleanType
           
static AbstractFormat displayFormat
           
static map forEach
           
static Declaration getNamedPartDecl
           
static Scheme instance
           
static InstanceOf instanceOf
           
static IsEq isEq
           
static IsEqual isEqual
           
static IsEqv isEqv
           
protected static SimpleEnvironment kawaEnvironment
           
static Lambda lambda
           
static map map
           
static not not
           
static Environment nullEnvironment
           
static NumberCompare numEqu
           
static NumberCompare numGEq
           
static NumberCompare numGrt
           
static NumberCompare numLEq
           
static NumberCompare numLss
           
static Environment r4Environment
           
static Environment r5Environment
           
static repl repl
           
static AbstractFormat writeFormat
           
 
Fields inherited from class gnu.kawa.lispexpr.LispLanguage
defaultReadTable, lookup_sym, quasiquote_sym, quote_sym, unquote_sym, unquotesplicing_sym
 
Fields inherited from class gnu.expr.Language
current, env_counter, environ, FUNCTION_NAMESPACE, NAMESPACE_PREFIX_NAMESPACE, PARSE_IMMEDIATE, PARSE_ONE_LINE, PARSE_PROLOG, requirePedantic, userEnv, VALUE_NAMESPACE
 
Constructor Summary
  Scheme()
           
protected Scheme(Environment env)
           
 
Method Summary
static Environment builtin()
           
 ReadTable createReadTable()
          Create a fresh ReadTable appropriate for this language.
static java.lang.Object eval(InPort port, Environment env)
          Evalutate Scheme expressions from stream.
static java.lang.Object eval(java.lang.Object sexpr, Environment env)
          Evalutate Scheme expressions from an "S expression."
static java.lang.Object eval(java.lang.String string, Environment env)
          Evalutate Scheme expressions from string.
static Type exp2Type(Expression exp)
          Convert expression to a Type.
 AbstractFormat getFormat(boolean readable)
           
static Scheme getInstance()
           
 java.lang.String getName()
           
static Type getNamedType(java.lang.String name)
           
 int getNamespaceOf(Declaration decl)
          Return the namespace (e.g value or function) of a Declaration.
 Type getTypeFor(java.lang.Class clas)
           
 Type getTypeFor(java.lang.String name)
           
static Type getTypeValue(Expression exp)
          If exp is a "constant" Type, return that type, otherwise return null.
 NamedLocation lookupBuiltin(Symbol name, java.lang.Object property, int hash)
           
 Expression makeApply(Expression func, Expression[] args)
           
static void registerEnvironment()
          The compiler insert calls to this method for applications and applets.
static Type string2Type(java.lang.String name)
           
 
Methods inherited from class gnu.kawa.lispexpr.LispLanguage
declFromField, defSntxStFld, defSntxStFld, fromLangSymbol, getCompilation, getLexer, langSymbolToSymbol, makeBody, parse, resolve, selfEvaluatingSymbol
 
Methods inherited from class gnu.expr.Language
asType, booleanObject, coerceFromObject, coerceToObject, coerceToObject, defAliasStFld, define, defineFunction, defineFunction, defProcStFld, defProcStFld, detect, detect, detect, emitCoerceToBoolean, emitPushBoolean, eval, eval, eval, eval, eval, eval, eval, eval, eval, getDefaultLanguage, getEnvironment, getEnvPropertyFor, getEnvPropertyFor, getInstance, getInstance, getInstanceFromFilenameExtension, getLangEnvironment, getLangTypeFor, getLanguages, getNewEnvironment, getOutputConsumer, getPrompter, getSymbol, getTypeFor, getTypeFor, getTypeFor, hasNamespace, hasSeparateFunctionNamespace, isTrue, loadClass, lookup, noValue, parse, parse, parse, registerLanguage, runAsApplication, setDefaultLanguage, setDefaults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullEnvironment

public static final Environment nullEnvironment

r4Environment

public static final Environment r4Environment

r5Environment

public static final Environment r5Environment

kawaEnvironment

protected static final SimpleEnvironment kawaEnvironment

booleanType

public static LangPrimType booleanType

instance

public static final Scheme instance

instanceOf

public static final InstanceOf instanceOf

not

public static final not not

map

public static final map map

forEach

public static final map forEach

isEq

public static final IsEq isEq

isEqv

public static final IsEqv isEqv

isEqual

public static final IsEqual isEqual

repl

public static final repl repl

numEqu

public static final NumberCompare numEqu

numGrt

public static final NumberCompare numGrt

numGEq

public static final NumberCompare numGEq

numLss

public static final NumberCompare numLss

numLEq

public static final NumberCompare numLEq

applyToArgs

public static final ApplyToArgs applyToArgs

getNamedPartDecl

public static final Declaration getNamedPartDecl

lambda

public static final Lambda lambda

writeFormat

public static final AbstractFormat writeFormat

displayFormat

public static final AbstractFormat displayFormat
Constructor Detail

Scheme

public Scheme()

Scheme

protected Scheme(Environment env)
Method Detail

getInstance

public static Scheme getInstance()

builtin

public static Environment builtin()

getName

public java.lang.String getName()
Overrides:
getName in class Language

lookupBuiltin

public NamedLocation lookupBuiltin(Symbol name,
                                   java.lang.Object property,
                                   int hash)
Overrides:
lookupBuiltin in class Language

eval

public static java.lang.Object eval(java.lang.String string,
                                    Environment env)
Evalutate Scheme expressions from string.

Parameters:
string - the string constaining Scheme expressions
env - the Environment to evaluate the string in
Returns:
result of last expression, or Language.voidObject if none.

eval

public static java.lang.Object eval(InPort port,
                                    Environment env)
Evalutate Scheme expressions from stream.

Parameters:
port - the port to read Scheme expressions from
env - the Environment to evaluate the string in
Returns:
result of last expression, or Language.voidObject if none.

eval

public static java.lang.Object eval(java.lang.Object sexpr,
                                    Environment env)
Evalutate Scheme expressions from an "S expression."

Parameters:
sexpr - the S expression to evaluate
env - the Environment to evaluate the string in
Returns:
result of the expression.

getFormat

public AbstractFormat getFormat(boolean readable)
Overrides:
getFormat in class Language

getNamespaceOf

public int getNamespaceOf(Declaration decl)
Description copied from class: Language
Return the namespace (e.g value or function) of a Declaration. Return a bitmask of all the namespaces "covered" by the Declaration. Note this isn't a namespace in the XML sense; if a Declaration has a specific namespace URI, then that is part of its symbol. This namespace bitmap is a separate dimension, for the use of languages that have separate namespaces for different kinds of declarations, such as variables and functions.

Overrides:
getNamespaceOf in class Language

getTypeValue

public static Type getTypeValue(Expression exp)
If exp is a "constant" Type, return that type, otherwise return null.


getNamedType

public static Type getNamedType(java.lang.String name)

getTypeFor

public Type getTypeFor(java.lang.Class clas)
Overrides:
getTypeFor in class Language

string2Type

public static Type string2Type(java.lang.String name)

getTypeFor

public Type getTypeFor(java.lang.String name)
Overrides:
getTypeFor in class Language

exp2Type

public static Type exp2Type(Expression exp)
Convert expression to a Type. Allow "TYPE" or 'TYPE or .


makeApply

public Expression makeApply(Expression func,
                            Expression[] args)
Overrides:
makeApply in class LispLanguage

createReadTable

public ReadTable createReadTable()
Description copied from class: LispLanguage
Create a fresh ReadTable appropriate for this language.

Specified by:
createReadTable in class LispLanguage

registerEnvironment

public static void registerEnvironment()
The compiler insert calls to this method for applications and applets.