Lines Matching refs:sym

168             classdefs.put(tree.sym, tree);
251 visitSymbol(tree.sym);
255 Symbol sym = _sym;
256 if (sym.kind == VAR || sym.kind == MTH) {
257 while (sym != null && sym.owner != owner)
258 sym = proxies.lookup(proxyName(sym.name)).sym;
259 if (sym != null && sym.owner == owner) {
260 VarSymbol v = (VarSymbol)sym;
589 cdef.sym = c;
604 * @param sym The symbol.
607 private void enterSynthetic(DiagnosticPosition pos, Symbol sym, Scope s) {
608 s.enter(sym);
645 chk.checkConflicts(that.pos(), that.sym, currentClass);
651 if (that.sym.owner.kind == TYP) {
652 chk.checkConflicts(that.pos(), that.sym, currentClass);
660 currentClass = that.sym;
675 Symbol sym = s.lookup(name).sym;
676 return (sym==null || (sym.flags()&SYNTHETIC)==0) ? null : sym;
714 cdef.sym = c;
724 && ((JCClassDecl) tree).sym == c) {
824 if (e.sym instanceof OperatorSymbol) {
825 OperatorSymbol op = (OperatorSymbol)e.sym;
881 * @param sym The accessed private symbol.
889 MethodSymbol accessSymbol(Symbol sym, JCTree tree, JCTree enclOp,
898 : accessClass(sym, protAccess, tree);
900 Symbol vsym = sym;
901 if (sym.owner != accOwner) {
902 vsym = sym.clone(accOwner);
903 actualSymbols.put(vsym, sym);
972 * This is either C.sym or C.this.sym, depending on whether or not
973 * sym is static.
974 * @param sym The accessed symbol.
976 JCExpression accessBase(DiagnosticPosition pos, Symbol sym) {
977 return (sym.flags() & STATIC) != 0
978 ? access(make.at(pos.getStartPosition()).QualIdent(sym.owner))
979 : makeOwnerThis(pos, sym, true);
984 boolean needsPrivateAccess(Symbol sym) {
985 if ((sym.flags() & PRIVATE) == 0 || sym.owner == currentClass) {
987 } else if (sym.name == names.init && (sym.owner.owner.kind & (VAR | MTH)) != 0) {
989 sym.flags_field &= ~PRIVATE;
998 boolean needsProtectedAccess(Symbol sym, JCTree tree) {
999 if ((sym.flags() & PROTECTED) == 0 ||
1000 sym.owner.owner == currentClass.owner || // fast special case
1001 sym.packge() == currentClass.packge())
1003 if (!currentClass.isSubClass(sym.owner, types))
1005 if ((sym.flags() & STATIC) != 0 ||
1013 * @param sym The access symbol
1017 ClassSymbol accessClass(Symbol sym, boolean protAccess, JCTree tree) {
1021 if (tree.getTag() == JCTree.SELECT && (sym.flags() & STATIC) == 0) {
1028 while (!c.isSubClass(sym.owner, types)) {
1035 return sym.owner.enclClass();
1040 * @param sym The accessed symbol.
1046 JCExpression access(Symbol sym, JCExpression tree, JCExpression enclOp, boolean refSuper) {
1048 while (sym.kind == VAR && sym.owner.kind == MTH &&
1049 sym.owner.enclClass() != currentClass) {
1051 Object cv = ((VarSymbol)sym).getConstValue();
1054 return makeLit(sym.type, cv);
1057 sym = proxies.lookup(proxyName(sym.name)).sym;
1058 Assert.check(sym != null && (sym.flags_field & FINAL) != 0);
1059 tree = make.at(tree.pos).Ident(sym);
1062 switch (sym.kind) {
1064 if (sym.owner.kind != PCK) {
1067 Name flatname = Convert.shortName(sym.flatName());
1078 tree = make.at(tree.pos).Ident(sym);
1087 if (sym.owner.kind == TYP) {
1094 boolean protAccess = refSuper && !needsPrivateAccess(sym)
1095 || needsProtectedAccess(sym, tree);
1096 boolean accReq = protAccess || needsPrivateAccess(sym);
1102 sym.owner != syms.predefClass &&
1103 !sym.isMemberOf(currentClass, types);
1109 if (sym.kind == VAR) {
1110 Object cv = ((VarSymbol)sym).getConstValue();
1111 if (cv != null) return makeLit(sym.type, cv);
1118 if ((sym.flags() & STATIC) == 0) {
1122 base = makeOwnerThis(tree.pos(), sym, true);
1126 Symbol access = accessSymbol(sym, tree,
1138 accessBase(tree.pos(), sym), sym).setType(tree.type);
1150 Symbol sym = TreeInfo.symbol(tree);
1151 return sym == null ? tree : access(sym, tree, null, false);
1205 * @param sym The symbol.
1207 void makeAccessible(Symbol sym) {
1208 JCClassDecl cdef = classDef(sym.owner.enclClass());
1209 if (cdef == null) Assert.error("class def not found: " + sym + " in " + sym.owner);
1210 if (sym.name == names.init) {
1212 accessConstructorDef(cdef.pos, sym, accessConstrs.get(sym)));
1214 MethodSymbol[] accessors = accessSyms.get(sym);
1218 accessDef(cdef.pos, sym, accessors[i], i));
1236 Symbol sym = actualSymbols.get(vsym);
1237 if (sym == null) sym = vsym;
1241 if ((sym.flags() & STATIC) != 0) {
1242 ref = make.Ident(sym);
1245 ref = make.Select(make.Ident(md.params.head), sym);
1249 if (sym.kind == VAR) {
1270 stat = make.Return(expr.setType(sym.type));
1298 callee.sym = constr;
1486 expr = make.Ident(var.sym).setType(resource.type);
1623 * @param sym The accessed symbol.
1625 * sym's owner, even if it doesn't contain sym
1629 JCExpression makeOwnerThis(DiagnosticPosition pos, Symbol sym, boolean preciseMatch) {
1630 Symbol c = sym.owner;
1631 if (preciseMatch ? sym.isMemberOf(currentClass, types)
1632 : currentClass.isSubClass(sym.owner, types)) {
1637 return makeOwnerThisN(pos, sym, preciseMatch);
1644 JCExpression makeOwnerThisN(DiagnosticPosition pos, Symbol sym, boolean preciseMatch) {
1645 Symbol c = sym.owner;
1655 while (!(preciseMatch ? sym.isMemberOf(otc, types) : otc.isSubClass(sym.owner, types))) {
1678 Symbol rhs = e.sym;
1680 Symbol lhs = e.next().sym;
1717 ClassSymbol clazz = outermostClassDef.sym;
1722 if (e.sym.kind == TYP &&
1723 e.sym.name == names.empty &&
1724 (e.sym.flags() & INTERFACE) == 0) return (ClassSymbol) e.sym;
1771 MethodSymbol classDollarSym = md.sym;
1825 List<JCExpression> args = List.of(make.Ident(md.params.head.sym),
1847 head.sym))))));
1966 VarSymbol sym = new VarSymbol(
1969 return make_at(pos).Select(make.Type(type), sym);
2005 ClassSymbol outermostClass = outermostClassDef.sym;
2069 if ((id.sym.flags() & FINAL) != 0 && id.sym.owner.kind == MTH)
2109 return builder.build(make.Select((JCExpression)selected, s.sym));
2222 packageAnnotationsClass.sym = c;
2248 currentClass = tree.sym;
2307 enterSynthetic(tree.pos(), l.head.sym, currentClass.members());
2311 enterSynthetic(tree.pos(), otdef.sym, currentClass.members());
2337 JCExpression e_class = classOfType(tree.sym.type, tree.pos()).
2351 values.append(make.QualIdent(var.sym));
2360 while (tree.sym.members().lookup(valuesName).scope != null) // avoid name clash
2372 tree.sym.members().enter(valuesVar);
2387 while (tree.sym.members().lookup(resultName).scope != null) // avoid name clash
2432 System.err.println(tree.sym + ".valuesDef = " + valuesDef);
2440 * where E is tree.sym
2444 tree.sym.type,
2450 make.Return(make.TypeCast(tree.sym.type,
2456 nameVal.sym = valueOf.params.head.sym;
2458 System.err.println(tree.sym + ".valueOf = " + valueOf);
2465 if (target.compilerBootstrap(tree.sym)) {
2474 return (e.sym != null);
2496 syms.stringType, tree.sym);
2497 nameParam.mods.flags |= SYNTHETIC; nameParam.sym.flags_field |= SYNTHETIC;
2503 syms.intType, tree.sym);
2504 ordParam.mods.flags |= SYNTHETIC; ordParam.sym.flags_field |= SYNTHETIC;
2508 MethodSymbol m = tree.sym;
2519 tree.sym.owner.members());
2520 JCIdent nameIdent = make.Ident(nameParam.sym);
2530 tree.sym.owner.members());
2531 JCIdent ordIdent = make.Ident(ordParam.sym);
2545 currentMethodSym = tree.sym;
2558 MethodSymbol m = tree.sym;
2687 tree.clazz = access(make_at(tree.clazz.pos()).Ident(tree.def.sym));
2807 .prepend(make_at(tree.pos()).Ident(params.tail.head.sym)) // ordinal
2808 .prepend(make.Ident(params.head.sym)); // name
3135 result = access(tree.sym, tree, enclOp, false);
3200 loopvardef.sym = tree.var.sym;
3283 indexDef.sym = tree.var.sym;
3602 result = access(tree.sym, tree, enclOp, qualifiedSuperAccess);
3716 cdef.sym);
3717 cdef.sym.members().enter(ordinal);
3726 cdef.sym);
3727 cdef.sym.members().enter(name);
3786 cdef.sym);
3795 cdef.sym.members().enter(toStringSym);
3804 List.of(cdef.sym.type));
3818 paramId1.sym = par1.sym;
3820 ((MethodSymbol)compareToSym).params = List.of(par1.sym);
3822 JCIdent par1UsageId = make.Ident(par1.sym);
3823 JCIdent castTargetIdent = make.Ident(cdef.sym);