📄 yylex.java
字号:
private int yy_rmap[] = unpackFromString(1,56,"0,1,2,3,1,2,4,2,1,5,6,7,1:6,8,9,1,10,1:2,2,1:2,11,1,12,13,14,12,15,16,17,18" +",19,20,21,22,23,24,25,26,27,28,29,30,31,12,32,33,34,35,36")[0]; private int yy_nxt[][] = unpackFromString(37,26,"1,2,3,24:12,4,24,5,6,27,7,24,8,33,24:2,-1:27,24,-1,24:12,-1,24:3,-1,24:2,-1" +",33,24:2,-1,9,-1,30,10:7,35,10:3,-1:6,10,-1:2,10,-1:2,24,-1,24:12,-1,24:2,6" +",27,24:2,-1,33,24:2,-1:4,11:7,-1,11:3,-1:6,11,-1:2,11,-1:5,10:7,-1,10:3,-1:" +"6,10,-1:2,10:2,-1:4,11:7,-1,11:3,-1:6,11,-1:2,11:2,-1:4,10:7,-1,10:3,-1:6,1" +"0,-1:2,10,-1:5,19:7,-1,19:3,-1:6,19,-1:2,19:2,-1,21:10,-1,21:3,-1,21:10,-1:" +"18,27:2,-1:7,50:18,-1,50:2,20,51,50:2,-1:4,38,-1:16,39,-1:25,48,-1:5,24,-1," +"24:12,-1,24:2,36,37,24:3,33,24:2,-1:15,23,-1:22,40,-1:14,24,-1,24:12,-1,24:" +"2,36,37,24:2,-1,33,24:2,-1:18,37:2,-1:3,24,-1:7,41,-1:41,12,-1:17,42,-1:18," +"43,-1:33,13,-1:18,44,-1:26,45,-1:26,46,-1:26,14,-1:15,1,15:18,16,28,31,15:4" +",-1:15,17,-1:10,1,25,18,8,19:7,8,19:3,4,8,26,27:2,28,19,29,8,19,8,-1,50:17," +"52,53,50:2,32,51,50:2,-1,50:17,52,53,50:2,20,51,50:2,-1:18,53:2,-1:3,50,-1:" +"2,1,21:10,8,21:3,22,21:10,1,21:10,34,21:3,8,21:10"); public java_cup.runtime.Symbol next_token () throws java.io.IOException { int yy_lookahead; int yy_anchor = YY_NO_ANCHOR; int yy_state = yy_state_dtrans[yy_lexical_state]; int yy_next_state = YY_NO_STATE; int yy_last_accept_state = YY_NO_STATE; boolean yy_initial = true; int yy_this_accept; yy_mark_start(); yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } while (true) { if (yy_initial && yy_at_bol) yy_lookahead = YY_BOL; else yy_lookahead = yy_advance(); yy_next_state = YY_F; yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]]; if (YY_EOF == yy_lookahead && true == yy_initial) { return new Symbol(sym.EOF); } if (YY_F != yy_next_state) { yy_state = yy_next_state; yy_initial = false; yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } } else { if (YY_NO_STATE == yy_last_accept_state) { throw (new Error("Lexical Error: Unmatched Input.")); } else { yy_anchor = yy_acpt[yy_last_accept_state]; if (0 != (YY_END & yy_anchor)) { yy_move_end(); } yy_to_mark(); switch (yy_last_accept_state) { case 0: { // System.out.println ("Text==" + yytext ()); return (new Symbol(sym.TEXT,yyline,yychar,yytext()));} case -2: break; case 1: case -3: break; case 2: { return (new Symbol(sym.SLASH,yyline, yychar)); } case -4: break; case 3: { yybegin (INNODE); return (new Symbol(sym.LBRACK,yyline, yychar)); } case -5: break; case 4: { yybegin (YYINITIAL); return (new Symbol(sym.RBRACK,yyline, yychar)); } case -6: break; case 5: { return (new Symbol(sym.EQUALS,yyline, yychar)); } case -7: break; case 6: { } case -8: break; case 7: { } case -9: break; case 8: { System.out.println("Illegal character: <" + yytext() + ">"); } case -10: break; case 10: { yybegin (INNODE); return (new Symbol(sym.LBRACK_NAME,yyline,yychar,yytext().substring (1)));} case -11: break; case 11: { // yybegin (INNODE); return (new Symbol(sym.LBRACK_SLASH_NAME,yyline,yychar,yytext().substring (2)));} case -12: break; case 12: { yybegin(COMMENT); } case -13: break; case 13: { yybegin (XML); } case -14: break; case 14: { yybegin (DOCTYPE); } case -15: break; case 15: { /*System.out.println ("Un-Matched:'" + yytext ()+ "'");*/ } case -16: break; case 16: { } case -17: break; case 17: { yybegin(YYINITIAL);} case -18: break; case 18: { yybegin (INNODE); return (new Symbol(sym.UNCLOSED,yyline, yychar)); } case -19: break; case 19: { return (new Symbol(sym.NAME,yyline,yychar,yytext()));} case -20: break; case 20: { String str = yytext(); str = str.substring (1, str.length() -1); int ampIndex = str.indexOf ("&"); while (ampIndex != -1) { int semiIndex = str.indexOf (";", ampIndex); /* // hack to replace " */ if (semiIndex == -1) { throw new java.io.IOException ("unclosed & at line="+yyline+" char="+yychar + " text='"+str+"'"); } String internal = str.substring (ampIndex+1,semiIndex); String lookup = (String)ampMappings.get (internal); if (lookup != null) { System.out.println ("&"+internal+"; matched '"+lookup+"'"); str = str.substring (0, ampIndex) + lookup + str.substring (semiIndex+1); ampIndex++; } else { System.out.println ("&"+internal+"; unmatched.."); ampIndex += internal.length (); } ampIndex = str.indexOf ("&", ampIndex); } return (new Symbol(sym.QUOTED_NAME,yyline,yychar,str));} case -21: break; case 21: { } case -22: break; case 22: { yybegin (YYINITIAL); } case -23: break; case 23: { yybegin (YYINITIAL); } case -24: break; case 24: { // System.out.println ("Text==" + yytext ()); return (new Symbol(sym.TEXT,yyline,yychar,yytext()));} case -25: break; case 25: { return (new Symbol(sym.SLASH,yyline, yychar)); } case -26: break; case 26: { return (new Symbol(sym.EQUALS,yyline, yychar)); } case -27: break; case 27: { } case -28: break; case 28: { } case -29: break; case 29: { System.out.println("Illegal character: <" + yytext() + ">"); } case -30: break; case 31: { /*System.out.println ("Un-Matched:'" + yytext ()+ "'");*/ } case -31: break; case 32: { String str = yytext(); str = str.substring (1, str.length() -1); int ampIndex = str.indexOf ("&"); while (ampIndex != -1) { int semiIndex = str.indexOf (";", ampIndex); /* // hack to replace " */ if (semiIndex == -1) { throw new java.io.IOException ("unclosed & at line="+yyline+" char="+yychar + " text='"+str+"'"); } String internal = str.substring (ampIndex+1,semiIndex); String lookup = (String)ampMappings.get (internal); if (lookup != null) { System.out.println ("&"+internal+"; matched '"+lookup+"'"); str = str.substring (0, ampIndex) + lookup + str.substring (semiIndex+1); ampIndex++; } else { System.out.println ("&"+internal+"; unmatched.."); ampIndex += internal.length (); } ampIndex = str.indexOf ("&", ampIndex); } return (new Symbol(sym.QUOTED_NAME,yyline,yychar,str));} case -32: break; case 33: { // System.out.println ("Text==" + yytext ()); return (new Symbol(sym.TEXT,yyline,yychar,yytext()));} case -33: break; case 34: { System.out.println("Illegal character: <" + yytext() + ">"); } case -34: break; case 36: { // System.out.println ("Text==" + yytext ()); return (new Symbol(sym.TEXT,yyline,yychar,yytext()));} case -35: break; default: yy_error(YY_E_INTERNAL,false); case -1: } yy_initial = true; yy_state = yy_state_dtrans[yy_lexical_state]; yy_next_state = YY_NO_STATE; yy_last_accept_state = YY_NO_STATE; yy_mark_start(); yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } } } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -