ca.uwaterloo.cs.ql.interp
Class Env

java.lang.Object
  extended by ca.uwaterloo.cs.ql.interp.Env

public class Env
extends java.lang.Object


Field Summary
 java.io.PrintStream err
           
 java.io.InputStream in
           
 java.io.PrintStream out
           
 
Constructor Summary
Env()
          Env.
 
Method Summary
 ScriptUnitNode getMainUnit()
          Gets the main script unit.
 Variable lookup(java.lang.String name)
          Looks up a variable.
 Function lookupFunction(java.lang.String name, java.lang.Class[] paramTypes)
          Looks up a Function.
 Function[] lookupFunctions(java.lang.String name)
          Looks up all functions with a given name.
 Scope peepScope()
          Peeps the scope on top of the stack.
 Scope popScope()
          Pops the scope on top of the stack.
 void pushScope(Scope scp)
          Pushes a scope onto the stack.
 void removeAllScopes()
          Removes all scopes on the stack.
 void setMainUnit(ScriptUnitNode unit)
          Sets the main script unit.
 ScriptUnitNode traceScriptUnit()
          Traces the script unit on top of the stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

public java.io.InputStream in

out

public java.io.PrintStream out

err

public java.io.PrintStream err
Constructor Detail

Env

public Env()
Env.

Method Detail

getMainUnit

public ScriptUnitNode getMainUnit()
Gets the main script unit.


setMainUnit

public void setMainUnit(ScriptUnitNode unit)
Sets the main script unit.


removeAllScopes

public void removeAllScopes()
Removes all scopes on the stack.


popScope

public Scope popScope()
Pops the scope on top of the stack.


pushScope

public void pushScope(Scope scp)
Pushes a scope onto the stack.


peepScope

public Scope peepScope()
Peeps the scope on top of the stack.


traceScriptUnit

public ScriptUnitNode traceScriptUnit()
Traces the script unit on top of the stack.


lookup

public Variable lookup(java.lang.String name)
                throws LookupException
Looks up a variable.

Throws:
LookupException - if no variable can be found.

lookupFunction

public Function lookupFunction(java.lang.String name,
                               java.lang.Class[] paramTypes)
                        throws LookupException
Looks up a Function.

Parameters:
name - the name of the Function.
paramTypes - the param types of the Function.
Throws:
LookupException

lookupFunctions

public Function[] lookupFunctions(java.lang.String name)
                           throws LookupException
Looks up all functions with a given name.

Parameters:
name - the name of functions to look up.
Throws:
LookupException