edu.mit.ai.psg.jeva
Class EnvEnd

java.lang.Object
  |
  +--edu.mit.ai.psg.jeva.EnvEnd

public class EnvEnd
extends Object
implements IEnv

A tail environment node that holds the root package. Top level definitions should lookup package name, then store into package.


Inner classes inherited from class edu.mit.ai.psg.jeva.IEnv
IEnv.ClassResult
 
Method Summary
 IEnv getNext()
          get next env in chain; used by lookup methods
 int getOptionBits()
          get option bits; for options, see JevaES
 IEnv.ClassResult lookupClass(String queryName)
          find root class with this name; nested classes found from parent.
 IClass lookupEnclosingClass()
          return enclosing class, or null if not in a class.
 IPackage lookupEnclosingPackage()
          return enclosing package
 IField lookupField(String queryName)
          lookup field name in current class, or return null if no such field, or no current class.
 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, e.g., to check if a local variable name is already in use.
 IPackage lookupPackage(String firstPackageName)
          find root package with this name; sub-packages found from parent
 IClass lookupReturnType()
          return type of enclosing method, or void.class (wrapped) if in a constructor, or null if in a static or object initializer
 Object lookupThis()
          return "this", or null if not in non-static context (method, constructor, non-static initializer)
 IClass[] lookupThrows()
          find checked exceptions caught in an enclosing try block or declared in throws clause of enclosing method or constructor
static IEnv makeDefaultEnv(int initOptions)
          options default is 0; for explanation see Jeva
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

makeDefaultEnv

public static IEnv makeDefaultEnv(int initOptions)
options default is 0; for explanation see Jeva

toString

public 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, e.g., to check 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

lookupField

public IField lookupField(String queryName)
Description copied from interface: IEnv
lookup field name in current class, or return null if no such field, or no current class.
Specified by:
lookupField in interface IEnv
Tags copied from interface: IEnv
Throws:
IllegalAccessException - if there is a field with that name but it is inaccessible from the current class
IllegalArgumentException - if different fields with that name are inherited from an interface and either a superclass or another interface. (Fields are different if they are declared in different classes or interfaces.)

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.
IllegalStateException - if env has conflicting definitions or class imports for queryName.

lookupPackage

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

lookupReturnType

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

lookupThrows

public IClass[] lookupThrows()
Description copied from interface: IEnv
find checked exceptions caught in an enclosing try block or declared in throws clause of enclosing method or constructor
Specified by:
lookupThrows in interface IEnv

lookupThis

public Object lookupThis()
Description copied from interface: IEnv
return "this", or null if not in non-static context (method, constructor, non-static initializer)
Specified by:
lookupThis in interface IEnv

lookupEnclosingClass

public IClass lookupEnclosingClass()
Description copied from interface: IEnv
return enclosing class, or null if not in a class.
Specified by:
lookupEnclosingClass 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 JevaES
Specified by:
getOptionBits in interface IEnv

getNext

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

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu