示例#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));
 }