public static TokenizerTable parseTokenizerDefinition(Cons definition) {
    { Vector transitiontable = Vector.newVector(Stella.$MAX_TOKENIZER_STATES$);
      StringBuffer transitions = edu.isi.stella.javalib.Native.makeMutableString(Stella.$MAX_TOKENIZER_CHARACTERS$, Stella.NULL_CHARACTER);
      Vector uniquestatenames = Vector.newVector(Stella.$MAX_TOKENIZER_STATES$);
      Vector statenames = Vector.newVector(Stella.$MAX_TOKENIZER_STATES$);
      Vector legaleofstates = Vector.newVector(Stella.$MAX_TOKENIZER_STATES$);
      GeneralizedSymbol fromstatename = null;
      int fromstateid = Stella.NULL_INTEGER;
      GeneralizedSymbol tostatename = null;
      GeneralizedSymbol tostatealias = null;
      int tostateid = Stella.NULL_INTEGER;
      int freestateid = 2;
      Stella_Object characterspec = null;
      Cons characterset = null;
      List allcharactersets = List.newList();
      int statemodifiers = 0;
      boolean errorsP = false;
      TokenizerTable table = TokenizerTable.newTokenizerTable();

      (uniquestatenames.theArray)[0] = Stella.KWD_ERROR;
      (statenames.theArray)[0] = Stella.KWD_ERROR;
      (uniquestatenames.theArray)[1] = Stella.KWD_START;
      (statenames.theArray)[1] = Stella.KWD_START;
      { Cons statedefinition = null;
        Cons iter000 = definition;

        loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          statedefinition = ((Cons)(iter000.value));
          if (!(Stella_Object.legalTokenizerFromStateP(statedefinition.value))) {
            Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal from state: `" + statedefinition.value + "'");
            errorsP = true;
            continue loop000;
          }
          fromstatename = ((GeneralizedSymbol)(statedefinition.value));
          statedefinition = statedefinition.rest;
          fromstateid = uniquestatenames.position(fromstatename, 0);
          if (fromstateid == Stella.NULL_INTEGER) {
            if (freestateid == Stella.$MAX_TOKENIZER_STATES$) {
              Stella.STANDARD_WARNING.nativeStream.println("Warning: Too many tokenizer states; maximum is `" + Stella.$MAX_TOKENIZER_STATES$ + "'");
              errorsP = true;
              break loop000;
            }
            (uniquestatenames.theArray)[freestateid] = fromstatename;
            (statenames.theArray)[freestateid] = fromstatename;
            fromstateid = freestateid;
            freestateid = freestateid + 1;
          }
          allcharactersets.clear();
          { int i = Stella.NULL_INTEGER;
            int iter001 = 0;
            int upperBound000 = Stella.$MAX_TOKENIZER_CHARACTERS$ - 1;

            for (;iter001 <= upperBound000; iter001 = iter001 + 1) {
              i = iter001;
              edu.isi.stella.javalib.Native.mutableString_nthSetter(transitions, ((char) 0), i);
            }
          }
          loop002 : while (!(statedefinition == Stella.NIL)) {
            if (Stella_Object.tokenizerIncludeSpecP(statedefinition.value)) {
              if (!(Stella_Object.legalTokenizerFromStateP(statedefinition.rest.value))) {
                Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal include specification for state `" + fromstatename + "'");
                errorsP = true;
                break loop002;
              }
              statedefinition = Cons.copyConsList(statedefinition);
              { Cons statedef = null;
                Cons iter002 = definition;

                loop003 : for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
                  statedef = ((Cons)(iter002.value));
                  if (Stella_Object.eqlP(statedef.value, statedefinition.rest.value)) {
                    statedefinition.firstSetter(statedef.rest.value);
                    statedefinition.rest = Cons.copyConsList(statedef.rest.rest).concatenate(statedefinition.rest.rest, Stella.NIL);
                    break loop003;
                  }
                }
              }
              continue loop002;
            }
            statemodifiers = Stella_Object.parseTokenizerStateModifiers(statedefinition.value);
            if (statemodifiers > 0) {
              statedefinition = statedefinition.rest;
            }
            characterspec = statedefinition.value;
            statedefinition = statedefinition.rest;
            if (!(characterspec != null)) {
              Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal definition of `" + fromstatename + "' state");
              errorsP = true;
              break loop002;
            }
            if (!(Stella_Object.legalTokenizerToStateP(statedefinition.value))) {
              Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal to state `" + statedefinition.value + "' for state `" + fromstatename + "'");
              errorsP = true;
              break loop002;
            }
            if (characterspec == Stella.KWD_EOF) {
              (legaleofstates.theArray)[fromstateid] = Stella.TRUE_WRAPPER;
              statedefinition = statedefinition.rest;
              continue loop002;
            }
            tostatename = Stella_Object.tokenizerToStateName(statedefinition.value);
            tostatealias = Stella_Object.tokenizerToStateAlias(statedefinition.value);
            statedefinition = statedefinition.rest;
            tostateid = uniquestatenames.position(tostatename, 0);
            if (tostateid == Stella.NULL_INTEGER) {
              if (freestateid == Stella.$MAX_TOKENIZER_STATES$) {
                Stella.STANDARD_WARNING.nativeStream.println("Warning: Too many tokenizer states; maximum is `" + Stella.$MAX_TOKENIZER_STATES$ + "'");
                errorsP = true;
                break loop002;
              }
              (uniquestatenames.theArray)[freestateid] = tostatename;
              (statenames.theArray)[freestateid] = tostatealias;
              tostateid = freestateid;
              freestateid = freestateid + 1;
            }
            if ((!(((GeneralizedSymbol)((statenames.theArray)[tostateid])) == tostatealias)) &&
                (((GeneralizedSymbol)((statenames.theArray)[tostateid])) != null)) {
              Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal redefinition of alias `" + tostatealias + "' for state `" + tostatename + "' in state `" + fromstatename + "'");
              errorsP = true;
            }
            characterset = Stella_Object.parseTokenizerCharacterSpec(characterspec, allcharactersets);
            if (characterset == null) {
              Stella.STANDARD_WARNING.nativeStream.println("Warning: Illegal character specification `" + characterspec + "' for state `" + fromstatename + "'");
              errorsP = true;
              continue loop002;
            }
            allcharactersets.push(characterset);
            { CharacterWrapper renamed_Char = null;
              Cons iter003 = characterset;

              for (;!(iter003 == Stella.NIL); iter003 = iter003.rest) {
                renamed_Char = ((CharacterWrapper)(iter003.value));
                edu.isi.stella.javalib.Native.mutableString_nthSetter(transitions, ((char) ((((statemodifiers << 6)) | tostateid))), ((int) (renamed_Char.wrapperValue)));
              }
            }
          }
          (transitiontable.theArray)[fromstateid] = (MutableStringWrapper.wrapMutableString(transitions));
          transitions = edu.isi.stella.javalib.Native.makeMutableString(Stella.$MAX_TOKENIZER_CHARACTERS$, Stella.NULL_CHARACTER);
        }
      }
      { int i = Stella.NULL_INTEGER;
        int iter004 = 0;
        int upperBound001 = freestateid - 1;

        for (;iter004 <= upperBound001; iter004 = iter004 + 1) {
          i = iter004;
          if (((MutableStringWrapper)((transitiontable.theArray)[i])) == null) {
            Stella.STANDARD_WARNING.nativeStream.println("Warning: State `" + ((GeneralizedSymbol)((uniquestatenames.theArray)[i])) + "' is undefined");
            errorsP = true;
          }
        }
      }
      if (errorsP) {
        return (null);
      }
      transitions = edu.isi.stella.javalib.Native.makeMutableString((freestateid * Stella.$MAX_TOKENIZER_CHARACTERS$), Stella.NULL_CHARACTER);
      { int i = Stella.NULL_INTEGER;
        int iter005 = 0;
        int upperBound002 = freestateid - 1;

        for (;iter005 <= upperBound002; iter005 = iter005 + 1) {
          i = iter005;
          { int j = Stella.NULL_INTEGER;
            int iter006 = 0;
            int upperBound003 = Stella.$MAX_TOKENIZER_CHARACTERS$ - 1;
            int k = Stella.NULL_INTEGER;
            int iter007 = Stella.$MAX_TOKENIZER_CHARACTERS$ * i;

            for (;iter006 <= upperBound003; iter006 = iter006 + 1, iter007 = iter007 + 1) {
              j = iter006;
              k = iter007;
              edu.isi.stella.javalib.Native.mutableString_nthSetter(transitions, ((((MutableStringWrapper)((transitiontable.theArray)[i])).wrapperValue).charAt(j)), k);
            }
          }
        }
      }
      table.transitions = transitions.toString();
      table.uniqueStateNames = Vector.newVector(freestateid);
      table.stateNames = Vector.newVector(freestateid);
      { int i = Stella.NULL_INTEGER;
        int iter008 = 0;
        int upperBound004 = freestateid - 1;

        for (;iter008 <= upperBound004; iter008 = iter008 + 1) {
          i = iter008;
          (table.uniqueStateNames.theArray)[i] = (((GeneralizedSymbol)((uniquestatenames.theArray)[i])));
          (table.stateNames.theArray)[i] = (((GeneralizedSymbol)((statenames.theArray)[i])));
        }
      }
      table.legalEofStates = Vector.newVector(freestateid);
      { int i = Stella.NULL_INTEGER;
        int iter009 = 0;
        int upperBound005 = freestateid - 1;

        for (;iter009 <= upperBound005; iter009 = iter009 + 1) {
          i = iter009;
          (table.legalEofStates.theArray)[i] = (((((BooleanWrapper)((legaleofstates.theArray)[i])) == null) ? Stella.FALSE_WRAPPER : ((BooleanWrapper)((legaleofstates.theArray)[i]))));
        }
      }
      return (table);
    }
  }