/** Enter a synthetic symbol in a given scope, but complain if there was already one there. * @param pos Position for error reporting. * @param sym The symbol. * @param s The scope. */ private void enterSynthetic(DiagnosticPosition pos, Symbol sym, Scope s) { s.enter(sym); }
/** Enter a synthetic symbol in a given scope, but complain if there was already one there. * @param pos Position for error reporting. * @param sym The symbol. * @param s The scope. */ private void enterSynthetic(DiagnosticPosition pos, Symbol sym, Scope s) { s.enter(sym); }
/** Add member to class unless it is synthetic. */ private void enterMember(ClassSymbol c, Symbol sym) { if ((sym.flags_field & (SYNTHETIC|BRIDGE)) != SYNTHETIC) c.members_field.enter(sym); }
/** Enter symbol sym in this scope. */ public void enter(Symbol sym) { assert shared == 0; enter(sym, this); }
/** Enter symbol sym in this scope. */ public void enter(Symbol sym) { assert shared == 0; enter(sym, this); }
@Override public void visitVarDef(JCVariableDecl tree) { enclosedSymbols.enter(tree.sym); super.visitVarDef(tree); } @Override
/** Add any variables defined in stats to the switch scope. */ private static void addVars(List<JCStatement> stats, Scope switchScope) { for (;stats.nonEmpty(); stats = stats.tail) { JCTree stat = stats.head; if (stat.tag == JCTree.VARDEF) switchScope.enter(((JCVariableDecl) stat).sym); } } // where
/** Enter symbol sym in this scope. */ public void enter(Symbol sym) { Assert.check(shared == 0); enter(sym, this); }
/** Import given class. * @param pos Position to be used for error reporting. * @param tsym The class to be imported. * @param env The environment containing the named import * scope to add to. */ private void importNamed(DiagnosticPosition pos, Symbol tsym, Env<AttrContext> env) { if (tsym.kind == TYP && chk.checkUniqueImport(pos, tsym, env.toplevel.namedImportScope)) env.toplevel.namedImportScope.enter(tsym, tsym.owner.members()); }
/** Add any variables defined in stats to the switch scope. */ private static void addVars(List<JCStatement> stats, Scope switchScope) { for (;stats.nonEmpty(); stats = stats.tail) { JCTree stat = stats.head; if (stat.hasTag(VARDEF)) switchScope.enter(((JCVariableDecl) stat).sym); } } // where
/** Import given class. * @param pos Position to be used for error reporting. * @param tsym The class to be imported. * @param env The environment containing the named import * scope to add to. */ private void importNamed(DiagnosticPosition pos, Symbol tsym, Env<AttrContext> env) { if (tsym.kind == TYP && chk.checkUniqueImport(pos, tsym, env.toplevel.namedImportScope)) env.toplevel.namedImportScope.enter(tsym, tsym.owner.members()); }
/** Enter symbol sym in this scope if not already there. */ public void enterIfAbsent(Symbol sym) { assert shared == 0; Entry e = lookup(sym.name); while (e.scope == this && e.sym.kind != sym.kind) e = e.next(); if (e.scope != this) enter(sym); }
private VarSymbol addEnumNameField(JCClassDecl cdef) { VarSymbol name = new VarSymbol(PRIVATE|FINAL|SYNTHETIC, names.fromString("$name"), syms.stringType, cdef.sym); cdef.sym.members().enter(name); cdef.defs = cdef.defs.prepend(make.VarDef(name, null)); return name; }
private VarSymbol addEnumOrdinalField(JCClassDecl cdef) { VarSymbol ordinal = new VarSymbol(PRIVATE|FINAL|SYNTHETIC, names.fromString("$ordinal"), syms.intType, cdef.sym); cdef.sym.members().enter(ordinal); cdef.defs = cdef.defs.prepend(make.VarDef(ordinal, null)); return ordinal; }
private VarSymbol addEnumOrdinalField(JCClassDecl cdef) { VarSymbol ordinal = new VarSymbol(PRIVATE|FINAL|SYNTHETIC, names.fromString("$ordinal"), syms.intType, cdef.sym); cdef.sym.members().enter(ordinal); cdef.defs = cdef.defs.prepend(make.VarDef(ordinal, null)); return ordinal; }
private VarSymbol addEnumNameField(JCClassDecl cdef) { VarSymbol name = new VarSymbol(PRIVATE|FINAL|SYNTHETIC, names.fromString("$name"), syms.stringType, cdef.sym); cdef.sym.members().enter(name); cdef.defs = cdef.defs.prepend(make.VarDef(name, null)); return name; }
/** Enter type variables of this classtype and all enclosing ones in * `typevars'. */ protected void enterTypevars(Type t) { if (t.getEnclosingType() != null && t.getEnclosingType().tag == CLASS) enterTypevars(t.getEnclosingType()); for (List<Type> xs = t.getTypeArguments(); xs.nonEmpty(); xs = xs.tail) typevars.enter(xs.head.tsym); }
/** Enter type variables of this classtype and all enclosing ones in * `typevars'. */ protected void enterTypevars(Type t) { if (t.getEnclosingType() != null && t.getEnclosingType().tag == CLASS) enterTypevars(t.getEnclosingType()); for (List<Type> xs = t.getTypeArguments(); xs.nonEmpty(); xs = xs.tail) typevars.enter(xs.head.tsym); }
/** Enter type variables of this classtype and all enclosing ones in * `typevars'. */ protected void enterTypevars(Type t) { if (t.getEnclosingType() != null && t.getEnclosingType().hasTag(CLASS)) enterTypevars(t.getEnclosingType()); for (List<Type> xs = t.getTypeArguments(); xs.nonEmpty(); xs = xs.tail) typevars.enter(xs.head.tsym); }
@Override protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { Scope sc = new Scope(syms.arrayClass); MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass); sc.enter(arrayConstr); return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false); }