49 * This code and its internal interfaces are subject to change or |
49 * This code and its internal interfaces are subject to change or |
50 * deletion without notice.</b> |
50 * deletion without notice.</b> |
51 */ |
51 */ |
52 public class Symtab { |
52 public class Symtab { |
53 /** The context key for the symbol table. */ |
53 /** The context key for the symbol table. */ |
54 protected static final Context.Key<Symtab> symtabKey = |
54 protected static final Context.Key<Symtab> symtabKey = new Context.Key<>(); |
55 new Context.Key<Symtab>(); |
|
56 |
55 |
57 /** Get the symbol table instance. */ |
56 /** Get the symbol table instance. */ |
58 public static Symtab instance(Context context) { |
57 public static Symtab instance(Context context) { |
59 Symtab instance = context.get(symtabKey); |
58 Symtab instance = context.get(symtabKey); |
60 if (instance == null) |
59 if (instance == null) |
188 */ |
187 */ |
189 public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()]; |
188 public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()]; |
190 |
189 |
191 /** A set containing all operator names. |
190 /** A set containing all operator names. |
192 */ |
191 */ |
193 public final Set<Name> operatorNames = new HashSet<Name>(); |
192 public final Set<Name> operatorNames = new HashSet<>(); |
194 |
193 |
195 /** A hashtable containing the encountered top-level and member classes, |
194 /** A hashtable containing the encountered top-level and member classes, |
196 * indexed by flat names. The table does not contain local classes. |
195 * indexed by flat names. The table does not contain local classes. |
197 * It should be updated from the outside to reflect classes defined |
196 * It should be updated from the outside to reflect classes defined |
198 * by compiled source files. |
197 * by compiled source files. |
199 */ |
198 */ |
200 public final Map<Name, ClassSymbol> classes = new HashMap<Name, ClassSymbol>(); |
199 public final Map<Name, ClassSymbol> classes = new HashMap<>(); |
201 |
200 |
202 /** A hashtable containing the encountered packages. |
201 /** A hashtable containing the encountered packages. |
203 * the table should be updated from outside to reflect packages defined |
202 * the table should be updated from outside to reflect packages defined |
204 * by compiled source files. |
203 * by compiled source files. |
205 */ |
204 */ |
206 public final Map<Name, PackageSymbol> packages = new HashMap<Name, PackageSymbol>(); |
205 public final Map<Name, PackageSymbol> packages = new HashMap<>(); |
207 |
206 |
208 public void initType(Type type, ClassSymbol c) { |
207 public void initType(Type type, ClassSymbol c) { |
209 type.tsym = c; |
208 type.tsym = c; |
210 typeOfTag[type.getTag().ordinal()] = type; |
209 typeOfTag[type.getTag().ordinal()] = type; |
211 } |
210 } |