From 2ba554804a8c2408d6f4784a667a26f86ed7f6bf Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Mon, 17 Mar 2008 16:20:21 +0000 Subject: [PATCH] Parser fix (system defn parallel comp grammar). git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@680 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/parser/PrismParser.java | 56 +++++++++++++++---------------- prism/src/parser/PrismParser.jj | 20 +++++------ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/prism/src/parser/PrismParser.java b/prism/src/parser/PrismParser.java index c781d9f7..fbdc50ff 100644 --- a/prism/src/parser/PrismParser.java +++ b/prism/src/parser/PrismParser.java @@ -1168,19 +1168,19 @@ public class PrismParser implements PrismParserConstants { // System definition component static final public SystemDefn SystemDefn() throws ParseException { SystemDefn ret; - ret = SystemInterleaved(); + ret = SystemFullParallel(); {if (true) return ret;} throw new Error("Missing return statement in function"); } -// System definition component (interleaved parallel) - static final public SystemDefn SystemInterleaved() throws ParseException { +// System definition component (full parallel) + static final public SystemDefn SystemFullParallel() throws ParseException { SystemDefn sys1 = null, sys2 = null; - SystemInterleaved par = null; + SystemFullParallel par = null; Token begin; begin = getToken(1); - sys1 = SystemFullParallel(); - par = new SystemInterleaved(); par.addOperand(sys1); + sys1 = SystemInterleaved(); + par = new SystemFullParallel(); par.addOperand(sys1); label_12: while (true) { if (jj_2_6(2147483647)) { @@ -1190,9 +1190,8 @@ public class PrismParser implements PrismParserConstants { } jj_consume_token(OR); jj_consume_token(OR); - jj_consume_token(OR); - sys2 = SystemFullParallel(); - par.addOperand(sys2); + sys2 = SystemParallel(); + par.addOperand(sys2); } if (par==null) { {if (true) return sys1;} @@ -1204,14 +1203,14 @@ public class PrismParser implements PrismParserConstants { throw new Error("Missing return statement in function"); } -// System definition component (full parallel) - static final public SystemDefn SystemFullParallel() throws ParseException { +// System definition component (interleaved parallel) + static final public SystemDefn SystemInterleaved() throws ParseException { SystemDefn sys1 = null, sys2 = null; - SystemFullParallel par = null; + SystemInterleaved par = null; Token begin; begin = getToken(1); sys1 = SystemParallel(); - par = new SystemFullParallel(); par.addOperand(sys1); + par = new SystemInterleaved(); par.addOperand(sys1); label_13: while (true) { if (jj_2_7(2147483647)) { @@ -1221,8 +1220,9 @@ public class PrismParser implements PrismParserConstants { } jj_consume_token(OR); jj_consume_token(OR); - sys2 = SystemParallel(); - par.addOperand(sys2); + jj_consume_token(OR); + sys2 = SystemFullParallel(); + par.addOperand(sys2); } if (par==null) { {if (true) return sys1;} @@ -2837,12 +2837,6 @@ public class PrismParser implements PrismParserConstants { return false; } - static final private boolean jj_3_7() { - if (jj_scan_token(OR)) return true; - if (jj_scan_token(OR)) return true; - return false; - } - static final private boolean jj_3R_68() { Token xsp; xsp = jj_scanpos; @@ -2865,6 +2859,13 @@ public class PrismParser implements PrismParserConstants { return false; } + static final private boolean jj_3_7() { + if (jj_scan_token(OR)) return true; + if (jj_scan_token(OR)) return true; + if (jj_scan_token(OR)) return true; + return false; + } + static final private boolean jj_3R_121() { if (jj_scan_token(LBRACE)) return true; if (jj_3R_33()) return true; @@ -3009,6 +3010,12 @@ public class PrismParser implements PrismParserConstants { return false; } + static final private boolean jj_3_6() { + if (jj_scan_token(OR)) return true; + if (jj_scan_token(OR)) return true; + return false; + } + static final private boolean jj_3R_123() { if (jj_3R_53()) return true; if (jj_3R_33()) return true; @@ -3022,13 +3029,6 @@ public class PrismParser implements PrismParserConstants { return false; } - static final private boolean jj_3_6() { - if (jj_scan_token(OR)) return true; - if (jj_scan_token(OR)) return true; - if (jj_scan_token(OR)) return true; - return false; - } - static final private boolean jj_3R_109() { if (jj_scan_token(R)) return true; Token xsp; diff --git a/prism/src/parser/PrismParser.jj b/prism/src/parser/PrismParser.jj index c3b3eed9..6b67e985 100644 --- a/prism/src/parser/PrismParser.jj +++ b/prism/src/parser/PrismParser.jj @@ -806,22 +806,22 @@ SystemDefn SystemDefn() : SystemDefn ret; } { - ret = SystemInterleaved() + ret = SystemFullParallel() { return ret; } } -// System definition component (interleaved parallel) +// System definition component (full parallel) -SystemDefn SystemInterleaved() : +SystemDefn SystemFullParallel() : { SystemDefn sys1 = null, sys2 = null; - SystemInterleaved par = null; + SystemFullParallel par = null; Token begin; } { { begin = getToken(1); } - sys1 = SystemFullParallel() - ( { par = new SystemInterleaved(); par.addOperand(sys1); } ( LOOKAHEAD( ) sys2 = SystemFullParallel() { par.addOperand(sys2); } )* ) + sys1 = SystemInterleaved() + ( { par = new SystemFullParallel(); par.addOperand(sys1); } ( LOOKAHEAD( ) sys2 = SystemParallel() { par.addOperand(sys2); } )* ) { if (par==null) { return sys1; @@ -833,18 +833,18 @@ SystemDefn SystemInterleaved() : } } -// System definition component (full parallel) +// System definition component (interleaved parallel) -SystemDefn SystemFullParallel() : +SystemDefn SystemInterleaved() : { SystemDefn sys1 = null, sys2 = null; - SystemFullParallel par = null; + SystemInterleaved par = null; Token begin; } { { begin = getToken(1); } sys1 = SystemParallel() - ( { par = new SystemFullParallel(); par.addOperand(sys1); } ( LOOKAHEAD( ) sys2 = SystemParallel() { par.addOperand(sys2); } )* ) + ( { par = new SystemInterleaved(); par.addOperand(sys1); } ( LOOKAHEAD( ) sys2 = SystemFullParallel() { par.addOperand(sys2); } )* ) { if (par==null) { return sys1;