/** * 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; }
/** * 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)); }
/** * Enter a class into symbol table. * * @param The name of the class. */ private Type enterClass(String s) { return reader.enterClass(names.fromString(s)).type; }
/** * 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; }
public void initType(Type type, String name, String bname) { initType(type, name); boxedName[type.tag] = names.fromString("java.lang." + bname); }
public void initType(Type type, String name) { initType(type, new ClassSymbol(PUBLIC, names.fromString(name), type, rootPackage)); }