equal
deleted
inserted
replaced
181 |
181 |
182 /** The name of the class that belongs to a basix type tag. |
182 /** The name of the class that belongs to a basix type tag. |
183 */ |
183 */ |
184 public final Name[] boxedName = new Name[TypeTags.TypeTagCount]; |
184 public final Name[] boxedName = new Name[TypeTags.TypeTagCount]; |
185 |
185 |
|
186 /** A set containing all operator names. |
|
187 */ |
|
188 public final Set<Name> operatorNames = new HashSet<Name>(); |
|
189 |
186 /** A hashtable containing the encountered top-level and member classes, |
190 /** A hashtable containing the encountered top-level and member classes, |
187 * indexed by flat names. The table does not contain local classes. |
191 * indexed by flat names. The table does not contain local classes. |
188 * It should be updated from the outside to reflect classes defined |
192 * It should be updated from the outside to reflect classes defined |
189 * by compiled source files. |
193 * by compiled source files. |
190 */ |
194 */ |
242 private void enterBinop(String name, |
246 private void enterBinop(String name, |
243 Type left, Type right, Type res, |
247 Type left, Type right, Type res, |
244 int opcode) { |
248 int opcode) { |
245 predefClass.members().enter( |
249 predefClass.members().enter( |
246 new OperatorSymbol( |
250 new OperatorSymbol( |
247 names.fromString(name), |
251 makeOperatorName(name), |
248 new MethodType(List.of(left, right), res, |
252 new MethodType(List.of(left, right), res, |
249 List.<Type>nil(), methodClass), |
253 List.<Type>nil(), methodClass), |
250 opcode, |
254 opcode, |
251 predefClass)); |
255 predefClass)); |
252 } |
256 } |
273 private OperatorSymbol enterUnop(String name, |
277 private OperatorSymbol enterUnop(String name, |
274 Type arg, |
278 Type arg, |
275 Type res, |
279 Type res, |
276 int opcode) { |
280 int opcode) { |
277 OperatorSymbol sym = |
281 OperatorSymbol sym = |
278 new OperatorSymbol(names.fromString(name), |
282 new OperatorSymbol(makeOperatorName(name), |
279 new MethodType(List.of(arg), |
283 new MethodType(List.of(arg), |
280 res, |
284 res, |
281 List.<Type>nil(), |
285 List.<Type>nil(), |
282 methodClass), |
286 methodClass), |
283 opcode, |
287 opcode, |
284 predefClass); |
288 predefClass); |
285 predefClass.members().enter(sym); |
289 predefClass.members().enter(sym); |
286 return sym; |
290 return sym; |
|
291 } |
|
292 |
|
293 /** |
|
294 * Create a new operator name from corresponding String representation |
|
295 * and add the name to the set of known operator names. |
|
296 */ |
|
297 private Name makeOperatorName(String name) { |
|
298 Name opName = names.fromString(name); |
|
299 operatorNames.add(opName); |
|
300 return opName; |
287 } |
301 } |
288 |
302 |
289 /** Enter a class into symbol table. |
303 /** Enter a class into symbol table. |
290 * @param The name of the class. |
304 * @param The name of the class. |
291 */ |
305 */ |