Exemplo n.º 1
0
 public Env<AttrContext> getTopLevelEnv(JCCompilationUnit tree) {
   Env<AttrContext> localEnv = new Env<AttrContext>(tree, new AttrContext());
   localEnv.toplevel = tree;
   localEnv.enclClass = predefClassDef;
   localEnv.info.scope = tree.namedImportScope;
   localEnv.info.lint = lint;
   return localEnv;
 }
Exemplo n.º 2
0
 /**
  * Create a fresh environment for class bodies. This will create a fresh scope for local symbols
  * of a class, referred to by the environments info.scope field. This scope will contain - symbols
  * for this and super - symbols for any type parameters In addition, it serves as an anchor for
  * scopes of methods and initializers which are nested in this scope via Scope.dup(). This scope
  * should not be confused with the members scope of a class.
  *
  * @param tree The class definition.
  * @param env The environment current outside of the class definition.
  */
 public Env<AttrContext> classEnv(JCClassDecl tree, Env<AttrContext> env) {
   Env<AttrContext> localEnv = env.dup(tree, env.info.dup(new Scope(tree.sym)));
   localEnv.enclClass = tree;
   localEnv.outer = env;
   localEnv.info.isSelfCall = false;
   localEnv.info.lint = null; // leave this to be filled in by Attr,
   // when annotations have been processed
   return localEnv;
 }
Exemplo n.º 3
0
 /**
  * Create a fresh environment for toplevels.
  *
  * @param tree The toplevel tree.
  */
 Env<AttrContext> topLevelEnv(JCCompilationUnit tree) {
   Env<AttrContext> localEnv = new Env<AttrContext>(tree, new AttrContext());
   localEnv.toplevel = tree;
   localEnv.enclClass = predefClassDef;
   tree.namedImportScope = new Scope.ImportScope(tree.packge);
   tree.starImportScope = new Scope.ImportScope(tree.packge);
   localEnv.info.scope = tree.namedImportScope;
   localEnv.info.lint = lint;
   return localEnv;
 }