public IElementType advance() throws java.io.IOException
  {
    int zzInput;
    int zzAction;

    // cached fields:
    int zzCurrentPosL;
    int zzMarkedPosL;
    int zzEndReadL = zzEndRead;
    CharSequence zzBufferL = zzBuffer;

    int [] zzTransL = ZZ_TRANS;
    int [] zzRowMapL = ZZ_ROWMAP;
    int [] zzAttrL = ZZ_ATTRIBUTE;

    while (true) {
      zzMarkedPosL = zzMarkedPos;

      zzAction = -1;

      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;

      zzState = ZZ_LEXSTATE[zzLexicalState];

      // set up zzAction for empty match case:
      int zzAttributes = zzAttrL[zzState];
      if ( (zzAttributes & 1) == 1 ) {
        zzAction = zzState;
      }


      zzForAction: {
        while (true) {

          if (zzCurrentPosL < zzEndReadL) {
            zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL);
            zzCurrentPosL += Character.charCount(zzInput);
          }
          else if (zzAtEOF) {
            zzInput = YYEOF;
            break zzForAction;
          }
          else {
            // store back cached positions
            zzCurrentPos  = zzCurrentPosL;
            zzMarkedPos   = zzMarkedPosL;
            boolean eof = zzRefill();
            // get translated positions and possibly new buffer
            zzCurrentPosL  = zzCurrentPos;
            zzMarkedPosL   = zzMarkedPos;
            zzBufferL      = zzBuffer;
            zzEndReadL     = zzEndRead;
            if (eof) {
              zzInput = YYEOF;
              break zzForAction;
            }
            else {
              zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL);
              zzCurrentPosL += Character.charCount(zzInput);
            }
          }
          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ];
          if (zzNext == -1) break zzForAction;
          zzState = zzNext;

          zzAttributes = zzAttrL[zzState];
          if ( (zzAttributes & 1) == 1 ) {
            zzAction = zzState;
            zzMarkedPosL = zzCurrentPosL;
            if ( (zzAttributes & 8) == 8 ) break zzForAction;
          }

        }
      }

      // store back cached position
      zzMarkedPos = zzMarkedPosL;

      if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
        zzAtEOF = true;
        return null;
      }
      else {
        switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
          case 1:
            { return PyTokenTypes.BAD_CHARACTER;
            }
          // fall through
          case 133: break;
          case 2:
            { return PyTokenTypes.TAB;
            }
          // fall through
          case 134: break;
          case 3:
            { if (zzCurrentPos == 0 && !isConsole()) yybegin(PENDING_DOCSTRING); return PyTokenTypes.LINE_BREAK;
            }
          // fall through
          case 135: break;
          case 4:
            { return PyTokenTypes.FORMFEED;
            }
          // fall through
          case 136: break;
          case 5:
            { return PyTokenTypes.SPACE;
            }
          // fall through
          case 137: break;
          case 6:
            { if (zzInput == YYEOF && zzStartRead == 0 && !isConsole()) return PyTokenTypes.DOCSTRING;
                                 else return PyTokenTypes.SINGLE_QUOTED_STRING;
            }
          // fall through
          case 138: break;
          case 7:
            { if (zzCurrentPos == 0 && !isConsole()) yybegin(PENDING_DOCSTRING); return PyTokenTypes.END_OF_LINE_COMMENT;
            }
          // fall through
          case 139: break;
          case 8:
            { return PyTokenTypes.PERC;
            }
          // fall through
          case 140: break;
          case 9:
            { return PyTokenTypes.AND;
            }
          // fall through
          case 141: break;
          case 10:
            { return PyTokenTypes.LPAR;
            }
          // fall through
          case 142: break;
          case 11:
            { return PyTokenTypes.RPAR;
            }
          // fall through
          case 143: break;
          case 12:
            { return PyTokenTypes.MULT;
            }
          // fall through
          case 144: break;
          case 13:
            { return PyTokenTypes.PLUS;
            }
          // fall through
          case 145: break;
          case 14:
            { return PyTokenTypes.COMMA;
            }
          // fall through
          case 146: break;
          case 15:
            { return PyTokenTypes.MINUS;
            }
          // fall through
          case 147: break;
          case 16:
            { return PyTokenTypes.DOT;
            }
          // fall through
          case 148: break;
          case 17:
            { return PyTokenTypes.DIV;
            }
          // fall through
          case 149: break;
          case 18:
            { return PyTokenTypes.INTEGER_LITERAL;
            }
          // fall through
          case 150: break;
          case 19:
            { return PyTokenTypes.COLON;
            }
          // fall through
          case 151: break;
          case 20:
            { return PyTokenTypes.SEMICOLON;
            }
          // fall through
          case 152: break;
          case 21:
            { return PyTokenTypes.LT;
            }
          // fall through
          case 153: break;
          case 22:
            { return PyTokenTypes.EQ;
            }
          // fall through
          case 154: break;
          case 23:
            { return PyTokenTypes.GT;
            }
          // fall through
          case 155: break;
          case 24:
            { return PyTokenTypes.AT;
            }
          // fall through
          case 156: break;
          case 25:
            { return PyTokenTypes.IDENTIFIER;
            }
          // fall through
          case 157: break;
          case 26:
            { return PyTokenTypes.LBRACKET;
            }
          // fall through
          case 158: break;
          case 27:
            { return PyTokenTypes.BACKSLASH;
            }
          // fall through
          case 159: break;
          case 28:
            { return PyTokenTypes.RBRACKET;
            }
          // fall through
          case 160: break;
          case 29:
            { return PyTokenTypes.XOR;
            }
          // fall through
          case 161: break;
          case 30:
            { return PyTokenTypes.TICK;
            }
          // fall through
          case 162: break;
          case 31:
            { return PyTokenTypes.LBRACE;
            }
          // fall through
          case 163: break;
          case 32:
            { return PyTokenTypes.OR;
            }
          // fall through
          case 164: break;
          case 33:
            { return PyTokenTypes.RBRACE;
            }
          // fall through
          case 165: break;
          case 34:
            { return PyTokenTypes.TILDE;
            }
          // fall through
          case 166: break;
          case 35:
            { yypushback(1); yybegin(YYINITIAL);
            }
          // fall through
          case 167: break;
          case 36:
            { return PyTokenTypes.LINE_BREAK;
            }
          // fall through
          case 168: break;
          case 37:
            { if (zzInput == YYEOF) return PyTokenTypes.DOCSTRING;
                                 else yybegin(YYINITIAL); return PyTokenTypes.SINGLE_QUOTED_STRING;
            }
          // fall through
          case 169: break;
          case 38:
            { return PyTokenTypes.END_OF_LINE_COMMENT;
            }
          // fall through
          case 170: break;
          case 39:
            { return PyTokenTypes.SINGLE_QUOTED_STRING;
            }
          // fall through
          case 171: break;
          case 40:
            { return fStringHelper.getTextTokenType();
            }
          // fall through
          case 172: break;
          case 41:
            { return fStringHelper.handleLineBreakInLiteralText();
            }
          // fall through
          case 173: break;
          case 42:
            { return fStringHelper.handleFStringEnd();
            }
          // fall through
          case 174: break;
          case 43:
            { return fStringHelper.handleFragmentStart();
            }
          // fall through
          case 175: break;
          case 44:
            { return fStringHelper.handleLineBreakInFragment();
            }
          // fall through
          case 176: break;
          case 45:
            { return PyTokenTypes.FSTRING_FRAGMENT_TYPE_CONVERSION;
            }
          // fall through
          case 177: break;
          case 46:
            { return fStringHelper.handleStringLiteral(PyTokenTypes.SINGLE_QUOTED_STRING);
            }
          // fall through
          case 178: break;
          case 47:
            { return fStringHelper.handleLeftBracketInFragment(PyTokenTypes.LPAR);
            }
          // fall through
          case 179: break;
          case 48:
            { return fStringHelper.handleRightBracketInFragment(PyTokenTypes.RPAR);
            }
          // fall through
          case 180: break;
          case 49:
            { return fStringHelper.handleColonInFragment();
            }
          // fall through
          case 181: break;
          case 50:
            { return fStringHelper.handleLeftBracketInFragment(PyTokenTypes.LBRACKET);
            }
          // fall through
          case 182: break;
          case 51:
            { return fStringHelper.handleRightBracketInFragment(PyTokenTypes.RBRACKET);
            }
          // fall through
          case 183: break;
          case 52:
            { return fStringHelper.handleLeftBracketInFragment(PyTokenTypes.LBRACE);
            }
          // fall through
          case 184: break;
          case 53:
            { return fStringHelper.handleRightBracketInFragment(PyTokenTypes.RBRACE);
            }
          // fall through
          case 185: break;
          case 54:
            { return fStringHelper.handleFragmentEnd();
            }
          // fall through
          case 186: break;
          case 55:
            { return PyTokenTypes.NE;
            }
          // fall through
          case 187: break;
          case 56:
            { yypushback(getSpaceLength(yytext())); if (zzCurrentPos != 0 || isConsole()) return PyTokenTypes.SINGLE_QUOTED_STRING;
return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 188: break;
          case 57:
            { return PyTokenTypes.PERCEQ;
            }
          // fall through
          case 189: break;
          case 58:
            { return PyTokenTypes.ANDEQ;
            }
          // fall through
          case 190: break;
          case 59:
            { return PyTokenTypes.EXP;
            }
          // fall through
          case 191: break;
          case 60:
            { return PyTokenTypes.MULTEQ;
            }
          // fall through
          case 192: break;
          case 61:
            { return PyTokenTypes.PLUSEQ;
            }
          // fall through
          case 193: break;
          case 62:
            { return PyTokenTypes.MINUSEQ;
            }
          // fall through
          case 194: break;
          case 63:
            { return PyTokenTypes.RARROW;
            }
          // fall through
          case 195: break;
          case 64:
            { return PyTokenTypes.FLOAT_LITERAL;
            }
          // fall through
          case 196: break;
          case 65:
            { return PyTokenTypes.FLOORDIV;
            }
          // fall through
          case 197: break;
          case 66:
            { return PyTokenTypes.DIVEQ;
            }
          // fall through
          case 198: break;
          case 67:
            { return PyTokenTypes.IMAGINARY_LITERAL;
            }
          // fall through
          case 199: break;
          case 68:
            { return PyTokenTypes.COLONEQ;
            }
          // fall through
          case 200: break;
          case 69:
            { return PyTokenTypes.LTLT;
            }
          // fall through
          case 201: break;
          case 70:
            { return PyTokenTypes.LE;
            }
          // fall through
          case 202: break;
          case 71:
            { return PyTokenTypes.NE_OLD;
            }
          // fall through
          case 203: break;
          case 72:
            { return PyTokenTypes.EQEQ;
            }
          // fall through
          case 204: break;
          case 73:
            { return PyTokenTypes.GE;
            }
          // fall through
          case 205: break;
          case 74:
            { return PyTokenTypes.GTGT;
            }
          // fall through
          case 206: break;
          case 75:
            { return PyTokenTypes.ATEQ;
            }
          // fall through
          case 207: break;
          case 76:
            { return fStringHelper.handleFStringStart();
            }
          // fall through
          case 208: break;
          case 77:
            { return PyTokenTypes.XOREQ;
            }
          // fall through
          case 209: break;
          case 78:
            { return PyTokenTypes.IF_KEYWORD;
            }
          // fall through
          case 210: break;
          case 79:
            { return PyTokenTypes.IN_KEYWORD;
            }
          // fall through
          case 211: break;
          case 80:
            { return PyTokenTypes.IS_KEYWORD;
            }
          // fall through
          case 212: break;
          case 81:
            { return PyTokenTypes.OR_KEYWORD;
            }
          // fall through
          case 213: break;
          case 82:
            { return PyTokenTypes.OREQ;
            }
          // fall through
          case 214: break;
          case 83:
            { yypushback(getSpaceLength(yytext())); yybegin(YYINITIAL); return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 215: break;
          case 84:
            { yypushback(yylength()-1); yybegin(PENDING_DOCSTRING); return PyTokenTypes.COLON;
            }
          // fall through
          case 216: break;
          case 85:
            { return fStringHelper.handleColonEqInFragment();
            }
          // fall through
          case 217: break;
          case 86:
            { return fStringHelper.handleFStringStartInFragment();
            }
          // fall through
          case 218: break;
          case 87:
            { if (zzInput == YYEOF && zzStartRead == 0 && !isConsole()) return PyTokenTypes.DOCSTRING;
                                 else return PyTokenTypes.TRIPLE_QUOTED_STRING;
            }
          // fall through
          case 219: break;
          case 88:
            { yypushback(getSpaceLength(yytext())); if (zzCurrentPos != 0 || isConsole()) return PyTokenTypes.SINGLE_QUOTED_STRING;
 yybegin(PENDING_DOCSTRING); return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 220: break;
          case 89:
            { return PyTokenTypes.EXPEQ;
            }
          // fall through
          case 221: break;
          case 90:
            { return PyTokenTypes.FLOORDIVEQ;
            }
          // fall through
          case 222: break;
          case 91:
            { return PyTokenTypes.LTLTEQ;
            }
          // fall through
          case 223: break;
          case 92:
            { return PyTokenTypes.GTGTEQ;
            }
          // fall through
          case 224: break;
          case 93:
            { return PyTokenTypes.AND_KEYWORD;
            }
          // fall through
          case 225: break;
          case 94:
            { yybegin(IN_DOCSTRING_OWNER); return PyTokenTypes.DEF_KEYWORD;
            }
          // fall through
          case 226: break;
          case 95:
            { return PyTokenTypes.DEL_KEYWORD;
            }
          // fall through
          case 227: break;
          case 96:
            { return PyTokenTypes.FOR_KEYWORD;
            }
          // fall through
          case 228: break;
          case 97:
            { return PyTokenTypes.NOT_KEYWORD;
            }
          // fall through
          case 229: break;
          case 98:
            { return PyTokenTypes.TRY_KEYWORD;
            }
          // fall through
          case 230: break;
          case 99:
            { if (zzInput == YYEOF) return PyTokenTypes.DOCSTRING;
                                 else yybegin(YYINITIAL); return PyTokenTypes.TRIPLE_QUOTED_STRING;
            }
          // fall through
          case 231: break;
          case 100:
            { yypushback(getSpaceLength(yytext())); return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 232: break;
          case 101:
            { return PyTokenTypes.TRIPLE_QUOTED_STRING;
            }
          // fall through
          case 233: break;
          case 102:
            { return fStringHelper.handleStringLiteral(PyTokenTypes.TRIPLE_QUOTED_STRING);
            }
          // fall through
          case 234: break;
          case 103:
            { fStringHelper.reset(); return PyTokenTypes.DEF_KEYWORD;
            }
          // fall through
          case 235: break;
          case 104:
            { fStringHelper.reset(); return PyTokenTypes.TRY_KEYWORD;
            }
          // fall through
          case 236: break;
          case 105:
            { yypushback(getSpaceLength(yytext())); if (zzCurrentPos != 0 || isConsole()) return PyTokenTypes.TRIPLE_QUOTED_STRING;
 yybegin(PENDING_DOCSTRING); return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 237: break;
          case 106:
            { return PyTokenTypes.ELIF_KEYWORD;
            }
          // fall through
          case 238: break;
          case 107:
            { return PyTokenTypes.ELSE_KEYWORD;
            }
          // fall through
          case 239: break;
          case 108:
            { return PyTokenTypes.FROM_KEYWORD;
            }
          // fall through
          case 240: break;
          case 109:
            { return PyTokenTypes.PASS_KEYWORD;
            }
          // fall through
          case 241: break;
          case 110:
            { fStringHelper.reset(); return PyTokenTypes.WITH_KEYWORD;
            }
          // fall through
          case 242: break;
          case 111:
            { return PyTokenTypes.BREAK_KEYWORD;
            }
          // fall through
          case 243: break;
          case 112:
            { yybegin(IN_DOCSTRING_OWNER); return PyTokenTypes.CLASS_KEYWORD;
            }
          // fall through
          case 244: break;
          case 113:
            { return PyTokenTypes.RAISE_KEYWORD;
            }
          // fall through
          case 245: break;
          case 114:
            { return PyTokenTypes.WHILE_KEYWORD;
            }
          // fall through
          case 246: break;
          case 115:
            { return PyTokenTypes.YIELD_KEYWORD;
            }
          // fall through
          case 247: break;
          case 116:
            { fStringHelper.reset(); return PyTokenTypes.BREAK_KEYWORD;
            }
          // fall through
          case 248: break;
          case 117:
            { fStringHelper.reset(); return PyTokenTypes.CLASS_KEYWORD;
            }
          // fall through
          case 249: break;
          case 118:
            { fStringHelper.reset(); return PyTokenTypes.RAISE_KEYWORD;
            }
          // fall through
          case 250: break;
          case 119:
            { fStringHelper.reset(); return PyTokenTypes.WHILE_KEYWORD;
            }
          // fall through
          case 251: break;
          case 120:
            { return PyTokenTypes.ASSERT_KEYWORD;
            }
          // fall through
          case 252: break;
          case 121:
            { return PyTokenTypes.EXCEPT_KEYWORD;
            }
          // fall through
          case 253: break;
          case 122:
            { return PyTokenTypes.GLOBAL_KEYWORD;
            }
          // fall through
          case 254: break;
          case 123:
            { return PyTokenTypes.IMPORT_KEYWORD;
            }
          // fall through
          case 255: break;
          case 124:
            { return PyTokenTypes.LAMBDA_KEYWORD;
            }
          // fall through
          case 256: break;
          case 125:
            { return PyTokenTypes.RETURN_KEYWORD;
            }
          // fall through
          case 257: break;
          case 126:
            { fStringHelper.reset(); return PyTokenTypes.EXCEPT_KEYWORD;
            }
          // fall through
          case 258: break;
          case 127:
            { fStringHelper.reset(); return PyTokenTypes.RETURN_KEYWORD;
            }
          // fall through
          case 259: break;
          case 128:
            { yypushback(getSpaceLength(yytext())); if (zzCurrentPos != 0 || isConsole()) return PyTokenTypes.TRIPLE_QUOTED_STRING;
return PyTokenTypes.DOCSTRING;
            }
          // fall through
          case 260: break;
          case 129:
            { return PyTokenTypes.FINALLY_KEYWORD;
            }
          // fall through
          case 261: break;
          case 130:
            { fStringHelper.reset(); return PyTokenTypes.FINALLY_KEYWORD;
            }
          // fall through
          case 262: break;
          case 131:
            { return PyTokenTypes.CONTINUE_KEYWORD;
            }
          // fall through
          case 263: break;
          case 132:
            { fStringHelper.reset(); return PyTokenTypes.CONTINUE_KEYWORD;
            }
          // fall through
          case 264: break;
          default:
            zzScanError(ZZ_NO_MATCH);
          }
      }
    }
  }
public IElementType advance()