From: miettinen Date: Wed, 19 Feb 2014 06:20:53 +0000 (+0000) Subject: Allow plus and minus signs in E notation exponent in Sysdyn parsers (refs #4703). X-Git-Tag: 1.8.1~133 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=1346642b304c2cfc90f4fdcc73239031a7f25909;p=simantics%2Fsysdyn.git Allow plus and minus signs in E notation exponent in Sysdyn parsers (refs #4703). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28888 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj index 5e8c3c2b..ce3b6126 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj @@ -109,9 +109,9 @@ TOKEN: { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? (["e","E"] (["+","-"])? )? + | "." (["e","E"] (["+","-"])? )? + | ["e","E"] (["+","-"])? ) > } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java index 011bc205..85adbb72 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java @@ -27,7 +27,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) return 2; } if ((active1 & 0x20000L) != 0L) - return 16; + return 17; return -1; case 1: if ((active0 & 0x84020080400000L) != 0L) @@ -182,7 +182,7 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 66; return jjMoveStringLiteralDfa1_0(0x0L, 0x2cc000L); case 47: - return jjStartNfaWithStates_0(0, 81, 16); + return jjStartNfaWithStates_0(0, 81, 17); case 58: jjmatchedKind = 67; return jjMoveStringLiteralDfa1_0(0x0L, 0x800000L); @@ -830,7 +830,7 @@ static final long[] jjbitVec0 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 34; + jjnewStateCnt = 37; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -866,12 +866,12 @@ private int jjMoveNfa_0(int startState, int curPos) else if (curChar == 39) jjCheckNAddTwoStates(4, 5); break; - case 16: + case 17: if (curChar == 47) { if (kind > 3) kind = 3; - jjCheckNAdd(23); + jjCheckNAdd(24); } else if (curChar == 42) jjCheckNAddStates(10, 12); @@ -923,99 +923,111 @@ private int jjMoveNfa_0(int startState, int curPos) jjCheckNAddTwoStates(12, 13); break; case 14: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(15); + break; + case 15: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjstateSet[jjnewStateCnt++] = 14; + jjCheckNAdd(15); break; - case 15: + case 16: if (curChar == 47) jjAddStates(5, 6); break; - case 17: + case 18: if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddStates(10, 12); break; - case 18: + case 19: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 19; + jjstateSet[jjnewStateCnt++] = 20; break; - case 19: + case 20: if ((0xffff7fffffffffffL & l) != 0L) jjCheckNAddStates(10, 12); break; - case 20: + case 21: if (curChar == 47 && kind > 2) kind = 2; break; - case 21: + case 22: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 21; break; - case 22: + case 23: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(23); + jjCheckNAdd(24); break; - case 23: + case 24: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(23); + jjCheckNAdd(24); break; - case 24: + case 25: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; jjCheckNAddStates(0, 4); break; - case 25: + case 26: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; - jjCheckNAdd(25); + jjCheckNAdd(26); break; - case 26: + case 27: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(26, 27); + jjCheckNAddTwoStates(27, 28); break; - case 27: + case 28: if (curChar != 46) break; if (kind > 92) kind = 92; - jjCheckNAddTwoStates(28, 29); + jjCheckNAddTwoStates(29, 30); break; - case 28: + case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjCheckNAddTwoStates(28, 29); + jjCheckNAddTwoStates(29, 30); break; - case 30: + case 31: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(32); + break; + case 32: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjstateSet[jjnewStateCnt++] = 30; + jjCheckNAdd(32); break; - case 31: + case 33: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(31, 32); + jjCheckNAddTwoStates(33, 34); break; - case 33: + case 35: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(36); + break; + case 36: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjstateSet[jjnewStateCnt++] = 33; + jjCheckNAdd(36); break; default : break; } @@ -1053,24 +1065,24 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 13: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 14; + jjAddStates(15, 16); break; - case 17: - case 19: + case 18: + case 20: jjCheckNAddStates(10, 12); break; - case 23: + case 24: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 23; + jjstateSet[jjnewStateCnt++] = 24; break; - case 29: + case 30: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + jjAddStates(17, 18); break; - case 32: + case 34: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; + jjAddStates(19, 20); break; default : break; } @@ -1089,17 +1101,17 @@ private int jjMoveNfa_0(int startState, int curPos) if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(7, 9); break; - case 17: - case 19: + case 18: + case 20: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(10, 12); break; - case 23: + case 24: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 23; + jjstateSet[jjnewStateCnt++] = 24; break; default : break; } @@ -1112,14 +1124,15 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 34 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 37 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 25, 26, 27, 31, 32, 16, 22, 7, 8, 10, 17, 18, 21, 4, 5, + 26, 27, 28, 33, 34, 17, 23, 7, 8, 10, 18, 19, 22, 4, 5, 14, + 15, 31, 32, 35, 36, }; /** Token literal values. */ @@ -1157,8 +1170,8 @@ static final long[] jjtoSkip = { 0xeL, 0x0L, }; protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[34]; -private final int[] jjstateSet = new int[68]; +private final int[] jjrounds = new int[37]; +private final int[] jjstateSet = new int[74]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1189,7 +1202,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 34; i-- > 0;) + for (i = 37; i-- > 0;) jjrounds[i] = 0x80000000; } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java index 19264f96..ab57915f 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java @@ -15,13 +15,13 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: + if ((active1 & 0x80000L) != 0L) + return 14; if ((active0 & 0x3ffffffffffffff0L) != 0L || (active1 & 0xc0000000L) != 0L) { jjmatchedKind = 90; return 2; } - if ((active1 & 0x80000L) != 0L) - return 13; if ((active1 & 0xb30010L) != 0L) return 9; return -1; @@ -185,7 +185,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, 14); case 58: jjmatchedKind = 69; return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L); @@ -936,7 +936,7 @@ static final long[] jjbitVec0 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 31; + jjnewStateCnt = 34; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -951,12 +951,12 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 13: + case 14: if (curChar == 47) { if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); } else if (curChar == 42) jjCheckNAddStates(0, 2); @@ -1015,99 +1015,111 @@ private int jjMoveNfa_0(int startState, int curPos) jjCheckNAddTwoStates(9, 10); break; case 11: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(12); + break; + case 12: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 11; + jjCheckNAdd(12); break; - case 12: + case 13: if (curChar == 47) jjAddStates(8, 9); break; - case 14: + case 15: if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; - case 15: + case 16: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 16; + jjstateSet[jjnewStateCnt++] = 17; break; - case 16: + case 17: if ((0xffff7fffffffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; - case 17: + case 18: if (curChar == 47 && kind > 2) kind = 2; break; - case 18: + case 19: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 17; + jjstateSet[jjnewStateCnt++] = 18; break; - case 19: + case 20: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); break; - case 20: + case 21: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); break; - case 21: + case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; jjCheckNAddStates(3, 7); break; - case 22: + case 23: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjCheckNAdd(22); + jjCheckNAdd(23); break; - case 23: + case 24: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); + jjCheckNAddTwoStates(24, 25); break; - case 24: + case 25: if (curChar != 46) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(25, 26); + jjCheckNAddTwoStates(26, 27); break; - case 25: + case 26: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(25, 26); + jjCheckNAddTwoStates(26, 27); break; - case 27: + case 28: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(29); + break; + case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 27; + jjCheckNAdd(29); break; - case 28: + case 30: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(28, 29); + jjCheckNAddTwoStates(30, 31); break; - case 30: + case 32: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(33); + break; + case 33: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 30; + jjCheckNAdd(33); break; default : break; } @@ -1141,24 +1153,24 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 10: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; + jjAddStates(13, 14); break; - case 14: - case 16: + case 15: + case 17: jjCheckNAddStates(0, 2); break; - case 20: + case 21: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 21; break; - case 26: + case 27: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 27; + jjAddStates(15, 16); break; - case 29: + case 31: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + jjAddStates(17, 18); break; default : break; } @@ -1177,17 +1189,17 @@ private int jjMoveNfa_0(int startState, int curPos) if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(10, 12); break; - case 14: - case 16: + case 15: + case 17: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(0, 2); break; - case 20: + case 21: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 21; break; default : break; } @@ -1200,14 +1212,15 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 34 - (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, + 15, 16, 19, 23, 24, 25, 30, 31, 14, 20, 4, 5, 7, 11, 12, 28, + 29, 32, 33, }; /** Token literal values. */ @@ -1246,8 +1259,8 @@ 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[34]; +private final int[] jjstateSet = new int[68]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1278,7 +1291,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 31; i-- > 0;) + for (i = 34; i-- > 0;) jjrounds[i] = 0x80000000; } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj index 2f9f31eb..04e39995 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj @@ -77,9 +77,9 @@ TOKEN: { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? (["e","E"] (["+","-"])? )? + | "." (["e","E"] (["+","-"])? )? + | ["e","E"] (["+","-"])? ) > } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParser.jj index 74caa34c..c7bd0bd9 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParser.jj @@ -57,9 +57,9 @@ TOKEN: { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? (["e","E"] (["+","-"])? )? + | "." (["e","E"] (["+","-"])? )? + | ["e","E"] (["+","-"])? ) > | | ))> } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParserTokenManager.java index 3de87d4f..d8eae25d 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParserTokenManager.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/tableParser/TableParserTokenManager.java @@ -1,5 +1,6 @@ /* Generated By:JavaCC: Do not edit this line. TableParserTokenManager.java */ package org.simantics.sysdyn.tableParser; +import java.util.ArrayList; /** Token Manager. */ public class TableParserTokenManager implements TableParserConstants @@ -14,17 +15,17 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: - if ((active1 & 0x80000L) != 0L) - return 24; if ((active0 & 0x3ffffffffffffff0L) != 0L) { jjmatchedKind = 90; return 2; } - if ((active1 & 0xb30010L) != 0L) - return 46; if ((active1 & 0x8000L) != 0L) return 9; + if ((active1 & 0xb30010L) != 0L) + return 52; + if ((active1 & 0x80000L) != 0L) + return 27; return -1; case 1: if ((active0 & 0x108420080400000L) != 0L) @@ -179,7 +180,7 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 68; return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L); case 47: - return jjStartNfaWithStates_0(0, 83, 24); + return jjStartNfaWithStates_0(0, 83, 27); case 58: jjmatchedKind = 69; return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L); @@ -831,7 +832,7 @@ static final long[] jjbitVec0 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 46; + jjnewStateCnt = 52; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -846,17 +847,7 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 24: - if (curChar == 47) - { - if (kind > 3) - kind = 3; - jjCheckNAdd(31); - } - else if (curChar == 42) - jjCheckNAddStates(0, 2); - break; - case 46: + case 52: if ((0x3ff000000000000L & l) != 0L) { if (kind > 94) @@ -867,7 +858,7 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 93) kind = 93; - jjCheckNAddTwoStates(43, 44); + jjCheckNAddTwoStates(48, 49); } break; case 9: @@ -875,7 +866,7 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 94) kind = 94; - jjCheckNAddStates(3, 7); + jjCheckNAddStates(0, 4); } else if (curChar == 46) jjCheckNAdd(10); @@ -885,7 +876,7 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 92) kind = 92; - jjCheckNAddStates(8, 17); + jjCheckNAddStates(5, 14); } else if ((0x100002600L & l) != 0L) { @@ -893,12 +884,22 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 1; } else if (curChar == 46) - jjCheckNAddTwoStates(43, 10); + jjCheckNAddTwoStates(48, 10); else if (curChar == 47) - jjAddStates(18, 19); + jjAddStates(15, 16); else if (curChar == 45) - jjAddStates(20, 21); + jjAddStates(17, 18); else if (curChar == 34) + jjCheckNAddStates(19, 21); + break; + case 27: + if (curChar == 47) + { + if (kind > 3) + kind = 3; + jjCheckNAdd(34); + } + else if (curChar == 42) jjCheckNAddStates(22, 24); break; case 2: @@ -910,15 +911,15 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 3: if (curChar == 34) - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; case 4: if ((0xfffffffbfffffbffL & l) != 0L) - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; case 6: if ((0xfffffffffffffbffL & l) != 0L) - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; case 7: if (curChar == 34 && kind > 91) @@ -926,7 +927,7 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 8: if (curChar == 45) - jjAddStates(20, 21); + jjAddStates(17, 18); break; case 10: if ((0x3ff000000000000L & l) == 0L) @@ -936,167 +937,191 @@ private int jjMoveNfa_0(int startState, int curPos) jjCheckNAddTwoStates(10, 11); break; case 12: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(13); + break; + case 13: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjstateSet[jjnewStateCnt++] = 12; + jjCheckNAdd(13); break; - case 13: + case 14: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjCheckNAddStates(3, 7); + jjCheckNAddStates(0, 4); break; - case 14: + case 15: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjCheckNAdd(14); + jjCheckNAdd(15); break; - case 15: + case 16: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(15, 16); + jjCheckNAddTwoStates(16, 17); break; - case 17: + case 18: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(19); + break; + case 19: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjstateSet[jjnewStateCnt++] = 17; + jjCheckNAdd(19); break; - case 18: + case 20: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); + jjCheckNAddTwoStates(20, 21); break; - case 19: + case 21: if (curChar != 46) break; if (kind > 94) kind = 94; - jjCheckNAddTwoStates(20, 21); + jjCheckNAddTwoStates(22, 23); break; - case 20: + case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjCheckNAddTwoStates(20, 21); + jjCheckNAddTwoStates(22, 23); break; - case 22: + case 24: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(25); + break; + case 25: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 94) kind = 94; - jjstateSet[jjnewStateCnt++] = 22; + jjCheckNAdd(25); break; - case 23: + case 26: if (curChar == 47) - jjAddStates(18, 19); + jjAddStates(15, 16); break; - case 25: + case 28: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(22, 24); break; - case 26: + case 29: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 27; + jjstateSet[jjnewStateCnt++] = 30; break; - case 27: + case 30: if ((0xffff7fffffffffffL & l) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(22, 24); break; - case 28: + case 31: if (curChar == 47 && kind > 2) kind = 2; break; - case 29: + case 32: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 28; + jjstateSet[jjnewStateCnt++] = 31; break; - case 30: + case 33: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(31); + jjCheckNAdd(34); break; - case 31: + case 34: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(31); + jjCheckNAdd(34); break; - case 32: + case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjCheckNAddStates(8, 17); + jjCheckNAddStates(5, 14); break; - case 33: + case 36: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjCheckNAdd(33); + jjCheckNAdd(36); break; - case 34: + case 37: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(34, 35); + jjCheckNAddTwoStates(37, 38); break; - case 35: + case 38: if (curChar != 46) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(36, 37); + jjCheckNAddTwoStates(39, 40); break; - case 36: + case 39: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(36, 37); + jjCheckNAddTwoStates(39, 40); break; - case 38: + case 41: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(42); + break; + case 42: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 38; + jjCheckNAdd(42); break; - case 39: + case 43: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(39, 40); + jjCheckNAddTwoStates(43, 44); break; - case 41: + case 45: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(46); + break; + case 46: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 41; + jjCheckNAdd(46); break; - case 42: + case 47: if (curChar == 46) - jjCheckNAddTwoStates(43, 10); + jjCheckNAddTwoStates(48, 10); break; - case 43: + case 48: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(43, 44); + jjCheckNAddTwoStates(48, 49); break; - case 45: + case 50: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(51); + break; + case 51: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjstateSet[jjnewStateCnt++] = 45; + jjCheckNAdd(51); break; default : break; } @@ -1119,47 +1144,47 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 4: if ((0xffffffffefffffffL & l) != 0L) - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; case 5: if (curChar == 92) jjstateSet[jjnewStateCnt++] = 6; break; case 6: - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; case 11: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 12; + jjAddStates(25, 26); break; - case 16: + case 17: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 17; + jjAddStates(27, 28); break; - case 21: + case 23: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 22; + jjAddStates(29, 30); break; - case 25: - case 27: - jjCheckNAddStates(0, 2); + case 28: + case 30: + jjCheckNAddStates(22, 24); break; - case 31: + case 34: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 31; - break; - case 37: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; + jjstateSet[jjnewStateCnt++] = 34; break; case 40: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 41; + jjAddStates(31, 32); break; case 44: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 45; + jjAddStates(33, 34); + break; + case 49: + if ((0x2000000020L & l) != 0L) + jjAddStates(35, 36); break; default : break; } @@ -1176,19 +1201,19 @@ private int jjMoveNfa_0(int startState, int curPos) case 4: case 6: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(22, 24); + jjCheckNAddStates(19, 21); break; - case 25: - case 27: + case 28: + case 30: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(0, 2); + jjCheckNAddStates(22, 24); break; - case 31: + case 34: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 31; + jjstateSet[jjnewStateCnt++] = 34; break; default : break; } @@ -1201,15 +1226,16 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 46 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 52 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 25, 26, 29, 14, 15, 16, 18, 19, 33, 34, 35, 39, 40, 14, 15, 16, - 18, 19, 24, 30, 9, 13, 4, 5, 7, + 15, 16, 17, 20, 21, 36, 37, 38, 43, 44, 15, 16, 17, 20, 21, 27, + 33, 9, 14, 4, 5, 7, 28, 29, 32, 12, 13, 18, 19, 24, 25, 41, + 42, 45, 46, 50, 51, }; /** Token literal values. */ @@ -1247,8 +1273,8 @@ static final long[] jjtoSkip = { 0xeL, 0x0L, }; protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[46]; -private final int[] jjstateSet = new int[92]; +private final int[] jjrounds = new int[52]; +private final int[] jjstateSet = new int[104]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1279,7 +1305,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 46; i-- > 0;) + for (i = 52; i-- > 0;) jjrounds[i] = 0x80000000; } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj index 7261f8cf..35d321e2 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj @@ -53,9 +53,9 @@ TOKEN: { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? (["e","E"] (["+","-"])? )? + | "." (["e","E"] (["+","-"])? )? + | ["e","E"] (["+","-"])? ) > } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt index 81d5fcb8..af0cd4bf 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt @@ -49,9 +49,9 @@ TOKEN: { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } | | "." ()? (["e","E"] )? - | "." (["e","E"] )? - | ["e","E"] + ( "." ()? (["e","E"] (["+","-"])? )? + | "." (["e","E"] (["+","-"])? )? + | ["e","E"] (["+","-"])? ) > } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTokenManager.java index 17e5dd5c..1758bea8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTokenManager.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTokenManager.java @@ -20,7 +20,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) return 2; } if ((active1 & 0x20000L) != 0L) - return 13; + return 14; if ((active1 & 0x2cc004L) != 0L) return 9; return -1; @@ -177,7 +177,7 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 66; return jjMoveStringLiteralDfa1_0(0x0L, 0x2cc000L); case 47: - return jjStartNfaWithStates_0(0, 81, 13); + return jjStartNfaWithStates_0(0, 81, 14); case 58: jjmatchedKind = 67; return jjMoveStringLiteralDfa1_0(0x0L, 0x800000L); @@ -837,7 +837,7 @@ static final long[] jjbitVec5 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 31; + jjnewStateCnt = 34; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -852,12 +852,12 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 13: + case 14: if (curChar == 47) { if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); } else if (curChar == 42) jjCheckNAddStates(0, 2); @@ -929,99 +929,111 @@ private int jjMoveNfa_0(int startState, int curPos) jjCheckNAddTwoStates(9, 10); break; case 11: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(12); + break; + case 12: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; - jjstateSet[jjnewStateCnt++] = 11; + jjCheckNAdd(12); break; - case 12: + case 13: if (curChar == 47) jjAddStates(8, 9); break; - case 14: + case 15: if ((0xfffffbffffffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; - case 15: + case 16: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 16; + jjstateSet[jjnewStateCnt++] = 17; break; - case 16: + case 17: if ((0xffff7fffffffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; - case 17: + case 18: if (curChar == 47 && kind > 2) kind = 2; break; - case 18: + case 19: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 17; + jjstateSet[jjnewStateCnt++] = 18; break; - case 19: + case 20: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); break; - case 20: + case 21: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(20); + jjCheckNAdd(21); break; - case 21: + case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 90) kind = 90; jjCheckNAddStates(3, 7); break; - case 22: + case 23: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 90) kind = 90; - jjCheckNAdd(22); + jjCheckNAdd(23); break; - case 23: + case 24: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); + jjCheckNAddTwoStates(24, 25); break; - case 24: + case 25: if (curChar != 46) break; if (kind > 91) kind = 91; - jjCheckNAddTwoStates(25, 26); + jjCheckNAddTwoStates(26, 27); break; - case 25: + case 26: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; - jjCheckNAddTwoStates(25, 26); + jjCheckNAddTwoStates(26, 27); break; - case 27: + case 28: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(29); + break; + case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; - jjstateSet[jjnewStateCnt++] = 27; + jjCheckNAdd(29); break; - case 28: + case 30: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(28, 29); + jjCheckNAddTwoStates(30, 31); break; - case 30: + case 32: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(33); + break; + case 33: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 91) kind = 91; - jjstateSet[jjnewStateCnt++] = 30; + jjCheckNAdd(33); break; default : break; } @@ -1055,24 +1067,24 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 10: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; + jjAddStates(13, 14); break; - case 14: - case 16: + case 15: + case 17: jjCheckNAddStates(0, 2); break; - case 20: + case 21: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 21; break; - case 26: + case 27: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 27; + jjAddStates(15, 16); break; - case 29: + case 31: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + jjAddStates(17, 18); break; default : break; } @@ -1102,17 +1114,17 @@ private int jjMoveNfa_0(int startState, int curPos) if (jjCanMove_1(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(10, 12); break; - case 14: - case 16: + case 15: + case 17: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(0, 2); break; - case 20: + case 21: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 20; + jjstateSet[jjnewStateCnt++] = 21; break; default : break; } @@ -1125,14 +1137,15 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 34 - (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, + 15, 16, 19, 23, 24, 25, 30, 31, 14, 20, 4, 5, 7, 11, 12, 28, + 29, 32, 33, }; private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { @@ -1206,8 +1219,8 @@ 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[34]; +private final int[] jjstateSet = new int[68]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1238,7 +1251,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 31; i-- > 0;) + for (i = 34; i-- > 0;) jjrounds[i] = 0x80000000; }