コード例 #1
0
ファイル: Enter.java プロジェクト: FCSu/DP2011Fall_hw07
 /**
  * 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;
 }