From 6e85bbd861a94fea5281bbf199d965f1b0658c58 Mon Sep 17 00:00:00 2001 From: miettinen Date: Wed, 20 Feb 2013 11:03:24 +0000 Subject: [PATCH] Adding java files compiled from ModelParser.jj (refs #3965) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26816 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/modelParser/ModelParser.java | 565 +++++++++--------- 1 file changed, 291 insertions(+), 274 deletions(-) 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 b069dc03..c61ea3fb 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java @@ -690,7 +690,8 @@ public class ModelParser implements ModelParserConstants { /*** Component Clause **********************************************/ final public void component_clause() throws ParseException { - type_prefix(); + boolean isInput = false; + isInput = type_prefix(); type_specifier(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 66: @@ -700,10 +701,11 @@ public class ModelParser implements ModelParserConstants { jj_la1[39] = jj_gen; ; } - component_list(); + component_list(isInput); } - final public void type_prefix() throws ParseException { + final public boolean type_prefix() throws ParseException { + boolean isInput = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 16: case 23: @@ -752,12 +754,13 @@ public class ModelParser implements ModelParserConstants { case 32: case 56: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 56: - jj_consume_token(56); - break; case 32: jj_consume_token(32); break; + case 56: + jj_consume_token(56); + isInput = true; + break; default: jj_la1[44] = jj_gen; jj_consume_token(-1); @@ -768,14 +771,16 @@ public class ModelParser implements ModelParserConstants { jj_la1[45] = jj_gen; ; } + {if (true) return isInput;} + throw new Error("Missing return statement in function"); } final public void type_specifier() throws ParseException { name(); } - final public void component_list() throws ParseException { - component_declaration(); + final public void component_list(boolean isInput) throws ParseException { + component_declaration(isInput); label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -787,12 +792,12 @@ public class ModelParser implements ModelParserConstants { break label_6; } jj_consume_token(71); - component_declaration(); + component_declaration(isInput); } } - final public void component_declaration() throws ParseException { - declaration(); + final public void component_declaration(boolean isInput) throws ParseException { + declaration(isInput); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 31: conditional_attribute(); @@ -809,8 +814,10 @@ public class ModelParser implements ModelParserConstants { expression(); } - final public void declaration() throws ParseException { + final public void declaration(boolean isInput) throws ParseException { + String input_variable = null; jj_consume_token(IDENT); + if (isInput) input_variable = new String(token.image); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 66: array_subscripts(); @@ -824,11 +831,16 @@ public class ModelParser implements ModelParserConstants { case 88: case 89: modification(); + input_variable = null; break; default: jj_la1[49] = jj_gen; ; } + if (input_variable != null) + { + //System.out.println("collect: " + input_variable); + } } /*** Modification **********************************************/ @@ -1100,7 +1112,7 @@ public class ModelParser implements ModelParserConstants { } final public void component_declaration1() throws ParseException { - declaration(); + declaration(false); comment(); } @@ -2620,12 +2632,6 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_95() { - if (jj_3R_101()) return true; - if (jj_3R_94()) return true; - return false; - } - private boolean jj_3R_71() { if (jj_3R_76()) return true; return false; @@ -2649,58 +2655,6 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_83() { - if (jj_3R_89()) return true; - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_88() { - if (jj_3R_93()) return true; - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3R_101() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(82)) { - jj_scanpos = xsp; - if (jj_scan_token(83)) { - jj_scanpos = xsp; - if (jj_scan_token(84)) { - jj_scanpos = xsp; - if (jj_scan_token(85)) return true; - } - } - } - return false; - } - - private boolean jj_3R_87() { - if (jj_3R_94()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_95()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_52() { - if (jj_3R_64()) return true; - return false; - } - - private boolean jj_3R_43() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_52()) { jj_scanpos = xsp; break; } - } - return false; - } - private boolean jj_3R_93() { Token xsp; xsp = jj_scanpos; @@ -2774,6 +2728,11 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_52() { + if (jj_3R_64()) return true; + return false; + } + private boolean jj_3_7() { if (jj_3R_44()) return true; if (jj_scan_token(88)) return true; @@ -2789,38 +2748,15 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_51() { - if (jj_3R_63()) return true; - return false; - } - - private boolean jj_3R_50() { - if (jj_scan_token(59)) return true; - return false; - } - - private boolean jj_3R_49() { + private boolean jj_3R_43() { Token xsp; - xsp = jj_scanpos; - if (jj_3_5()) { - jj_scanpos = xsp; - if (jj_3R_60()) { - jj_scanpos = xsp; - if (jj_3R_61()) { - jj_scanpos = xsp; - if (jj_3R_62()) return true; - } - } + while (true) { + xsp = jj_scanpos; + if (jj_3R_52()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3_5() { - if (jj_scan_token(57)) return true; - if (jj_3R_43()) return true; - return false; - } - private boolean jj_3R_73() { Token xsp; xsp = jj_scanpos; @@ -2829,20 +2765,6 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_42() { - if (jj_3R_43()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_49()) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_3R_50()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_51()) jj_scanpos = xsp; - return false; - } - private boolean jj_3R_65() { if (jj_3R_73()) return true; Token xsp; @@ -2871,19 +2793,43 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_68() { + private boolean jj_3R_51() { + if (jj_3R_63()) return true; + return false; + } + + private boolean jj_3R_50() { + if (jj_scan_token(59)) return true; + return false; + } + + private boolean jj_3R_49() { Token xsp; xsp = jj_scanpos; - if (jj_scan_token(46)) jj_scanpos = xsp; - if (jj_scan_token(45)) return true; + if (jj_3_5()) { + jj_scanpos = xsp; + if (jj_3R_60()) { + jj_scanpos = xsp; + if (jj_3R_61()) { + jj_scanpos = xsp; + if (jj_3R_62()) return true; + } + } + } return false; } - private boolean jj_3R_90() { + private boolean jj_3_5() { + if (jj_scan_token(57)) return true; + if (jj_3R_43()) return true; + return false; + } + + private boolean jj_3R_68() { Token xsp; xsp = jj_scanpos; - if (jj_scan_token(50)) jj_scanpos = xsp; - if (jj_scan_token(44)) return true; + if (jj_scan_token(46)) jj_scanpos = xsp; + if (jj_scan_token(45)) return true; return false; } @@ -2895,6 +2841,20 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_42() { + if (jj_3R_43()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_49()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_50()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_51()) jj_scanpos = xsp; + return false; + } + private boolean jj_3R_56() { if (jj_scan_token(31)) return true; if (jj_3R_45()) return true; @@ -2916,6 +2876,14 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_90() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(50)) jj_scanpos = xsp; + if (jj_scan_token(44)) return true; + return false; + } + private boolean jj_3_4() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(88)) return true; @@ -2944,6 +2912,38 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_59() { + if (jj_scan_token(21)) return true; + return false; + } + + private boolean jj_3R_63() { + if (jj_scan_token(14)) return true; + return false; + } + + private boolean jj_3R_48() { + if (jj_scan_token(STRING)) return true; + return false; + } + + private boolean jj_3R_41() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_48()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_128() { + if (jj_3R_45()) return true; + return false; + } + + private boolean jj_3R_124() { + if (jj_3R_45()) return true; + return false; + } + private boolean jj_3R_84() { Token xsp; xsp = jj_scanpos; @@ -2985,78 +2985,36 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_59() { - if (jj_scan_token(21)) return true; - return false; - } - - private boolean jj_3R_63() { - if (jj_scan_token(14)) return true; - return false; - } - - private boolean jj_3R_48() { - if (jj_scan_token(STRING)) return true; - return false; - } - - private boolean jj_3R_41() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_48()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_127() { - if (jj_3R_45()) return true; - return false; - } - - private boolean jj_3R_123() { - if (jj_3R_45()) return true; - return false; - } - - private boolean jj_3R_98() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(56)) { - jj_scanpos = xsp; - if (jj_scan_token(32)) return true; - } - return false; - } - - private boolean jj_3R_119() { + private boolean jj_3R_120() { if (jj_scan_token(71)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_123()) jj_scanpos = xsp; + if (jj_3R_124()) jj_scanpos = xsp; return false; } - private boolean jj_3R_125() { + private boolean jj_3R_126() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(69)) { jj_scanpos = xsp; - if (jj_3R_127()) return true; + if (jj_3R_128()) return true; } return false; } - private boolean jj_3R_120() { + private boolean jj_3R_121() { if (jj_scan_token(71)) return true; return false; } - private boolean jj_3R_122() { + private boolean jj_3R_123() { if (jj_scan_token(66)) return true; - if (jj_3R_125()) return true; + if (jj_3R_126()) return true; return false; } - private boolean jj_3R_117() { + private boolean jj_3R_118() { if (jj_scan_token(68)) return true; if (jj_scan_token(IDENT)) return true; return false; @@ -3077,74 +3035,64 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_118() { + private boolean jj_3R_119() { if (jj_3R_45()) return true; return false; } - private boolean jj_3R_112() { + private boolean jj_3R_113() { if (jj_3R_45()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_120()) { jj_scanpos = xsp; break; } + if (jj_3R_121()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_111() { + private boolean jj_3R_112() { Token xsp; xsp = jj_scanpos; - if (jj_3R_118()) jj_scanpos = xsp; + if (jj_3R_119()) jj_scanpos = xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_119()) { jj_scanpos = xsp; break; } + if (jj_3R_120()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_62() { - if (jj_3R_69()) return true; - return false; - } - - private boolean jj_3R_126() { + private boolean jj_3R_127() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(88)) return true; return false; } - private boolean jj_3R_108() { + private boolean jj_3R_109() { if (jj_3R_57()) return true; return false; } - private boolean jj_3R_124() { - if (jj_3R_126()) return true; - return false; - } - - private boolean jj_3R_116() { - if (jj_3R_122()) return true; + private boolean jj_3R_125() { + if (jj_3R_127()) return true; return false; } - private boolean jj_3R_121() { - if (jj_3R_124()) return true; + private boolean jj_3R_117() { + if (jj_3R_123()) return true; return false; } - private boolean jj_3R_92() { - if (jj_3R_57()) return true; + private boolean jj_3R_122() { + if (jj_3R_125()) return true; return false; } - private boolean jj_3R_114() { + private boolean jj_3R_115() { Token xsp; xsp = jj_scanpos; if (jj_3_9()) { jj_scanpos = xsp; - if (jj_3R_121()) return true; + if (jj_3R_122()) return true; } return false; } @@ -3157,92 +3105,101 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_62() { + if (jj_3R_69()) return true; + return false; + } + private boolean jj_3R_67() { if (jj_scan_token(68)) return true; if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_115() { - if (jj_3R_114()) return true; + private boolean jj_3R_116() { + if (jj_3R_115()) return true; return false; } - private boolean jj_3R_97() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(5)) { - jj_scanpos = xsp; - if (jj_scan_token(42)) { - jj_scanpos = xsp; - if (jj_scan_token(49)) return true; - } - } + private boolean jj_3R_102() { + if (jj_scan_token(56)) return true; return false; } - private boolean jj_3R_96() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(16)) { - jj_scanpos = xsp; - if (jj_scan_token(23)) return true; - } + private boolean jj_3R_114() { + if (jj_scan_token(70)) return true; return false; } - private boolean jj_3R_91() { + private boolean jj_3R_110() { + if (jj_scan_token(62)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_96()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_97()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_98()) jj_scanpos = xsp; + if (jj_3R_116()) jj_scanpos = xsp; + if (jj_scan_token(63)) return true; return false; } - private boolean jj_3R_113() { - if (jj_scan_token(70)) return true; + private boolean jj_3R_92() { + if (jj_3R_57()) return true; return false; } - private boolean jj_3R_109() { - if (jj_scan_token(62)) return true; + private boolean jj_3R_111() { Token xsp; xsp = jj_scanpos; - if (jj_3R_115()) jj_scanpos = xsp; - if (jj_scan_token(63)) return true; + if (jj_scan_token(68)) jj_scanpos = xsp; + if (jj_scan_token(IDENT)) return true; + xsp = jj_scanpos; + if (jj_3R_117()) jj_scanpos = xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_118()) { jj_scanpos = xsp; break; } + } return false; } - private boolean jj_3R_61() { - if (jj_3R_68()) return true; + private boolean jj_3R_98() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(32)) { + jj_scanpos = xsp; + if (jj_3R_102()) return true; + } return false; } - private boolean jj_3R_85() { - if (jj_3R_91()) return true; - if (jj_3R_92()) return true; + private boolean jj_3R_97() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(5)) { + jj_scanpos = xsp; + if (jj_scan_token(42)) { + jj_scanpos = xsp; + if (jj_scan_token(49)) return true; + } + } return false; } - private boolean jj_3R_110() { + private boolean jj_3R_96() { 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_116()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_117()) { jj_scanpos = xsp; break; } + if (jj_scan_token(16)) { + jj_scanpos = xsp; + if (jj_scan_token(23)) return true; } return false; } - private boolean jj_3R_81() { - if (jj_3R_85()) return true; + private boolean jj_3R_91() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_96()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_97()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_98()) jj_scanpos = xsp; return false; } @@ -3263,9 +3220,8 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3_6() { - if (jj_scan_token(IDENT)) return true; - if (jj_scan_token(88)) return true; + private boolean jj_3R_61() { + if (jj_3R_68()) return true; return false; } @@ -3283,14 +3239,15 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_107() { + private boolean jj_3R_108() { if (jj_scan_token(87)) return true; if (jj_3R_99()) return true; return false; } - private boolean jj_3R_76() { - if (jj_scan_token(55)) return true; + private boolean jj_3R_85() { + if (jj_3R_91()) return true; + if (jj_3R_92()) return true; return false; } @@ -3299,63 +3256,64 @@ public class ModelParser implements ModelParserConstants { xsp = jj_scanpos; if (jj_scan_token(86)) { jj_scanpos = xsp; - if (jj_3R_107()) return true; + if (jj_3R_108()) return true; } return false; } - private boolean jj_3R_106() { - if (jj_scan_token(64)) return true; - if (jj_3R_114()) return true; - if (jj_scan_token(65)) return true; + private boolean jj_3R_81() { + if (jj_3R_85()) return true; return false; } - private boolean jj_3R_78() { - if (jj_scan_token(13)) return true; + private boolean jj_3R_107() { + if (jj_scan_token(64)) return true; + if (jj_3R_115()) return true; + if (jj_scan_token(65)) return true; return false; } - private boolean jj_3R_105() { + private boolean jj_3R_106() { if (jj_scan_token(66)) return true; - if (jj_3R_112()) return true; + if (jj_3R_113()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_113()) { jj_scanpos = xsp; break; } + if (jj_3R_114()) { jj_scanpos = xsp; break; } } if (jj_scan_token(67)) return true; return false; } - private boolean jj_3R_75() { - if (jj_scan_token(36)) return true; - return false; - } - - private boolean jj_3R_104() { + private boolean jj_3R_105() { if (jj_scan_token(62)) return true; - if (jj_3R_111()) return true; + if (jj_3R_112()) return true; if (jj_scan_token(63)) return true; return false; } - private boolean jj_3R_102() { + private boolean jj_3R_103() { Token xsp; xsp = jj_scanpos; - if (jj_3R_108()) { + if (jj_3R_109()) { jj_scanpos = xsp; if (jj_scan_token(58)) { jj_scanpos = xsp; if (jj_scan_token(46)) return true; } } - if (jj_3R_109()) return true; + if (jj_3R_110()) return true; return false; } - private boolean jj_3R_103() { - if (jj_3R_110()) return true; + private boolean jj_3R_104() { + if (jj_3R_111()) return true; + return false; + } + + private boolean jj_3_6() { + if (jj_scan_token(IDENT)) return true; + if (jj_scan_token(88)) return true; return false; } @@ -3372,8 +3330,6 @@ public class ModelParser implements ModelParserConstants { jj_scanpos = xsp; if (jj_scan_token(33)) { jj_scanpos = xsp; - if (jj_3R_102()) { - jj_scanpos = xsp; if (jj_3R_103()) { jj_scanpos = xsp; if (jj_3R_104()) { @@ -3382,6 +3338,8 @@ public class ModelParser implements ModelParserConstants { jj_scanpos = xsp; if (jj_3R_106()) { jj_scanpos = xsp; + if (jj_3R_107()) { + jj_scanpos = xsp; if (jj_scan_token(35)) return true; } } @@ -3396,6 +3354,63 @@ public class ModelParser implements ModelParserConstants { return false; } + private boolean jj_3R_76() { + if (jj_scan_token(55)) return true; + return false; + } + + private boolean jj_3R_94() { + if (jj_3R_99()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_100()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_95() { + if (jj_3R_101()) return true; + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_78() { + if (jj_scan_token(13)) return true; + return false; + } + + private boolean jj_3R_83() { + if (jj_3R_89()) return true; + if (jj_3R_82()) return true; + return false; + } + + private boolean jj_3R_88() { + if (jj_3R_93()) return true; + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3R_75() { + if (jj_scan_token(36)) return true; + return false; + } + + private boolean jj_3R_101() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(82)) { + jj_scanpos = xsp; + if (jj_scan_token(83)) { + jj_scanpos = xsp; + if (jj_scan_token(84)) { + jj_scanpos = xsp; + if (jj_scan_token(85)) return true; + } + } + } + return false; + } + private boolean jj_3R_60() { if (jj_scan_token(52)) return true; return false; @@ -3416,11 +3431,13 @@ public class ModelParser implements ModelParserConstants { return false; } - private boolean jj_3R_94() { - if (jj_3R_99()) return true; + private boolean jj_3R_87() { + if (jj_3R_94()) return true; Token xsp; - xsp = jj_scanpos; - if (jj_3R_100()) jj_scanpos = xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_95()) { jj_scanpos = xsp; break; } + } return false; } -- 2.47.1