From caebcebaa4cf979554227f2620448f82e65077a2 Mon Sep 17 00:00:00 2001 From: miettinen Date: Fri, 31 Jan 2014 12:26:33 +0000 Subject: [PATCH] Generated java files for unit parser (refs #4320). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28744 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/unitParser/UnitParser.java | 391 ++++++++++-------- .../simantics/sysdyn/unitParser/UnitParser.jj | 38 +- .../unitParser/UnitParserTreeConstants.java | 16 +- 3 files changed, 251 insertions(+), 194 deletions(-) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java index 6092c827..4e353980 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java @@ -1241,16 +1241,7 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit jjtn000.jjtSetFirstToken(getToken(1)); try { if (jj_2_4(2)) { - named_argument(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 69: - jj_consume_token(69); - function_arguments(); - break; - default: - jj_la1[30] = jj_gen; - ; - } + named_arguments(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: @@ -1283,18 +1274,18 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit for_indices(); break; default: - jj_la1[31] = jj_gen; + jj_la1[30] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[32] = jj_gen; + jj_la1[31] = jj_gen; ; } break; default: - jj_la1[33] = jj_gen; + jj_la1[32] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1336,7 +1327,7 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit ; break; default: - jj_la1[34] = jj_gen; + jj_la1[33] = jj_gen; break label_8; } jj_consume_token(69); @@ -1377,6 +1368,45 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit jj_consume_token(41); expression(); break; + default: + jj_la1[34] = jj_gen; + ; + } + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtn000.jjtSetLastToken(getToken(0)); + } + } + } + + final public void named_arguments() throws ParseException { + /*@bgen(jjtree) named_arguments */ + UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENTS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtn000.jjtSetFirstToken(getToken(1)); + try { + named_argument(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 69: + jj_consume_token(69); + named_arguments(); + break; default: jj_la1[35] = jj_gen; ; @@ -1403,12 +1433,6 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit } } -/* Removed by Teemu. Refactored in function_arguments) -void named_arguments() : { -} { - named_argument() ( "," named_arguments() )? -} -*/ final public void named_argument() throws ParseException { /*@bgen(jjtree) named_argument */ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENT); @@ -1737,20 +1761,20 @@ void named_arguments() : { finally { jj_save(4, xla); } } - private boolean jj_3R_79() { + private boolean jj_3R_80() { if (jj_3R_12()) return true; return false; } - private boolean jj_3R_30() { + private boolean jj_3R_31() { if (jj_scan_token(62)) return true; - if (jj_3R_36()) return true; + if (jj_3R_37()) return true; if (jj_scan_token(63)) return true; return false; } - private boolean jj_3R_26() { - if (jj_3R_32()) return true; + private boolean jj_3R_27() { + if (jj_3R_33()) return true; return false; } @@ -1761,34 +1785,34 @@ void named_arguments() : { } private boolean jj_3R_22() { - if (jj_3R_30()) return true; + if (jj_3R_31()) return true; return false; } private boolean jj_3R_21() { if (jj_scan_token(64)) return true; - if (jj_3R_28()) return true; + if (jj_3R_29()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_29()) { jj_scanpos = xsp; break; } + if (jj_3R_30()) { jj_scanpos = xsp; break; } } if (jj_scan_token(65)) return true; return false; } private boolean jj_3R_20() { - if (jj_3R_27()) return true; + if (jj_3R_28()) return true; return false; } private boolean jj_3R_19() { - if (jj_3R_26()) return true; + if (jj_3R_27()) return true; return false; } private boolean jj_3R_18() { - if (jj_3R_25()) return true; + if (jj_3R_26()) return true; return false; } @@ -1818,11 +1842,11 @@ void named_arguments() : { } private boolean jj_3R_17() { - if (jj_3R_24()) return true; + if (jj_3R_25()) return true; return false; } - private boolean jj_3R_87() { + private boolean jj_3R_88() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(81)) { @@ -1832,7 +1856,7 @@ void named_arguments() : { return false; } - private boolean jj_3R_86() { + private boolean jj_3R_87() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(80)) { @@ -1852,7 +1876,7 @@ void named_arguments() : { return false; } - private boolean jj_3R_61() { + private boolean jj_3R_62() { if (jj_scan_token(67)) return true; if (jj_3R_51()) return true; return false; @@ -1864,45 +1888,45 @@ void named_arguments() : { return false; } - private boolean jj_3R_72() { - if (jj_3R_76()) return true; - if (jj_3R_71()) return true; + private boolean jj_3R_73() { + if (jj_3R_77()) return true; + if (jj_3R_72()) return true; return false; } - private boolean jj_3R_75() { - if (jj_3R_77()) return true; - if (jj_3R_74()) return true; + private boolean jj_3R_76() { + if (jj_3R_78()) return true; + if (jj_3R_75()) return true; return false; } - private boolean jj_3R_81() { + private boolean jj_3R_82() { if (jj_3R_12()) return true; if (jj_3R_13()) return true; if (jj_3R_12()) return true; return false; } - private boolean jj_3R_78() { - if (jj_3R_81()) return true; + private boolean jj_3R_79() { + if (jj_3R_82()) return true; return false; } - private boolean jj_3R_74() { + private boolean jj_3R_75() { Token xsp; xsp = jj_scanpos; - if (jj_3R_78()) { + if (jj_3R_79()) { jj_scanpos = xsp; - if (jj_3R_79()) return true; + if (jj_3R_80()) return true; } while (true) { xsp = jj_scanpos; - if (jj_3R_80()) { jj_scanpos = xsp; break; } + if (jj_3R_81()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_77() { + private boolean jj_3R_78() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(76)) { @@ -1918,30 +1942,30 @@ void named_arguments() : { return false; } - private boolean jj_3R_66() { + private boolean jj_3R_67() { if (jj_scan_token(9)) return true; - if (jj_3R_65()) return true; + if (jj_3R_66()) return true; return false; } - private boolean jj_3R_73() { - if (jj_3R_77()) return true; + private boolean jj_3R_74() { + if (jj_3R_78()) return true; return false; } - private boolean jj_3R_71() { + private boolean jj_3R_72() { Token xsp; xsp = jj_scanpos; - if (jj_3R_73()) jj_scanpos = xsp; - if (jj_3R_74()) return true; + if (jj_3R_74()) jj_scanpos = xsp; + if (jj_3R_75()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_75()) { jj_scanpos = xsp; break; } + if (jj_3R_76()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_76() { + private boolean jj_3R_77() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(70)) { @@ -1968,13 +1992,13 @@ void named_arguments() : { if (jj_3R_51()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_61()) jj_scanpos = xsp; + if (jj_3R_62()) jj_scanpos = xsp; return false; } - private boolean jj_3R_60() { + private boolean jj_3R_61() { if (jj_scan_token(22)) return true; - if (jj_3R_59()) return true; + if (jj_3R_60()) return true; return false; } @@ -1982,29 +2006,29 @@ void named_arguments() : { if (jj_scan_token(20)) return true; if (jj_3R_53()) return true; if (jj_scan_token(28)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; return false; } - private boolean jj_3R_69() { - if (jj_3R_71()) return true; + private boolean jj_3R_70() { + if (jj_3R_72()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_72()) jj_scanpos = xsp; + if (jj_3R_73()) jj_scanpos = xsp; return false; } - private boolean jj_3R_64() { - if (jj_scan_token(67)) return true; - if (jj_3R_63()) return true; + private boolean jj_3R_66() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(12)) jj_scanpos = xsp; + if (jj_3R_70()) return true; return false; } private boolean jj_3R_65() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(12)) jj_scanpos = xsp; - if (jj_3R_69()) return true; + if (jj_scan_token(67)) return true; + if (jj_3R_64()) return true; return false; } @@ -2014,12 +2038,12 @@ void named_arguments() : { return false; } - private boolean jj_3R_59() { - if (jj_3R_65()) return true; + private boolean jj_3R_60() { + if (jj_3R_66()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_66()) { jj_scanpos = xsp; break; } + if (jj_3R_67()) { jj_scanpos = xsp; break; } } return false; } @@ -2031,16 +2055,16 @@ void named_arguments() : { } private boolean jj_3R_51() { - if (jj_3R_59()) return true; + if (jj_3R_60()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_60()) { jj_scanpos = xsp; break; } + if (jj_3R_61()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_63() { + private boolean jj_3R_64() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(90)) { @@ -2050,30 +2074,30 @@ void named_arguments() : { return false; } - private boolean jj_3R_57() { - if (jj_3R_25()) return true; + private boolean jj_3R_46() { + if (jj_3R_51()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_52()) jj_scanpos = xsp; return false; } private boolean jj_3R_58() { - if (jj_3R_63()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_64()) jj_scanpos = xsp; + if (jj_3R_26()) return true; return false; } - private boolean jj_3R_45() { - if (jj_3R_51()) return true; + private boolean jj_3R_59() { + if (jj_3R_64()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_52()) jj_scanpos = xsp; + if (jj_3R_65()) jj_scanpos = xsp; return false; } - private boolean jj_3R_35() { + private boolean jj_3R_36() { if (jj_scan_token(69)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; return false; } @@ -2082,21 +2106,21 @@ void named_arguments() : { xsp = jj_scanpos; if (jj_scan_token(67)) { jj_scanpos = xsp; - if (jj_3R_57()) { + if (jj_3R_58()) { jj_scanpos = xsp; - if (jj_3R_58()) return true; + if (jj_3R_59()) return true; } } return false; } - private boolean jj_3R_56() { + private boolean jj_3R_57() { if (jj_scan_token(21)) return true; - if (jj_3R_62()) return true; + if (jj_3R_63()) return true; return false; } - private boolean jj_3R_44() { + private boolean jj_3R_45() { if (jj_scan_token(64)) return true; if (jj_3R_49()) return true; Token xsp; @@ -2108,138 +2132,146 @@ void named_arguments() : { return false; } - private boolean jj_3R_53() { - if (jj_3R_33()) return true; - return false; - } - - private boolean jj_3R_42() { - if (jj_3R_46()) return true; - return false; - } - - private boolean jj_3R_28() { - if (jj_3R_33()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_35()) { jj_scanpos = xsp; break; } - } + private boolean jj_3R_55() { + if (jj_scan_token(69)) return true; + if (jj_3R_16()) return true; return false; } - private boolean jj_3R_47() { - if (jj_scan_token(69)) return true; - if (jj_3R_36()) return true; + private boolean jj_3R_53() { + if (jj_3R_34()) return true; return false; } - private boolean jj_3R_41() { - if (jj_3R_45()) return true; + private boolean jj_3R_43() { + if (jj_3R_47()) return true; return false; } - private boolean jj_3R_33() { + private boolean jj_3R_34() { Token xsp; xsp = jj_scanpos; - if (jj_3R_41()) { + if (jj_3R_42()) { jj_scanpos = xsp; - if (jj_3R_42()) return true; + if (jj_3R_43()) return true; } return false; } - private boolean jj_3R_46() { + private boolean jj_3R_42() { + if (jj_3R_46()) return true; + return false; + } + + private boolean jj_3R_47() { if (jj_scan_token(31)) return true; if (jj_3R_53()) return true; if (jj_scan_token(28)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_3R_54()) { jj_scanpos = xsp; break; } } if (jj_scan_token(15)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; return false; } - private boolean jj_3R_40() { + private boolean jj_3R_29() { + if (jj_3R_34()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_36()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_41() { if (jj_scan_token(66)) return true; - if (jj_3R_32()) return true; + if (jj_3R_33()) return true; return false; } - private boolean jj_3R_16() { + private boolean jj_3R_24() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(86)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; return false; } - private boolean jj_3R_70() { + private boolean jj_3R_71() { if (jj_scan_token(41)) return true; - if (jj_3R_33()) return true; + if (jj_3R_34()) return true; return false; } - private boolean jj_3R_85() { + private boolean jj_3R_86() { if (jj_3R_12()) return true; return false; } - private boolean jj_3R_68() { + private boolean jj_3R_69() { if (jj_scan_token(69)) return true; - if (jj_3R_67()) return true; + if (jj_3R_68()) return true; + return false; + } + + private boolean jj_3R_16() { + if (jj_3R_24()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_55()) jj_scanpos = xsp; return false; } private boolean jj_3R_48() { Token xsp; xsp = jj_scanpos; - if (jj_3R_55()) { + if (jj_3R_56()) { jj_scanpos = xsp; - if (jj_3R_56()) return true; + if (jj_3R_57()) return true; } return false; } - private boolean jj_3R_55() { + private boolean jj_3R_56() { if (jj_scan_token(69)) return true; - if (jj_3R_36()) return true; + if (jj_3R_37()) return true; return false; } - private boolean jj_3R_37() { - if (jj_3R_36()) return true; + private boolean jj_3R_38() { + if (jj_3R_37()) return true; return false; } - private boolean jj_3R_67() { + private boolean jj_3R_68() { if (jj_scan_token(IDENT)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_70()) jj_scanpos = xsp; + if (jj_3R_71()) jj_scanpos = xsp; return false; } - private boolean jj_3R_62() { - if (jj_3R_67()) return true; + private boolean jj_3R_63() { + if (jj_3R_68()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_68()) { jj_scanpos = xsp; break; } + if (jj_3R_69()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_39() { - if (jj_3R_44()) return true; + private boolean jj_3R_40() { + if (jj_3R_45()) return true; return false; } - private boolean jj_3R_43() { - if (jj_3R_33()) return true; + private boolean jj_3R_44() { + if (jj_3R_34()) return true; Token xsp; xsp = jj_scanpos; if (jj_3R_48()) jj_scanpos = xsp; @@ -2248,28 +2280,25 @@ void named_arguments() : { private boolean jj_3_4() { if (jj_3R_16()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_47()) jj_scanpos = xsp; return false; } - private boolean jj_3R_36() { + private boolean jj_3R_37() { Token xsp; xsp = jj_scanpos; if (jj_3_4()) { jj_scanpos = xsp; - if (jj_3R_43()) return true; + if (jj_3R_44()) return true; } return false; } - private boolean jj_3R_31() { + private boolean jj_3R_32() { if (jj_3R_15()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_37()) jj_scanpos = xsp; - if (jj_3R_34()) return true; + if (jj_3R_38()) jj_scanpos = xsp; + if (jj_3R_35()) return true; return false; } @@ -2285,12 +2314,12 @@ void named_arguments() : { return false; } - private boolean jj_3R_84() { - if (jj_3R_81()) return true; + private boolean jj_3R_85() { + if (jj_3R_82()) return true; return false; } - private boolean jj_3R_38() { + private boolean jj_3R_39() { if (jj_scan_token(IDENT)) return true; Token xsp; while (true) { @@ -2300,13 +2329,13 @@ void named_arguments() : { return false; } - private boolean jj_3R_32() { - if (jj_3R_38()) return true; + private boolean jj_3R_33() { + if (jj_3R_39()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_39()) jj_scanpos = xsp; - xsp = jj_scanpos; if (jj_3R_40()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_41()) jj_scanpos = xsp; return false; } @@ -2318,12 +2347,12 @@ void named_arguments() : { return false; } - private boolean jj_3R_83() { - if (jj_3R_87()) return true; + private boolean jj_3R_84() { + if (jj_3R_88()) return true; return false; } - private boolean jj_3R_34() { + private boolean jj_3R_35() { if (jj_scan_token(61)) return true; return false; } @@ -2333,7 +2362,7 @@ void named_arguments() : { return false; } - private boolean jj_3R_24() { + private boolean jj_3R_25() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(91)) { @@ -2352,42 +2381,42 @@ void named_arguments() : { return false; } - private boolean jj_3R_82() { - if (jj_3R_86()) return true; + private boolean jj_3R_83() { + if (jj_3R_87()) return true; return false; } - private boolean jj_3R_80() { + private boolean jj_3R_81() { Token xsp; xsp = jj_scanpos; - if (jj_3R_82()) { + if (jj_3R_83()) { jj_scanpos = xsp; - if (jj_3R_83()) return true; + if (jj_3R_84()) return true; } xsp = jj_scanpos; - if (jj_3R_84()) { + if (jj_3R_85()) { jj_scanpos = xsp; - if (jj_3R_85()) return true; + if (jj_3R_86()) return true; } return false; } - private boolean jj_3R_29() { + private boolean jj_3R_30() { if (jj_scan_token(68)) return true; - if (jj_3R_28()) return true; + if (jj_3R_29()) return true; return false; } - private boolean jj_3R_27() { + private boolean jj_3R_28() { if (jj_3R_15()) return true; - if (jj_3R_33()) return true; if (jj_3R_34()) return true; + if (jj_3R_35()) return true; return false; } - private boolean jj_3R_25() { + private boolean jj_3R_26() { if (jj_3R_14()) return true; - if (jj_3R_31()) return true; + if (jj_3R_32()) return true; return false; } @@ -2412,13 +2441,13 @@ void named_arguments() : { jj_la1_init_2(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x1040,0x80001041,0x80001040,0x100000,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x80001040,0x0,0x200000,0x200000,0x80001040,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_0 = new int[] {0x1040,0x80001041,0x80001040,0x100000,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x80001040,0x0,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x0,0x0,0x0,0x0,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x5000000a,0x5000000a,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x2,0x50000008,0x2,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x0,0x5000000a,0x0,0x200,0x5000000a,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_1 = new int[] {0x5000000a,0x5000000a,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x2,0x50000008,0x2,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x5000000a,0x0,0x200,0x0,0x5000000a,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0xf00f001,0xf00f001,0xf00f001,0x0,0x8,0x8,0x0,0x0,0x0,0xfc0,0xfc0,0xf000,0xf000,0xf000,0xf000001,0xf0000,0xf0000,0xf000001,0x300000,0x50000,0xa0000,0x10,0xe000000,0x1000001,0xe000000,0x4,0x1,0x4,0x1000000,0xf00f001,0x20,0x20,0x20,0xf00f001,0x20,0x0,0xf00f001,0x20,0xf00f001,0x20,0x20,0x8,0x8,0x5000000,0x5000000,}; + jj_la1_2 = new int[] {0xf00f001,0xf00f001,0xf00f001,0x0,0x8,0x8,0x0,0x0,0x0,0xfc0,0xfc0,0xf000,0xf000,0xf000,0xf000001,0xf0000,0xf0000,0xf000001,0x300000,0x50000,0xa0000,0x10,0xe000000,0x1000001,0xe000000,0x4,0x1,0x4,0x1000000,0xf00f001,0x20,0x20,0xf00f001,0x20,0x0,0x20,0xf00f001,0x20,0xf00f001,0x20,0x20,0x8,0x8,0x5000000,0x5000000,}; } final private JJCalls[] jj_2_rtns = new JJCalls[5]; private boolean jj_rescan = false; 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 c178f70d..7261f8cf 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj @@ -935,7 +935,7 @@ void function_arguments() : {/*@bgen(jjtree) function_arguments */ /*@egen*/ //expression [ "," function_arguments | for for_indices ] //| named_arguments - LOOKAHEAD(2) named_argument() ( "," function_arguments() )? + LOOKAHEAD(2) named_arguments() | expression() ( "," function_arguments() | "for" for_indices() )?/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { @@ -1029,12 +1029,38 @@ void for_index() : {/*@bgen(jjtree) for_index */ /*@egen*/ } -/* Removed by Teemu. Refactored in function_arguments) -void named_arguments() : { -} { - named_argument() ( "," named_arguments() )? +void named_arguments() : {/*@bgen(jjtree) named_arguments */ + UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENTS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtn000.jjtSetFirstToken(getToken(1)); +/*@egen*/ +} {/*@bgen(jjtree) named_arguments */ + try { +/*@egen*/ + named_argument() ( "," named_arguments() )?/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtn000.jjtSetLastToken(getToken(0)); + } + } +/*@egen*/ } -*/ void named_argument() : {/*@bgen(jjtree) named_argument */ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENT); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTreeConstants.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTreeConstants.java index c0fd05ca..656c2382 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTreeConstants.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParserTreeConstants.java @@ -35,12 +35,13 @@ public interface UnitParserTreeConstants public int JJTFUNCTION_ARGUMENTS = 29; public int JJTFOR_INDICES = 30; public int JJTFOR_INDEX = 31; - public int JJTNAMED_ARGUMENT = 32; - public int JJTOUTPUT_EXPRESSION_LIST = 33; - public int JJTEXPRESSION_LIST = 34; - public int JJTARRAY_SUBSCRIPTS = 35; - public int JJTSUBSCRIPT = 36; - public int JJTRANGEINDEX = 37; + public int JJTNAMED_ARGUMENTS = 32; + public int JJTNAMED_ARGUMENT = 33; + public int JJTOUTPUT_EXPRESSION_LIST = 34; + public int JJTEXPRESSION_LIST = 35; + public int JJTARRAY_SUBSCRIPTS = 36; + public int JJTSUBSCRIPT = 37; + public int JJTRANGEINDEX = 38; public String[] jjtNodeName = { @@ -76,6 +77,7 @@ public interface UnitParserTreeConstants "function_arguments", "for_indices", "for_index", + "named_arguments", "named_argument", "output_expression_list", "expression_list", @@ -84,4 +86,4 @@ public interface UnitParserTreeConstants "rangeIndex", }; } -/* JavaCC - OriginalChecksum=a1957170c02afdfeff8b8b1a0e67790c (do not edit this line) */ +/* JavaCC - OriginalChecksum=55cc0533e9e24a32b3fbe9bcd56ca148 (do not edit this line) */ -- 2.47.1