public static void startupUnits() {
    { Object old$Module$000 = Stella.$MODULE$.get();
      Object old$Context$000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/UTILITIES", Stella.$STARTUP_TIME_PHASE$ > 1));
        Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
        if (Stella.currentStartupTimePhaseP(2)) {
          _StartupUnits.helpStartupUnits1();
        }
        if (Stella.currentStartupTimePhaseP(4)) {
          _StartupUnits.helpStartupUnits2();
        }
        if (Stella.currentStartupTimePhaseP(5)) {
          { Stella_Class renamed_Class = Stella.defineClassFromStringifiedSource("INCOMPATIBLE-UNITS-EXCEPTION", "(DEFCLASS INCOMPATIBLE-UNITS-EXCEPTION (INCOMPATIBLE-QUANTITY-EXCEPTION) :PUBLIC? TRUE)");

            renamed_Class.classConstructorCode = Native.find_java_method("edu.isi.stella.utilities.IncompatibleUnitsException", "newIncompatibleUnitsException", new java.lang.Class [] {Native.find_java_class("java.lang.String")});
          }
          { Stella_Class renamed_Class = Stella.defineClassFromStringifiedSource("RATIO", "(DEFCLASS RATIO (QUANTITY) :PUBLIC? TRUE :PUBLIC-SLOTS ((NUMERATOR :TYPE INTEGER :REQUIRED? TRUE) (DENOMINATOR :TYPE INTEGER :REQUIRED? TRUE)) :PRINT-FORM (PRINT-STREAM STREAM (NUMERATOR SELF) \"/\" (DENOMINATOR SELF)))");

            renamed_Class.classConstructorCode = Native.find_java_method("edu.isi.stella.utilities.Ratio", "newRatio", new java.lang.Class [] {java.lang.Integer.TYPE, java.lang.Integer.TYPE});
            renamed_Class.classSlotAccessorCode = Native.find_java_method("edu.isi.stella.utilities.Ratio", "accessRatioSlotValue", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.Ratio"), Native.find_java_class("edu.isi.stella.Symbol"), Native.find_java_class("edu.isi.stella.Stella_Object"), java.lang.Boolean.TYPE});
          }
          { Stella_Class renamed_Class = Stella.defineClassFromStringifiedSource("MEASURE", "(DEFCLASS MEASURE (STANDARD-OBJECT) :PUBLIC? TRUE :PUBLIC-SLOTS ((BASE-UNIT :TYPE STRING) (SCALE :TYPE (KEY-VALUE-LIST OF STRING-WRAPPER FLOAT-WRAPPER) :INITIALLY (NEW KEY-VALUE-LIST)) (PRIME-ID :TYPE RATIO) (NAME :TYPE STRING)) :PRINT-FORM (PRINT-NATIVE-STREAM STREAM \"<Measure \" (NAME SELF) \"(\" (BASE-UNIT SELF) \")>\"))");

            renamed_Class.classConstructorCode = Native.find_java_method("edu.isi.stella.utilities.Measure", "newMeasure", new java.lang.Class [] {});
            renamed_Class.classSlotAccessorCode = Native.find_java_method("edu.isi.stella.utilities.Measure", "accessMeasureSlotValue", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.Measure"), Native.find_java_class("edu.isi.stella.Symbol"), Native.find_java_class("edu.isi.stella.Stella_Object"), java.lang.Boolean.TYPE});
          }
          { Stella_Class renamed_Class = Stella.defineClassFromStringifiedSource("DIM-NUMBER", "(DEFCLASS DIM-NUMBER (QUANTITY) :PUBLIC? TRUE :PUBLIC-SLOTS ((PID :TYPE RATIO :REQUIRED? TRUE) (MAGNITUDE :TYPE FLOAT :REQUIRED? TRUE) (PREFERRED-UNITS :TYPE STRING :INITIALLY NULL)) :PRINT-FORM (PRINT-STREAM STREAM \"<\" (GET-MAGNITUDE SELF (GET-UNIT SELF)) (GET-UNIT SELF) \">\"))");

            renamed_Class.classConstructorCode = Native.find_java_method("edu.isi.stella.utilities.DimNumber", "newDimNumber", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.Ratio"), java.lang.Double.TYPE});
            renamed_Class.classSlotAccessorCode = Native.find_java_method("edu.isi.stella.utilities.DimNumber", "accessDimNumberSlotValue", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.DimNumber"), Native.find_java_class("edu.isi.stella.Symbol"), Native.find_java_class("edu.isi.stella.Stella_Object"), java.lang.Boolean.TYPE});
          }
        }
        if (Stella.currentStartupTimePhaseP(6)) {
          Stella.finalizeClasses();
        }
        if (Stella.currentStartupTimePhaseP(7)) {
          _StartupUnits.helpStartupUnits3();
          Stella.defineFunctionObject("DMS-TO-DEGREES", "(DEFUN (DMS-TO-DEGREES DIM-NUMBER) ((L (CONS OF DIM-NUMBER))) :PUBLIC? TRUE :DOCUMENTATION \"Converts a (Degree Minute Second) to decimal degrees.\")", Native.find_java_method("edu.isi.stella.utilities.Utilities", "dmsToDegrees", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.Cons")}), null);
          Stella.defineFunctionObject("DEGREES-TO-DMS", "(DEFUN (DEGREES-TO-DMS (CONS OF DIM-NUMBER)) ((D DIM-NUMBER)) :PUBLIC? TRUE :DOCUMENTATION \"Convert decimal degrees to a list of (Degree Minute Second)\nwhere Degree and Minute are integer-valued.\")", Native.find_java_method("edu.isi.stella.utilities.DimNumber", "degreesToDms", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.DimNumber")}), null);
          Stella.defineFunctionObject("HMS-TO-HOURS", "(DEFUN (HMS-TO-HOURS DIM-NUMBER) ((L (CONS OF DIM-NUMBER))) :PUBLIC? TRUE :DOCUMENTATION \"Converts a (Hour Minute Second) to decimal hours\")", Native.find_java_method("edu.isi.stella.utilities.Utilities", "hmsToHours", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.Cons")}), null);
          Stella.defineFunctionObject("HOURS-TO-HMS", "(DEFUN (HOURS-TO-HMS (CONS OF DIM-NUMBER)) ((D DIM-NUMBER)) :PUBLIC? TRUE :DOCUMENTATION \"Convert decimal hours to a list of (Hour Minute Second)\nwhere Hour and Minute are integer-valued.\")", Native.find_java_method("edu.isi.stella.utilities.DimNumber", "hoursToHms", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.utilities.DimNumber")}), null);
          Stella.defineFunctionObject("SHOW-MEASURES", "(DEFUN SHOW-MEASURES () :PUBLIC? TRUE :COMMAND? TRUE :DOCUMENTATION \"Print all defined measures.\")", Native.find_java_method("edu.isi.stella.utilities.Utilities", "showMeasures", new java.lang.Class [] {}), null);
          Stella.defineFunctionObject("SHOW-MEASURE", "(DEFUN SHOW-MEASURE ((MEASURE-NAME STRING)) :PUBLIC? TRUE :COMMAND? TRUE :DOCUMENTATION \"Print all units and scale factors for measure `measure-name'.\")", Native.find_java_method("edu.isi.stella.utilities.Utilities", "showMeasure", new java.lang.Class [] {Native.find_java_class("java.lang.String")}), Native.find_java_method("edu.isi.stella.utilities.Utilities", "showMeasureEvaluatorWrapper", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.Cons")}));
          Stella.defineFunctionObject("STARTUP-UNITS", "(DEFUN STARTUP-UNITS () :PUBLIC? TRUE)", Native.find_java_method("edu.isi.stella.utilities._StartupUnits", "startupUnits", new java.lang.Class [] {}), null);
          { MethodSlot function = Symbol.lookupFunction(Utilities.SYM_UTILITIES_STARTUP_UNITS);

            KeyValueList.setDynamicSlotValue(function.dynamicSlots, Utilities.SYM_STELLA_METHOD_STARTUP_CLASSNAME, StringWrapper.wrapString("_StartupUnits"), Stella.NULL_STRING_WRAPPER);
          }
        }
        if (Stella.currentStartupTimePhaseP(8)) {
          Stella.finalizeSlots();
          Stella.cleanupUnfinalizedClasses();
        }
        if (Stella.currentStartupTimePhaseP(9)) {
          Stella_Object.inModule(((StringWrapper)(Stella_Object.copyConsTree(StringWrapper.wrapString("UTILITIES")))));
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *PRIME-NUMBERS* (CONS OF INTEGER-WRAPPER) (QUOTE (2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)) :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *CURRENT-PRIME-INDEX* INTEGER -1 :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *PRIME-TO-MEASURE-TABLE* (STELLA-HASH-TABLE OF RATIO MEASURE) (NEW STELLA-HASH-TABLE) :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *PRIME-TO-BASE-MEASURE-TABLE* (INTEGER-HASH-TABLE OF INTEGER MEASURE) (NEW INTEGER-HASH-TABLE) :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *NAME-TO-MEASURE-TABLE* (STRING-HASH-TABLE OF STRING MEASURE) (NEW STRING-HASH-TABLE) :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *UNIT-TO-MEASURE-TABLE* (STRING-HASH-TABLE OF STRING MEASURE) (NEW STRING-HASH-TABLE) :PUBLIC? FALSE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *ALL-MEASURES* (CONS OF MEASURE) NIL :PUBLIC? TRUE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *BASE-MEASURES* (CONS OF MEASURE) NIL :PUBLIC? TRUE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *RATIO-ONE* RATIO (NEW RATIO :NUMERATOR 1 :DENOMINATOR 1) :PUBLIC? TRUE)");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *UNIT-TOKENIZER-TABLE-DEFINITION* CONS (BQUOTE ((:START * \"-+0123456789\" :INTEGER * \".\" :DELIMITER * \"/\" :FRACTION * \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%\" :UNIT :EOF :EOF :OTHERWISE :ERROR) (:UNIT * \"-+0123456789\" :INTEGER * \".\" :DELIMITER * \"/\" :FRACTION \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%\" :UNIT :EOF :EOF :OTHERWISE :ERROR) (:INTEGER \"-+0123456789\" :INTEGER * \".\" :DELIMITER * \"/\" :FRACTION * \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%\" :UNIT :EOF :EOF :OTHERWISE :ERROR) (:FRACTION :INCLUDE :START) (:DELIMITER :INCLUDE :START) (:ERROR :INCLUDE :START))))");
          Stella.defineStellaGlobalVariableFromStringifiedSource("(DEFGLOBAL *UNIT-TOKENIZER-TABLE* TOKENIZER-TABLE NULL)");
          Utilities.$UNIT_TOKENIZER_TABLE$ = Cons.parseTokenizerDefinition(Utilities.$UNIT_TOKENIZER_TABLE_DEFINITION$);
          Utilities.resetMeasures();
          Utilities.initializeUnitDefinitions();
        }

      } finally {
        Stella.$CONTEXT$.set(old$Context$000);
        Stella.$MODULE$.set(old$Module$000);
      }
    }
  }