edu.mit.ai.psg.jevaES
Class EnvBase

java.lang.Object
  |
  +--edu.mit.ai.psg.jevaES.EnvBase
Direct Known Subclasses:
EnvLocalStore, EnvOptionBits

public abstract class EnvBase
extends Object
implements IEnv

A base class for Environment nodes that forwards all requests to the next environment node. Subclasses should override some methods to actually do some kinds of lookups. (Environments are chains of binding nodes).


Inner classes inherited from class edu.mit.ai.psg.jevaES.IEnv
IEnv.ClassResult
 
Constructor Summary
EnvBase(IEnv nextEnv)
           
 
Method Summary
 IEnv getNext()
          get next env in chain; used by lookup methods
 int getOptionBits()
          get option bits; for options, see Jeva
 IEnv.ClassResult lookupClass(String queryName)
          find root class with this name; nested classes found from parent.
 IPackage lookupEnclosingPackage()
          return enclosing package
 IStatementNode lookupLabel(String queryName, boolean isForContinue)
          if label found, return node of statement it labels; stops at method or initializer boundary.
 IStore lookupLocal(String queryName)
          lookup restricted to local variables and parameters, used for checking if a local variable name is already in use.
 IPackage lookupPackage(String rootPackageName)
          find root package with this name; sub-packages found from parent
 Class lookupReturnType()
          return type of enclosing method, or void.class if in a constructor, or null if in a static initializer
 Class[] lookupThrows()
          find checked exceptions declared in throws clause of enclosing method or constructor, or null if not in a method or constructor
abstract  String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnvBase

public EnvBase(IEnv nextEnv)
        throws IllegalArgumentException
Method Detail

getNext

public final IEnv getNext()
Description copied from interface: IEnv
get next env in chain; used by lookup methods
Specified by:
getNext in interface IEnv

toString

public abstract String toString()
Overrides:
toString in class Object

lookupLocal

public IStore lookupLocal(String queryName)
Description copied from interface: IEnv
lookup restricted to local variables and parameters, used for checking if a local variable name is already in use. Local scope may be a method, constructor, field initializer, static initializer, object initializer. [JavaLangSpec1.0sec14.3.2]
Specified by:
lookupLocal in interface IEnv

lookupLabel

public IStatementNode lookupLabel(String queryName,
                                  boolean isForContinue)
Description copied from interface: IEnv
if label found, return node of statement it labels; stops at method or initializer boundary. If label is empty (""), then returns first for, do, while, or switch statement. If isForContinue, then skip unlabeled switch statements.
Specified by:
lookupLabel in interface IEnv

lookupClass

public IEnv.ClassResult lookupClass(String queryName)
Description copied from interface: IEnv
find root class with this name; nested classes found from parent. Returns IEnv.ClassResult if found, else null;
Specified by:
lookupClass in interface IEnv
Tags copied from interface: IEnv
Throws:
IllegalArgumentException - if two on-demand-imports import different classes named queryName.

lookupPackage

public IPackage lookupPackage(String rootPackageName)
Description copied from interface: IEnv
find root package with this name; sub-packages found from parent
Specified by:
lookupPackage in interface IEnv

lookupReturnType

public Class lookupReturnType()
Description copied from interface: IEnv
return type of enclosing method, or void.class if in a constructor, or null if in a static initializer
Specified by:
lookupReturnType in interface IEnv

lookupThrows

public Class[] lookupThrows()
Description copied from interface: IEnv
find checked exceptions declared in throws clause of enclosing method or constructor, or null if not in a method or constructor
Specified by:
lookupThrows in interface IEnv

lookupEnclosingPackage

public IPackage lookupEnclosingPackage()
Description copied from interface: IEnv
return enclosing package
Specified by:
lookupEnclosingPackage in interface IEnv

getOptionBits

public int getOptionBits()
Description copied from interface: IEnv
get option bits; for options, see Jeva
Specified by:
getOptionBits in interface IEnv

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu