From 4ce03c3cc9139fd35edb610c3c2f8fab9a774a3f Mon Sep 17 00:00:00 2001 From: villberg Date: Mon, 31 Mar 2014 11:45:24 +0000 Subject: [PATCH] Getting closer refs #4765 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29223 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/solver/parser/ModelParser.java | 42 +- .../solver/parser/ModelParserConstants.java | 7 +- .../parser/ModelParserTokenManager.java | 367 +++++++++++------- .../sysdyn/solver/parser/ModelicaParser.jj | 7 +- .../sysdyn/solver/parser/ModelicaParser.jjt | 7 +- 5 files changed, 269 insertions(+), 161 deletions(-) diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java index 99bdaaee..29ef1f1e 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java @@ -119,8 +119,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 47: case 50: case 61: - case 94: case 95: + case 96: ; break; default: @@ -226,12 +226,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 17: jj_consume_token(17); break; - case 94: - jj_consume_token(94); - break; case 95: jj_consume_token(95); break; + case 96: + jj_consume_token(96); + break; default: jj_la1[7] = jj_gen; jj_consume_token(-1); @@ -709,8 +709,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 61: case 68: case IDENT: - case 94: case 95: + case 96: ; break; default: @@ -786,8 +786,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 61: case 68: case IDENT: - case 94: case 95: + case 96: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 8: jj_consume_token(8); @@ -844,8 +844,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 61: case 68: case IDENT: - case 94: case 95: + case 96: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: case 17: @@ -859,8 +859,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 47: case 50: case 61: - case 94: case 95: + case 96: class_definition(); break; case 5: @@ -895,8 +895,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 47: case 50: case 61: - case 94: case 95: + case 96: class_definition(); break; case 5: @@ -1772,8 +1772,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 61: case 68: case IDENT: - case 94: case 95: + case 96: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: case 17: @@ -1787,8 +1787,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 47: case 50: case 61: - case 94: case 95: + case 96: class_definition(); break; case 5: @@ -1857,8 +1857,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 47: case 50: case 61: - case 94: case 95: + case 96: class_definition(); break; case 5: @@ -4997,9 +4997,9 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_scanpos = xsp; if (jj_scan_token(17)) { jj_scanpos = xsp; - if (jj_scan_token(94)) { + if (jj_scan_token(95)) { jj_scanpos = xsp; - if (jj_scan_token(95)) return true; + if (jj_scan_token(96)) return true; } } } @@ -5736,10 +5736,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; + static private int[] jj_la1_3; static { jj_la1_init_0(); jj_la1_init_1(); jj_la1_init_2(); + jj_la1_init_3(); } private static void jj_la1_init_0() { jj_la1_0 = new int[] {0x0,0x0,0x45020880,0x800,0x40000000,0x0,0x0,0x5020080,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x0,0x0,0x4000,0x0,0x4000,0x0,0x80001040,0x4d8329a0,0x100,0x800,0x0,0x8000000,0x458300a0,0x458300a0,0x0,0x458320a0,0x4d8329a0,0x0,0x0,0x0,0x4000,0x0,0x0,0x810000,0x810000,0x20,0x20,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x2d00,0x0,0x2d00,0x400,0x800,0x2000,0x0,0x400,0x800,0x458300a0,0x458320a0,0x458300a0,0x0,0x0,0x0,0xa0240000,0x80200000,0x0,0xa0240000,0x80201040,0x100000,0x80201040,0x80201040,0x8000,0xa0240000,0x100000,0xa0240000,0xa0240000,0x8000,0x80201040,0xa0240000,0x0,0x0,0xa0240000,0x80201040,0x2000000,0x80201040,0xa0240000,0x2000000,0xa0240000,0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x80001040,0x4000,0x0,0x0,}; @@ -5748,7 +5750,10 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_la1_1 = new int[] {0x0,0x200000,0x20049064,0x0,0x0,0x8000,0x40000,0x20041064,0x0,0x40000000,0x0,0x0,0x0,0x2106000,0x106000,0x0,0x0,0x0,0x8000000,0x0,0x0,0x4400400a,0x218e9475,0x0,0x0,0x80000,0x0,0x21069465,0x21069465,0x400000,0x21069465,0x218e9475,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x20400,0x20400,0x1000001,0x1000001,0x0,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,0x0,0x21069465,0x21069465,0x21069465,0x400000,0x4000,0x4000,0x40010800,0x880,0x40000000,0x40010800,0x4400488a,0x0,0x4400488a,0x4400488a,0x0,0x40010800,0x0,0x40010800,0x40010800,0x0,0x4400488a,0x40010800,0x0,0x200,0x40010800,0x4400488a,0x0,0x4400488a,0x40010800,0x0,0x40010800,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4004000,0x0,0x2,0x40000008,0x0,0x0,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x4400400a,0x0,0x0,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x4000010,0x0,0xc0000000,0x0,0x0,0x0,0x0,0xc0000000,0x4,0x0,0x80,0x4000000,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x3c03c015,0xc4000010,0x0,0x0,0x0,0x0,0xc4000010,0xc4000010,0x0,0xc4000010,0xc4000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0xc4000010,0xc4000010,0xc4000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x3c03c015,0x0,0x3c03c015,0x3c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x3c03c015,0x4000010,0x80,0x0,0x4000010,0x3c03c015,0x0,0x3c03c015,0x4000010,0x0,0x4000010,0x0,0x3c03c015,0x0,0x3c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x38000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x3c03c015,0x80,0x80,0x4000000,0x80,0x3c03c015,0x80,0x3c03c015,0x80,0x80,0x3c03c035,0x0,0x4000,0x8000000,}; + jj_la1_2 = new int[] {0x4000010,0x0,0x80000000,0x0,0x0,0x0,0x0,0x80000000,0x4,0x0,0x80,0x4000000,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x6c03c015,0x84000010,0x0,0x0,0x0,0x0,0x84000010,0x84000010,0x0,0x84000010,0x84000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0x84000010,0x84000010,0x84000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x6c03c015,0x0,0x6c03c015,0x6c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x6c03c015,0x4000010,0x80,0x0,0x4000010,0x6c03c015,0x0,0x6c03c015,0x4000010,0x0,0x4000010,0x0,0x6c03c015,0x0,0x6c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x68000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x6c03c015,0x80,0x80,0x4000000,0x80,0x6c03c015,0x80,0x6c03c015,0x80,0x80,0x6c03c035,0x0,0x4000,0x8000000,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[10]; private boolean jj_rescan = false; @@ -5937,7 +5942,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo /** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); - boolean[] la1tokens = new boolean[96]; + boolean[] la1tokens = new boolean[97]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; @@ -5954,10 +5959,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo if ((jj_la1_2[i] & (1<", "", + "", "", "", "\"operator function\"", diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTokenManager.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTokenManager.java index 754f36e8..5aa460e2 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTokenManager.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTokenManager.java @@ -15,20 +15,25 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: - if ((active0 & 0x3ffffffffffffff0L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active1 & 0x80000L) != 0L) + return 20; + if ((active0 & 0x377bdef7bdef7bf0L) != 0L || (active1 & 0x180000000L) != 0L) { jjmatchedKind = 90; return 2; } - if ((active1 & 0x80000L) != 0L) - return 13; if ((active1 & 0xb30010L) != 0L) - return 9; + return 13; + if ((active0 & 0x884210842108400L) != 0L) + { + jjmatchedKind = 90; + return 44; + } return -1; case 1: if ((active0 & 0x108420080400000L) != 0L) return 2; - if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0x180000000L) != 0L) { if (jjmatchedPos != 1) { @@ -41,7 +46,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 2: if ((active0 & 0x400000800201200L) != 0L) return 2; - if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0x180000000L) != 0L) { jjmatchedKind = 90; jjmatchedPos = 2; @@ -51,7 +56,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 3: if ((active0 & 0x1000084212118400L) != 0L) return 2; - if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0x180000000L) != 0L) { if (jjmatchedPos != 3) { @@ -64,7 +69,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 4: if ((active0 & 0x1090004290008c0L) != 0L) return 2; - if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0x180000000L) != 0L) { jjmatchedKind = 90; jjmatchedPos = 4; @@ -74,7 +79,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 5: if ((active0 & 0x22200011009c0000L) != 0L) return 2; - if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0x180000000L) != 0L) { jjmatchedKind = 90; jjmatchedPos = 5; @@ -84,7 +89,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 6: if ((active0 & 0x80d0a000000000L) != 0L) return 2; - if ((active0 & 0x856250046026130L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x856250046026130L) != 0L || (active1 & 0x180000000L) != 0L) { if (jjmatchedPos != 6) { @@ -104,7 +109,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) } return 2; } - if ((active0 & 0x802200006020020L) != 0L || (active1 & 0xc0000000L) != 0L) + if ((active0 & 0x802200006020020L) != 0L || (active1 & 0x180000000L) != 0L) return 2; return -1; case 8: @@ -185,7 +190,7 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 68; return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L); case 47: - return jjStartNfaWithStates_0(0, 83, 13); + return jjStartNfaWithStates_0(0, 83, 20); case 58: jjmatchedKind = 69; return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L); @@ -227,7 +232,7 @@ private int jjMoveStringLiteralDfa0_0() case 110: return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L); case 111: - return jjMoveStringLiteralDfa1_0(0x108420000L, 0xc0000000L); + return jjMoveStringLiteralDfa1_0(0x108420000L, 0x180000000L); case 112: return jjMoveStringLiteralDfa1_0(0x210842000000000L, 0x0L); case 114: @@ -315,7 +320,7 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1) case 111: return jjMoveStringLiteralDfa2_0(active0, 0x1042108000201080L, active1, 0L); case 112: - return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0x180000000L); case 113: return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L); case 114: @@ -361,7 +366,7 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a return jjStartNfaWithStates_0(2, 35, 2); return jjMoveStringLiteralDfa3_0(active0, 0x180L, active1, 0L); case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0x180000000L); case 103: return jjMoveStringLiteralDfa3_0(active0, 0x10L, active1, 0L); case 105: @@ -442,7 +447,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a return jjStartNfaWithStates_0(3, 60, 2); return jjMoveStringLiteralDfa4_0(active0, 0x100000000L, active1, 0L); case 114: - return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0x180000000L); case 115: return jjMoveStringLiteralDfa4_0(active0, 0x42000400000040L, active1, 0L); case 116: @@ -470,7 +475,7 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long a switch(curChar) { case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0x180000000L); case 99: return jjMoveStringLiteralDfa5_0(active0, 0x100L, active1, 0L); case 101: @@ -578,7 +583,7 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long a return jjStartNfaWithStates_0(5, 32, 2); else if ((active0 & 0x1000000000L) != 0L) return jjStartNfaWithStates_0(5, 36, 2); - return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0x180000000L); default : break; } @@ -610,7 +615,7 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a case 110: return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L, active1, 0L); case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0x180000000L); case 115: if ((active0 & 0x80000000000000L) != 0L) return jjStartNfaWithStates_0(6, 55, 2); @@ -672,7 +677,7 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long a jjmatchedKind = 17; jjmatchedPos = 7; } - return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0x180000000L); case 116: if ((active0 & 0x2000000000000L) != 0L) return jjStartNfaWithStates_0(7, 49, 2); @@ -694,7 +699,7 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long a switch(curChar) { case 32: - return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0xc0000000L); + return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x180000000L); case 97: return jjMoveStringLiteralDfa9_0(active0, 0x40000000L, active1, 0L); case 98: @@ -746,7 +751,7 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long a return jjStartNfaWithStates_0(9, 50, 2); return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L, active1, 0L); case 102: - return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000L); + return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L); case 108: return jjMoveStringLiteralDfa10_0(active0, 0x2000L, active1, 0L); case 110: @@ -756,7 +761,7 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long a case 111: return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L, active1, 0L); case 114: - return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L); + return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x100000000L); case 116: return jjMoveStringLiteralDfa10_0(active0, 0x40000000L, active1, 0L); default : @@ -780,13 +785,13 @@ private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long case 101: if ((active0 & 0x2000L) != 0L) return jjStartNfaWithStates_0(10, 13, 2); - return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x80000000L); + return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x100000000L); case 110: if ((active0 & 0x10000000000L) != 0L) return jjStartNfaWithStates_0(10, 40, 2); break; case 117: - return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x40000000L); + return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x80000000L); default : break; } @@ -806,13 +811,13 @@ private int jjMoveStringLiteralDfa11_0(long old0, long active0, long old1, long case 98: return jjMoveStringLiteralDfa12_0(active0, 0x40000000000000L, active1, 0L); case 99: - return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L); + return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x100000000L); case 100: if ((active0 & 0x40000000L) != 0L) return jjStartNfaWithStates_0(11, 30, 2); break; case 110: - return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x40000000L); + return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L); default : break; } @@ -830,9 +835,9 @@ private int jjMoveStringLiteralDfa12_0(long old0, long active0, long old1, long switch(curChar) { case 99: - return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x40000000L); - case 111: return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x80000000L); + case 111: + return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x100000000L); case 121: if ((active0 & 0x40000000000000L) != 0L) return jjStartNfaWithStates_0(12, 54, 2); @@ -854,9 +859,9 @@ private int jjMoveStringLiteralDfa13_0(long old0, long active0, long old1, long switch(curChar) { case 114: - return jjMoveStringLiteralDfa14_0(active1, 0x80000000L); + return jjMoveStringLiteralDfa14_0(active1, 0x100000000L); case 116: - return jjMoveStringLiteralDfa14_0(active1, 0x40000000L); + return jjMoveStringLiteralDfa14_0(active1, 0x80000000L); default : break; } @@ -874,11 +879,11 @@ private int jjMoveStringLiteralDfa14_0(long old1, long active1) switch(curChar) { case 100: - if ((active1 & 0x80000000L) != 0L) - return jjStopAtPos(14, 95); + if ((active1 & 0x100000000L) != 0L) + return jjStopAtPos(14, 96); break; case 105: - return jjMoveStringLiteralDfa15_0(active1, 0x40000000L); + return jjMoveStringLiteralDfa15_0(active1, 0x80000000L); default : break; } @@ -896,7 +901,7 @@ private int jjMoveStringLiteralDfa15_0(long old1, long active1) switch(curChar) { case 111: - return jjMoveStringLiteralDfa16_0(active1, 0x40000000L); + return jjMoveStringLiteralDfa16_0(active1, 0x80000000L); default : break; } @@ -914,8 +919,8 @@ private int jjMoveStringLiteralDfa16_0(long old1, long active1) switch(curChar) { case 110: - if ((active1 & 0x40000000L) != 0L) - return jjStopAtPos(16, 94); + if ((active1 & 0x80000000L) != 0L) + return jjStopAtPos(16, 95); break; default : break; @@ -936,7 +941,7 @@ static final long[] jjbitVec0 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 31; + jjnewStateCnt = 44; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -951,22 +956,12 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 13: - if (curChar == 47) - { - if (kind > 3) - kind = 3; - jjCheckNAdd(20); - } - else if (curChar == 42) - jjCheckNAddStates(0, 2); - break; case 0: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 92) - kind = 92; - jjCheckNAddStates(3, 7); + if (kind > 93) + kind = 93; + jjCheckNAddStates(0, 6); } else if ((0x100002600L & l) != 0L) { @@ -974,140 +969,179 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 1; } else if (curChar == 47) - jjAddStates(8, 9); + jjAddStates(7, 8); else if (curChar == 46) - jjCheckNAdd(9); + jjCheckNAdd(13); else if (curChar == 34) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); + break; + case 44: + if ((0x3ff400000000000L & l) != 0L) + { + if (kind > 90) + kind = 90; + jjCheckNAdd(2); + } + else if (curChar == 45) + { + if (kind > 92) + kind = 92; + } + break; + case 20: + if (curChar == 47) + { + if (kind > 3) + kind = 3; + jjCheckNAdd(27); + } + else if (curChar == 42) + jjCheckNAddStates(12, 14); break; case 2: if ((0x3ff400000000000L & l) == 0L) break; if (kind > 90) kind = 90; - jjstateSet[jjnewStateCnt++] = 2; + jjCheckNAdd(2); break; case 3: if (curChar == 34) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); break; case 4: if ((0xfffffffbfffffbffL & l) != 0L) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); break; case 6: if ((0xfffffffffffffbffL & l) != 0L) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); break; case 7: if (curChar == 34 && kind > 91) kind = 91; break; - case 8: + case 9: + if (curChar == 45 && kind > 92) + kind = 92; + break; + case 12: if (curChar == 46) - jjCheckNAdd(9); + jjCheckNAdd(13); break; - case 9: + case 13: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 93) - kind = 93; - jjCheckNAddTwoStates(9, 10); + if (kind > 94) + kind = 94; + jjCheckNAddStates(15, 18); break; - case 11: + case 15: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 93) - kind = 93; - jjstateSet[jjnewStateCnt++] = 11; + if (kind > 94) + kind = 94; + jjCheckNAdd(15); break; - case 12: + case 16: + if (curChar == 45) + jjCheckNAdd(15); + break; + case 19: if (curChar == 47) - jjAddStates(8, 9); + jjAddStates(7, 8); break; - case 14: + case 21: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(12, 14); break; - case 15: + case 22: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 16; + jjstateSet[jjnewStateCnt++] = 23; break; - case 16: + case 23: if ((0xffff7fffffffffffL & l) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(12, 14); break; - case 17: + case 24: if (curChar == 47 && kind > 2) kind = 2; break; - case 18: + case 25: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 17; + jjstateSet[jjnewStateCnt++] = 24; break; - case 19: + case 26: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(27); break; - case 20: + case 27: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(27); break; - case 21: + case 28: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 92) - kind = 92; - jjCheckNAddStates(3, 7); + if (kind > 93) + kind = 93; + jjCheckNAddStates(0, 6); break; - case 22: + case 29: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 92) - kind = 92; - jjCheckNAdd(22); + if (kind > 93) + kind = 93; + jjCheckNAdd(29); break; - case 23: + case 30: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); + jjCheckNAddTwoStates(30, 31); break; - case 24: + case 31: if (curChar != 46) break; - if (kind > 93) - kind = 93; - jjCheckNAddTwoStates(25, 26); + if (kind > 94) + kind = 94; + jjCheckNAddStates(19, 22); break; - case 25: + case 32: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 93) - kind = 93; - jjCheckNAddTwoStates(25, 26); + if (kind > 94) + kind = 94; + jjCheckNAddStates(19, 22); break; - case 27: + case 34: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 93) - kind = 93; - jjstateSet[jjnewStateCnt++] = 27; + if (kind > 94) + kind = 94; + jjCheckNAdd(34); break; - case 28: + case 35: + if (curChar == 45) + jjCheckNAdd(34); + break; + case 38: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(28, 29); + jjCheckNAddStates(23, 26); break; - case 30: + case 40: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 93) - kind = 93; - jjstateSet[jjnewStateCnt++] = 30; + if (kind > 94) + kind = 94; + jjCheckNAdd(40); + break; + case 41: + if (curChar == 45) + jjCheckNAdd(40); break; default : break; } @@ -1121,6 +1155,23 @@ private int jjMoveNfa_0(int startState, int curPos) switch(jjstateSet[--i]) { case 0: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 90) + kind = 90; + jjCheckNAdd(2); + } + if ((0x2000000020L & l) != 0L) + { + if (kind > 92) + kind = 92; + } + if (curChar == 69) + jjCheckNAdd(9); + else if (curChar == 101) + jjCheckNAdd(9); + break; + case 44: case 2: if ((0x7fffffe87fffffeL & l) == 0L) break; @@ -1128,37 +1179,80 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 90; jjCheckNAdd(2); break; + case 1: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 90) + kind = 90; + jjCheckNAdd(2); + break; case 4: if ((0xffffffffefffffffL & l) != 0L) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); break; case 5: if (curChar == 92) jjstateSet[jjnewStateCnt++] = 6; break; case 6: - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); + break; + case 8: + if ((0x2000000020L & l) != 0L && kind > 92) + kind = 92; break; case 10: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; + if (curChar == 101) + jjCheckNAdd(9); + break; + case 11: + if (curChar == 69) + jjCheckNAdd(9); break; case 14: - case 16: - jjCheckNAddStates(0, 2); + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 15; break; - case 20: + case 17: + if (curChar == 101) + jjCheckNAdd(16); + break; + case 18: + if (curChar == 69) + jjCheckNAdd(16); + break; + case 21: + case 23: + jjCheckNAddStates(12, 14); + break; + case 27: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 27; break; - case 26: + case 33: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 27; + jjstateSet[jjnewStateCnt++] = 34; break; - case 29: + case 36: + if (curChar == 101) + jjCheckNAdd(35); + break; + case 37: + if (curChar == 69) + jjCheckNAdd(35); + break; + case 39: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + jjstateSet[jjnewStateCnt++] = 40; + break; + case 42: + if (curChar == 101) + jjCheckNAdd(41); + break; + case 43: + if (curChar == 69) + jjCheckNAdd(41); break; default : break; } @@ -1175,19 +1269,19 @@ private int jjMoveNfa_0(int startState, int curPos) case 4: case 6: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(10, 12); + jjCheckNAddStates(9, 11); break; - case 14: - case 16: + case 21: + case 23: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(12, 14); break; - case 20: + case 27: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 27; break; default : break; } @@ -1200,14 +1294,15 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 44 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 14, 15, 18, 22, 23, 24, 28, 29, 13, 19, 4, 5, 7, + 29, 30, 31, 38, 39, 42, 43, 20, 26, 4, 5, 7, 21, 22, 25, 13, + 14, 17, 18, 32, 33, 36, 37, 38, 39, 42, 43, }; /** Token literal values. */ @@ -1232,7 +1327,7 @@ public static final String[] jjstrLiteralImages = { "\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", "\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", "\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", -"\136", "\56\136", "\75", "\72\75", null, null, null, null, +"\136", "\56\136", "\75", "\72\75", null, null, null, null, null, "\157\160\145\162\141\164\157\162\40\146\165\156\143\164\151\157\156", "\157\160\145\162\141\164\157\162\40\162\145\143\157\162\144", }; /** Lexer state names. */ @@ -1240,14 +1335,14 @@ public static final String[] lexStateNames = { "DEFAULT", }; static final long[] jjtoToken = { - 0xfffffffffffffff1L, 0xffffffffL, + 0xfffffffffffffff1L, 0x1ffffffffL, }; static final long[] jjtoSkip = { 0xeL, 0x0L, }; protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[31]; -private final int[] jjstateSet = new int[62]; +private final int[] jjrounds = new int[44]; +private final int[] jjstateSet = new int[88]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1278,7 +1373,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 31; i-- > 0;) + for (i = 44; i-- > 0;) jjrounds[i] = 0x80000000; } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj index a6dceb85..2ba477f3 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj @@ -78,11 +78,12 @@ TOKEN: | | { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } +| | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? ( )? + | "." ( )? + | ) > } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt index 422e38fd..0296fd88 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt @@ -74,11 +74,12 @@ TOKEN: | | { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } +| | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? ( )? + | "." ( )? + | ) > } -- 2.47.1