edu.rice.cs.dynamicjava.interpreter
Class RuntimeBindings

java.lang.Object
  extended by edu.rice.cs.dynamicjava.interpreter.RuntimeBindings

public class RuntimeBindings
extends Object

An environment used for evaluation. All keys in the environment are global -- there are no shadowing concerns. Thus, instances can be used very flexibly during evaluation, given that a program is statically safe. For example, the environment used to call a function can extend the calling context. Without this flexibility, it would have to be determined at what point (if any) in the calling context's chain of environments the function declaration and the calling context share a common lexical scope.


Field Summary
static RuntimeBindings EMPTY
           
 
Constructor Summary
RuntimeBindings(RuntimeBindings parent, DJClass thisClass, Object thisObj)
           
RuntimeBindings(RuntimeBindings parent, Iterable<LocalVariable> vars, Iterable<Object> vals)
           
RuntimeBindings(RuntimeBindings parent, LocalVariable var, Object val)
           
RuntimeBindings(RuntimeBindings parent, Map<LocalVariable,Object> vars, Map<VariableType,Type> tvars, Map<DJClass,Object> thisVals)
           
 
Method Summary
 Object get(LocalVariable v)
           
 Type get(VariableType v)
           
 Object getThis(DJClass c)
           
 void set(LocalVariable v, Object val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final RuntimeBindings EMPTY
Constructor Detail

RuntimeBindings

public RuntimeBindings(RuntimeBindings parent,
                       Map<LocalVariable,Object> vars,
                       Map<VariableType,Type> tvars,
                       Map<DJClass,Object> thisVals)

RuntimeBindings

public RuntimeBindings(RuntimeBindings parent,
                       LocalVariable var,
                       Object val)

RuntimeBindings

public RuntimeBindings(RuntimeBindings parent,
                       Iterable<LocalVariable> vars,
                       Iterable<Object> vals)

RuntimeBindings

public RuntimeBindings(RuntimeBindings parent,
                       DJClass thisClass,
                       Object thisObj)
Method Detail

get

public Object get(LocalVariable v)

set

public void set(LocalVariable v,
                Object val)

get

public Type get(VariableType v)

getThis

public Object getThis(DJClass c)