From: miettinen Date: Thu, 20 Mar 2014 12:11:41 +0000 (+0000) Subject: Fixed ^ and ^. handling in Sysdyn ModelParser (refs #4778). X-Git-Tag: 1.8.1~111 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=41585dfebdef9fdd38cf895620e24e6543947dee;p=simantics%2Fsysdyn.git Fixed ^ and ^. handling in Sysdyn ModelParser (refs #4778). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29182 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java index bcb3d09e..08ecdcb4 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java @@ -369,17 +369,16 @@ public class ExpressionParser implements ExpressionParserConstants { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 84: jj_consume_token(84); - primary(); break; case 85: jj_consume_token(85); - primary(); break; default: jj_la1[15] = jj_gen; jj_consume_token(-1); throw new ParseException(); } + primary(); break; default: jj_la1[16] = jj_gen; @@ -982,9 +981,9 @@ void named_arguments() : { return false; } - private boolean jj_3R_74() { + private boolean jj_3R_72() { if (jj_scan_token(67)) return true; - if (jj_3R_73()) return true; + if (jj_3R_71()) return true; return false; } @@ -1003,7 +1002,7 @@ void named_arguments() : { return false; } - private boolean jj_3R_79() { + private boolean jj_3R_77() { if (jj_scan_token(41)) return true; if (jj_3R_16()) return true; return false; @@ -1033,9 +1032,9 @@ void named_arguments() : { return false; } - private boolean jj_3R_76() { + private boolean jj_3R_74() { if (jj_scan_token(69)) return true; - if (jj_3R_75()) return true; + if (jj_3R_73()) return true; return false; } @@ -1049,38 +1048,38 @@ void named_arguments() : { return false; } - private boolean jj_3R_67() { + private boolean jj_3R_65() { if (jj_scan_token(69)) return true; - if (jj_3R_55()) return true; + if (jj_3R_53()) return true; return false; } - private boolean jj_3R_64() { + private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; - if (jj_3R_67()) { + if (jj_3R_65()) { jj_scanpos = xsp; - if (jj_3R_68()) return true; + if (jj_3R_66()) return true; } return false; } - private boolean jj_3R_58() { + private boolean jj_3R_56() { if (jj_scan_token(66)) return true; - if (jj_3R_52()) return true; + if (jj_3R_50()) return true; return false; } - private boolean jj_3R_78() { + private boolean jj_3R_76() { if (jj_3R_14()) return true; return false; } - private boolean jj_3R_75() { + private boolean jj_3R_73() { if (jj_3R_14()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_79()) jj_scanpos = xsp; + if (jj_3R_77()) jj_scanpos = xsp; return false; } @@ -1094,17 +1093,17 @@ void named_arguments() : { return false; } - private boolean jj_3R_77() { + private boolean jj_3R_75() { if (jj_scan_token(UNSIGNED_INTEGER)) return true; return false; } - private boolean jj_3R_73() { + private boolean jj_3R_71() { Token xsp; xsp = jj_scanpos; - if (jj_3R_77()) { + if (jj_3R_75()) { jj_scanpos = xsp; - if (jj_3R_78()) return true; + if (jj_3R_76()) return true; } return false; } @@ -1127,19 +1126,19 @@ void named_arguments() : { return false; } - private boolean jj_3R_72() { - if (jj_3R_75()) return true; + private boolean jj_3R_70() { + if (jj_3R_73()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_76()) { jj_scanpos = xsp; break; } + if (jj_3R_74()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_54() { + private boolean jj_3R_52() { if (jj_scan_token(68)) return true; - if (jj_3R_53()) return true; + if (jj_3R_51()) return true; return false; } @@ -1158,17 +1157,17 @@ void named_arguments() : { return false; } - private boolean jj_3R_61() { + private boolean jj_3R_59() { if (jj_3R_16()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_64()) jj_scanpos = xsp; + if (jj_3R_62()) jj_scanpos = xsp; return false; } - private boolean jj_3R_66() { + private boolean jj_3R_64() { if (jj_scan_token(69)) return true; - if (jj_3R_65()) return true; + if (jj_3R_63()) return true; return false; } @@ -1193,34 +1192,34 @@ void named_arguments() : { return false; } - private boolean jj_3R_71() { - if (jj_3R_73()) return true; + private boolean jj_3R_69() { + if (jj_3R_71()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_74()) jj_scanpos = xsp; + if (jj_3R_72()) jj_scanpos = xsp; return false; } - private boolean jj_3R_60() { + private boolean jj_3R_58() { if (jj_3R_13()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_63()) jj_scanpos = xsp; + if (jj_3R_61()) jj_scanpos = xsp; return false; } - private boolean jj_3R_55() { + private boolean jj_3R_53() { Token xsp; xsp = jj_scanpos; - if (jj_3R_60()) { + if (jj_3R_58()) { jj_scanpos = xsp; - if (jj_3R_61()) return true; + if (jj_3R_59()) return true; } return false; } - private boolean jj_3R_56() { - if (jj_3R_55()) return true; + private boolean jj_3R_54() { + if (jj_3R_53()) return true; return false; } @@ -1229,9 +1228,9 @@ void named_arguments() : { return false; } - private boolean jj_3R_70() { + private boolean jj_3R_68() { if (jj_3R_12()) return true; - if (jj_3R_51()) return true; + if (jj_3R_49()) return true; return false; } @@ -1253,39 +1252,33 @@ void named_arguments() : { return false; } - private boolean jj_3R_51() { + private boolean jj_3R_49() { if (jj_scan_token(60)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_56()) jj_scanpos = xsp; + if (jj_3R_54()) jj_scanpos = xsp; if (jj_scan_token(61)) return true; return false; } - private boolean jj_3R_50() { - if (jj_scan_token(85)) return true; - if (jj_3R_41()) return true; - return false; - } - - private boolean jj_3R_57() { - if (jj_3R_62()) return true; + private boolean jj_3R_55() { + if (jj_3R_60()) return true; return false; } - private boolean jj_3R_69() { + private boolean jj_3R_67() { if (jj_scan_token(67)) return true; return false; } - private boolean jj_3R_65() { + private boolean jj_3R_63() { Token xsp; xsp = jj_scanpos; - if (jj_3R_69()) { + if (jj_3R_67()) { jj_scanpos = xsp; - if (jj_3R_70()) { + if (jj_3R_68()) { jj_scanpos = xsp; - if (jj_3R_71()) return true; + if (jj_3R_69()) return true; } } return false; @@ -1299,18 +1292,18 @@ void named_arguments() : { private boolean jj_3R_48() { if (jj_scan_token(62)) return true; - if (jj_3R_55()) return true; + if (jj_3R_53()) return true; if (jj_scan_token(63)) return true; return false; } private boolean jj_3R_47() { if (jj_scan_token(64)) return true; - if (jj_3R_53()) return true; + if (jj_3R_51()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_54()) { jj_scanpos = xsp; break; } + if (jj_3R_52()) { jj_scanpos = xsp; break; } } if (jj_scan_token(65)) return true; return false; @@ -1324,23 +1317,23 @@ void named_arguments() : { } private boolean jj_3R_45() { - if (jj_3R_52()) return true; + if (jj_3R_50()) return true; return false; } - private boolean jj_3R_59() { + private boolean jj_3R_57() { if (jj_scan_token(69)) return true; if (jj_3R_16()) return true; return false; } - private boolean jj_3R_62() { + private boolean jj_3R_60() { if (jj_scan_token(64)) return true; - if (jj_3R_65()) return true; + if (jj_3R_63()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_66()) { jj_scanpos = xsp; break; } + if (jj_3R_64()) { jj_scanpos = xsp; break; } } if (jj_scan_token(65)) return true; return false; @@ -1348,23 +1341,18 @@ void named_arguments() : { private boolean jj_3R_44() { if (jj_3R_12()) return true; - if (jj_3R_51()) return true; - return false; - } - - private boolean jj_3R_49() { - if (jj_scan_token(84)) return true; - if (jj_3R_41()) return true; + if (jj_3R_49()) return true; return false; } private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; - if (jj_3R_49()) { + if (jj_scan_token(84)) { jj_scanpos = xsp; - if (jj_3R_50()) return true; + if (jj_scan_token(85)) return true; } + if (jj_3R_41()) return true; return false; } @@ -1453,19 +1441,19 @@ void named_arguments() : { return false; } - private boolean jj_3R_53() { + private boolean jj_3R_51() { if (jj_3R_16()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_59()) { jj_scanpos = xsp; break; } + if (jj_3R_57()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_63() { + private boolean jj_3R_61() { if (jj_scan_token(69)) return true; - if (jj_3R_55()) return true; + if (jj_3R_53()) return true; return false; } @@ -1476,9 +1464,9 @@ void named_arguments() : { return false; } - private boolean jj_3R_68() { + private boolean jj_3R_66() { if (jj_scan_token(21)) return true; - if (jj_3R_72()) return true; + if (jj_3R_70()) return true; return false; } @@ -1516,13 +1504,13 @@ void named_arguments() : { return false; } - private boolean jj_3R_52() { + private boolean jj_3R_50() { if (jj_3R_14()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_57()) jj_scanpos = xsp; + if (jj_3R_55()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_58()) jj_scanpos = xsp; + if (jj_3R_56()) jj_scanpos = xsp; return false; } 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 ce3b6126..e3884cf9 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj @@ -191,7 +191,7 @@ void term() : { void factor() : { } { - primary() ( "^" primary() | ".^" primary() )? + primary() ( ( "^" | ".^" ) primary() )? } void mul_op() : { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java index eb87c0d9..5f89fce8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java @@ -2170,13 +2170,13 @@ public class ModelParser implements ModelParserConstants { break; case 87: jj_consume_token(87); - primary(); break; default: jj_la1[108] = jj_gen; jj_consume_token(-1); throw new ParseException(); } + primary(); break; default: jj_la1[109] = jj_gen; @@ -2727,22 +2727,22 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_138() { + private boolean jj_3R_137() { if (jj_3R_46()) return true; return false; } - private boolean jj_3R_136() { + private boolean jj_3R_135() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(69)) { jj_scanpos = xsp; - if (jj_3R_138()) return true; + if (jj_3R_137()) return true; } return false; } - private boolean jj_3R_132() { + private boolean jj_3R_131() { if (jj_scan_token(71)) return true; return false; } @@ -2755,13 +2755,13 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_134() { + private boolean jj_3R_133() { if (jj_scan_token(66)) return true; - if (jj_3R_136()) return true; + if (jj_3R_135()) return true; return false; } - private boolean jj_3R_131() { + private boolean jj_3R_130() { if (jj_scan_token(68)) return true; if (jj_scan_token(IDENT)) return true; return false; @@ -2787,12 +2787,12 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_126() { + private boolean jj_3R_125() { if (jj_3R_46()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_132()) { jj_scanpos = xsp; break; } + if (jj_3R_131()) { jj_scanpos = xsp; break; } } return false; } @@ -2802,7 +2802,7 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_137() { + private boolean jj_3R_136() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(88)) return true; return false; @@ -2836,32 +2836,32 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_135() { - if (jj_3R_137()) return true; + private boolean jj_3R_134() { + if (jj_3R_136()) return true; return false; } - private boolean jj_3R_130() { - if (jj_3R_134()) return true; + private boolean jj_3R_129() { + if (jj_3R_133()) return true; return false; } - private boolean jj_3R_133() { - if (jj_3R_135()) return true; + private boolean jj_3R_132() { + if (jj_3R_134()) return true; return false; } - private boolean jj_3R_124() { + private boolean jj_3R_123() { if (jj_3R_63()) return true; return false; } - private boolean jj_3R_128() { + private boolean jj_3R_127() { Token xsp; xsp = jj_scanpos; if (jj_3_10()) { jj_scanpos = xsp; - if (jj_3R_133()) return true; + if (jj_3R_132()) return true; } return false; } @@ -2880,8 +2880,8 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_129() { - if (jj_3R_128()) return true; + private boolean jj_3R_128() { + if (jj_3R_127()) return true; return false; } @@ -2889,7 +2889,7 @@ public class ModelParser implements ModelParserConstants { if (jj_scan_token(62)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_129()) jj_scanpos = xsp; + if (jj_3R_128()) jj_scanpos = xsp; if (jj_scan_token(63)) return true; return false; } @@ -2935,21 +2935,21 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_125() { + private boolean jj_3R_124() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(68)) jj_scanpos = xsp; if (jj_scan_token(IDENT)) return true; xsp = jj_scanpos; - if (jj_3R_130()) jj_scanpos = xsp; + if (jj_3R_129()) jj_scanpos = xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_131()) { jj_scanpos = xsp; break; } + if (jj_3R_130()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_127() { + private boolean jj_3R_126() { if (jj_scan_token(70)) return true; return false; } @@ -2996,12 +2996,6 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_123() { - if (jj_scan_token(87)) return true; - if (jj_3R_113()) return true; - return false; - } - private boolean jj_3R_106() { if (jj_3R_63()) return true; return false; @@ -3012,8 +3006,9 @@ public class ModelParser implements ModelParserConstants { xsp = jj_scanpos; if (jj_scan_token(86)) { jj_scanpos = xsp; - if (jj_3R_123()) return true; + if (jj_scan_token(87)) return true; } + if (jj_3R_113()) return true; return false; } @@ -3025,18 +3020,18 @@ public class ModelParser implements ModelParserConstants { private boolean jj_3R_122() { if (jj_scan_token(64)) return true; - if (jj_3R_128()) return true; + if (jj_3R_127()) return true; if (jj_scan_token(65)) return true; return false; } private boolean jj_3R_121() { if (jj_scan_token(66)) return true; - if (jj_3R_126()) return true; + if (jj_3R_125()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_127()) { jj_scanpos = xsp; break; } + if (jj_3R_126()) { jj_scanpos = xsp; break; } } if (jj_scan_token(67)) return true; return false; @@ -3057,7 +3052,7 @@ public class ModelParser implements ModelParserConstants { private boolean jj_3R_118() { Token xsp; xsp = jj_scanpos; - if (jj_3R_124()) { + if (jj_3R_123()) { jj_scanpos = xsp; if (jj_scan_token(58)) { jj_scanpos = xsp; @@ -3069,7 +3064,7 @@ public class ModelParser implements ModelParserConstants { } private boolean jj_3R_119() { - if (jj_3R_125()) return true; + if (jj_3R_124()) return true; return false; } 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 04e39995..e780b8a5 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj @@ -628,7 +628,7 @@ void mul_op() : { void factor() : { } { - primary() ( "^" | ".^" primary() )? + primary() ( ( "^" | ".^" ) primary() )? } void primary() : {