Skip to content

Commit

Permalink
regenerate JavaLexer (fixed tm); floating literals tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inspirer committed Aug 2, 2012
1 parent 53f01ab commit 198696c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 64 deletions.
99 changes: 43 additions & 56 deletions java/src/org/textmapper/grammar/java/JavaLexer.java
Expand Up @@ -308,7 +308,7 @@ private static char[] unpack_vc_char(int size, String... st) {
"\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135" +
"\136\137\140\141\142\143\144\145\146\147\150\151");

private static final short[] lapg_lexem = unpack_vc_short(6120,
private static final short[] lapg_lexem = unpack_vc_short(5508,
"\1\ufffe\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\uffff\1\11\1\12\1\13\1\14\1\15" +
"\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35" +
"\1\36\1\37\1\6\1\uffff\1\3\1\40\3\6\1\40\1\6\1\40\6\6\1\40\63\ufffc\4\ufffb\1\3\141" +
Expand All @@ -323,61 +323,48 @@ private static char[] unpack_vc_char(int size, String... st) {
"\24\uffa1\1\75\11\uffa1\1\76\24\uffa1\24\uffa0\1\77\36\uffa0\24\uff9c\1\100\36\uff9c" +
"\24\uff9b\1\101\36\uff9b\6\uffc7\1\102\1\103\1\45\34\uffc7\1\102\1\47\2\uffc7\1\102" +
"\1\uffc7\1\102\1\52\1\53\3\uffc7\1\53\1\102\1\ufffa\2\41\2\ufffa\56\41\63\uff94\6" +
"\uffc5\1\104\1\105\35\uffc5\1\106\1\107\2\uffc5\1\104\1\uffc5\1\104\6\uffc5\1\104" +
"\6\uffff\1\110\1\44\35\uffff\1\106\3\uffff\1\110\1\uffff\1\110\6\uffff\1\110\6\uffff" +
"\1\111\36\uffff\1\111\3\uffff\1\111\1\uffff\1\111\6\uffff\1\111\6\uffff\1\106\1\46" +
"\35\uffff\1\106\3\uffff\1\106\1\uffff\1\106\6\uffff\1\106\63\uffc7\6\uffff\1\112" +
"\36\uffff\1\112\2\uffff\6\112\2\uffff\3\112\6\uffff\1\113\44\uffff\1\113\15\uffff" +
"\1\114\26\uffff\2\115\6\uffff\1\114\3\uffff\1\114\1\uffff\1\114\6\uffff\1\114\63" +
"\uffc1\6\uffff\2\116\35\uffff\1\116\3\uffff\1\116\1\uffff\1\116\1\117\5\uffff\1\116" +
"\11\uffff\1\120\57\uffff\1\121\2\uffff\3\55\35\uffff\1\122\1\uffff\1\121\3\uffff" +
"\3\55\1\121\6\uffff\1\123\2\uffff\3\11\35\uffff\1\124\1\uffff\1\123\3\uffff\3\11" +
"\1\123\63\uffbc\63\uffaa\63\uffa8\24\uff99\1\125\1\126\35\uff99\63\uffa9\24\uff9a" +
"\1\127\36\uff9a\63\uffa7\63\uff93\63\uffa6\63\uff92\63\uffa5\63\uff97\63\uffa4\63" +
"\uff96\63\uffa3\63\uff95\63\uff91\63\uff90\6\uffc7\1\130\1\131\35\uffc7\1\130\1\47" +
"\2\uffc7\1\130\1\uffc7\1\130\6\uffc7\1\130\6\uffff\1\132\1\103\35\uffff\1\132\3\uffff" +
"\1\132\1\uffff\1\132\6\uffff\1\132\6\uffff\1\133\1\105\1\45\34\uffff\1\106\3\uffff" +
"\1\133\1\uffff\1\133\1\52\1\53\3\uffff\1\53\1\133\6\uffff\1\133\1\105\35\uffff\1" +
"\106\3\uffff\1\133\1\uffff\1\133\6\uffff\1\133\6\uffff\1\106\1\46\1\45\34\uffff\1" +
"\106\3\uffff\1\106\1\uffff\1\106\1\52\1\53\3\uffff\1\53\1\106\71\uffc5\1\104\1\105" +
"\1\45\34\uffc5\1\106\1\107\2\uffc5\1\104\1\uffc5\1\104\1\52\1\53\3\uffc5\1\53\1\104" +
"\6\uffff\2\134\35\uffff\1\134\3\uffff\1\134\1\uffff\1\134\1\117\5\uffff\1\134\6\uffc6" +
"\2\135\1\136\34\uffc6\1\135\1\137\1\uffc6\6\135\1\140\1\uffc6\3\135\6\uffc4\1\113" +
"\1\141\36\uffc4\1\142\4\uffc4\1\113\7\uffc4\6\uffc2\2\143\35\uffc2\1\143\3\uffc2" +
"\1\143\1\uffc2\1\143\1\uffc2\1\144\3\uffc2\1\144\1\143\6\uffff\1\114\36\uffff\1\114" +
"\3\uffff\1\114\1\uffff\1\114\6\uffff\1\114\6\uffff\1\145\1\116\35\uffff\1\145\3\uffff" +
"\1\145\1\uffff\1\145\6\uffff\1\145\6\uffff\1\146\26\uffff\2\147\6\uffff\1\146\3\uffff" +
"\1\146\1\uffff\1\146\6\uffff\1\146\63\uffbd\6\uffff\1\122\2\uffff\1\120\37\uffff" +
"\1\122\1\uffff\1\122\6\uffff\1\122\6\uffff\1\55\2\uffff\1\120\37\uffff\1\55\1\uffff" +
"\1\55\6\uffff\1\55\1\uffff\2\11\2\uffff\1\11\1\124\3\11\1\57\1\60\35\11\1\124\1\11" +
"\1\124\6\11\1\124\1\uffff\2\11\2\uffff\5\11\1\57\1\60\47\11\63\uff8e\24\uff98\1\150" +
"\36\uff98\63\uff8f\6\uffff\1\151\1\131\1\45\34\uffff\1\151\3\uffff\1\151\1\uffff" +
"\1\151\1\52\1\53\3\uffff\1\53\1\151\6\uffff\1\151\1\131\35\uffff\1\151\3\uffff\1" +
"\151\1\uffff\1\151\6\uffff\1\151\6\uffc7\1\130\1\131\1\45\34\uffc7\1\130\1\47\2\uffc7" +
"\1\130\1\uffc7\1\130\1\52\1\53\3\uffc7\1\53\1\130\6\uffc5\1\133\1\105\1\45\34\uffc5" +
"\1\106\1\107\2\uffc5\1\133\1\uffc5\1\133\1\52\1\53\3\uffc5\1\53\1\133\6\uffff\1\152" +
"\1\134\35\uffff\1\152\3\uffff\1\152\1\uffff\1\152\6\uffff\1\152\6\uffff\1\153\1\135" +
"\35\uffff\1\153\2\uffff\6\153\2\uffff\3\153\6\uffff\1\154\36\uffff\1\154\2\uffff" +
"\6\154\1\140\1\uffff\3\154\63\uffc6\6\uffff\1\155\26\uffff\2\156\6\uffff\1\155\3" +
"\uffff\1\155\1\uffff\1\155\6\uffff\1\155\6\uffff\1\113\1\141\43\uffff\1\113\7\uffff" +
"\63\uffc4\6\uffff\1\157\1\143\35\uffff\1\157\3\uffff\1\157\1\uffff\1\157\6\uffff" +
"\1\157\63\uffc2\6\uffff\1\145\1\116\35\uffff\1\145\3\uffff\1\145\1\uffff\1\145\1" +
"\117\5\uffff\1\145\6\uffc3\2\160\35\uffc3\1\160\3\uffc3\1\160\1\uffc3\1\160\1\uffc3" +
"\1\161\3\uffc3\1\161\1\160\6\uffff\1\146\36\uffff\1\146\3\uffff\1\146\1\uffff\1\146" +
"\6\uffff\1\146\63\uff8d\6\uffc7\1\151\1\131\1\45\34\uffc7\1\151\1\47\2\uffc7\1\151" +
"\1\uffc7\1\151\1\52\1\53\3\uffc7\1\53\1\151\6\uffff\1\152\1\134\35\uffff\1\152\3" +
"\uffff\1\152\1\uffff\1\152\1\117\5\uffff\1\152\6\uffc6\1\153\1\135\1\136\34\uffc6" +
"\1\153\1\137\1\uffc6\6\153\1\140\1\uffc6\3\153\6\uffff\2\162\35\uffff\1\162\2\uffff" +
"\6\162\1\140\1\uffff\3\162\6\uffc0\2\163\35\uffc0\1\163\3\uffc0\1\163\1\uffc0\1\163" +
"\1\uffc0\1\164\3\uffc0\1\164\1\163\6\uffff\1\155\36\uffff\1\155\3\uffff\1\155\1\uffff" +
"\1\155\6\uffff\1\155\6\uffc2\1\157\1\143\35\uffc2\1\157\3\uffc2\1\157\1\uffc2\1\157" +
"\1\uffc2\1\144\3\uffc2\1\144\1\157\6\uffff\1\165\1\160\35\uffff\1\165\3\uffff\1\165" +
"\1\uffff\1\165\6\uffff\1\165\63\uffc3\6\uffff\1\166\1\162\35\uffff\1\166\2\uffff" +
"\6\166\2\uffff\3\166\6\uffff\1\167\1\163\35\uffff\1\167\3\uffff\1\167\1\uffff\1\167" +
"\6\uffff\1\167\63\uffc0\6\uffc3\1\165\1\160\35\uffc3\1\165\3\uffc3\1\165\1\uffc3" +
"\1\165\1\uffc3\1\161\3\uffc3\1\161\1\165\6\uffff\1\166\1\162\35\uffff\1\166\2\uffff" +
"\6\166\1\140\1\uffff\3\166\6\uffc0\1\167\1\163\35\uffc0\1\167\3\uffc0\1\167\1\uffc0" +
"\1\167\1\uffc0\1\164\3\uffc0\1\164\1\167");
"\uffc5\1\43\1\104\1\45\34\uffc5\1\46\1\105\2\uffc5\1\43\1\uffc5\1\43\1\52\1\53\3" +
"\uffc5\1\53\1\43\6\uffff\1\43\1\44\35\uffff\1\46\3\uffff\1\43\1\uffff\1\43\6\uffff" +
"\1\43\6\uffc3\1\106\36\uffc3\1\106\3\uffc3\1\106\1\uffc3\1\106\1\107\1\110\3\uffc3" +
"\1\110\1\106\6\uffff\1\46\1\111\1\45\34\uffff\1\46\3\uffff\1\46\1\uffff\1\46\1\52" +
"\1\53\3\uffff\1\53\1\46\63\uffc7\6\uffff\1\112\1\uffff\1\113\34\uffff\1\112\2\uffff" +
"\6\112\2\uffff\3\112\6\uffff\1\114\44\uffff\1\114\15\uffff\1\115\26\uffff\2\116\6" +
"\uffff\1\115\3\uffff\1\115\1\uffff\1\115\6\uffff\1\115\63\uffc1\6\uffc3\1\54\1\117" +
"\35\uffc3\1\54\3\uffc3\1\54\1\uffc3\1\54\1\107\1\110\3\uffc3\1\110\1\54\11\uffff" +
"\1\120\57\uffff\1\121\2\uffff\3\55\35\uffff\1\122\1\uffff\1\121\3\uffff\3\55\1\121" +
"\6\uffff\1\123\2\uffff\3\11\35\uffff\1\124\1\uffff\1\123\3\uffff\3\11\1\123\63\uffbc" +
"\63\uffaa\63\uffa8\24\uff99\1\125\1\126\35\uff99\63\uffa9\24\uff9a\1\127\36\uff9a" +
"\63\uffa7\63\uff93\63\uffa6\63\uff92\63\uffa5\63\uff97\63\uffa4\63\uff96\63\uffa3" +
"\63\uff95\63\uff91\63\uff90\6\uffc7\1\102\1\130\1\45\34\uffc7\1\102\1\47\2\uffc7" +
"\1\102\1\uffc7\1\102\1\52\1\53\3\uffc7\1\53\1\102\6\uffff\1\102\1\103\35\uffff\1" +
"\102\3\uffff\1\102\1\uffff\1\102\6\uffff\1\102\6\uffff\1\43\1\104\35\uffff\1\46\3" +
"\uffff\1\43\1\uffff\1\43\6\uffff\1\43\63\uffc5\6\uffc3\1\106\1\131\35\uffc3\1\106" +
"\3\uffc3\1\106\1\uffc3\1\106\1\107\1\110\3\uffc3\1\110\1\106\6\uffff\1\132\26\uffff" +
"\2\133\6\uffff\1\132\3\uffff\1\132\1\uffff\1\132\6\uffff\1\132\63\uffc3\6\uffff\1" +
"\46\1\111\35\uffff\1\46\3\uffff\1\46\1\uffff\1\46\6\uffff\1\46\6\uffc6\1\112\1\134" +
"\1\135\34\uffc6\1\112\1\136\1\uffc6\6\112\1\137\1\uffc6\3\112\6\uffff\1\140\36\uffff" +
"\1\140\2\uffff\6\140\2\uffff\3\140\6\uffc4\1\114\1\141\36\uffc4\1\142\4\uffc4\1\114" +
"\7\uffc4\6\uffc2\1\115\1\143\35\uffc2\1\115\3\uffc2\1\115\1\uffc2\1\115\1\uffc2\1" +
"\144\3\uffc2\1\144\1\115\6\uffff\1\115\36\uffff\1\115\3\uffff\1\115\1\uffff\1\115" +
"\6\uffff\1\115\6\uffff\1\54\1\117\35\uffff\1\54\3\uffff\1\54\1\uffff\1\54\6\uffff" +
"\1\54\63\uffbd\6\uffff\1\122\2\uffff\1\120\37\uffff\1\122\1\uffff\1\122\6\uffff\1" +
"\122\6\uffff\1\55\2\uffff\1\120\37\uffff\1\55\1\uffff\1\55\6\uffff\1\55\1\uffff\2" +
"\11\2\uffff\1\11\1\124\3\11\1\57\1\60\35\11\1\124\1\11\1\124\6\11\1\124\1\uffff\2" +
"\11\2\uffff\5\11\1\57\1\60\47\11\63\uff8e\24\uff98\1\145\36\uff98\63\uff8f\6\uffff" +
"\1\102\1\130\35\uffff\1\102\3\uffff\1\102\1\uffff\1\102\6\uffff\1\102\6\uffff\1\106" +
"\1\131\35\uffff\1\106\3\uffff\1\106\1\uffff\1\106\6\uffff\1\106\6\uffc3\1\132\1\146" +
"\35\uffc3\1\132\3\uffc3\1\132\1\uffc3\1\132\1\uffc3\1\110\3\uffc3\1\110\1\132\6\uffff" +
"\1\132\36\uffff\1\132\3\uffff\1\132\1\uffff\1\132\6\uffff\1\132\6\uffff\1\112\1\134" +
"\35\uffff\1\112\2\uffff\6\112\2\uffff\3\112\6\uffff\1\140\36\uffff\1\140\2\uffff" +
"\6\140\1\137\1\uffff\3\140\63\uffc6\6\uffff\1\147\26\uffff\2\150\6\uffff\1\147\3" +
"\uffff\1\147\1\uffff\1\147\6\uffff\1\147\6\uffff\1\140\1\151\35\uffff\1\140\2\uffff" +
"\6\140\1\137\1\uffff\3\140\6\uffff\1\114\1\141\43\uffff\1\114\7\uffff\63\uffc4\6" +
"\uffff\1\115\1\143\35\uffff\1\115\3\uffff\1\115\1\uffff\1\115\6\uffff\1\115\63\uffc2" +
"\63\uff8d\6\uffff\1\132\1\146\35\uffff\1\132\3\uffff\1\132\1\uffff\1\132\6\uffff" +
"\1\132\6\uffc0\1\147\1\152\35\uffc0\1\147\3\uffc0\1\147\1\uffc0\1\147\1\uffc0\1\153" +
"\3\uffc0\1\153\1\147\6\uffff\1\147\36\uffff\1\147\3\uffff\1\147\1\uffff\1\147\6\uffff" +
"\1\147\6\uffff\1\140\1\151\35\uffff\1\140\2\uffff\6\140\2\uffff\3\140\6\uffff\1\147" +
"\1\152\35\uffff\1\147\3\uffff\1\147\1\uffff\1\147\6\uffff\1\147\63\uffc0");

private static short[] unpack_vc_short(int size, String... st) {
short[] res = new short[size];
Expand Down
16 changes: 8 additions & 8 deletions java/tests/org/textmapper/grammar/java/JavaLexerTest.java
Expand Up @@ -96,17 +96,17 @@ public void testInts() {
@Test
public void testFloat() {
assertJava("1e1f", Lexems.FloatingPointLiteral);
// assertJava("2.f", Lexems.FloatingPointLiteral);
// assertJava(".3f", Lexems.FloatingPointLiteral);
assertJava("2.f", Lexems.FloatingPointLiteral);
assertJava(".3f", Lexems.FloatingPointLiteral);
assertJava("0f", Lexems.FloatingPointLiteral);
// assertJava("3.14f", Lexems.FloatingPointLiteral);
// assertJava("6.022137e+23f", Lexems.FloatingPointLiteral);
assertJava("3.14f", Lexems.FloatingPointLiteral);
assertJava("6.022137e+23f", Lexems.FloatingPointLiteral);

assertJava("1e1", Lexems.FloatingPointLiteral);
// assertJava("2.", Lexems.FloatingPointLiteral);
// assertJava(".3", Lexems.FloatingPointLiteral);
// assertJava("0.0", Lexems.FloatingPointLiteral);
// assertJava("3.14", Lexems.FloatingPointLiteral);
assertJava("2.", Lexems.FloatingPointLiteral);
assertJava(".3", Lexems.FloatingPointLiteral);
assertJava("0.0", Lexems.FloatingPointLiteral);
assertJava("3.14", Lexems.FloatingPointLiteral);
assertJava("1e-9d", Lexems.FloatingPointLiteral);
assertJava("1e137", Lexems.FloatingPointLiteral);
}
Expand Down

0 comments on commit 198696c

Please sign in to comment.