]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
E notation correction (accept numbers written in E notation with plus sign, like...
authormiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 23 Jun 2014 07:12:01 +0000 (07:12 +0000)
committermiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 23 Jun 2014 07:12:01 +0000 (07:12 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29683 ac1ea38d-2e2b-0410-8846-a27921b304fc

fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTokenManager.java
fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj
fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt

index 5aa460e21333bbe30566c613a29635e61ee1aa4b..dd08221904d8064d8f66c0487d4ddbc970b9e44e 100644 (file)
@@ -16,18 +16,18 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
    {\r
       case 0:\r
          if ((active1 & 0x80000L) != 0L)\r
-            return 20;\r
-         if ((active0 & 0x377bdef7bdef7bf0L) != 0L || (active1 & 0x180000000L) != 0L)\r
+            return 22;\r
+         if ((active1 & 0xb30010L) != 0L)\r
+            return 10;\r
+         if ((active0 & 0x884210842108400L) != 0L)\r
          {\r
             jjmatchedKind = 90;\r
-            return 2;\r
+            return 48;\r
          }\r
-         if ((active1 & 0xb30010L) != 0L)\r
-            return 13;\r
-         if ((active0 & 0x884210842108400L) != 0L)\r
+         if ((active0 & 0x377bdef7bdef7bf0L) != 0L || (active1 & 0x180000000L) != 0L)\r
          {\r
             jjmatchedKind = 90;\r
-            return 44;\r
+            return 2;\r
          }\r
          return -1;\r
       case 1:\r
@@ -190,7 +190,7 @@ private int jjMoveStringLiteralDfa0_0()
          jjmatchedKind = 68;\r
          return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L);\r
       case 47:\r
-         return jjStartNfaWithStates_0(0, 83, 20);\r
+         return jjStartNfaWithStates_0(0, 83, 22);\r
       case 58:\r
          jjmatchedKind = 69;\r
          return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L);\r
@@ -941,7 +941,7 @@ static final long[] jjbitVec0 = {
 private int jjMoveNfa_0(int startState, int curPos)\r
 {\r
    int startsAt = 0;\r
-   jjnewStateCnt = 44;\r
+   jjnewStateCnt = 48;\r
    int i = 1;\r
    jjstateSet[0] = startState;\r
    int kind = 0x7fffffff;\r
@@ -971,29 +971,34 @@ private int jjMoveNfa_0(int startState, int curPos)
                   else if (curChar == 47)\r
                      jjAddStates(7, 8);\r
                   else if (curChar == 46)\r
-                     jjCheckNAdd(13);\r
+                     jjCheckNAdd(10);\r
                   else if (curChar == 34)\r
                      jjCheckNAddStates(9, 11);\r
                   break;\r
-               case 44:\r
+               case 48:\r
                   if ((0x3ff400000000000L & l) != 0L)\r
                   {\r
                      if (kind > 90)\r
                         kind = 90;\r
                      jjCheckNAdd(2);\r
                   }\r
+                  else if (curChar == 43)\r
+                  {\r
+                     if (kind > 92)\r
+                        kind = 92;\r
+                  }\r
                   else if (curChar == 45)\r
                   {\r
                      if (kind > 92)\r
                         kind = 92;\r
                   }\r
                   break;\r
-               case 20:\r
+               case 22:\r
                   if (curChar == 47)\r
                   {\r
                      if (kind > 3)\r
                         kind = 3;\r
-                     jjCheckNAdd(27);\r
+                     jjCheckNAdd(29);\r
                   }\r
                   else if (curChar == 42)\r
                      jjCheckNAddStates(12, 14);\r
@@ -1022,126 +1027,142 @@ private int jjMoveNfa_0(int startState, int curPos)
                      kind = 91;\r
                   break;\r
                case 9:\r
-                  if (curChar == 45 && kind > 92)\r
-                     kind = 92;\r
-                  break;\r
-               case 12:\r
                   if (curChar == 46)\r
-                     jjCheckNAdd(13);\r
+                     jjCheckNAdd(10);\r
                   break;\r
-               case 13:\r
+               case 10:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
                   jjCheckNAddStates(15, 18);\r
                   break;\r
-               case 15:\r
+               case 12:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
-                  jjCheckNAdd(15);\r
+                  jjCheckNAdd(12);\r
                   break;\r
-               case 16:\r
+               case 14:\r
                   if (curChar == 45)\r
-                     jjCheckNAdd(15);\r
+                     jjCheckNAdd(12);\r
+                  break;\r
+               case 15:\r
+                  if (curChar == 43)\r
+                     jjCheckNAdd(12);\r
+                  break;\r
+               case 18:\r
+                  if (curChar == 45 && kind > 92)\r
+                     kind = 92;\r
                   break;\r
                case 19:\r
+                  if (curChar == 43 && kind > 92)\r
+                     kind = 92;\r
+                  break;\r
+               case 21:\r
                   if (curChar == 47)\r
                      jjAddStates(7, 8);\r
                   break;\r
-               case 21:\r
+               case 23:\r
                   if ((0xfffffbffffffffffL & l) != 0L)\r
                      jjCheckNAddStates(12, 14);\r
                   break;\r
-               case 22:\r
+               case 24:\r
                   if (curChar == 42)\r
-                     jjstateSet[jjnewStateCnt++] = 23;\r
+                     jjstateSet[jjnewStateCnt++] = 25;\r
                   break;\r
-               case 23:\r
+               case 25:\r
                   if ((0xffff7fffffffffffL & l) != 0L)\r
                      jjCheckNAddStates(12, 14);\r
                   break;\r
-               case 24:\r
+               case 26:\r
                   if (curChar == 47 && kind > 2)\r
                      kind = 2;\r
                   break;\r
-               case 25:\r
+               case 27:\r
                   if (curChar == 42)\r
-                     jjstateSet[jjnewStateCnt++] = 24;\r
+                     jjstateSet[jjnewStateCnt++] = 26;\r
                   break;\r
-               case 26:\r
+               case 28:\r
                   if (curChar != 47)\r
                      break;\r
                   if (kind > 3)\r
                      kind = 3;\r
-                  jjCheckNAdd(27);\r
+                  jjCheckNAdd(29);\r
                   break;\r
-               case 27:\r
+               case 29:\r
                   if ((0xfffffffffffffbffL & l) == 0L)\r
                      break;\r
                   if (kind > 3)\r
                      kind = 3;\r
-                  jjCheckNAdd(27);\r
+                  jjCheckNAdd(29);\r
                   break;\r
-               case 28:\r
+               case 30:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 93)\r
                      kind = 93;\r
                   jjCheckNAddStates(0, 6);\r
                   break;\r
-               case 29:\r
+               case 31:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 93)\r
                      kind = 93;\r
-                  jjCheckNAdd(29);\r
+                  jjCheckNAdd(31);\r
                   break;\r
-               case 30:\r
+               case 32:\r
                   if ((0x3ff000000000000L & l) != 0L)\r
-                     jjCheckNAddTwoStates(30, 31);\r
+                     jjCheckNAddTwoStates(32, 33);\r
                   break;\r
-               case 31:\r
+               case 33:\r
                   if (curChar != 46)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
                   jjCheckNAddStates(19, 22);\r
                   break;\r
-               case 32:\r
+               case 34:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
                   jjCheckNAddStates(19, 22);\r
                   break;\r
-               case 34:\r
+               case 36:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
-                  jjCheckNAdd(34);\r
+                  jjCheckNAdd(36);\r
                   break;\r
-               case 35:\r
+               case 38:\r
                   if (curChar == 45)\r
-                     jjCheckNAdd(34);\r
+                     jjCheckNAdd(36);\r
                   break;\r
-               case 38:\r
+               case 39:\r
+                  if (curChar == 43)\r
+                     jjCheckNAdd(36);\r
+                  break;\r
+               case 41:\r
                   if ((0x3ff000000000000L & l) != 0L)\r
                      jjCheckNAddStates(23, 26);\r
                   break;\r
-               case 40:\r
+               case 43:\r
                   if ((0x3ff000000000000L & l) == 0L)\r
                      break;\r
                   if (kind > 94)\r
                      kind = 94;\r
-                  jjCheckNAdd(40);\r
+                  jjCheckNAdd(43);\r
                   break;\r
-               case 41:\r
+               case 45:\r
                   if (curChar == 45)\r
-                     jjCheckNAdd(40);\r
+                     jjCheckNAdd(43);\r
+                  break;\r
+               case 46:\r
+                  if (curChar == 43)\r
+                     jjCheckNAdd(43);\r
                   break;\r
                default : break;\r
             }\r
@@ -1167,11 +1188,11 @@ private int jjMoveNfa_0(int startState, int curPos)
                         kind = 92;\r
                   }\r
                   if (curChar == 69)\r
-                     jjCheckNAdd(9);\r
+                     jjCheckNAddTwoStates(18, 19);\r
                   else if (curChar == 101)\r
-                     jjCheckNAdd(9);\r
+                     jjCheckNAddTwoStates(18, 19);\r
                   break;\r
-               case 44:\r
+               case 48:\r
                case 2:\r
                   if ((0x7fffffe87fffffeL & l) == 0L)\r
                      break;\r
@@ -1201,58 +1222,58 @@ private int jjMoveNfa_0(int startState, int curPos)
                   if ((0x2000000020L & l) != 0L && kind > 92)\r
                      kind = 92;\r
                   break;\r
-               case 10:\r
+               case 11:\r
+                  if ((0x2000000020L & l) != 0L)\r
+                     jjstateSet[jjnewStateCnt++] = 12;\r
+                  break;\r
+               case 13:\r
                   if (curChar == 101)\r
-                     jjCheckNAdd(9);\r
+                     jjCheckNAddTwoStates(14, 15);\r
                   break;\r
-               case 11:\r
+               case 16:\r
                   if (curChar == 69)\r
-                     jjCheckNAdd(9);\r
-                  break;\r
-               case 14:\r
-                  if ((0x2000000020L & l) != 0L)\r
-                     jjstateSet[jjnewStateCnt++] = 15;\r
+                     jjCheckNAddTwoStates(14, 15);\r
                   break;\r
                case 17:\r
                   if (curChar == 101)\r
-                     jjCheckNAdd(16);\r
+                     jjCheckNAddTwoStates(18, 19);\r
                   break;\r
-               case 18:\r
+               case 20:\r
                   if (curChar == 69)\r
-                     jjCheckNAdd(16);\r
+                     jjCheckNAddTwoStates(18, 19);\r
                   break;\r
-               case 21:\r
                case 23:\r
+               case 25:\r
                   jjCheckNAddStates(12, 14);\r
                   break;\r
-               case 27:\r
+               case 29:\r
                   if (kind > 3)\r
                      kind = 3;\r
-                  jjstateSet[jjnewStateCnt++] = 27;\r
+                  jjstateSet[jjnewStateCnt++] = 29;\r
                   break;\r
-               case 33:\r
+               case 35:\r
                   if ((0x2000000020L & l) != 0L)\r
-                     jjstateSet[jjnewStateCnt++] = 34;\r
+                     jjstateSet[jjnewStateCnt++] = 36;\r
                   break;\r
-               case 36:\r
+               case 37:\r
                   if (curChar == 101)\r
-                     jjCheckNAdd(35);\r
+                     jjCheckNAddTwoStates(38, 39);\r
                   break;\r
-               case 37:\r
+               case 40:\r
                   if (curChar == 69)\r
-                     jjCheckNAdd(35);\r
+                     jjCheckNAddTwoStates(38, 39);\r
                   break;\r
-               case 39:\r
+               case 42:\r
                   if ((0x2000000020L & l) != 0L)\r
-                     jjstateSet[jjnewStateCnt++] = 40;\r
+                     jjstateSet[jjnewStateCnt++] = 43;\r
                   break;\r
-               case 42:\r
+               case 44:\r
                   if (curChar == 101)\r
-                     jjCheckNAdd(41);\r
+                     jjCheckNAddTwoStates(45, 46);\r
                   break;\r
-               case 43:\r
+               case 47:\r
                   if (curChar == 69)\r
-                     jjCheckNAdd(41);\r
+                     jjCheckNAddTwoStates(45, 46);\r
                   break;\r
                default : break;\r
             }\r
@@ -1271,17 +1292,17 @@ private int jjMoveNfa_0(int startState, int curPos)
                   if ((jjbitVec0[i2] & l2) != 0L)\r
                      jjCheckNAddStates(9, 11);\r
                   break;\r
-               case 21:\r
                case 23:\r
+               case 25:\r
                   if ((jjbitVec0[i2] & l2) != 0L)\r
                      jjCheckNAddStates(12, 14);\r
                   break;\r
-               case 27:\r
+               case 29:\r
                   if ((jjbitVec0[i2] & l2) == 0L)\r
                      break;\r
                   if (kind > 3)\r
                      kind = 3;\r
-                  jjstateSet[jjnewStateCnt++] = 27;\r
+                  jjstateSet[jjnewStateCnt++] = 29;\r
                   break;\r
                default : break;\r
             }\r
@@ -1294,15 +1315,15 @@ private int jjMoveNfa_0(int startState, int curPos)
          kind = 0x7fffffff;\r
       }\r
       ++curPos;\r
-      if ((i = jjnewStateCnt) == (startsAt = 44 - (jjnewStateCnt = startsAt)))\r
+      if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt)))\r
          return curPos;\r
       try { curChar = input_stream.readChar(); }\r
       catch(java.io.IOException e) { return curPos; }\r
    }\r
 }\r
 static final int[] jjnextStates = {
-   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
+   31, 32, 33, 41, 42, 44, 47, 22, 28, 4, 5, 7, 23, 24, 27, 10
+   11, 13, 16, 34, 35, 37, 40, 41, 42, 44, 47
 };\r
 \r
 /** Token literal values. */\r
@@ -1341,8 +1362,8 @@ static final long[] jjtoSkip = {
    0xeL, 0x0L, 
 };\r
 protected SimpleCharStream input_stream;\r
-private final int[] jjrounds = new int[44];\r
-private final int[] jjstateSet = new int[88];\r
+private final int[] jjrounds = new int[48];\r
+private final int[] jjstateSet = new int[96];\r
 private final StringBuilder jjimage = new StringBuilder();\r
 private StringBuilder image = jjimage;\r
 private int jjimageLen;\r
@@ -1373,7 +1394,7 @@ private void ReInitRounds()
 {\r
    int i;\r
    jjround = 0x80000001;\r
-   for (i = 44; i-- > 0;)\r
+   for (i = 48; i-- > 0;)\r
       jjrounds[i] = 0x80000000;\r
 }\r
 \r
index 190ea2f86aa97874f7044825e92805dd3d47b0e5..839340c836286c052a48fc95e8e18be3c3ed53f8 100644 (file)
@@ -78,7 +78,7 @@ TOKEN:
 | <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_",".", "0"-"9"])* >\r
 | <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
     { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
-| <EXP: "e" | "e-" | "E" | "E-" >\r
+| <EXP: "e" | "e-" | "E" | "E-" | "E+" | "e+" >\r
 | <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
 | <UNSIGNED_NUMBER:  \r
     ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (<EXP> <UNSIGNED_INTEGER>)?\r
index 2fc5f9ce5e00c77b55e4b20a7179a72f980cbe65..c65900fd944a24e1ddbb7c09040be32c1f0d2826 100644 (file)
@@ -74,7 +74,7 @@ TOKEN:
 | <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_",".", "0"-"9"])* >\r
 | <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
     { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
-| <EXP: "e" | "e-" | "E" | "E-" >\r
+| <EXP: "e" | "e-" | "E" | "E-" | "E+" | "e+" >\r
 | <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
 | <UNSIGNED_NUMBER:  \r
     ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (<EXP> <UNSIGNED_INTEGER>)?\r