edu.mit.ai.psg.jevaES
Interface IEnv

All Known Implementing Classes:
EnvBase, EnvLocalStore, EnvEnd

public interface IEnv

IEnv: Interface to objects in which names can be looked up. Environments are implemented as a chain, so each can pass the request on to the next if the queryName is not found.


Inner Class Summary
static class IEnv.ClassResult
          class used for multiple value return.
 
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
 

Method Detail

lookupLocal

public IStore lookupLocal(String queryName)
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]

lookupLabel

public IStatementNode lookupLabel(String queryName,
                                  boolean isForContinue)
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.

lookupClass

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

lookupPackage

public IPackage lookupPackage(String rootPackageName)
find root package with this name; sub-packages found from parent

lookupReturnType

public Class lookupReturnType()
return type of enclosing method, or void.class if in a constructor, or null if in a static initializer

lookupThrows

public Class[] lookupThrows()
find checked exceptions declared in throws clause of enclosing method or constructor, or null if not in a method or constructor

lookupEnclosingPackage

public IPackage lookupEnclosingPackage()
return enclosing package

getOptionBits

public int getOptionBits()
get option bits; for options, see Jeva

getNext

public IEnv getNext()
get next env in chain; used by lookup methods

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu