162 public final Name TYPE_USE;
163
164 // members of java.lang.annotation.RetentionPolicy
165 public final Name CLASS;
166 public final Name RUNTIME;
167 public final Name SOURCE;
168
169 // other identifiers
170 public final Name T;
171 public final Name deprecated;
172 public final Name ex;
173 public final Name package_info;
174 public final Name requireNonNull;
175
176 //lambda-related
177 public final Name lambda;
178 public final Name metafactory;
179 public final Name altMetafactory;
180 public final Name dollarThis;
181
182 public final Name.Table table;
183
184 public Names(Context context) {
185 Options options = Options.instance(context);
186 table = createTable(options);
187
188 // operators and punctuation
189 asterisk = fromString("*");
190 comma = fromString(",");
191 empty = fromString("");
192 hyphen = fromString("-");
193 one = fromString("1");
194 period = fromString(".");
195 semicolon = fromString(";");
196 slash = fromString("/");
197 slashequals = fromString("/=");
198
199 // keywords
200 _class = fromString("class");
201 _default = fromString("default");
299 TYPE = fromString("TYPE");
300 TYPE_PARAMETER = fromString("TYPE_PARAMETER");
301 TYPE_USE = fromString("TYPE_USE");
302
303 // members of java.lang.annotation.RetentionPolicy
304 CLASS = fromString("CLASS");
305 RUNTIME = fromString("RUNTIME");
306 SOURCE = fromString("SOURCE");
307
308 // other identifiers
309 T = fromString("T");
310 deprecated = fromString("deprecated");
311 ex = fromString("ex");
312 package_info = fromString("package-info");
313 requireNonNull = fromString("requireNonNull");
314
315 //lambda-related
316 lambda = fromString("lambda$");
317 metafactory = fromString("metafactory");
318 altMetafactory = fromString("altMetafactory");
319 }
320
321 protected Name.Table createTable(Options options) {
322 boolean useUnsharedTable = options.isSet("useUnsharedTable");
323 if (useUnsharedTable)
324 return UnsharedNameTable.create(this);
325 else
326 return SharedNameTable.create(this);
327 }
328
329 public void dispose() {
330 table.dispose();
331 }
332
333 public Name fromChars(char[] cs, int start, int len) {
334 return table.fromChars(cs, start, len);
335 }
336
337 public Name fromString(String s) {
338 return table.fromString(s);
|
162 public final Name TYPE_USE;
163
164 // members of java.lang.annotation.RetentionPolicy
165 public final Name CLASS;
166 public final Name RUNTIME;
167 public final Name SOURCE;
168
169 // other identifiers
170 public final Name T;
171 public final Name deprecated;
172 public final Name ex;
173 public final Name package_info;
174 public final Name requireNonNull;
175
176 //lambda-related
177 public final Name lambda;
178 public final Name metafactory;
179 public final Name altMetafactory;
180 public final Name dollarThis;
181
182 // string concat
183 public final Name makeConcat;
184 public final Name makeConcatWithConstants;
185
186 public final Name.Table table;
187
188 public Names(Context context) {
189 Options options = Options.instance(context);
190 table = createTable(options);
191
192 // operators and punctuation
193 asterisk = fromString("*");
194 comma = fromString(",");
195 empty = fromString("");
196 hyphen = fromString("-");
197 one = fromString("1");
198 period = fromString(".");
199 semicolon = fromString(";");
200 slash = fromString("/");
201 slashequals = fromString("/=");
202
203 // keywords
204 _class = fromString("class");
205 _default = fromString("default");
303 TYPE = fromString("TYPE");
304 TYPE_PARAMETER = fromString("TYPE_PARAMETER");
305 TYPE_USE = fromString("TYPE_USE");
306
307 // members of java.lang.annotation.RetentionPolicy
308 CLASS = fromString("CLASS");
309 RUNTIME = fromString("RUNTIME");
310 SOURCE = fromString("SOURCE");
311
312 // other identifiers
313 T = fromString("T");
314 deprecated = fromString("deprecated");
315 ex = fromString("ex");
316 package_info = fromString("package-info");
317 requireNonNull = fromString("requireNonNull");
318
319 //lambda-related
320 lambda = fromString("lambda$");
321 metafactory = fromString("metafactory");
322 altMetafactory = fromString("altMetafactory");
323
324 // string concat
325 makeConcat = fromString("makeConcat");
326 makeConcatWithConstants = fromString("makeConcatWithConstants");
327 }
328
329 protected Name.Table createTable(Options options) {
330 boolean useUnsharedTable = options.isSet("useUnsharedTable");
331 if (useUnsharedTable)
332 return UnsharedNameTable.create(this);
333 else
334 return SharedNameTable.create(this);
335 }
336
337 public void dispose() {
338 table.dispose();
339 }
340
341 public Name fromChars(char[] cs, int start, int len) {
342 return table.fromChars(cs, start, len);
343 }
344
345 public Name fromString(String s) {
346 return table.fromString(s);
|