UNIT_TYPE    = newTerm(Symbol.NONE, Names.Unit   , 0); BOOLEAN_TYPE = newTerm(Symbol.NONE, Names.Boolean, 0); BYTE_TYPE    = newTerm(Symbol.NONE, Names.Byte   , 0); SHORT_TYPE   = newTerm(Symbol.NONE, Names.Short  , 0); CHAR_TYPE    = newTerm(Symbol.NONE, Names.Char   , 0); INT_TYPE     = newTerm(Symbol.NONE, Names.Int    , 0); LONG_TYPE    = newTerm(Symbol.NONE, Names.Long   , 0); FLOAT_TYPE   = newTerm(Symbol.NONE, Names.Float  , 0); DOUBLE_TYPE  = newTerm(Symbol.NONE, Names.Double , 0); ARRAY_TYPE   = newTerm(Symbol.NONE, Names.Array  , 0);  initMethod(UNIT_TYPE   , Type.EMPTY_ARRAY, UNIT_CLASS.type()); initMethod(BOOLEAN_TYPE, Type.EMPTY_ARRAY, BOOLEAN_CLASS.type()); initMethod(BYTE_TYPE   , Type.EMPTY_ARRAY, BYTE_CLASS.type()); initMethod(SHORT_TYPE  , Type.EMPTY_ARRAY, SHORT_CLASS.type()); initMethod(CHAR_TYPE   , Type.EMPTY_ARRAY, CHAR_CLASS.type()); initMethod(INT_TYPE    , Type.EMPTY_ARRAY, INT_CLASS.type()); initMethod(LONG_TYPE   , Type.EMPTY_ARRAY, LONG_CLASS.type()); initMethod(FLOAT_TYPE  , Type.EMPTY_ARRAY, FLOAT_CLASS.type()); initMethod(DOUBLE_TYPE , Type.EMPTY_ARRAY, DOUBLE_CLASS.type()); initMethod(ARRAY_TYPE  , Type.EMPTY_ARRAY, Type.appliedType(ARRAY_CLASS.type(), new Type[]{ANYREF_TYPE()}));
    public Definitions(Global global) {        // make definitions accessible earlier to other components        global.definitions = this;        // force initialization of class Type        Type.localThisType.symbol();        // the root module        ROOT = TermSymbol.newJavaPackageModule(            Names.ROOT, Symbol.NONE, new PackageParser(global));        ROOT_CLASS = ROOT.moduleClass();        // the scala package        Symbol SCALA_PACKAGE = getClass(Names.scala);        // the top and bottom classes        ANY_CLASS = newClass(SCALA_PACKAGE, Names.Any, Modifiers.JAVA);	ANYVAL_CLASS = getClass(Names.scala_AnyVal);	ANYREF_CLASS = newAlias(SCALA_PACKAGE, Names.AnyRef, Modifiers.JAVA);        ALLREF_CLASS = newClass(SCALA_PACKAGE, Names.AllRef, 0);        ALL_CLASS = newClass(SCALA_PACKAGE, Names.All, 0);        // the java classes        JAVA_OBJECT_CLASS = getClass(Names.java_lang_Object);        JAVA_THROWABLE_CLASS = getClass(Names.java_lang_Throwable);        JAVA_STRING_CLASS = getClass(Names.java_lang_String);        // the scala value classes        UNIT_CLASS = getClass(Names.scala_Unit);        BOOLEAN_CLASS = getClass(Names.scala_Boolean);        BYTE_CLASS = getClass(Names.scala_Byte);        SHORT_CLASS = getClass(Names.scala_Short);        CHAR_CLASS = getClass(Names.scala_Char);        INT_CLASS = getClass(Names.scala_Int);        LONG_CLASS = getClass(Names.scala_Long);        FLOAT_CLASS = getClass(Names.scala_Float);        DOUBLE_CLASS = getClass(Names.scala_Double);        // the scala reference classes	OBJECT_CLASS = getClass(Names.scala_Object);        STRING_CLASS = newAlias(SCALA_PACKAGE, Names.String, 0);        REF_CLASS = getClass(Names.scala_Ref);        for (int i = 1; i < TUPLE_COUNT; i++) {            TUPLE_CLASS[i] = getClass(Names.scala_Tuple(i));            TUPLE_FIELD[i] = new Symbol[i];        }        for (int i = 0; i < FUNCTION_COUNT; i++)            FUNCTION_CLASS[i] = getClass(Names.scala_Function(i));	PARTIALFUNCTION_CLASS = getClass(Names.scala_PartialFunction);	ITERABLE_CLASS = getClass(Names.scala_Iterable);	ITERATOR_CLASS = getClass(Names.scala_Iterator);	SEQ_CLASS = getClass(Names.scala_Seq);	LIST_CLASS = getClass(Names.scala_List);        ARRAY_CLASS = getClass(Names.scala_Array);	MATCHERROR = getModule(Names.scala_MatchError);        // initialize generated classes and aliases        initClass(ANY_CLASS, Type.EMPTY_ARRAY);        initAlias(ANYREF_CLASS, JAVA_OBJECT_TYPE());        initClass(ALLREF_CLASS, new Type[]{ANYREF_TYPE()});        initClass(ALL_CLASS, new Type[]{ANY_TYPE()});        initAlias(STRING_CLASS, JAVA_STRING_TYPE());        // add members to scala.Any	ANY_EQ       = newTerm(ANY_CLASS, Names.eq          , 0);        ANY_EQEQ     = newTerm(ANY_CLASS, Names.EQEQ        , Modifiers.FINAL);        ANY_BANGEQ   = newTerm(ANY_CLASS, Names.BANGEQ      , Modifiers.FINAL);        ANY_EQUALS   = newTerm(ANY_CLASS, Names.equals      , 0);        ANY_HASHCODE = newTerm(ANY_CLASS, Names.hashCode    , 0);        ANY_TOSTRING = newTerm(ANY_CLASS, Names.toString    , 0);        // ANY_PLUS  = newTerm(ANY_CLASS, Names.PLUS        , Modifiers.FINAL);        ANY_IS       = newTerm(ANY_CLASS, Names.isInstanceOf, Modifiers.FINAL);        ANY_AS       = newTerm(ANY_CLASS, Names.asInstanceOf, Modifiers.FINAL);        ANY_MATCH    = newTerm(ANY_CLASS, Names.match       , Modifiers.FINAL);        initMethod(ANY_EQ      , new Type[]{ANY_TYPE()}   , BOOLEAN_TYPE());        initMethod(ANY_EQEQ    , new Type[]{ANY_TYPE()}   , BOOLEAN_TYPE());        initMethod(ANY_BANGEQ  , new Type[]{ANY_TYPE()}   , BOOLEAN_TYPE());        initMethod(ANY_EQUALS  , new Type[]{ANY_TYPE()}   , BOOLEAN_TYPE());        initMethod(ANY_HASHCODE, new Type[]{}             , INT_TYPE());        initMethod(ANY_TOSTRING, new Type[]{}             , STRING_TYPE());        // initMethod(ANY_PLUS , new Type[]{STRING_TYPE()}, STRING_TYPE());        Symbol[] ANY_IS_TPARAMS = {newTParam(ANY_IS, 0, ANY_TYPE())};        ANY_IS.setInfo(Type.PolyType(ANY_IS_TPARAMS, BOOLEAN_TYPE()));        Symbol[] ANY_AS_TPARAMS = {newTParam(ANY_AS, 0, ANY_TYPE())};        ANY_AS.setInfo(Type.PolyType(ANY_AS_TPARAMS,ANY_AS_TPARAMS[0].type()));	Symbol[] ANY_MATCH_TPARAMS = {            newTParam(ANY_MATCH, 0, ANY_TYPE()),            newTParam(ANY_MATCH, 1, ANY_TYPE())};	Symbol[] ANY_MATCH_VPARAMS = {            newVParam(ANY_MATCH, 0, FUNCTION_TYPE(                new Type[]{ANY_MATCH_TPARAMS[0].type()},                ANY_MATCH_TPARAMS[1].type()))};        ANY_MATCH.setInfo(	    Type.PolyType(		ANY_MATCH_TPARAMS,		Type.MethodType(                    ANY_MATCH_VPARAMS,                    ANY_MATCH_TPARAMS[1].type())));        // add members to java.lang.String        JAVA_STRING_PLUS =            newTerm(JAVA_STRING_CLASS, Names.PLUS, Modifiers.FINAL);        initMethod(JAVA_STRING_PLUS, new Type[]{ANY_TYPE()}, STRING_TYPE());        // add members to java.lang.Throwable        JAVA_THROWABLE_THROW =            newTerm(JAVA_THROWABLE_CLASS, Names.throw_, Modifiers.FINAL);        JAVA_THROWABLE_THROW.setInfo(            Type.PolyType(Symbol.EMPTY_ARRAY, ALL_TYPE()));        // create global values	NULL = newTerm(ROOT_CLASS, Names.null_, 0).setInfo(ALLREF_TYPE());	ZERO = newTerm(ROOT_CLASS, Names.ZERO, 0).setInfo(ALL_TYPE());        PATTERN_WILDCARD = newTerm(Symbol.NONE, Names.PATTERN_WILDCARD, 0)            .setType(ALL_TYPE());    }