Merge lp:~tapaal-contributor/tapaal/signed-integers-fix-1714815 into lp:tapaal

Proposed by Mads Johannsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 942
Merged at revision: 942
Proposed branch: lp:~tapaal-contributor/tapaal/signed-integers-fix-1714815
Merge into: lp:tapaal
Diff against target: 1901 lines (+497/-609)
7 files modified
src/dk/aau/cs/TCTL/CTLParsing/ParseException.java (+16/-22)
src/dk/aau/cs/TCTL/CTLParsing/SimpleCharStream.java (+7/-10)
src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParser.java (+303/-365)
src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParserTokenManager.java (+155/-197)
src/dk/aau/cs/TCTL/CTLParsing/Token.java (+3/-3)
src/dk/aau/cs/TCTL/CTLParsing/TokenMgrError.java (+12/-11)
src/resources/TCTLParser/TAPAALCTLQueryParser.jj (+1/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/signed-integers-fix-1714815
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+330241@code.launchpad.net

Description of the change

Allow signed integers in manual edit (for CTL queries).

To post a comment you must log in.
942. By Mads Johannsen

Allow signed integers in manual edit (for CTL queries)

Revision history for this message
Jiri Srba (srba) wrote :

Works nicely.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/ParseException.java'
2--- src/dk/aau/cs/TCTL/CTLParsing/ParseException.java 2017-05-07 12:44:00 +0000
3+++ src/dk/aau/cs/TCTL/CTLParsing/ParseException.java 2017-09-05 21:26:24 +0000
4@@ -1,5 +1,5 @@
5-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */
6-/* JavaCCOptions:KEEP_LINE_COLUMN=true */
7+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
8+/* JavaCCOptions:KEEP_LINE_COL=null */
9 package dk.aau.cs.TCTL.CTLParsing;
10
11 /**
12@@ -21,11 +21,6 @@
13 private static final long serialVersionUID = 1L;
14
15 /**
16- * The end of line string for this machine.
17- */
18- protected static String EOL = System.getProperty("line.separator", "\n");
19-
20- /**
21 * This constructor is used by the method "generateParseException"
22 * in the generated parser. Calling this constructor generates
23 * a new object of this type with the fields "currentToken",
24@@ -93,7 +88,7 @@
25 private static String initialise(Token currentToken,
26 int[][] expectedTokenSequences,
27 String[] tokenImage) {
28-
29+ String eol = System.getProperty("line.separator", "\n");
30 StringBuffer expected = new StringBuffer();
31 int maxSize = 0;
32 for (int i = 0; i < expectedTokenSequences.length; i++) {
33@@ -106,7 +101,7 @@
34 if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
35 expected.append("...");
36 }
37- expected.append(EOL).append(" ");
38+ expected.append(eol).append(" ");
39 }
40 String retval = "Encountered \"";
41 Token tok = currentToken.next;
42@@ -123,23 +118,20 @@
43 tok = tok.next;
44 }
45 retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
46- retval += "." + EOL;
47-
48-
49- if (expectedTokenSequences.length == 0) {
50- // Nothing to add here
51+ retval += "." + eol;
52+ if (expectedTokenSequences.length == 1) {
53+ retval += "Was expecting:" + eol + " ";
54 } else {
55- if (expectedTokenSequences.length == 1) {
56- retval += "Was expecting:" + EOL + " ";
57- } else {
58- retval += "Was expecting one of:" + EOL + " ";
59- }
60- retval += expected.toString();
61+ retval += "Was expecting one of:" + eol + " ";
62 }
63-
64+ retval += expected.toString();
65 return retval;
66 }
67
68+ /**
69+ * The end of line string for this machine.
70+ */
71+ protected String eol = System.getProperty("line.separator", "\n");
72
73 /**
74 * Used to convert raw characters to their escaped version
75@@ -152,6 +144,8 @@
76 for (int i = 0; i < str.length(); i++) {
77 switch (str.charAt(i))
78 {
79+ case 0 :
80+ continue;
81 case '\b':
82 retval.append("\\b");
83 continue;
84@@ -190,4 +184,4 @@
85 }
86
87 }
88-/* JavaCC - OriginalChecksum=cecb7af8f6d81d2720805fee8666f83e (do not edit this line) */
89+/* JavaCC - OriginalChecksum=e3b16ba93b705462aa836b464f80ade3 (do not edit this line) */
90
91=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/SimpleCharStream.java'
92--- src/dk/aau/cs/TCTL/CTLParsing/SimpleCharStream.java 2017-05-07 12:44:00 +0000
93+++ src/dk/aau/cs/TCTL/CTLParsing/SimpleCharStream.java 2017-09-05 21:26:24 +0000
94@@ -1,4 +1,4 @@
95-/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 7.0 */
96+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
97 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
98 package dk.aau.cs.TCTL.CTLParsing;
99
100@@ -30,12 +30,10 @@
101 protected char[] buffer;
102 protected int maxNextCharInd = 0;
103 protected int inBuf = 0;
104- protected int tabSize = 1;
105- protected boolean trackLineColumn = true;
106-
107- public void setTabSize(int i) { tabSize = i; }
108- public int getTabSize() { return tabSize; }
109-
110+ protected int tabSize = 8;
111+
112+ protected void setTabSize(int i) { tabSize = i; }
113+ protected int getTabSize(int i) { return tabSize; }
114
115
116 protected void ExpandBuff(boolean wrapAround)
117@@ -468,7 +466,6 @@
118 line = bufline[j];
119 column = bufcolumn[j];
120 }
121- boolean getTrackLineColumn() { return trackLineColumn; }
122- void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
123+
124 }
125-/* JavaCC - OriginalChecksum=3bfee23fa238f42634d20b3466c7eaef (do not edit this line) */
126+/* JavaCC - OriginalChecksum=816436a32bfa27b6bfceb55653f8d63a (do not edit this line) */
127
128=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParser.java'
129--- src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParser.java 2017-05-15 10:38:38 +0000
130+++ src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParser.java 2017-09-05 21:26:24 +0000
131@@ -1,4 +1,3 @@
132-/* TAPAALCTLQueryParser.java */
133 /* Generated By:JavaCC: Do not edit this line. TAPAALCTLQueryParser.java */
134 package dk.aau.cs.TCTL.CTLParsing;
135
136@@ -41,164 +40,155 @@
137 }
138
139 /** Root production. */
140- final public TCTLAbstractPathProperty AbstractPathProperty() throws ParseException {TCTLAbstractStateProperty child = null;
141+ final public TCTLAbstractPathProperty AbstractPathProperty() throws ParseException {
142+ TCTLAbstractStateProperty child = null;
143 TCTLAbstractStateProperty child2 = null;
144- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
145- case EF:{
146+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
147+ case EF:
148 jj_consume_token(EF);
149 child = OrExpr();
150-{if ("" != null) return new TCTLEFNode(child);}
151+ {if (true) return new TCTLEFNode(child);}
152 break;
153- }
154- case EG:{
155+ case EG:
156 jj_consume_token(EG);
157 child = OrExpr();
158-{if ("" != null) return new TCTLEGNode(child);}
159+ {if (true) return new TCTLEGNode(child);}
160 break;
161- }
162- case EX:{
163+ case EX:
164 jj_consume_token(EX);
165 child = OrExpr();
166-{if ("" != null) return new TCTLEXNode(child);}
167+ {if (true) return new TCTLEXNode(child);}
168 break;
169- }
170- case E:{
171+ case E:
172 jj_consume_token(E);
173 jj_consume_token(26);
174 child = OrExpr();
175 jj_consume_token(U);
176 child2 = OrExpr();
177 jj_consume_token(27);
178-{if ("" != null) return new TCTLEUNode(child, child2);}
179+ {if (true) return new TCTLEUNode(child, child2);}
180 break;
181- }
182- case AF:{
183+ case AF:
184 jj_consume_token(AF);
185 child = OrExpr();
186-{if ("" != null) return new TCTLAFNode(child);}
187+ {if (true) return new TCTLAFNode(child);}
188 break;
189- }
190- case AG:{
191+ case AG:
192 jj_consume_token(AG);
193 child = OrExpr();
194-{if ("" != null) return new TCTLAGNode(child);}
195+ {if (true) return new TCTLAGNode(child);}
196 break;
197- }
198- case A:{
199+ case A:
200 jj_consume_token(A);
201 jj_consume_token(26);
202 child = OrExpr();
203 jj_consume_token(U);
204 child2 = OrExpr();
205 jj_consume_token(27);
206-{if ("" != null) return new TCTLAUNode(child, child2);}
207+ {if (true) return new TCTLAUNode(child, child2);}
208 break;
209- }
210- case AX:{
211+ case AX:
212 jj_consume_token(AX);
213 child = OrExpr();
214-{if ("" != null) return new TCTLAXNode(child);}
215+ {if (true) return new TCTLAXNode(child);}
216 break;
217- }
218 default:
219 jj_la1[0] = jj_gen;
220 child = OrExpr();
221-{if ("" != null) return new TCTLStateToPathConverter(child);}
222+ {if (true) return new TCTLStateToPathConverter(child);}
223 }
224 throw new Error("Missing return statement in function");
225-}
226+ }
227
228- final public TCTLAbstractStateProperty OrExpr() throws ParseException {TCTLAbstractStateProperty currentChild;
229+ final public TCTLAbstractStateProperty OrExpr() throws ParseException {
230+ TCTLAbstractStateProperty currentChild;
231 ArrayList<TCTLAbstractStateProperty> disjunctions = new ArrayList<TCTLAbstractStateProperty>();
232 currentChild = AndExpr();
233-disjunctions.add(currentChild);
234+ disjunctions.add(currentChild);
235 label_1:
236 while (true) {
237- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
238- case OR:{
239+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
240+ case OR:
241 ;
242 break;
243- }
244 default:
245 jj_la1[1] = jj_gen;
246 break label_1;
247 }
248 jj_consume_token(OR);
249 currentChild = AndExpr();
250-disjunctions.add(currentChild);
251+ disjunctions.add(currentChild);
252 }
253-{if ("" != null) return disjunctions.size() == 1 ? currentChild : new TCTLOrListNode(disjunctions);}
254+ {if (true) return disjunctions.size() == 1 ? currentChild : new TCTLOrListNode(disjunctions);}
255 throw new Error("Missing return statement in function");
256-}
257+ }
258
259- final public TCTLAbstractStateProperty AndExpr() throws ParseException {TCTLAbstractStateProperty currentChild;
260+ final public TCTLAbstractStateProperty AndExpr() throws ParseException {
261+ TCTLAbstractStateProperty currentChild;
262 ArrayList<TCTLAbstractStateProperty> conjunctions = new ArrayList<TCTLAbstractStateProperty>();
263 currentChild = NotExpr();
264-conjunctions.add(currentChild);
265+ conjunctions.add(currentChild);
266 label_2:
267 while (true) {
268- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
269- case AND:{
270+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
271+ case AND:
272 ;
273 break;
274- }
275 default:
276 jj_la1[2] = jj_gen;
277 break label_2;
278 }
279 jj_consume_token(AND);
280 currentChild = NotExpr();
281-conjunctions.add(currentChild);
282+ conjunctions.add(currentChild);
283 }
284-{if ("" != null) return conjunctions.size() == 1 ? currentChild : new TCTLAndListNode(conjunctions);}
285+ {if (true) return conjunctions.size() == 1 ? currentChild : new TCTLAndListNode(conjunctions);}
286 throw new Error("Missing return statement in function");
287-}
288+ }
289
290- final public TCTLAbstractStateProperty NotExpr() throws ParseException {TCTLAbstractStateProperty child;
291+ final public TCTLAbstractStateProperty NotExpr() throws ParseException {
292+ TCTLAbstractStateProperty child;
293 TCTLAbstractPathProperty childConverter;
294- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
295- case NOT:{
296+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
297+ case NOT:
298 jj_consume_token(NOT);
299 jj_consume_token(26);
300 child = OrExpr();
301 jj_consume_token(27);
302-{if ("" != null) return new TCTLNotNode(child);}
303+ {if (true) return new TCTLNotNode(child);}
304 break;
305- }
306 default:
307 jj_la1[3] = jj_gen;
308 child = Factor();
309-{if ("" != null) return child;}
310+ {if (true) return child;}
311 }
312 throw new Error("Missing return statement in function");
313-}
314+ }
315
316- final public TCTLAbstractStateProperty Factor() throws ParseException {TCTLAbstractStateProperty thisProp;
317+ final public TCTLAbstractStateProperty Factor() throws ParseException {
318+ TCTLAbstractStateProperty thisProp;
319 Token temp = null;
320 Token transition;
321- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
322- case TRUE:{
323+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
324+ case TRUE:
325 jj_consume_token(TRUE);
326-thisProp = new TCTLTrueNode();
327+ thisProp = new TCTLTrueNode();
328 break;
329- }
330- case FALSE:{
331+ case FALSE:
332 jj_consume_token(FALSE);
333-thisProp = new TCTLFalseNode();
334+ thisProp = new TCTLFalseNode();
335 break;
336- }
337- case DEADLOCK:{
338+ case DEADLOCK:
339 jj_consume_token(DEADLOCK);
340-thisProp = new TCTLDeadlockNode();
341+ thisProp = new TCTLDeadlockNode();
342 break;
343- }
344 default:
345 jj_la1[4] = jj_gen;
346 if (jj_2_2(2147483647)) {
347 thisProp = AtomicProposition();
348 } else {
349- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
350- case IDENT:{
351+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
352+ case IDENT:
353 if (jj_2_1(2)) {
354 temp = jj_consume_token(IDENT);
355 jj_consume_token(28);
356@@ -206,117 +196,117 @@
357 ;
358 }
359 transition = jj_consume_token(IDENT);
360-thisProp = new TCTLTransitionNode(temp == null ? "" : temp.image, transition.image);
361+ thisProp = new TCTLTransitionNode(temp == null ? "" : temp.image, transition.image);
362 break;
363- }
364- case 26:{
365+ case 26:
366 jj_consume_token(26);
367 thisProp = OrExpr();
368 jj_consume_token(27);
369 break;
370- }
371 default:
372 jj_la1[5] = jj_gen;
373-thisProp = new TCTLPathToStateConverter(AbstractPathProperty());
374+ thisProp = new TCTLPathToStateConverter(AbstractPathProperty());
375 }
376 }
377 }
378-{if ("" != null) return thisProp;}
379+ {if (true) return thisProp;}
380 throw new Error("Missing return statement in function");
381-}
382+ }
383
384- final public TCTLAbstractStateProperty AtomicProposition() throws ParseException {TCTLAbstractStateProperty left;
385+ final public TCTLAbstractStateProperty AtomicProposition() throws ParseException {
386+ TCTLAbstractStateProperty left;
387 TCTLAbstractStateProperty right;
388 Token op;
389 left = AritmeticExpr();
390 op = jj_consume_token(OP);
391 right = AritmeticExpr();
392-{if ("" != null) return new TCTLAtomicPropositionNode(left, op.image, right);}
393+ {if (true) return new TCTLAtomicPropositionNode(left, op.image, right);}
394 throw new Error("Missing return statement in function");
395-}
396+ }
397
398- final public TCTLAbstractStateProperty AritmeticExpr() throws ParseException {TCTLAbstractStateProperty currentChild;
399+ final public TCTLAbstractStateProperty AritmeticExpr() throws ParseException {
400+ TCTLAbstractStateProperty currentChild;
401 ArrayList<TCTLAbstractStateProperty> terms = new ArrayList<TCTLAbstractStateProperty>();
402 Token op;
403 currentChild = AritmeticMinusExpr();
404-terms.add(currentChild);
405+ terms.add(currentChild);
406 label_3:
407 while (true) {
408- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
409- case PLUS:{
410+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
411+ case PLUS:
412 ;
413 break;
414- }
415 default:
416 jj_la1[6] = jj_gen;
417 break label_3;
418 }
419 op = jj_consume_token(PLUS);
420 currentChild = AritmeticMinusExpr();
421-terms.add(new AritmeticOperator(op.image));
422+ terms.add(new AritmeticOperator(op.image));
423 terms.add(currentChild);
424 }
425-{if ("" != null) return terms.size() == 1 ? currentChild : new TCTLTermListNode(terms);}
426+ {if (true) return terms.size() == 1 ? currentChild : new TCTLTermListNode(terms);}
427 throw new Error("Missing return statement in function");
428-}
429+ }
430
431- final public TCTLAbstractStateProperty AritmeticMinusExpr() throws ParseException {TCTLAbstractStateProperty currentChild;
432+ final public TCTLAbstractStateProperty AritmeticMinusExpr() throws ParseException {
433+ TCTLAbstractStateProperty currentChild;
434 ArrayList<TCTLAbstractStateProperty> terms = new ArrayList<TCTLAbstractStateProperty>();
435 Token op;
436 currentChild = AritmeticTerm();
437-terms.add(currentChild);
438+ terms.add(currentChild);
439 label_4:
440 while (true) {
441- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
442- case MINUS:{
443+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
444+ case MINUS:
445 ;
446 break;
447- }
448 default:
449 jj_la1[7] = jj_gen;
450 break label_4;
451 }
452 op = jj_consume_token(MINUS);
453 currentChild = AritmeticTerm();
454-terms.add(new AritmeticOperator(op.image));
455+ terms.add(new AritmeticOperator(op.image));
456 terms.add(currentChild);
457 }
458-{if ("" != null) return terms.size() == 1 ? currentChild : new TCTLTermListNode(terms);}
459+ {if (true) return terms.size() == 1 ? currentChild : new TCTLTermListNode(terms);}
460 throw new Error("Missing return statement in function");
461-}
462+ }
463
464- final public TCTLAbstractStateProperty AritmeticTerm() throws ParseException {TCTLAbstractStateProperty currentChild;
465+ final public TCTLAbstractStateProperty AritmeticTerm() throws ParseException {
466+ TCTLAbstractStateProperty currentChild;
467 ArrayList<TCTLAbstractStateProperty> factors = new ArrayList<TCTLAbstractStateProperty>();
468 Token op;
469 currentChild = AritmeticFactor();
470-factors.add(currentChild);
471+ factors.add(currentChild);
472 label_5:
473 while (true) {
474- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
475- case MULT:{
476+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
477+ case MULT:
478 ;
479 break;
480- }
481 default:
482 jj_la1[8] = jj_gen;
483 break label_5;
484 }
485 op = jj_consume_token(MULT);
486 currentChild = AritmeticFactor();
487-factors.add(new AritmeticOperator(op.image));
488+ factors.add(new AritmeticOperator(op.image));
489 factors.add(currentChild);
490 }
491-{if ("" != null) return factors.size() == 1 ? currentChild : new TCTLTermListNode(factors);}
492+ {if (true) return factors.size() == 1 ? currentChild : new TCTLTermListNode(factors);}
493 throw new Error("Missing return statement in function");
494-}
495+ }
496
497- final public TCTLAbstractStateProperty AritmeticFactor() throws ParseException {TCTLAbstractStateProperty thisProp;
498+ final public TCTLAbstractStateProperty AritmeticFactor() throws ParseException {
499+ TCTLAbstractStateProperty thisProp;
500 Token temp = null;
501 Token place;
502 Token op;
503 Token num;
504- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
505- case IDENT:{
506+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
507+ case IDENT:
508 if (jj_2_3(2)) {
509 temp = jj_consume_token(IDENT);
510 jj_consume_token(28);
511@@ -324,90 +314,78 @@
512 ;
513 }
514 place = jj_consume_token(IDENT);
515-thisProp = new TCTLPlaceNode(temp == null ? "" : temp.image, place.image);
516+ thisProp = new TCTLPlaceNode(temp == null ? "" : temp.image, place.image);
517 break;
518- }
519- case NUM:{
520+ case NUM:
521 num = jj_consume_token(NUM);
522-thisProp = new TCTLConstNode(Integer.parseInt(num.image));
523+ thisProp = new TCTLConstNode(Integer.parseInt(num.image));
524 break;
525- }
526- case 26:{
527+ case 26:
528 jj_consume_token(26);
529 thisProp = AritmeticExpr();
530 jj_consume_token(27);
531 break;
532- }
533 default:
534 jj_la1[9] = jj_gen;
535 jj_consume_token(-1);
536 throw new ParseException();
537 }
538-{if ("" != null) return thisProp;}
539+ {if (true) return thisProp;}
540 throw new Error("Missing return statement in function");
541-}
542+ }
543
544- private boolean jj_2_1(int xla)
545- {
546+ private boolean jj_2_1(int xla) {
547 jj_la = xla; jj_lastpos = jj_scanpos = token;
548- try { return (!jj_3_1()); }
549+ try { return !jj_3_1(); }
550 catch(LookaheadSuccess ls) { return true; }
551 finally { jj_save(0, xla); }
552 }
553
554- private boolean jj_2_2(int xla)
555- {
556+ private boolean jj_2_2(int xla) {
557 jj_la = xla; jj_lastpos = jj_scanpos = token;
558- try { return (!jj_3_2()); }
559+ try { return !jj_3_2(); }
560 catch(LookaheadSuccess ls) { return true; }
561 finally { jj_save(1, xla); }
562 }
563
564- private boolean jj_2_3(int xla)
565- {
566+ private boolean jj_2_3(int xla) {
567 jj_la = xla; jj_lastpos = jj_scanpos = token;
568- try { return (!jj_3_3()); }
569+ try { return !jj_3_3(); }
570 catch(LookaheadSuccess ls) { return true; }
571 finally { jj_save(2, xla); }
572 }
573
574- private boolean jj_3R_16()
575- {
576+ private boolean jj_3R_16() {
577 if (jj_scan_token(26)) return true;
578 if (jj_3R_7()) return true;
579 if (jj_scan_token(27)) return true;
580 return false;
581 }
582
583- private boolean jj_3R_13()
584- {
585+ private boolean jj_3R_13() {
586 if (jj_scan_token(MULT)) return true;
587 if (jj_3R_12()) return true;
588 return false;
589 }
590
591- private boolean jj_3_1()
592- {
593+ private boolean jj_3_1() {
594 if (jj_scan_token(IDENT)) return true;
595 if (jj_scan_token(28)) return true;
596 return false;
597 }
598
599- private boolean jj_3R_15()
600- {
601+ private boolean jj_3R_15() {
602 if (jj_scan_token(NUM)) return true;
603 return false;
604 }
605
606- private boolean jj_3_3()
607- {
608+ private boolean jj_3_3() {
609 if (jj_scan_token(IDENT)) return true;
610 if (jj_scan_token(28)) return true;
611 return false;
612 }
613
614- private boolean jj_3R_7()
615- {
616+ private boolean jj_3R_7() {
617 if (jj_3R_8()) return true;
618 Token xsp;
619 while (true) {
620@@ -417,8 +395,7 @@
621 return false;
622 }
623
624- private boolean jj_3R_14()
625- {
626+ private boolean jj_3R_14() {
627 Token xsp;
628 xsp = jj_scanpos;
629 if (jj_3_3()) jj_scanpos = xsp;
630@@ -426,8 +403,7 @@
631 return false;
632 }
633
634- private boolean jj_3R_8()
635- {
636+ private boolean jj_3R_8() {
637 if (jj_3R_10()) return true;
638 Token xsp;
639 while (true) {
640@@ -437,8 +413,7 @@
641 return false;
642 }
643
644- private boolean jj_3R_10()
645- {
646+ private boolean jj_3R_10() {
647 if (jj_3R_12()) return true;
648 Token xsp;
649 while (true) {
650@@ -448,8 +423,7 @@
651 return false;
652 }
653
654- private boolean jj_3R_12()
655- {
656+ private boolean jj_3R_12() {
657 Token xsp;
658 xsp = jj_scanpos;
659 if (jj_3R_14()) {
660@@ -462,29 +436,25 @@
661 return false;
662 }
663
664- private boolean jj_3R_9()
665- {
666+ private boolean jj_3R_9() {
667 if (jj_scan_token(PLUS)) return true;
668 if (jj_3R_8()) return true;
669 return false;
670 }
671
672- private boolean jj_3_2()
673- {
674+ private boolean jj_3_2() {
675 if (jj_3R_6()) return true;
676 return false;
677 }
678
679- private boolean jj_3R_6()
680- {
681+ private boolean jj_3R_6() {
682 if (jj_3R_7()) return true;
683 if (jj_scan_token(OP)) return true;
684 if (jj_3R_7()) return true;
685 return false;
686 }
687
688- private boolean jj_3R_11()
689- {
690+ private boolean jj_3R_11() {
691 if (jj_scan_token(MINUS)) return true;
692 if (jj_3R_10()) return true;
693 return false;
694@@ -504,168 +474,159 @@
695 final private int[] jj_la1 = new int[10];
696 static private int[] jj_la1_0;
697 static {
698- jj_la1_init_0();
699- }
700- private static void jj_la1_init_0() {
701- jj_la1_0 = new int[] {0x1ef0,0x2000,0x4000,0x8000,0xe,0x4100000,0x10000,0x20000,0x40000,0x4180000,};
702- }
703+ jj_la1_init_0();
704+ }
705+ private static void jj_la1_init_0() {
706+ jj_la1_0 = new int[] {0x1ef0,0x2000,0x4000,0x8000,0xe,0x4100000,0x10000,0x20000,0x40000,0x4180000,};
707+ }
708 final private JJCalls[] jj_2_rtns = new JJCalls[3];
709 private boolean jj_rescan = false;
710 private int jj_gc = 0;
711
712 /** Constructor with InputStream. */
713 public TAPAALCTLQueryParser(java.io.InputStream stream) {
714- this(stream, null);
715+ this(stream, null);
716 }
717 /** Constructor with InputStream and supplied encoding */
718 public TAPAALCTLQueryParser(java.io.InputStream stream, String encoding) {
719- try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
720- token_source = new TAPAALCTLQueryParserTokenManager(jj_input_stream);
721- token = new Token();
722- jj_ntk = -1;
723- jj_gen = 0;
724- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
725- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
726+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
727+ token_source = new TAPAALCTLQueryParserTokenManager(jj_input_stream);
728+ token = new Token();
729+ jj_ntk = -1;
730+ jj_gen = 0;
731+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
732+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
733 }
734
735 /** Reinitialise. */
736 public void ReInit(java.io.InputStream stream) {
737- ReInit(stream, null);
738+ ReInit(stream, null);
739 }
740 /** Reinitialise. */
741 public void ReInit(java.io.InputStream stream, String encoding) {
742- try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
743- token_source.ReInit(jj_input_stream);
744- token = new Token();
745- jj_ntk = -1;
746- jj_gen = 0;
747- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
748- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
749+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
750+ token_source.ReInit(jj_input_stream);
751+ token = new Token();
752+ jj_ntk = -1;
753+ jj_gen = 0;
754+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
755+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
756 }
757
758 /** Constructor. */
759 public TAPAALCTLQueryParser(java.io.Reader stream) {
760- jj_input_stream = new SimpleCharStream(stream, 1, 1);
761- token_source = new TAPAALCTLQueryParserTokenManager(jj_input_stream);
762- token = new Token();
763- jj_ntk = -1;
764- jj_gen = 0;
765- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
766- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
767+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
768+ token_source = new TAPAALCTLQueryParserTokenManager(jj_input_stream);
769+ token = new Token();
770+ jj_ntk = -1;
771+ jj_gen = 0;
772+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
773+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
774 }
775
776 /** Reinitialise. */
777 public void ReInit(java.io.Reader stream) {
778- if (jj_input_stream == null) {
779- jj_input_stream = new SimpleCharStream(stream, 1, 1);
780- } else {
781- jj_input_stream.ReInit(stream, 1, 1);
782- }
783- if (token_source == null) {
784- token_source = new TAPAALCTLQueryParserTokenManager(jj_input_stream);
785- }
786-
787- token_source.ReInit(jj_input_stream);
788- token = new Token();
789- jj_ntk = -1;
790- jj_gen = 0;
791- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
792- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
793+ jj_input_stream.ReInit(stream, 1, 1);
794+ token_source.ReInit(jj_input_stream);
795+ token = new Token();
796+ jj_ntk = -1;
797+ jj_gen = 0;
798+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
799+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
800 }
801
802 /** Constructor with generated Token Manager. */
803 public TAPAALCTLQueryParser(TAPAALCTLQueryParserTokenManager tm) {
804- token_source = tm;
805- token = new Token();
806- jj_ntk = -1;
807- jj_gen = 0;
808- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
809- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
810+ token_source = tm;
811+ token = new Token();
812+ jj_ntk = -1;
813+ jj_gen = 0;
814+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
815+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
816 }
817
818 /** Reinitialise. */
819 public void ReInit(TAPAALCTLQueryParserTokenManager tm) {
820- token_source = tm;
821- token = new Token();
822- jj_ntk = -1;
823- jj_gen = 0;
824- for (int i = 0; i < 10; i++) jj_la1[i] = -1;
825- for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
826+ token_source = tm;
827+ token = new Token();
828+ jj_ntk = -1;
829+ jj_gen = 0;
830+ for (int i = 0; i < 10; i++) jj_la1[i] = -1;
831+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
832 }
833
834 private Token jj_consume_token(int kind) throws ParseException {
835- Token oldToken;
836- if ((oldToken = token).next != null) token = token.next;
837- else token = token.next = token_source.getNextToken();
838- jj_ntk = -1;
839- if (token.kind == kind) {
840- jj_gen++;
841- if (++jj_gc > 100) {
842- jj_gc = 0;
843- for (int i = 0; i < jj_2_rtns.length; i++) {
844- JJCalls c = jj_2_rtns[i];
845- while (c != null) {
846- if (c.gen < jj_gen) c.first = null;
847- c = c.next;
848- }
849- }
850- }
851- return token;
852- }
853- token = oldToken;
854- jj_kind = kind;
855- throw generateParseException();
856+ Token oldToken;
857+ if ((oldToken = token).next != null) token = token.next;
858+ else token = token.next = token_source.getNextToken();
859+ jj_ntk = -1;
860+ if (token.kind == kind) {
861+ jj_gen++;
862+ if (++jj_gc > 100) {
863+ jj_gc = 0;
864+ for (int i = 0; i < jj_2_rtns.length; i++) {
865+ JJCalls c = jj_2_rtns[i];
866+ while (c != null) {
867+ if (c.gen < jj_gen) c.first = null;
868+ c = c.next;
869+ }
870+ }
871+ }
872+ return token;
873+ }
874+ token = oldToken;
875+ jj_kind = kind;
876+ throw generateParseException();
877 }
878
879- @SuppressWarnings("serial")
880 static private final class LookaheadSuccess extends java.lang.Error { }
881 final private LookaheadSuccess jj_ls = new LookaheadSuccess();
882 private boolean jj_scan_token(int kind) {
883- if (jj_scanpos == jj_lastpos) {
884- jj_la--;
885- if (jj_scanpos.next == null) {
886- jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
887- } else {
888- jj_lastpos = jj_scanpos = jj_scanpos.next;
889- }
890- } else {
891- jj_scanpos = jj_scanpos.next;
892- }
893- if (jj_rescan) {
894- int i = 0; Token tok = token;
895- while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
896- if (tok != null) jj_add_error_token(kind, i);
897- }
898- if (jj_scanpos.kind != kind) return true;
899- if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
900- return false;
901+ if (jj_scanpos == jj_lastpos) {
902+ jj_la--;
903+ if (jj_scanpos.next == null) {
904+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
905+ } else {
906+ jj_lastpos = jj_scanpos = jj_scanpos.next;
907+ }
908+ } else {
909+ jj_scanpos = jj_scanpos.next;
910+ }
911+ if (jj_rescan) {
912+ int i = 0; Token tok = token;
913+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
914+ if (tok != null) jj_add_error_token(kind, i);
915+ }
916+ if (jj_scanpos.kind != kind) return true;
917+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
918+ return false;
919 }
920
921
922 /** Get the next Token. */
923 final public Token getNextToken() {
924- if (token.next != null) token = token.next;
925- else token = token.next = token_source.getNextToken();
926- jj_ntk = -1;
927- jj_gen++;
928- return token;
929+ if (token.next != null) token = token.next;
930+ else token = token.next = token_source.getNextToken();
931+ jj_ntk = -1;
932+ jj_gen++;
933+ return token;
934 }
935
936 /** Get the specific Token. */
937 final public Token getToken(int index) {
938- Token t = token;
939- for (int i = 0; i < index; i++) {
940- if (t.next != null) t = t.next;
941- else t = t.next = token_source.getNextToken();
942- }
943- return t;
944+ Token t = token;
945+ for (int i = 0; i < index; i++) {
946+ if (t.next != null) t = t.next;
947+ else t = t.next = token_source.getNextToken();
948+ }
949+ return t;
950 }
951
952- private int jj_ntk_f() {
953- if ((jj_nt=token.next) == null)
954- return (jj_ntk = (token.next=token_source.getNextToken()).kind);
955- else
956- return (jj_ntk = jj_nt.kind);
957+ private int jj_ntk() {
958+ if ((jj_nt=token.next) == null)
959+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
960+ else
961+ return (jj_ntk = jj_nt.kind);
962 }
963
964 private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
965@@ -675,83 +636,65 @@
966 private int jj_endpos;
967
968 private void jj_add_error_token(int kind, int pos) {
969- if (pos >= 100) {
970- return;
971- }
972-
973- if (pos == jj_endpos + 1) {
974- jj_lasttokens[jj_endpos++] = kind;
975- } else if (jj_endpos != 0) {
976- jj_expentry = new int[jj_endpos];
977-
978- for (int i = 0; i < jj_endpos; i++) {
979- jj_expentry[i] = jj_lasttokens[i];
980- }
981-
982- for (int[] oldentry : jj_expentries) {
983- if (oldentry.length == jj_expentry.length) {
984- boolean isMatched = true;
985-
986- for (int i = 0; i < jj_expentry.length; i++) {
987- if (oldentry[i] != jj_expentry[i]) {
988- isMatched = false;
989- break;
990- }
991-
992- }
993- if (isMatched) {
994- jj_expentries.add(jj_expentry);
995- break;
996- }
997- }
998- }
999-
1000- if (pos != 0) {
1001- jj_lasttokens[(jj_endpos = pos) - 1] = kind;
1002- }
1003- }
1004+ if (pos >= 100) return;
1005+ if (pos == jj_endpos + 1) {
1006+ jj_lasttokens[jj_endpos++] = kind;
1007+ } else if (jj_endpos != 0) {
1008+ jj_expentry = new int[jj_endpos];
1009+ for (int i = 0; i < jj_endpos; i++) {
1010+ jj_expentry[i] = jj_lasttokens[i];
1011+ }
1012+ boolean exists = false;
1013+ for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {
1014+ exists = true;
1015+ int[] oldentry = (int[])(it.next());
1016+ if (oldentry.length == jj_expentry.length) {
1017+ for (int i = 0; i < jj_expentry.length; i++) {
1018+ if (oldentry[i] != jj_expentry[i]) {
1019+ exists = false;
1020+ break;
1021+ }
1022+ }
1023+ if (exists) break;
1024+ }
1025+ }
1026+ if (!exists) jj_expentries.add(jj_expentry);
1027+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
1028+ }
1029 }
1030
1031 /** Generate ParseException. */
1032 public ParseException generateParseException() {
1033- jj_expentries.clear();
1034- boolean[] la1tokens = new boolean[29];
1035- if (jj_kind >= 0) {
1036- la1tokens[jj_kind] = true;
1037- jj_kind = -1;
1038- }
1039- for (int i = 0; i < 10; i++) {
1040- if (jj_la1[i] == jj_gen) {
1041- for (int j = 0; j < 32; j++) {
1042- if ((jj_la1_0[i] & (1<<j)) != 0) {
1043- la1tokens[j] = true;
1044- }
1045- }
1046- }
1047- }
1048- for (int i = 0; i < 29; i++) {
1049- if (la1tokens[i]) {
1050- jj_expentry = new int[1];
1051- jj_expentry[0] = i;
1052- jj_expentries.add(jj_expentry);
1053- }
1054- }
1055- jj_endpos = 0;
1056- jj_rescan_token();
1057- jj_add_error_token(0, 0);
1058- int[][] exptokseq = new int[jj_expentries.size()][];
1059- for (int i = 0; i < jj_expentries.size(); i++) {
1060- exptokseq[i] = jj_expentries.get(i);
1061- }
1062- return new ParseException(token, exptokseq, tokenImage);
1063- }
1064-
1065- private int trace_indent = 0;
1066- private boolean trace_enabled;
1067-
1068-/** Trace enabled. */
1069- final public boolean trace_enabled() {
1070- return trace_enabled;
1071+ jj_expentries.clear();
1072+ boolean[] la1tokens = new boolean[29];
1073+ if (jj_kind >= 0) {
1074+ la1tokens[jj_kind] = true;
1075+ jj_kind = -1;
1076+ }
1077+ for (int i = 0; i < 10; i++) {
1078+ if (jj_la1[i] == jj_gen) {
1079+ for (int j = 0; j < 32; j++) {
1080+ if ((jj_la1_0[i] & (1<<j)) != 0) {
1081+ la1tokens[j] = true;
1082+ }
1083+ }
1084+ }
1085+ }
1086+ for (int i = 0; i < 29; i++) {
1087+ if (la1tokens[i]) {
1088+ jj_expentry = new int[1];
1089+ jj_expentry[0] = i;
1090+ jj_expentries.add(jj_expentry);
1091+ }
1092+ }
1093+ jj_endpos = 0;
1094+ jj_rescan_token();
1095+ jj_add_error_token(0, 0);
1096+ int[][] exptokseq = new int[jj_expentries.size()][];
1097+ for (int i = 0; i < jj_expentries.size(); i++) {
1098+ exptokseq[i] = jj_expentries.get(i);
1099+ }
1100+ return new ParseException(token, exptokseq, tokenImage);
1101 }
1102
1103 /** Enable tracing. */
1104@@ -763,45 +706,40 @@
1105 }
1106
1107 private void jj_rescan_token() {
1108- jj_rescan = true;
1109- for (int i = 0; i < 3; i++) {
1110- try {
1111- JJCalls p = jj_2_rtns[i];
1112-
1113- do {
1114- if (p.gen > jj_gen) {
1115- jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
1116- switch (i) {
1117- case 0: jj_3_1(); break;
1118- case 1: jj_3_2(); break;
1119- case 2: jj_3_3(); break;
1120- }
1121- }
1122- p = p.next;
1123- } while (p != null);
1124-
1125- } catch(LookaheadSuccess ls) { }
1126- }
1127- jj_rescan = false;
1128+ jj_rescan = true;
1129+ for (int i = 0; i < 3; i++) {
1130+ try {
1131+ JJCalls p = jj_2_rtns[i];
1132+ do {
1133+ if (p.gen > jj_gen) {
1134+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
1135+ switch (i) {
1136+ case 0: jj_3_1(); break;
1137+ case 1: jj_3_2(); break;
1138+ case 2: jj_3_3(); break;
1139+ }
1140+ }
1141+ p = p.next;
1142+ } while (p != null);
1143+ } catch(LookaheadSuccess ls) { }
1144+ }
1145+ jj_rescan = false;
1146 }
1147
1148 private void jj_save(int index, int xla) {
1149- JJCalls p = jj_2_rtns[index];
1150- while (p.gen > jj_gen) {
1151- if (p.next == null) { p = p.next = new JJCalls(); break; }
1152- p = p.next;
1153- }
1154-
1155- p.gen = jj_gen + xla - jj_la;
1156- p.first = token;
1157- p.arg = xla;
1158+ JJCalls p = jj_2_rtns[index];
1159+ while (p.gen > jj_gen) {
1160+ if (p.next == null) { p = p.next = new JJCalls(); break; }
1161+ p = p.next;
1162+ }
1163+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
1164 }
1165
1166 static final class JJCalls {
1167- int gen;
1168- Token first;
1169- int arg;
1170- JJCalls next;
1171+ int gen;
1172+ Token first;
1173+ int arg;
1174+ JJCalls next;
1175 }
1176
1177 }
1178
1179=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParserTokenManager.java'
1180--- src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParserTokenManager.java 2017-05-14 19:42:09 +0000
1181+++ src/dk/aau/cs/TCTL/CTLParsing/TAPAALCTLQueryParserTokenManager.java 2017-09-05 21:26:24 +0000
1182@@ -1,4 +1,3 @@
1183-/* TAPAALCTLQueryParserTokenManager.java */
1184 /* Generated By:JavaCC: Do not edit this line. TAPAALCTLQueryParserTokenManager.java */
1185 package dk.aau.cs.TCTL.CTLParsing;
1186 import java.io.StringReader;
1187@@ -30,28 +29,33 @@
1188 import dk.aau.cs.TCTL.TCTLStateToPathConverter;
1189
1190 /** Token Manager. */
1191-public class TAPAALCTLQueryParserTokenManager implements TAPAALCTLQueryParserConstants {
1192+public class TAPAALCTLQueryParserTokenManager implements TAPAALCTLQueryParserConstants
1193+{
1194
1195 /** Debug output. */
1196 public java.io.PrintStream debugStream = System.out;
1197 /** Set debug output. */
1198 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
1199-private final int jjStopStringLiteralDfa_0(int pos, long active0){
1200+private final int jjStopStringLiteralDfa_0(int pos, long active0)
1201+{
1202 switch (pos)
1203 {
1204 case 0:
1205- if ((active0 & 0x100L) != 0L)
1206- return 49;
1207+ if ((active0 & 0x20000L) != 0L)
1208+ return 48;
1209 if ((active0 & 0x240L) != 0L)
1210- return 64;
1211+ return 65;
1212 if ((active0 & 0x1080L) != 0L)
1213- return 57;
1214+ return 58;
1215+ if ((active0 & 0x100L) != 0L)
1216+ return 50;
1217 return -1;
1218 default :
1219 return -1;
1220 }
1221 }
1222-private final int jjStartNfa_0(int pos, long active0){
1223+private final int jjStartNfa_0(int pos, long active0)
1224+{
1225 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
1226 }
1227 private int jjStopAtPos(int pos, int kind)
1228@@ -60,7 +64,8 @@
1229 jjmatchedPos = pos;
1230 return pos + 1;
1231 }
1232-private int jjMoveStringLiteralDfa0_0(){
1233+private int jjMoveStringLiteralDfa0_0()
1234+{
1235 switch(curChar)
1236 {
1237 case 40:
1238@@ -72,7 +77,7 @@
1239 case 43:
1240 return jjStopAtPos(0, 16);
1241 case 45:
1242- return jjStopAtPos(0, 17);
1243+ return jjStartNfaWithStates_0(0, 17, 48);
1244 case 46:
1245 return jjStopAtPos(0, 28);
1246 case 65:
1247@@ -82,12 +87,13 @@
1248 jjmatchedKind = 6;
1249 return jjMoveStringLiteralDfa1_0(0x200L);
1250 case 85:
1251- return jjStartNfaWithStates_0(0, 8, 49);
1252+ return jjStartNfaWithStates_0(0, 8, 50);
1253 default :
1254 return jjMoveNfa_0(3, 0);
1255 }
1256 }
1257-private int jjMoveStringLiteralDfa1_0(long active0){
1258+private int jjMoveStringLiteralDfa1_0(long active0)
1259+{
1260 try { curChar = input_stream.readChar(); }
1261 catch(java.io.IOException e) {
1262 jjStopStringLiteralDfa_0(0, active0);
1263@@ -97,9 +103,9 @@
1264 {
1265 case 88:
1266 if ((active0 & 0x200L) != 0L)
1267- return jjStartNfaWithStates_0(1, 9, 49);
1268+ return jjStartNfaWithStates_0(1, 9, 50);
1269 else if ((active0 & 0x1000L) != 0L)
1270- return jjStartNfaWithStates_0(1, 12, 49);
1271+ return jjStartNfaWithStates_0(1, 12, 50);
1272 break;
1273 default :
1274 break;
1275@@ -117,7 +123,7 @@
1276 private int jjMoveNfa_0(int startState, int curPos)
1277 {
1278 int startsAt = 0;
1279- jjnewStateCnt = 70;
1280+ jjnewStateCnt = 71;
1281 int i = 1;
1282 jjstateSet[0] = startState;
1283 int kind = 0x7fffffff;
1284@@ -137,7 +143,7 @@
1285 {
1286 if (kind > 19)
1287 kind = 19;
1288- { jjCheckNAdd(47); }
1289+ jjCheckNAdd(48);
1290 }
1291 else if ((0x7000000000000000L & l) != 0L)
1292 {
1293@@ -145,40 +151,42 @@
1294 kind = 21;
1295 }
1296 else if (curChar == 33)
1297- { jjCheckNAdd(51); }
1298+ jjCheckNAdd(52);
1299+ else if (curChar == 45)
1300+ jjCheckNAdd(48);
1301 else if (curChar == 38)
1302 jjstateSet[jjnewStateCnt++] = 41;
1303 if (curChar == 62)
1304- { jjCheckNAdd(51); }
1305+ jjCheckNAdd(52);
1306 else if (curChar == 61)
1307- { jjCheckNAdd(51); }
1308+ jjCheckNAdd(52);
1309 else if (curChar == 60)
1310- { jjCheckNAdd(51); }
1311+ jjCheckNAdd(52);
1312 else if (curChar == 33)
1313 {
1314 if (kind > 15)
1315 kind = 15;
1316 }
1317 break;
1318- case 64:
1319+ case 65:
1320 if ((0x3ff000000000000L & l) != 0L)
1321 {
1322 if (kind > 20)
1323 kind = 20;
1324- { jjCheckNAdd(49); }
1325+ jjCheckNAdd(50);
1326 }
1327 else if (curChar == 60)
1328- jjstateSet[jjnewStateCnt++] = 65;
1329+ jjstateSet[jjnewStateCnt++] = 66;
1330 break;
1331- case 57:
1332+ case 58:
1333 if ((0x3ff000000000000L & l) != 0L)
1334 {
1335 if (kind > 20)
1336 kind = 20;
1337- { jjCheckNAdd(49); }
1338+ jjCheckNAdd(50);
1339 }
1340 else if (curChar == 60)
1341- jjstateSet[jjnewStateCnt++] = 58;
1342+ jjstateSet[jjnewStateCnt++] = 59;
1343 break;
1344 case 41:
1345 if (curChar == 38 && kind > 14)
1346@@ -193,58 +201,62 @@
1347 kind = 15;
1348 break;
1349 case 47:
1350+ if (curChar == 45)
1351+ jjCheckNAdd(48);
1352+ break;
1353+ case 48:
1354 if ((0x3ff000000000000L & l) == 0L)
1355 break;
1356 if (kind > 19)
1357 kind = 19;
1358- { jjCheckNAdd(47); }
1359+ jjCheckNAdd(48);
1360 break;
1361- case 49:
1362+ case 50:
1363 if ((0x3ff000000000000L & l) == 0L)
1364 break;
1365 if (kind > 20)
1366 kind = 20;
1367- { jjCheckNAdd(49); }
1368+ jjCheckNAdd(50);
1369 break;
1370- case 50:
1371+ case 51:
1372 if ((0x7000000000000000L & l) != 0L && kind > 21)
1373 kind = 21;
1374 break;
1375- case 51:
1376+ case 52:
1377 if (curChar == 61 && kind > 21)
1378 kind = 21;
1379 break;
1380- case 52:
1381+ case 53:
1382 if (curChar == 33)
1383- { jjCheckNAdd(51); }
1384- break;
1385- case 53:
1386- if (curChar == 60)
1387- { jjCheckNAdd(51); }
1388+ jjCheckNAdd(52);
1389 break;
1390 case 54:
1391+ if (curChar == 60)
1392+ jjCheckNAdd(52);
1393+ break;
1394+ case 55:
1395 if (curChar == 61)
1396- { jjCheckNAdd(51); }
1397+ jjCheckNAdd(52);
1398 break;
1399- case 55:
1400+ case 56:
1401 if (curChar == 62)
1402- { jjCheckNAdd(51); }
1403+ jjCheckNAdd(52);
1404 break;
1405- case 58:
1406+ case 59:
1407 if (curChar == 62 && kind > 10)
1408 kind = 10;
1409 break;
1410- case 59:
1411+ case 60:
1412 if (curChar == 60)
1413- jjstateSet[jjnewStateCnt++] = 58;
1414+ jjstateSet[jjnewStateCnt++] = 59;
1415 break;
1416- case 65:
1417+ case 66:
1418 if (curChar == 62 && kind > 4)
1419 kind = 4;
1420 break;
1421- case 66:
1422+ case 67:
1423 if (curChar == 60)
1424- jjstateSet[jjnewStateCnt++] = 65;
1425+ jjstateSet[jjnewStateCnt++] = 66;
1426 break;
1427 default : break;
1428 }
1429@@ -262,14 +274,14 @@
1430 {
1431 if (kind > 20)
1432 kind = 20;
1433- { jjCheckNAdd(49); }
1434+ jjCheckNAdd(50);
1435 }
1436 else if (curChar == 124)
1437 jjstateSet[jjnewStateCnt++] = 36;
1438 if (curChar == 69)
1439- { jjAddStates(0, 3); }
1440+ jjAddStates(0, 3);
1441 else if (curChar == 65)
1442- { jjAddStates(4, 7); }
1443+ jjAddStates(4, 7);
1444 else if (curChar == 110)
1445 jjstateSet[jjnewStateCnt++] = 44;
1446 else if (curChar == 97)
1447@@ -289,15 +301,15 @@
1448 else if (curChar == 116)
1449 jjstateSet[jjnewStateCnt++] = 2;
1450 break;
1451- case 64:
1452+ case 65:
1453 if ((0x7fffffe87fffffeL & l) != 0L)
1454 {
1455 if (kind > 20)
1456 kind = 20;
1457- { jjCheckNAdd(49); }
1458+ jjCheckNAdd(50);
1459 }
1460 else if (curChar == 91)
1461- jjstateSet[jjnewStateCnt++] = 68;
1462+ jjstateSet[jjnewStateCnt++] = 69;
1463 if (curChar == 71)
1464 {
1465 if (kind > 5)
1466@@ -309,15 +321,15 @@
1467 kind = 4;
1468 }
1469 break;
1470- case 57:
1471+ case 58:
1472 if ((0x7fffffe87fffffeL & l) != 0L)
1473 {
1474 if (kind > 20)
1475 kind = 20;
1476- { jjCheckNAdd(49); }
1477+ jjCheckNAdd(50);
1478 }
1479 else if (curChar == 91)
1480- jjstateSet[jjnewStateCnt++] = 61;
1481+ jjstateSet[jjnewStateCnt++] = 62;
1482 if (curChar == 71)
1483 {
1484 if (kind > 11)
1485@@ -501,51 +513,51 @@
1486 if (curChar == 110)
1487 jjstateSet[jjnewStateCnt++] = 44;
1488 break;
1489- case 48:
1490- if ((0x7fffffe87fffffeL & l) == 0L)
1491- break;
1492- if (kind > 20)
1493- kind = 20;
1494- { jjCheckNAdd(49); }
1495- break;
1496 case 49:
1497 if ((0x7fffffe87fffffeL & l) == 0L)
1498 break;
1499 if (kind > 20)
1500 kind = 20;
1501- { jjCheckNAdd(49); }
1502- break;
1503- case 56:
1504+ jjCheckNAdd(50);
1505+ break;
1506+ case 50:
1507+ if ((0x7fffffe87fffffeL & l) == 0L)
1508+ break;
1509+ if (kind > 20)
1510+ kind = 20;
1511+ jjCheckNAdd(50);
1512+ break;
1513+ case 57:
1514 if (curChar == 65)
1515- { jjAddStates(4, 7); }
1516+ jjAddStates(4, 7);
1517 break;
1518- case 60:
1519+ case 61:
1520 if (curChar == 71 && kind > 11)
1521 kind = 11;
1522 break;
1523- case 61:
1524+ case 62:
1525 if (curChar == 93 && kind > 11)
1526 kind = 11;
1527 break;
1528- case 62:
1529- if (curChar == 91)
1530- jjstateSet[jjnewStateCnt++] = 61;
1531- break;
1532 case 63:
1533+ if (curChar == 91)
1534+ jjstateSet[jjnewStateCnt++] = 62;
1535+ break;
1536+ case 64:
1537 if (curChar == 69)
1538- { jjAddStates(0, 3); }
1539+ jjAddStates(0, 3);
1540 break;
1541- case 67:
1542+ case 68:
1543 if (curChar == 71 && kind > 5)
1544 kind = 5;
1545 break;
1546- case 68:
1547+ case 69:
1548 if (curChar == 93 && kind > 5)
1549 kind = 5;
1550 break;
1551- case 69:
1552+ case 70:
1553 if (curChar == 91)
1554- jjstateSet[jjnewStateCnt++] = 68;
1555+ jjstateSet[jjnewStateCnt++] = 69;
1556 break;
1557 default : break;
1558 }
1559@@ -570,18 +582,81 @@
1560 kind = 0x7fffffff;
1561 }
1562 ++curPos;
1563- if ((i = jjnewStateCnt) == (startsAt = 70 - (jjnewStateCnt = startsAt)))
1564+ if ((i = jjnewStateCnt) == (startsAt = 71 - (jjnewStateCnt = startsAt)))
1565 return curPos;
1566 try { curChar = input_stream.readChar(); }
1567 catch(java.io.IOException e) { return curPos; }
1568 }
1569 }
1570+static final int[] jjnextStates = {
1571+ 65, 67, 68, 70, 58, 60, 61, 63,
1572+};
1573
1574 /** Token literal values. */
1575 public static final String[] jjstrLiteralImages = {
1576 "", null, null, null, null, null, "\105", "\101", "\125", "\105\130", null,
1577 null, "\101\130", null, null, null, "\53", "\55", "\52", null, null, null, null,
1578 null, null, null, "\50", "\51", "\56", };
1579+
1580+/** Lexer state names. */
1581+public static final String[] lexStateNames = {
1582+ "DEFAULT",
1583+};
1584+static final long[] jjtoToken = {
1585+ 0x1c3fffffL,
1586+};
1587+static final long[] jjtoSkip = {
1588+ 0x3c00000L,
1589+};
1590+protected SimpleCharStream input_stream;
1591+private final int[] jjrounds = new int[71];
1592+private final int[] jjstateSet = new int[142];
1593+protected char curChar;
1594+/** Constructor. */
1595+public TAPAALCTLQueryParserTokenManager(SimpleCharStream stream){
1596+ if (SimpleCharStream.staticFlag)
1597+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
1598+ input_stream = stream;
1599+}
1600+
1601+/** Constructor. */
1602+public TAPAALCTLQueryParserTokenManager(SimpleCharStream stream, int lexState){
1603+ this(stream);
1604+ SwitchTo(lexState);
1605+}
1606+
1607+/** Reinitialise parser. */
1608+public void ReInit(SimpleCharStream stream)
1609+{
1610+ jjmatchedPos = jjnewStateCnt = 0;
1611+ curLexState = defaultLexState;
1612+ input_stream = stream;
1613+ ReInitRounds();
1614+}
1615+private void ReInitRounds()
1616+{
1617+ int i;
1618+ jjround = 0x80000001;
1619+ for (i = 71; i-- > 0;)
1620+ jjrounds[i] = 0x80000000;
1621+}
1622+
1623+/** Reinitialise parser. */
1624+public void ReInit(SimpleCharStream stream, int lexState)
1625+{
1626+ ReInit(stream);
1627+ SwitchTo(lexState);
1628+}
1629+
1630+/** Switch to specified lex state. */
1631+public void SwitchTo(int lexState)
1632+{
1633+ if (lexState >= 1 || lexState < 0)
1634+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1635+ else
1636+ curLexState = lexState;
1637+}
1638+
1639 protected Token jjFillToken()
1640 {
1641 final Token t;
1642@@ -596,9 +671,7 @@
1643 beginColumn = input_stream.getBeginColumn();
1644 endLine = input_stream.getEndLine();
1645 endColumn = input_stream.getEndColumn();
1646- t = Token.newToken(jjmatchedKind);
1647- t.kind = jjmatchedKind;
1648- t.image = curTokenImage;
1649+ t = Token.newToken(jjmatchedKind, curTokenImage);
1650
1651 t.beginLine = beginLine;
1652 t.endLine = endLine;
1653@@ -607,9 +680,6 @@
1654
1655 return t;
1656 }
1657-static final int[] jjnextStates = {
1658- 64, 66, 67, 69, 57, 59, 60, 62,
1659-};
1660
1661 int curLexState = 0;
1662 int defaultLexState = 0;
1663@@ -631,10 +701,9 @@
1664 {
1665 curChar = input_stream.BeginToken();
1666 }
1667- catch(Exception e)
1668+ catch(java.io.IOException e)
1669 {
1670 jjmatchedKind = 0;
1671- jjmatchedPos = -1;
1672 matchedToken = jjFillToken();
1673 return matchedToken;
1674 }
1675@@ -684,31 +753,6 @@
1676 }
1677 }
1678
1679-void SkipLexicalActions(Token matchedToken)
1680-{
1681- switch(jjmatchedKind)
1682- {
1683- default :
1684- break;
1685- }
1686-}
1687-void MoreLexicalActions()
1688-{
1689- jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
1690- switch(jjmatchedKind)
1691- {
1692- default :
1693- break;
1694- }
1695-}
1696-void TokenLexicalActions(Token matchedToken)
1697-{
1698- switch(jjmatchedKind)
1699- {
1700- default :
1701- break;
1702- }
1703-}
1704 private void jjCheckNAdd(int state)
1705 {
1706 if (jjrounds[state] != jjround)
1707@@ -729,90 +773,4 @@
1708 jjCheckNAdd(state2);
1709 }
1710
1711- /** Constructor. */
1712- public TAPAALCTLQueryParserTokenManager(SimpleCharStream stream){
1713-
1714- if (SimpleCharStream.staticFlag)
1715- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
1716-
1717- input_stream = stream;
1718- }
1719-
1720- /** Constructor. */
1721- public TAPAALCTLQueryParserTokenManager (SimpleCharStream stream, int lexState){
1722- ReInit(stream);
1723- SwitchTo(lexState);
1724- }
1725-
1726- /** Reinitialise parser. */
1727-
1728- public void ReInit(SimpleCharStream stream)
1729- {
1730-
1731-
1732- jjmatchedPos =
1733- jjnewStateCnt =
1734- 0;
1735- curLexState = defaultLexState;
1736- input_stream = stream;
1737- ReInitRounds();
1738- }
1739-
1740- private void ReInitRounds()
1741- {
1742- int i;
1743- jjround = 0x80000001;
1744- for (i = 70; i-- > 0;)
1745- jjrounds[i] = 0x80000000;
1746- }
1747-
1748- /** Reinitialise parser. */
1749- public void ReInit(SimpleCharStream stream, int lexState)
1750-
1751- {
1752- ReInit(stream);
1753- SwitchTo(lexState);
1754- }
1755-
1756- /** Switch to specified lex state. */
1757- public void SwitchTo(int lexState)
1758- {
1759- if (lexState >= 1 || lexState < 0)
1760- throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1761- else
1762- curLexState = lexState;
1763- }
1764-
1765-
1766-/** Lexer state names. */
1767-public static final String[] lexStateNames = {
1768- "DEFAULT",
1769-};
1770-
1771-/** Lex State array. */
1772-public static final int[] jjnewLexState = {
1773- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1774- -1, -1, -1, -1,
1775-};
1776-static final long[] jjtoToken = {
1777- 0x1c3fffffL,
1778-};
1779-static final long[] jjtoSkip = {
1780- 0x3c00000L,
1781-};
1782-static final long[] jjtoSpecial = {
1783- 0x0L,
1784-};
1785-static final long[] jjtoMore = {
1786- 0x0L,
1787-};
1788- protected SimpleCharStream input_stream;
1789-
1790- private final int[] jjrounds = new int[70];
1791- private final int[] jjstateSet = new int[2 * 70];
1792- private final StringBuilder jjimage = new StringBuilder();
1793- private StringBuilder image = jjimage;
1794- private int jjimageLen;
1795- private int lengthOfMatch;
1796- protected int curChar;
1797 }
1798
1799=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/Token.java'
1800--- src/dk/aau/cs/TCTL/CTLParsing/Token.java 2017-05-07 12:44:00 +0000
1801+++ src/dk/aau/cs/TCTL/CTLParsing/Token.java 2017-09-05 21:26:24 +0000
1802@@ -1,5 +1,5 @@
1803-/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */
1804-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
1805+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
1806+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
1807 package dk.aau.cs.TCTL.CTLParsing;
1808
1809 /**
1810@@ -128,4 +128,4 @@
1811 }
1812
1813 }
1814-/* JavaCC - OriginalChecksum=8ee1473b89874b09d6c560395ea72ef9 (do not edit this line) */
1815+/* JavaCC - OriginalChecksum=c3a33ef5a2c7f5ec67f13491eacfbc58 (do not edit this line) */
1816
1817=== modified file 'src/dk/aau/cs/TCTL/CTLParsing/TokenMgrError.java'
1818--- src/dk/aau/cs/TCTL/CTLParsing/TokenMgrError.java 2017-05-07 12:44:00 +0000
1819+++ src/dk/aau/cs/TCTL/CTLParsing/TokenMgrError.java 2017-09-05 21:26:24 +0000
1820@@ -1,4 +1,4 @@
1821-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */
1822+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
1823 /* JavaCCOptions: */
1824 package dk.aau.cs.TCTL.CTLParsing;
1825
1826@@ -20,22 +20,22 @@
1827 /**
1828 * Lexical error occurred.
1829 */
1830- public static final int LEXICAL_ERROR = 0;
1831+ static final int LEXICAL_ERROR = 0;
1832
1833 /**
1834 * An attempt was made to create a second instance of a static token manager.
1835 */
1836- public static final int STATIC_LEXER_ERROR = 1;
1837+ static final int STATIC_LEXER_ERROR = 1;
1838
1839 /**
1840 * Tried to change to an invalid lexical state.
1841 */
1842- public static final int INVALID_LEXICAL_STATE = 2;
1843+ static final int INVALID_LEXICAL_STATE = 2;
1844
1845 /**
1846 * Detected (and bailed out of) an infinite loop in the token manager.
1847 */
1848- public static final int LOOP_DETECTED = 3;
1849+ static final int LOOP_DETECTED = 3;
1850
1851 /**
1852 * Indicates the reason why the exception is thrown. It will have
1853@@ -53,6 +53,8 @@
1854 for (int i = 0; i < str.length(); i++) {
1855 switch (str.charAt(i))
1856 {
1857+ case 0 :
1858+ continue;
1859 case '\b':
1860 retval.append("\\b");
1861 continue;
1862@@ -102,12 +104,11 @@
1863 * curchar : the offending character
1864 * Note: You can customize the lexical error message by modifying this method.
1865 */
1866- protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) {
1867- char curChar1 = (char)curChar;
1868+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
1869 return("Lexical error at line " +
1870 errorLine + ", column " +
1871 errorColumn + ". Encountered: " +
1872- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + (int)curChar + "), ") +
1873+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
1874 "after : \"" + addEscapes(errorAfter) + "\"");
1875 }
1876
1877@@ -139,8 +140,8 @@
1878 }
1879
1880 /** Full Constructor. */
1881- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) {
1882- this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
1883+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
1884+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
1885 }
1886 }
1887-/* JavaCC - OriginalChecksum=e4cccd65824e0c3a5184be2779230da1 (do not edit this line) */
1888+/* JavaCC - OriginalChecksum=859f023f3abe7d4b866c6b4b7c693934 (do not edit this line) */
1889
1890=== modified file 'src/resources/TCTLParser/TAPAALCTLQueryParser.jj'
1891--- src/resources/TCTLParser/TAPAALCTLQueryParser.jj 2017-05-15 10:38:38 +0000
1892+++ src/resources/TCTLParser/TAPAALCTLQueryParser.jj 2017-09-05 21:26:24 +0000
1893@@ -112,7 +112,7 @@
1894
1895 TOKEN :
1896 {
1897- < NUM: ( ["0"-"9"] )+ >
1898+ < NUM: ("-")? ( ["0"-"9"] )+ >
1899 |
1900 <IDENT: ["a"-"z","A"-"Z","_"] ( ["a"-"z","A"-"Z","_","0"-"9"] )* >
1901 }

Subscribers

People subscribed via source and target branches