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;

      if (zzMarkedPosL > zzStartRead) {
        switch (zzBufferL.charAt(zzMarkedPosL-1)) {
        case '\n':
        case '\u000B':  // fall through
        case '\u000C':  // fall through
        case '\u0085':  // fall through
        case '\u2028':  // fall through
        case '\u2029':  // fall through
          zzAtBOL = true;
          break;
        case '\r': 
          if (zzMarkedPosL < zzEndReadL)
            zzAtBOL = zzBufferL.charAt(zzMarkedPosL) != '\n';
          else if (zzAtEOF)
            zzAtBOL = false;
          else {
            boolean eof = zzRefill();
            zzMarkedPosL = zzMarkedPos;
            zzEndReadL = zzEndRead;
            zzBufferL = zzBuffer;
            if (eof) 
              zzAtBOL = false;
            else 
              zzAtBOL = zzBufferL.charAt(zzMarkedPosL) != '\n';
          }
          break;
        default:
          zzAtBOL = false;
        }
      }
      zzAction = -1;

      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;

      if (zzAtBOL)
        zzState = ZZ_LEXSTATE[zzLexicalState+1];
      else
        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:
            { yybegin(IN_INLINE); return LINE;
            }
          // fall through
          case 49: break;
          case 2:
            { yypushback(1); yybegin(INIT);
            }
          // fall through
          case 50: break;
          case 3:
            { yybegin(INIT); return WHITESPACE;
            }
          // fall through
          case 51: break;
          case 4:
            { yybegin(INIT); return ERROR;
            }
          // fall through
          case 52: break;
          case 5:
            { return WHITESPACE;
            }
          // fall through
          case 53: break;
          case 6:
            { yybegin(IN_COMMENT); return COMMENT;
            }
          // fall through
          case 54: break;
          case 7:
            { return COMMENT;
            }
          // fall through
          case 55: break;
          case 8:
            { yybegin(PRE_INDENTED); myIndent = yylength(); return chooseType();
            }
          // fall through
          case 56: break;
          case 9:
            { yybegin(PRE_QUOTED); return SPEC_SYMBOL;
            }
          // fall through
          case 57: break;
          case 10:
            { yypushback(1); myIndent = 0; myState = 0; yybegin(INIT);
            }
          // fall through
          case 58: break;
          case 11:
            { if (yylength() >= myIndent) {
                                                        yybegin(PRE_INDENTED); return chooseType();}
                                                     else {
                                                      myIndent = 0; yypushback(yylength()); yybegin(INIT);
                                                     }
            }
          // fall through
          case 59: break;
          case 12:
            { return chooseType();
            }
          // fall through
          case 60: break;
          case 13:
            { yybegin(INDENTED);  return chooseType();
            }
          // fall through
          case 61: break;
          case 14:
            { yypushback(1); myState = 0; yybegin(INIT);
            }
          // fall through
          case 62: break;
          case 15:
            { yybegin(PRE_QUOTED); return chooseType();
            }
          // fall through
          case 63: break;
          case 16:
            { yybegin(QUOTED);  return chooseType();
            }
          // fall through
          case 64: break;
          case 17:
            { yybegin(INIT); return LINE;
            }
          // fall through
          case 65: break;
          case 18:
            { yybegin(IN_FOOTNOTE); return LINE;
            }
          // fall through
          case 66: break;
          case 19:
            { return LINE;
            }
          // fall through
          case 67: break;
          case 20:
            { yypushback(1); yybegin(IN_LINE);
            }
          // fall through
          case 68: break;
          case 21:
            { yybegin(IN_LINEBEGIN); return WHITESPACE;
            }
          // fall through
          case 69: break;
          case 22:
            { yybegin(IN_LINE); return SPEC_SYMBOL;
            }
          // fall through
          case 70: break;
          case 23:
            { yybegin(INIT); return COMMENT;
            }
          // fall through
          case 71: break;
          case 24:
            { yybegin(IN_VALUE); return CUSTOM_DIRECTIVE;
            }
          // fall through
          case 72: break;
          case 25:
            { yybegin(INIT); return FOOTNOTE;
            }
          // fall through
          case 73: break;
          case 26:
            { yybegin(IN_VALUE); return ANONYMOUS_HYPERLINK;
            }
          // fall through
          case 74: break;
          case 27:
            { return SUBSTITUTION;
            }
          // fall through
          case 75: break;
          case 28:
            { String value = yytext().toString().trim();
                                                      if ("python".equalsIgnoreCase(value)) {
                                                        myState = 1;
                                                        yybegin(IN_INLINE);
                                                      }
                                                      else if ("django".equalsIgnoreCase(value) ||
                                                              "html+django".equalsIgnoreCase(value)) {
                                                        myState = 2;
                                                        yybegin(IN_INLINE);
                                                      }
                                                      else if ("javascript".equalsIgnoreCase(value)) {
                                                        myState = 3;
                                                        yybegin(IN_INLINE);
                                                      }
                                                      else {
                                                        yybegin(INIT);
                                                      }
                                                     return LINE;
            }
          // fall through
          case 76: break;
          case 29:
            { yybegin(IN_LINEBEGIN); return LINE;
            }
          // fall through
          case 77: break;
          case 30:
            { yybegin(INIT); return CITATION;
            }
          // fall through
          case 78: break;
          case 31:
            { yybegin(IN_EXPLISIT_MARKUP); return EXPLISIT_MARKUP_START;
            }
          // fall through
          case 79: break;
          case 32:
            { yypushback(1); return REFERENCE_NAME;
            }
          // fall through
          case 80: break;
          case 33:
            { return INTERPRETED;
            }
          // fall through
          case 81: break;
          case 34:
            { return TITLE;
            }
          // fall through
          case 82: break;
          case 35:
            { yybegin(INIT); return HYPERLINK;
            }
          // fall through
          case 83: break;
          case 36:
            { yypushback(1); yybegin(INIT); return REFERENCE_NAME;
            }
          // fall through
          case 84: break;
          case 37:
            { yypushback(yylength()-1); return LINE;
            }
          // fall through
          case 85: break;
          case 38:
            { return ITALIC;
            }
          // fall through
          case 86: break;
          case 39:
            { yybegin(IN_INLINE);return LITERAL_BLOCK_START;
            }
          // fall through
          case 87: break;
          case 40:
            { yypushback(1); return FIELD;
            }
          // fall through
          case 88: break;
          case 41:
            { yybegin(IN_VALUE); return DIRECTIVE;
            }
          // fall through
          case 89: break;
          case 42:
            { yypushback(1); yybegin(INIT); return FIELD;
            }
          // fall through
          case 90: break;
          case 43:
            { yypushback(1); yybegin(FIELD_LINE); return FIELD;
            }
          // fall through
          case 91: break;
          case 44:
            { yypushback(yylength()-1); yybegin(FIELD_IN_INLINE); return WHITESPACE;
            }
          // fall through
          case 92: break;
          case 45:
            { return BOLD;
            }
          // fall through
          case 93: break;
          case 46:
            { return FIXED;
            }
          // fall through
          case 94: break;
          case 47:
            { return DIRECT_HYPERLINK;
            }
          // fall through
          case 95: break;
          case 48:
            { yybegin(IN_HIGHLIGHT); return CUSTOM_DIRECTIVE;
            }
          // fall through
          case 96: break;
          default:
            zzScanError(ZZ_NO_MATCH);
          }
      }
    }
  }
public IElementType advance()