/** Duplicate this environment, updating with given tree, * and copying all other fields. */ public Env<A> dup(JCTree tree) { return dup(tree, this.info); }
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; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = new Scope.DelegatedScope(env.info.scope); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || (env.enclClass.sym.flags() & INTERFACE) != 0) localEnv.info.staticLevel++; return localEnv; }
memberEnter(env.toplevel, env.enclosing(JCTree.TOPLEVEL)); todo.append(env);
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; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = env.info.scope.dupUnshared(); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || ((env.enclClass.sym.flags() & INTERFACE) != 0 && env.enclMethod == null)) localEnv.info.staticLevel++; return localEnv; }
memberEnter(env.toplevel, env.enclosing(JCTree.TOPLEVEL)); todo.append(env);
/** Duplicate this environment, updating with given tree, * and copying all other fields. */ public Env<A> dup(JCTree tree) { return dup(tree, this.info); }
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; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = new Scope.DelegatedScope(env.info.scope); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || (env.enclClass.sym.flags() & INTERFACE) != 0) localEnv.info.staticLevel++; return localEnv; }
memberEnter(env.toplevel, env.enclosing(TOPLEVEL)); todo.append(env);
/** Duplicate this environment, updating with given tree, * and copying all other fields. */ public Env<A> dup(JCTree tree) { return dup(tree, this.info); }
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; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = env.info.scope.dupUnshared(); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || ((env.enclClass.sym.flags() & INTERFACE) != 0 && env.enclMethod == null)) localEnv.info.staticLevel++; return localEnv; }
memberEnter(env.toplevel, env.enclosing(TOPLEVEL)); todo.append(env);
/** Duplicate this environment, updating with given tree, * and copying all other fields. */ public Env<A> dup(JCTree tree) { return dup(tree, this.info); }