Пример #1
0
 /**
  * Enter a unary operation into symbol table.
  *
  * @param name The name of the operator.
  * @param arg The type of the operand.
  * @param res The operation's result type.
  * @param opcode The operation's bytecode instruction.
  */
 private OperatorSymbol enterUnop(String name, Type arg, Type res, int opcode) {
   OperatorSymbol sym =
       new OperatorSymbol(
           names.fromString(name),
           new MethodType(List.make(arg), res, Type.emptyList, methodClass),
           opcode,
           predefClass);
   predefClass.members().enter(sym);
   return sym;
 }
Пример #2
0
 /**
  * Enter a binary operation into symbol table.
  *
  * @param name The name of the operator.
  * @param left The type of the left operand.
  * @param right The type of the left operand.
  * @param res The operation's result type.
  * @param opcode The operation's bytecode instruction.
  */
 private void enterBinop(String name, Type left, Type right, Type res, int opcode) {
   predefClass
       .members()
       .enter(
           new OperatorSymbol(
               names.fromString(name),
               new MethodType(List.make(left, right), res, Type.emptyList, methodClass),
               opcode,
               predefClass));
 }
Пример #3
0
 /**
  * Enter a class into symbol table.
  *
  * @param The name of the class.
  */
 private Type enterClass(String s) {
   return reader.enterClass(names.fromString(s)).type;
 }
Пример #4
0
 /**
  * Enter a constant into symbol table.
  *
  * @param name The constant's name.
  * @param type The constant's type.
  */
 private VarSymbol enterConstant(String name, Type type) {
   VarSymbol c = new VarSymbol(PUBLIC | STATIC | FINAL, names.fromString(name), type, predefClass);
   c.constValue = type.constValue;
   predefClass.members().enter(c);
   return c;
 }
Пример #5
0
 public void initType(Type type, String name, String bname) {
   initType(type, name);
   boxedName[type.tag] = names.fromString("java.lang." + bname);
 }
Пример #6
0
 public void initType(Type type, String name) {
   initType(type, new ClassSymbol(PUBLIC, names.fromString(name), type, rootPackage));
 }