Browse Source

Update parser files to version 6.0 of JavaCC.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11367 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 10 years ago
parent
commit
ec0428f084
  1. 4
      prism/src/parser/ParseException.java
  2. 1545
      prism/src/parser/Prism3To4.java
  3. 248
      prism/src/parser/Prism3To4TokenManager.java
  4. 1880
      prism/src/parser/PrismParser.java
  5. 2
      prism/src/parser/PrismParser.jj
  6. 252
      prism/src/parser/PrismParserTokenManager.java
  7. 11
      prism/src/parser/SimpleCharStream.java
  8. 4
      prism/src/parser/Token.java
  9. 4
      prism/src/parser/TokenMgrError.java
  10. 144
      prism/src/pta/parser/PTAParser.java
  11. 204
      prism/src/pta/parser/PTAParserTokenManager.java
  12. 4
      prism/src/pta/parser/ParseException.java
  13. 11
      prism/src/pta/parser/SimpleCharStream.java
  14. 4
      prism/src/pta/parser/Token.java
  15. 4
      prism/src/pta/parser/TokenMgrError.java

4
prism/src/parser/ParseException.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */ /* JavaCCOptions:KEEP_LINE_COL=null */
package parser; package parser;
@ -184,4 +184,4 @@ public class ParseException extends Exception {
} }
} }
/* JavaCC - OriginalChecksum=16ba3edbb338127335444b2b77a37aa1 (do not edit this line) */
/* JavaCC - OriginalChecksum=83512206aea6c09dd76f640dc4cc775b (do not edit this line) */

1545
prism/src/parser/Prism3To4.java
File diff suppressed because it is too large
View File

248
prism/src/parser/Prism3To4TokenManager.java

@ -1,17 +1,16 @@
/* Prism3To4TokenManager.java */
/* Generated By:JavaCC: Do not edit this line. Prism3To4TokenManager.java */ /* Generated By:JavaCC: Do not edit this line. Prism3To4TokenManager.java */
package parser; package parser;
import java.io.*; import java.io.*;
/** Token Manager. */ /** Token Manager. */
public class Prism3To4TokenManager implements Prism3To4Constants
{
@SuppressWarnings("unused")public class Prism3To4TokenManager implements Prism3To4Constants {
/** Debug output. */ /** Debug output. */
public static java.io.PrintStream debugStream = System.out; public static java.io.PrintStream debugStream = System.out;
/** Set debug output. */ /** Set debug output. */
public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private static final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
{
private static final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){
switch (pos) switch (pos)
{ {
case 0: case 0:
@ -162,8 +161,7 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
return -1; return -1;
} }
} }
private static final int jjStartNfa_0(int pos, long active0, long active1)
{
private static final int jjStartNfa_0(int pos, long active0, long active1){
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
} }
static private int jjStopAtPos(int pos, int kind) static private int jjStopAtPos(int pos, int kind)
@ -172,8 +170,7 @@ static private int jjStopAtPos(int pos, int kind)
jjmatchedPos = pos; jjmatchedPos = pos;
return pos + 1; return pos + 1;
} }
static private int jjMoveStringLiteralDfa0_0()
{
static private int jjMoveStringLiteralDfa0_0(){
switch(curChar) switch(curChar)
{ {
case 33: case 33:
@ -279,8 +276,7 @@ static private int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0(0, 0); return jjMoveNfa_0(0, 0);
} }
} }
static private int jjMoveStringLiteralDfa1_0(long active0, long active1)
{
static private int jjMoveStringLiteralDfa1_0(long active0, long active1){
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(0, active0, active1); jjStopStringLiteralDfa_0(0, active0, active1);
@ -339,8 +335,7 @@ static private int jjMoveStringLiteralDfa1_0(long active0, long active1)
} }
return jjStartNfa_0(0, active0, active1); return jjStartNfa_0(0, active0, active1);
} }
static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
{
static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){
if (((active0 &= old0) | (active1 &= old1)) == 0L) if (((active0 &= old0) | (active1 &= old1)) == 0L)
return jjStartNfa_0(0, old0, old1); return jjStartNfa_0(0, old0, old1);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -393,8 +388,7 @@ static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1,
} }
return jjStartNfa_0(1, active0, 0L); return jjStartNfa_0(1, active0, 0L);
} }
static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa3_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0, 0L); return jjStartNfa_0(1, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -468,8 +462,7 @@ static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
} }
return jjStartNfa_0(2, active0, 0L); return jjStartNfa_0(2, active0, 0L);
} }
static private int jjMoveStringLiteralDfa4_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa4_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(2, old0, 0L); return jjStartNfa_0(2, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -512,8 +505,7 @@ static private int jjMoveStringLiteralDfa4_0(long old0, long active0)
} }
return jjStartNfa_0(3, active0, 0L); return jjStartNfa_0(3, active0, 0L);
} }
static private int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa5_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(3, old0, 0L); return jjStartNfa_0(3, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -556,8 +548,7 @@ static private int jjMoveStringLiteralDfa5_0(long old0, long active0)
} }
return jjStartNfa_0(4, active0, 0L); return jjStartNfa_0(4, active0, 0L);
} }
static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa6_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0, 0L); return jjStartNfa_0(4, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -590,8 +581,7 @@ static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
} }
return jjStartNfa_0(5, active0, 0L); return jjStartNfa_0(5, active0, 0L);
} }
static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa7_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0, 0L); return jjStartNfa_0(5, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -614,8 +604,7 @@ static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
} }
return jjStartNfa_0(6, active0, 0L); return jjStartNfa_0(6, active0, 0L);
} }
static private int jjMoveStringLiteralDfa8_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa8_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(6, old0, 0L); return jjStartNfa_0(6, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -642,8 +631,7 @@ static private int jjMoveStringLiteralDfa8_0(long old0, long active0)
} }
return jjStartNfa_0(7, active0, 0L); return jjStartNfa_0(7, active0, 0L);
} }
static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa9_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(7, old0, 0L); return jjStartNfa_0(7, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -668,8 +656,7 @@ static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
} }
return jjStartNfa_0(8, active0, 0L); return jjStartNfa_0(8, active0, 0L);
} }
static private int jjMoveStringLiteralDfa10_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa10_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(8, old0, 0L); return jjStartNfa_0(8, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -688,8 +675,7 @@ static private int jjMoveStringLiteralDfa10_0(long old0, long active0)
} }
return jjStartNfa_0(9, active0, 0L); return jjStartNfa_0(9, active0, 0L);
} }
static private int jjMoveStringLiteralDfa11_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa11_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(9, old0, 0L); return jjStartNfa_0(9, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -706,8 +692,7 @@ static private int jjMoveStringLiteralDfa11_0(long old0, long active0)
} }
return jjStartNfa_0(10, active0, 0L); return jjStartNfa_0(10, active0, 0L);
} }
static private int jjMoveStringLiteralDfa12_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa12_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(10, old0, 0L); return jjStartNfa_0(10, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -728,8 +713,7 @@ static private int jjMoveStringLiteralDfa12_0(long old0, long active0)
} }
return jjStartNfa_0(11, active0, 0L); return jjStartNfa_0(11, active0, 0L);
} }
static private int jjMoveStringLiteralDfa13_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa13_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(11, old0, 0L); return jjStartNfa_0(11, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -746,8 +730,7 @@ static private int jjMoveStringLiteralDfa13_0(long old0, long active0)
} }
return jjStartNfa_0(12, active0, 0L); return jjStartNfa_0(12, active0, 0L);
} }
static private int jjMoveStringLiteralDfa14_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa14_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(12, old0, 0L); return jjStartNfa_0(12, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -764,8 +747,7 @@ static private int jjMoveStringLiteralDfa14_0(long old0, long active0)
} }
return jjStartNfa_0(13, active0, 0L); return jjStartNfa_0(13, active0, 0L);
} }
static private int jjMoveStringLiteralDfa15_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa15_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(13, old0, 0L); return jjStartNfa_0(13, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -818,7 +800,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 78) if (kind > 78)
kind = 78; kind = 78;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
} }
else if (curChar == 39) else if (curChar == 39)
{ {
@ -826,14 +808,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 77; kind = 77;
} }
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 0: case 0:
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
{ {
if (kind > 76) if (kind > 76)
kind = 76; kind = 76;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
} }
else if ((0x100002600L & l) != 0L) else if ((0x100002600L & l) != 0L)
{ {
@ -841,16 +823,16 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 1; kind = 1;
} }
else if (curChar == 35) else if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
else if (curChar == 46) else if (curChar == 46)
jjCheckNAdd(11);
{ jjCheckNAdd(11); }
else if (curChar == 47) else if (curChar == 47)
jjstateSet[jjnewStateCnt++] = 1; jjstateSet[jjnewStateCnt++] = 1;
if ((0x3fe000000000000L & l) != 0L) if ((0x3fe000000000000L & l) != 0L)
{ {
if (kind > 75) if (kind > 75)
kind = 75; kind = 75;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
} }
else if (curChar == 48) else if (curChar == 48)
{ {
@ -860,11 +842,11 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
case 1: case 1:
if (curChar == 47) if (curChar == 47)
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 2: case 2:
if ((0xffffffffffffdbffL & l) != 0L) if ((0xffffffffffffdbffL & l) != 0L)
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 3: case 3:
if ((0x2400L & l) != 0L && kind > 2) if ((0x2400L & l) != 0L && kind > 2)
@ -887,14 +869,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 75) if (kind > 75)
kind = 75; kind = 75;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
break; break;
case 8: case 8:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 75) if (kind > 75)
kind = 75; kind = 75;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
break; break;
case 9: case 9:
if (curChar == 48 && kind > 75) if (curChar == 48 && kind > 75)
@ -902,33 +884,33 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
case 10: case 10:
if (curChar == 46) if (curChar == 46)
jjCheckNAdd(11);
{ jjCheckNAdd(11); }
break; break;
case 11: case 11:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 76) if (kind > 76)
kind = 76; kind = 76;
jjCheckNAddTwoStates(11, 12);
{ jjCheckNAddTwoStates(11, 12); }
break; break;
case 13: case 13:
if ((0x280000000000L & l) != 0L) if ((0x280000000000L & l) != 0L)
jjCheckNAdd(14);
{ jjCheckNAdd(14); }
break; break;
case 14: case 14:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 76) if (kind > 76)
kind = 76; kind = 76;
jjCheckNAdd(14);
{ jjCheckNAdd(14); }
break; break;
case 15: case 15:
if (curChar == 35) if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 16: case 16:
if ((0xfffffff7ffffffffL & l) != 0L) if ((0xfffffff7ffffffffL & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 17: case 17:
if (curChar == 35 && kind > 79) if (curChar == 35 && kind > 79)
@ -939,11 +921,11 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 76) if (kind > 76)
kind = 76; kind = 76;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
break; break;
case 20: case 20:
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 21: case 21:
if (curChar == 39 && kind > 77) if (curChar == 39 && kind > 77)
@ -954,7 +936,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 78) if (kind > 78)
kind = 78; kind = 78;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
break; break;
default : break; default : break;
} }
@ -972,38 +954,38 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 78) if (kind > 78)
kind = 78; kind = 78;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
} }
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 0: case 0:
if ((0x7fffffe87fffffeL & l) == 0L) if ((0x7fffffe87fffffeL & l) == 0L)
break; break;
if (kind > 78) if (kind > 78)
kind = 78; kind = 78;
jjCheckNAddStates(7, 9);
{ jjCheckNAddStates(7, 9); }
break; break;
case 2: case 2:
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
case 12: case 12:
if ((0x2000000020L & l) != 0L) if ((0x2000000020L & l) != 0L)
jjAddStates(10, 11);
{ jjAddStates(10, 11); }
break; break;
case 16: case 16:
jjAddStates(12, 13);
{ jjAddStates(12, 13); }
break; break;
case 20: case 20:
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 22: case 22:
if ((0x7fffffe87fffffeL & l) == 0L) if ((0x7fffffe87fffffeL & l) == 0L)
break; break;
if (kind > 78) if (kind > 78)
kind = 78; kind = 78;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
break; break;
default : break; default : break;
} }
@ -1019,11 +1001,11 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
case 2: case 2:
if ((jjbitVec0[i2] & l2) != 0L) if ((jjbitVec0[i2] & l2) != 0L)
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
case 16: case 16:
if ((jjbitVec0[i2] & l2) != 0L) if ((jjbitVec0[i2] & l2) != 0L)
jjAddStates(12, 13);
{ jjAddStates(12, 13); }
break; break;
default : break; default : break;
} }
@ -1062,69 +1044,6 @@ public static final String[] jjstrLiteralImages = {
"\75\76", "\55\76", "\72", "\73", "\54", "\56\56", "\50", "\51", "\133", "\135", "\173", "\75\76", "\55\76", "\72", "\73", "\54", "\56\56", "\50", "\51", "\133", "\135", "\173",
"\175", "\75", "\41\75", "\74", "\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57", "\175", "\75", "\41\75", "\74", "\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57",
"\47", "\74\55", "\77", "\42", null, null, null, null, null, }; "\47", "\74\55", "\77", "\42", null, null, null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0xfffffffffffffff9L, 0xffffL,
};
static final long[] jjtoSkip = {
0x6L, 0x0L,
};
static final long[] jjtoSpecial = {
0x6L, 0x0L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[23];
static private final int[] jjstateSet = new int[46];
static protected char curChar;
/** Constructor. */
public Prism3To4TokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public Prism3To4TokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 23; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
static protected Token jjFillToken() static protected Token jjFillToken()
{ {
final Token t; final Token t;
@ -1173,6 +1092,7 @@ public static Token getNextToken()
catch(java.io.IOException e) catch(java.io.IOException e)
{ {
jjmatchedKind = 0; jjmatchedKind = 0;
jjmatchedPos = -1;
matchedToken = jjFillToken(); matchedToken = jjFillToken();
matchedToken.specialToken = specialToken; matchedToken.specialToken = specialToken;
return matchedToken; return matchedToken;
@ -1257,4 +1177,72 @@ static private void jjCheckNAddStates(int start, int end)
} while (start++ != end); } while (start++ != end);
} }
/** Constructor. */
public Prism3To4TokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public Prism3To4TokenManager (SimpleCharStream stream, int lexState){
ReInit(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 23; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0xfffffffffffffff9L, 0xffffL,
};
static final long[] jjtoSkip = {
0x6L, 0x0L,
};
static final long[] jjtoSpecial = {
0x6L, 0x0L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[23];
static private final int[] jjstateSet = new int[2 * 23];
static protected char curChar;
} }

1880
prism/src/parser/PrismParser.java
File diff suppressed because it is too large
View File

2
prism/src/parser/PrismParser.jj

@ -355,7 +355,7 @@ public class PrismParser
*/ */
public int getTabSize() public int getTabSize()
{ {
return SimpleCharStream.getTabSize(0);
return SimpleCharStream.getTabSize();
} }
/** /**

252
prism/src/parser/PrismParserTokenManager.java

@ -1,3 +1,4 @@
/* PrismParserTokenManager.java */
/* Generated By:JavaCC: Do not edit this line. PrismParserTokenManager.java */ /* Generated By:JavaCC: Do not edit this line. PrismParserTokenManager.java */
package parser; package parser;
import java.io.*; import java.io.*;
@ -13,15 +14,13 @@ import prism.ModelType;
import prism.PrismLangException; import prism.PrismLangException;
/** Token Manager. */ /** Token Manager. */
public class PrismParserTokenManager implements PrismParserConstants
{
@SuppressWarnings("unused")public class PrismParserTokenManager implements PrismParserConstants {
/** Debug output. */ /** Debug output. */
public static java.io.PrintStream debugStream = System.out; public static java.io.PrintStream debugStream = System.out;
/** Set debug output. */ /** Set debug output. */
public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private static final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
{
private static final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){
switch (pos) switch (pos)
{ {
case 0: case 0:
@ -177,8 +176,7 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
return -1; return -1;
} }
} }
private static final int jjStartNfa_0(int pos, long active0, long active1)
{
private static final int jjStartNfa_0(int pos, long active0, long active1){
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
} }
static private int jjStopAtPos(int pos, int kind) static private int jjStopAtPos(int pos, int kind)
@ -187,8 +185,7 @@ static private int jjStopAtPos(int pos, int kind)
jjmatchedPos = pos; jjmatchedPos = pos;
return pos + 1; return pos + 1;
} }
static private int jjMoveStringLiteralDfa0_0()
{
static private int jjMoveStringLiteralDfa0_0(){
switch(curChar) switch(curChar)
{ {
case 33: case 33:
@ -302,8 +299,7 @@ static private int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0(0, 0); return jjMoveNfa_0(0, 0);
} }
} }
static private int jjMoveStringLiteralDfa1_0(long active0, long active1)
{
static private int jjMoveStringLiteralDfa1_0(long active0, long active1){
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(0, active0, active1); jjStopStringLiteralDfa_0(0, active0, active1);
@ -379,8 +375,7 @@ static private int jjMoveStringLiteralDfa1_0(long active0, long active1)
} }
return jjStartNfa_0(0, active0, active1); return jjStartNfa_0(0, active0, active1);
} }
static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
{
static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){
if (((active0 &= old0) | (active1 &= old1)) == 0L) if (((active0 &= old0) | (active1 &= old1)) == 0L)
return jjStartNfa_0(0, old0, old1); return jjStartNfa_0(0, old0, old1);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -441,8 +436,7 @@ static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1,
} }
return jjStartNfa_0(1, active0, 0L); return jjStartNfa_0(1, active0, 0L);
} }
static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa3_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0, 0L); return jjStartNfa_0(1, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -512,8 +506,7 @@ static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
} }
return jjStartNfa_0(2, active0, 0L); return jjStartNfa_0(2, active0, 0L);
} }
static private int jjMoveStringLiteralDfa4_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa4_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(2, old0, 0L); return jjStartNfa_0(2, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -558,8 +551,7 @@ static private int jjMoveStringLiteralDfa4_0(long old0, long active0)
} }
return jjStartNfa_0(3, active0, 0L); return jjStartNfa_0(3, active0, 0L);
} }
static private int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa5_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(3, old0, 0L); return jjStartNfa_0(3, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -608,8 +600,7 @@ static private int jjMoveStringLiteralDfa5_0(long old0, long active0)
} }
return jjStartNfa_0(4, active0, 0L); return jjStartNfa_0(4, active0, 0L);
} }
static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa6_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0, 0L); return jjStartNfa_0(4, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -642,8 +633,7 @@ static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
} }
return jjStartNfa_0(5, active0, 0L); return jjStartNfa_0(5, active0, 0L);
} }
static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa7_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0, 0L); return jjStartNfa_0(5, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -668,8 +658,7 @@ static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
} }
return jjStartNfa_0(6, active0, 0L); return jjStartNfa_0(6, active0, 0L);
} }
static private int jjMoveStringLiteralDfa8_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa8_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(6, old0, 0L); return jjStartNfa_0(6, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -700,8 +689,7 @@ static private int jjMoveStringLiteralDfa8_0(long old0, long active0)
} }
return jjStartNfa_0(7, active0, 0L); return jjStartNfa_0(7, active0, 0L);
} }
static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa9_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(7, old0, 0L); return jjStartNfa_0(7, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -728,8 +716,7 @@ static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
} }
return jjStartNfa_0(8, active0, 0L); return jjStartNfa_0(8, active0, 0L);
} }
static private int jjMoveStringLiteralDfa10_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa10_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(8, old0, 0L); return jjStartNfa_0(8, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -748,8 +735,7 @@ static private int jjMoveStringLiteralDfa10_0(long old0, long active0)
} }
return jjStartNfa_0(9, active0, 0L); return jjStartNfa_0(9, active0, 0L);
} }
static private int jjMoveStringLiteralDfa11_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa11_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(9, old0, 0L); return jjStartNfa_0(9, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -770,8 +756,7 @@ static private int jjMoveStringLiteralDfa11_0(long old0, long active0)
} }
return jjStartNfa_0(10, active0, 0L); return jjStartNfa_0(10, active0, 0L);
} }
static private int jjMoveStringLiteralDfa12_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa12_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(10, old0, 0L); return jjStartNfa_0(10, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -792,8 +777,7 @@ static private int jjMoveStringLiteralDfa12_0(long old0, long active0)
} }
return jjStartNfa_0(11, active0, 0L); return jjStartNfa_0(11, active0, 0L);
} }
static private int jjMoveStringLiteralDfa13_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa13_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(11, old0, 0L); return jjStartNfa_0(11, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -810,8 +794,7 @@ static private int jjMoveStringLiteralDfa13_0(long old0, long active0)
} }
return jjStartNfa_0(12, active0, 0L); return jjStartNfa_0(12, active0, 0L);
} }
static private int jjMoveStringLiteralDfa14_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa14_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(12, old0, 0L); return jjStartNfa_0(12, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -828,8 +811,7 @@ static private int jjMoveStringLiteralDfa14_0(long old0, long active0)
} }
return jjStartNfa_0(13, active0, 0L); return jjStartNfa_0(13, active0, 0L);
} }
static private int jjMoveStringLiteralDfa15_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa15_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(13, old0, 0L); return jjStartNfa_0(13, old0, 0L);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -885,7 +867,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 89) if (kind > 89)
kind = 89; kind = 89;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
} }
else if (curChar == 39) else if (curChar == 39)
{ {
@ -893,14 +875,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 88; kind = 88;
} }
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 0: case 0:
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
{ {
if (kind > 87) if (kind > 87)
kind = 87; kind = 87;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
} }
else if ((0x100002600L & l) != 0L) else if ((0x100002600L & l) != 0L)
{ {
@ -908,16 +890,16 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 1; kind = 1;
} }
else if (curChar == 35) else if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
else if (curChar == 46) else if (curChar == 46)
jjCheckNAdd(11);
{ jjCheckNAdd(11); }
else if (curChar == 47) else if (curChar == 47)
jjstateSet[jjnewStateCnt++] = 1; jjstateSet[jjnewStateCnt++] = 1;
if ((0x3fe000000000000L & l) != 0L) if ((0x3fe000000000000L & l) != 0L)
{ {
if (kind > 86) if (kind > 86)
kind = 86; kind = 86;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
} }
else if (curChar == 48) else if (curChar == 48)
{ {
@ -930,14 +912,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 2) if (kind > 2)
kind = 2; kind = 2;
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 2: case 2:
if ((0xffffffffffffdbffL & l) == 0L) if ((0xffffffffffffdbffL & l) == 0L)
break; break;
if (kind > 2) if (kind > 2)
kind = 2; kind = 2;
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 3: case 3:
if ((0x2400L & l) != 0L && kind > 2) if ((0x2400L & l) != 0L && kind > 2)
@ -960,14 +942,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 86) if (kind > 86)
kind = 86; kind = 86;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
break; break;
case 8: case 8:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 86) if (kind > 86)
kind = 86; kind = 86;
jjCheckNAdd(8);
{ jjCheckNAdd(8); }
break; break;
case 9: case 9:
if (curChar == 48 && kind > 86) if (curChar == 48 && kind > 86)
@ -975,33 +957,33 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
case 10: case 10:
if (curChar == 46) if (curChar == 46)
jjCheckNAdd(11);
{ jjCheckNAdd(11); }
break; break;
case 11: case 11:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 87) if (kind > 87)
kind = 87; kind = 87;
jjCheckNAddTwoStates(11, 12);
{ jjCheckNAddTwoStates(11, 12); }
break; break;
case 13: case 13:
if ((0x280000000000L & l) != 0L) if ((0x280000000000L & l) != 0L)
jjCheckNAdd(14);
{ jjCheckNAdd(14); }
break; break;
case 14: case 14:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 87) if (kind > 87)
kind = 87; kind = 87;
jjCheckNAdd(14);
{ jjCheckNAdd(14); }
break; break;
case 15: case 15:
if (curChar == 35) if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 16: case 16:
if ((0xfffffff7ffffffffL & l) != 0L) if ((0xfffffff7ffffffffL & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 17: case 17:
if (curChar == 35 && kind > 90) if (curChar == 35 && kind > 90)
@ -1012,11 +994,11 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 87) if (kind > 87)
kind = 87; kind = 87;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
break; break;
case 20: case 20:
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 21: case 21:
if (curChar == 39 && kind > 88) if (curChar == 39 && kind > 88)
@ -1027,7 +1009,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 89) if (kind > 89)
kind = 89; kind = 89;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
break; break;
default : break; default : break;
} }
@ -1045,40 +1027,40 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 89) if (kind > 89)
kind = 89; kind = 89;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
} }
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 0: case 0:
if ((0x7fffffe87fffffeL & l) == 0L) if ((0x7fffffe87fffffeL & l) == 0L)
break; break;
if (kind > 89) if (kind > 89)
kind = 89; kind = 89;
jjCheckNAddStates(7, 9);
{ jjCheckNAddStates(7, 9); }
break; break;
case 2: case 2:
if (kind > 2) if (kind > 2)
kind = 2; kind = 2;
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
case 12: case 12:
if ((0x2000000020L & l) != 0L) if ((0x2000000020L & l) != 0L)
jjAddStates(10, 11);
{ jjAddStates(10, 11); }
break; break;
case 16: case 16:
jjAddStates(12, 13);
{ jjAddStates(12, 13); }
break; break;
case 20: case 20:
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(20, 21);
{ jjCheckNAddTwoStates(20, 21); }
break; break;
case 22: case 22:
if ((0x7fffffe87fffffeL & l) == 0L) if ((0x7fffffe87fffffeL & l) == 0L)
break; break;
if (kind > 89) if (kind > 89)
kind = 89; kind = 89;
jjCheckNAdd(22);
{ jjCheckNAdd(22); }
break; break;
default : break; default : break;
} }
@ -1086,7 +1068,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
} }
else else
{ {
int hiByte = (int)(curChar >> 8);
int hiByte = (curChar >> 8);
int i1 = hiByte >> 6; int i1 = hiByte >> 6;
long l1 = 1L << (hiByte & 077); long l1 = 1L << (hiByte & 077);
int i2 = (curChar & 0xff) >> 6; int i2 = (curChar & 0xff) >> 6;
@ -1100,13 +1082,13 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 2) if (kind > 2)
kind = 2; kind = 2;
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
case 16: case 16:
if (jjCanMove_0(hiByte, i1, i2, l1, l2)) if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(12, 13);
{ jjAddStates(12, 13); }
break; break;
default : break;
default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break;
} }
} while(i != startsAt); } while(i != startsAt);
} }
@ -1158,69 +1140,6 @@ public static final String[] jjstrLiteralImages = {
"\133", "\135", "\133\133", "\135\135", "\173", "\175", "\75", "\41\75", "\74", "\76", "\133", "\135", "\133\133", "\135\135", "\173", "\175", "\75", "\41\75", "\74", "\76",
"\74\74", "\76\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57", "\47", "\74\55", "\74\74", "\76\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57", "\47", "\74\55",
"\77", "\42", null, null, null, null, null, null, }; "\77", "\42", null, null, null, null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0xfffffffffffffff9L, 0xfffffffL,
};
static final long[] jjtoSkip = {
0x6L, 0x0L,
};
static final long[] jjtoSpecial = {
0x6L, 0x0L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[23];
static private final int[] jjstateSet = new int[46];
static protected char curChar;
/** Constructor. */
public PrismParserTokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public PrismParserTokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 23; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
static protected Token jjFillToken() static protected Token jjFillToken()
{ {
final Token t; final Token t;
@ -1269,6 +1188,7 @@ public static Token getNextToken()
catch(java.io.IOException e) catch(java.io.IOException e)
{ {
jjmatchedKind = 0; jjmatchedKind = 0;
jjmatchedPos = -1;
matchedToken = jjFillToken(); matchedToken = jjFillToken();
matchedToken.specialToken = specialToken; matchedToken.specialToken = specialToken;
return matchedToken; return matchedToken;
@ -1357,4 +1277,72 @@ static private void jjCheckNAddStates(int start, int end)
} while (start++ != end); } while (start++ != end);
} }
/** Constructor. */
public PrismParserTokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public PrismParserTokenManager (SimpleCharStream stream, int lexState){
ReInit(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 23; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0xfffffffffffffff9L, 0xfffffffL,
};
static final long[] jjtoSkip = {
0x6L, 0x0L,
};
static final long[] jjtoSpecial = {
0x6L, 0x0L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[23];
static private final int[] jjstateSet = new int[2 * 23];
static protected char curChar;
} }

11
prism/src/parser/SimpleCharStream.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */
/* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package parser; package parser;
@ -31,9 +31,10 @@ public class SimpleCharStream
static protected int maxNextCharInd = 0; static protected int maxNextCharInd = 0;
static protected int inBuf = 0; static protected int inBuf = 0;
static protected int tabSize = 8; static protected int tabSize = 8;
static protected boolean trackLineColumn = true;
static protected void setTabSize(int i) { tabSize = i; }
static protected int getTabSize(int i) { return tabSize; }
static public void setTabSize(int i) { tabSize = i; }
static public int getTabSize() { return tabSize; }
static protected void ExpandBuff(boolean wrapAround) static protected void ExpandBuff(boolean wrapAround)
@ -471,5 +472,7 @@ public class SimpleCharStream
column = bufcolumn[j]; column = bufcolumn[j];
} }
static boolean getTrackLineColumn() { return trackLineColumn; }
static void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
} }
/* JavaCC - OriginalChecksum=63f42dc268ec5028b8be6ca7c2cc6f11 (do not edit this line) */
/* JavaCC - OriginalChecksum=dcc1df1ef735c110db7f51764c3f7f64 (do not edit this line) */

4
prism/src/parser/Token.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ /* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package parser; package parser;
@ -128,4 +128,4 @@ public class Token implements java.io.Serializable {
} }
} }
/* JavaCC - OriginalChecksum=5577319da3c994ced3a7d8398937b710 (do not edit this line) */
/* JavaCC - OriginalChecksum=7d751264ae152bf5b6855a5f69a4ab67 (do not edit this line) */

4
prism/src/parser/TokenMgrError.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 6.0 */
/* JavaCCOptions: */ /* JavaCCOptions: */
package parser; package parser;
@ -144,4 +144,4 @@ public class TokenMgrError extends Error
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
} }
} }
/* JavaCC - OriginalChecksum=7ef45f5276cce4d58ec92f075d668e1f (do not edit this line) */
/* JavaCC - OriginalChecksum=6c4705c2bebd89492711d8a1e624d837 (do not edit this line) */

144
prism/src/pta/parser/PTAParser.java

@ -1,3 +1,4 @@
/* PTAParser.java */
/* Generated By:JavaCC: Do not edit this line. PTAParser.java */ /* Generated By:JavaCC: Do not edit this line. PTAParser.java */
package pta.parser; package pta.parser;
@ -194,14 +195,15 @@ public class PTAParser implements PTAParserConstants {
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// PTA // PTA
static final public astPTA PTA() throws ParseException {
astPTA pta = new astPTA();
static final public
astPTA PTA() throws ParseException {astPTA pta = new astPTA();
label_1: label_1:
while (true) { while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACE:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LBRACE:{
; ;
break; break;
}
default: default:
jj_la1[0] = jj_gen; jj_la1[0] = jj_gen;
break label_1; break label_1;
@ -209,18 +211,18 @@ public class PTAParser implements PTAParserConstants {
Location(pta); Location(pta);
} }
jj_consume_token(0); jj_consume_token(0);
{if (true) return pta;}
{if ("" != null) return pta;}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
static final public void Location(astPTA pta) throws ParseException {
String name;
static final public void Location(astPTA pta) throws ParseException {String name;
LinkedHashSet<Constraint> constrs; LinkedHashSet<Constraint> constrs;
jj_consume_token(LBRACE); jj_consume_token(LBRACE);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case INIT:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case INIT:{
jj_consume_token(INIT); jj_consume_token(INIT);
break; break;
}
default: default:
jj_la1[1] = jj_gen; jj_la1[1] = jj_gen;
; ;
@ -233,23 +235,26 @@ public class PTAParser implements PTAParserConstants {
pta.setInvariantConditions(name, constrs); pta.setInvariantConditions(name, constrs);
label_2: label_2:
while (true) { while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LBRACKET:{
; ;
break; break;
}
default: default:
jj_la1[2] = jj_gen; jj_la1[2] = jj_gen;
break label_2; break label_2;
} }
Transition(pta, name); Transition(pta, name);
} }
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case RBRACE:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case RBRACE:{
jj_consume_token(RBRACE); jj_consume_token(RBRACE);
break; break;
case TIMES:
}
case TIMES:{
jj_consume_token(TIMES); jj_consume_token(TIMES);
break; break;
}
default: default:
jj_la1[3] = jj_gen; jj_la1[3] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
@ -257,17 +262,17 @@ public class PTAParser implements PTAParserConstants {
} }
} }
static final public void Transition(astPTA pta, String locName) throws ParseException {
astTransition tr;
static final public void Transition(astPTA pta, String locName) throws ParseException {astTransition tr;
jj_consume_token(LBRACKET); jj_consume_token(LBRACKET);
tr = pta.addTransition(locName); tr = pta.addTransition(locName);
label_3: label_3:
while (true) { while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRAN: case TRAN:
case REG_IDENT:
case REG_IDENT:{
; ;
break; break;
}
default: default:
jj_la1[4] = jj_gen; jj_la1[4] = jj_gen;
break label_3; break label_3;
@ -277,18 +282,18 @@ public class PTAParser implements PTAParserConstants {
jj_consume_token(RBRACKET); jj_consume_token(RBRACKET);
} }
static final public void Edge(astPTA pta, astTransition tr) throws ParseException {
LinkedHashSet<Constraint> constrs;
static final public void Edge(astPTA pta, astTransition tr) throws ParseException {LinkedHashSet<Constraint> constrs;
String action = null, dest; String action = null, dest;
double p; double p;
astEdge edge; astEdge edge;
HashMap<Integer,Integer> resets; HashMap<Integer,Integer> resets;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REG_IDENT:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case REG_IDENT:{
action = Identifier(); action = Identifier();
jj_consume_token(OR); jj_consume_token(OR);
jj_consume_token(OR); jj_consume_token(OR);
break; break;
}
default: default:
jj_la1[5] = jj_gen; jj_la1[5] = jj_gen;
; ;
@ -307,17 +312,17 @@ public class PTAParser implements PTAParserConstants {
for (Constraint c : constrs) tr.addGuardConstraint(c); for (Constraint c : constrs) tr.addGuardConstraint(c);
} }
static final public LinkedHashSet<Constraint> ConstraintList(astPTA pta) throws ParseException {
LinkedHashSet<Constraint> constrs = new LinkedHashSet<Constraint>();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REG_IDENT:
static final public LinkedHashSet<Constraint> ConstraintList(astPTA pta) throws ParseException {LinkedHashSet<Constraint> constrs = new LinkedHashSet<Constraint>();
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case REG_IDENT:{
Constraint(pta, constrs); Constraint(pta, constrs);
label_4: label_4:
while (true) { while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case COMMA:{
; ;
break; break;
}
default: default:
jj_la1[6] = jj_gen; jj_la1[6] = jj_gen;
break label_4; break label_4;
@ -326,46 +331,52 @@ public class PTAParser implements PTAParserConstants {
Constraint(pta, constrs); Constraint(pta, constrs);
} }
break; break;
case TRUE:
}
case TRUE:{
jj_consume_token(TRUE); jj_consume_token(TRUE);
break; break;
}
default: default:
jj_la1[7] = jj_gen; jj_la1[7] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
throw new ParseException(); throw new ParseException();
} }
{if (true) return constrs;}
{if ("" != null) return constrs;}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
static final public void Constraint(astPTA pta, LinkedHashSet<Constraint> constrs) throws ParseException {
String clock1Name, clock2Name;
static final public void Constraint(astPTA pta, LinkedHashSet<Constraint> constrs) throws ParseException {String clock1Name, clock2Name;
int clock1, clock2, val; int clock1, clock2, val;
Token t; Token t;
clock1Name = Identifier(); clock1Name = Identifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LT:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LT:{
t = jj_consume_token(LT); t = jj_consume_token(LT);
break; break;
case LE:
}
case LE:{
t = jj_consume_token(LE); t = jj_consume_token(LE);
break; break;
case GT:
}
case GT:{
t = jj_consume_token(GT); t = jj_consume_token(GT);
break; break;
case GE:
}
case GE:{
t = jj_consume_token(GE); t = jj_consume_token(GE);
break; break;
case EQ:
}
case EQ:{
t = jj_consume_token(EQ); t = jj_consume_token(EQ);
break; break;
}
default: default:
jj_la1[8] = jj_gen; jj_la1[8] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
throw new ParseException(); throw new ParseException();
} }
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REG_INT:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case REG_INT:{
val = Integer(); val = Integer();
clock1 = pta.getOrAddClock(clock1Name); clock1 = pta.getOrAddClock(clock1Name);
switch (t.kind) { switch (t.kind) {
@ -382,7 +393,8 @@ public class PTAParser implements PTAParserConstants {
constrs.add(Constraint.buildGeq(clock1, val)); break; constrs.add(Constraint.buildGeq(clock1, val)); break;
} }
break; break;
case REG_IDENT:
}
case REG_IDENT:{
clock2Name = Identifier(); clock2Name = Identifier();
clock1 = pta.getOrAddClock(clock1Name); clock1 = pta.getOrAddClock(clock1Name);
clock2 = pta.getOrAddClock(clock2Name); clock2 = pta.getOrAddClock(clock2Name);
@ -393,6 +405,7 @@ public class PTAParser implements PTAParserConstants {
System.err.println("Error: Unsupported constraint type"); System.exit(1); System.err.println("Error: Unsupported constraint type"); System.exit(1);
} }
break; break;
}
default: default:
jj_la1[9] = jj_gen; jj_la1[9] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
@ -400,17 +413,17 @@ public class PTAParser implements PTAParserConstants {
} }
} }
static final public HashMap<Integer,Integer> Resets(astPTA pta) throws ParseException {
HashMap<Integer,Integer> resets = new HashMap<Integer,Integer>();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REG_IDENT:
static final public HashMap<Integer,Integer> Resets(astPTA pta) throws ParseException {HashMap<Integer,Integer> resets = new HashMap<Integer,Integer>();
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case REG_IDENT:{
Reset(pta, resets); Reset(pta, resets);
label_5: label_5:
while (true) { while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case COMMA:{
; ;
break; break;
}
default: default:
jj_la1[10] = jj_gen; jj_la1[10] = jj_gen;
break label_5; break label_5;
@ -419,20 +432,21 @@ public class PTAParser implements PTAParserConstants {
Reset(pta, resets); Reset(pta, resets);
} }
break; break;
case NULL:
}
case NULL:{
jj_consume_token(NULL); jj_consume_token(NULL);
break; break;
}
default: default:
jj_la1[11] = jj_gen; jj_la1[11] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
throw new ParseException(); throw new ParseException();
} }
{if (true) return resets;}
{if ("" != null) return resets;}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
static final public void Reset(astPTA pta, HashMap<Integer,Integer> resets) throws ParseException {
String clockName;
static final public void Reset(astPTA pta, HashMap<Integer,Integer> resets) throws ParseException {String clockName;
int clock; int clock;
int val; int val;
clockName = Identifier(); clockName = Identifier();
@ -442,22 +456,23 @@ public class PTAParser implements PTAParserConstants {
resets.put(clock, val); resets.put(clock, val);
} }
static final public double Probability() throws ParseException {
Token t;
static final public double Probability() throws ParseException {Token t;
double d; double d;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REG_DOUBLE:
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case REG_DOUBLE:{
t = jj_consume_token(REG_DOUBLE); t = jj_consume_token(REG_DOUBLE);
break; break;
case REG_INT:
}
case REG_INT:{
t = jj_consume_token(REG_INT); t = jj_consume_token(REG_INT);
break; break;
}
default: default:
jj_la1[12] = jj_gen; jj_la1[12] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
throw new ParseException(); throw new ParseException();
} }
{if (true) return Double.parseDouble(t.image);}
{if ("" != null) return Double.parseDouble(t.image);}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
@ -466,16 +481,18 @@ public class PTAParser implements PTAParserConstants {
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Identifier (returns String) // Identifier (returns String)
static final public String Identifier() throws ParseException {
static final public
String Identifier() throws ParseException {
jj_consume_token(REG_IDENT); jj_consume_token(REG_IDENT);
{if (true) return getToken(0).image;}
{if ("" != null) return getToken(0).image;}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
// Integer // Integer
static final public int Integer() throws ParseException {
static final public
int Integer() throws ParseException {
jj_consume_token(REG_INT); jj_consume_token(REG_INT);
{if (true) return Integer.parseInt(getToken(0).image);}
{if ("" != null) return Integer.parseInt(getToken(0).image);}
throw new Error("Missing return statement in function"); throw new Error("Missing return statement in function");
} }
@ -624,7 +641,7 @@ public class PTAParser implements PTAParserConstants {
return t; return t;
} }
static private int jj_ntk() {
static private int jj_ntk_f() {
if ((jj_nt=token.next) == null) if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind); return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else else
@ -678,3 +695,6 @@ public class PTAParser implements PTAParserConstants {
} }
} }
//-----------------------------------------------------------------------------------

204
prism/src/pta/parser/PTAParserTokenManager.java

@ -1,3 +1,4 @@
/* PTAParserTokenManager.java */
/* Generated By:JavaCC: Do not edit this line. PTAParserTokenManager.java */ /* Generated By:JavaCC: Do not edit this line. PTAParserTokenManager.java */
package pta.parser; package pta.parser;
import java.io.*; import java.io.*;
@ -6,15 +7,13 @@ import pta.*;
import prism.PrismLangException; import prism.PrismLangException;
/** Token Manager. */ /** Token Manager. */
public class PTAParserTokenManager implements PTAParserConstants
{
@SuppressWarnings("unused")public class PTAParserTokenManager implements PTAParserConstants {
/** Debug output. */ /** Debug output. */
public static java.io.PrintStream debugStream = System.out; public static java.io.PrintStream debugStream = System.out;
/** Set debug output. */ /** Set debug output. */
public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private static final int jjStopStringLiteralDfa_0(int pos, long active0)
{
private static final int jjStopStringLiteralDfa_0(int pos, long active0){
switch (pos) switch (pos)
{ {
case 0: case 0:
@ -46,8 +45,7 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0)
return -1; return -1;
} }
} }
private static final int jjStartNfa_0(int pos, long active0)
{
private static final int jjStartNfa_0(int pos, long active0){
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
} }
static private int jjStopAtPos(int pos, int kind) static private int jjStopAtPos(int pos, int kind)
@ -56,8 +54,7 @@ static private int jjStopAtPos(int pos, int kind)
jjmatchedPos = pos; jjmatchedPos = pos;
return pos + 1; return pos + 1;
} }
static private int jjMoveStringLiteralDfa0_0()
{
static private int jjMoveStringLiteralDfa0_0(){
switch(curChar) switch(curChar)
{ {
case 33: case 33:
@ -121,8 +118,7 @@ static private int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0(0, 0); return jjMoveNfa_0(0, 0);
} }
} }
static private int jjMoveStringLiteralDfa1_0(long active0)
{
static private int jjMoveStringLiteralDfa1_0(long active0){
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(0, active0); jjStopStringLiteralDfa_0(0, active0);
@ -165,8 +161,7 @@ static private int jjMoveStringLiteralDfa1_0(long active0)
} }
return jjStartNfa_0(0, active0); return jjStartNfa_0(0, active0);
} }
static private int jjMoveStringLiteralDfa2_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa2_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(0, old0); return jjStartNfa_0(0, old0);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -191,8 +186,7 @@ static private int jjMoveStringLiteralDfa2_0(long old0, long active0)
} }
return jjStartNfa_0(1, active0); return jjStartNfa_0(1, active0);
} }
static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
static private int jjMoveStringLiteralDfa3_0(long old0, long active0){
if (((active0 &= old0)) == 0L) if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0); return jjStartNfa_0(1, old0);
try { curChar = input_stream.readChar(); } try { curChar = input_stream.readChar(); }
@ -259,7 +253,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 38) if (kind > 38)
kind = 38; kind = 38;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
} }
else if ((0x100002600L & l) != 0L) else if ((0x100002600L & l) != 0L)
{ {
@ -267,14 +261,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 1; kind = 1;
} }
else if (curChar == 46) else if (curChar == 46)
jjCheckNAdd(10);
{ jjCheckNAdd(10); }
else if (curChar == 35) else if (curChar == 35)
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
if ((0x3fe000000000000L & l) != 0L) if ((0x3fe000000000000L & l) != 0L)
{ {
if (kind > 37) if (kind > 37)
kind = 37; kind = 37;
jjCheckNAdd(7);
{ jjCheckNAdd(7); }
} }
else if (curChar == 48) else if (curChar == 48)
{ {
@ -287,7 +281,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
if (kind > 40) if (kind > 40)
kind = 40; kind = 40;
jjCheckNAdd(18);
{ jjCheckNAdd(18); }
} }
else if (curChar == 39) else if (curChar == 39)
{ {
@ -295,15 +289,15 @@ static private int jjMoveNfa_0(int startState, int curPos)
kind = 39; kind = 39;
} }
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 1: case 1:
if (curChar == 35) if (curChar == 35)
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 2: case 2:
if ((0xffffffffffffdbffL & l) != 0L) if ((0xffffffffffffdbffL & l) != 0L)
jjCheckNAddStates(4, 6);
{ jjCheckNAddStates(4, 6); }
break; break;
case 3: case 3:
if ((0x2400L & l) != 0L && kind > 2) if ((0x2400L & l) != 0L && kind > 2)
@ -322,14 +316,14 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 37) if (kind > 37)
kind = 37; kind = 37;
jjCheckNAdd(7);
{ jjCheckNAdd(7); }
break; break;
case 7: case 7:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 37) if (kind > 37)
kind = 37; kind = 37;
jjCheckNAdd(7);
{ jjCheckNAdd(7); }
break; break;
case 8: case 8:
if (curChar == 48 && kind > 37) if (curChar == 48 && kind > 37)
@ -337,36 +331,36 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
case 9: case 9:
if (curChar == 46) if (curChar == 46)
jjCheckNAdd(10);
{ jjCheckNAdd(10); }
break; break;
case 10: case 10:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 38) if (kind > 38)
kind = 38; kind = 38;
jjCheckNAddTwoStates(10, 11);
{ jjCheckNAddTwoStates(10, 11); }
break; break;
case 12: case 12:
if ((0x280000000000L & l) != 0L) if ((0x280000000000L & l) != 0L)
jjCheckNAdd(13);
{ jjCheckNAdd(13); }
break; break;
case 13: case 13:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 38) if (kind > 38)
kind = 38; kind = 38;
jjCheckNAdd(13);
{ jjCheckNAdd(13); }
break; break;
case 14: case 14:
if ((0x3ff000000000000L & l) == 0L) if ((0x3ff000000000000L & l) == 0L)
break; break;
if (kind > 38) if (kind > 38)
kind = 38; kind = 38;
jjCheckNAddStates(0, 3);
{ jjCheckNAddStates(0, 3); }
break; break;
case 16: case 16:
if ((0x3ff000000000000L & l) != 0L) if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 17: case 17:
if (curChar == 39 && kind > 39) if (curChar == 39 && kind > 39)
@ -377,7 +371,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 40) if (kind > 40)
kind = 40; kind = 40;
jjCheckNAdd(18);
{ jjCheckNAdd(18); }
break; break;
default : break; default : break;
} }
@ -395,35 +389,35 @@ static private int jjMoveNfa_0(int startState, int curPos)
break; break;
if (kind > 40) if (kind > 40)
kind = 40; kind = 40;
jjCheckNAddStates(7, 9);
{ jjCheckNAddStates(7, 9); }
break; break;
case 19: case 19:
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
{ {
if (kind > 40) if (kind > 40)
kind = 40; kind = 40;
jjCheckNAdd(18);
{ jjCheckNAdd(18); }
} }
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 2: case 2:
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
case 11: case 11:
if ((0x2000000020L & l) != 0L) if ((0x2000000020L & l) != 0L)
jjAddStates(10, 11);
{ jjAddStates(10, 11); }
break; break;
case 16: case 16:
if ((0x7fffffe87fffffeL & l) != 0L) if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(16, 17);
{ jjCheckNAddTwoStates(16, 17); }
break; break;
case 18: case 18:
if ((0x7fffffe87fffffeL & l) == 0L) if ((0x7fffffe87fffffeL & l) == 0L)
break; break;
if (kind > 40) if (kind > 40)
kind = 40; kind = 40;
jjCheckNAdd(18);
{ jjCheckNAdd(18); }
break; break;
default : break; default : break;
} }
@ -439,7 +433,7 @@ static private int jjMoveNfa_0(int startState, int curPos)
{ {
case 2: case 2:
if ((jjbitVec0[i2] & l2) != 0L) if ((jjbitVec0[i2] & l2) != 0L)
jjAddStates(4, 6);
{ jjAddStates(4, 6); }
break; break;
default : break; default : break;
} }
@ -469,69 +463,6 @@ public static final String[] jjstrLiteralImages = {
"\54", "\56\56", "\50", "\51", "\133", "\135", "\173", "\175", "\75", "\41\75", "\54", "\56\56", "\50", "\51", "\133", "\135", "\173", "\175", "\75", "\41\75",
"\74", "\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57", "\47", "\74\55", "\77", "\74", "\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57", "\47", "\74\55", "\77",
"\42", null, null, null, null, null, }; "\42", null, null, null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0x3fffffffff9L,
};
static final long[] jjtoSkip = {
0x6L,
};
static final long[] jjtoSpecial = {
0x6L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[19];
static private final int[] jjstateSet = new int[38];
static protected char curChar;
/** Constructor. */
public PTAParserTokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public PTAParserTokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 19; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
static protected Token jjFillToken() static protected Token jjFillToken()
{ {
final Token t; final Token t;
@ -580,6 +511,7 @@ public static Token getNextToken()
catch(java.io.IOException e) catch(java.io.IOException e)
{ {
jjmatchedKind = 0; jjmatchedKind = 0;
jjmatchedPos = -1;
matchedToken = jjFillToken(); matchedToken = jjFillToken();
matchedToken.specialToken = specialToken; matchedToken.specialToken = specialToken;
return matchedToken; return matchedToken;
@ -668,4 +600,72 @@ static private void jjCheckNAddStates(int start, int end)
} while (start++ != end); } while (start++ != end);
} }
/** Constructor. */
public PTAParserTokenManager(SimpleCharStream stream){
if (input_stream != null)
throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
input_stream = stream;
}
/** Constructor. */
public PTAParserTokenManager (SimpleCharStream stream, int lexState){
ReInit(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
static private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 19; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
static public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
static public void SwitchTo(int lexState)
{
if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0x3fffffffff9L,
};
static final long[] jjtoSkip = {
0x6L,
};
static final long[] jjtoSpecial = {
0x6L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[19];
static private final int[] jjstateSet = new int[2 * 19];
static protected char curChar;
} }

4
prism/src/pta/parser/ParseException.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */ /* JavaCCOptions:KEEP_LINE_COL=null */
package pta.parser; package pta.parser;
@ -184,4 +184,4 @@ public class ParseException extends Exception {
} }
} }
/* JavaCC - OriginalChecksum=66646d5c4f8e1407808fefab06fde22c (do not edit this line) */
/* JavaCC - OriginalChecksum=7c64fc0ab38b25558450547c14c3b451 (do not edit this line) */

11
prism/src/pta/parser/SimpleCharStream.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */
/* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package pta.parser; package pta.parser;
@ -31,9 +31,10 @@ public class SimpleCharStream
static protected int maxNextCharInd = 0; static protected int maxNextCharInd = 0;
static protected int inBuf = 0; static protected int inBuf = 0;
static protected int tabSize = 8; static protected int tabSize = 8;
static protected boolean trackLineColumn = true;
static protected void setTabSize(int i) { tabSize = i; }
static protected int getTabSize(int i) { return tabSize; }
static public void setTabSize(int i) { tabSize = i; }
static public int getTabSize() { return tabSize; }
static protected void ExpandBuff(boolean wrapAround) static protected void ExpandBuff(boolean wrapAround)
@ -471,5 +472,7 @@ public class SimpleCharStream
column = bufcolumn[j]; column = bufcolumn[j];
} }
static boolean getTrackLineColumn() { return trackLineColumn; }
static void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
} }
/* JavaCC - OriginalChecksum=3508e18b871f03c08f232f31778aadb6 (do not edit this line) */
/* JavaCC - OriginalChecksum=2c820e3833e159fe44638fac71ff5bb8 (do not edit this line) */

4
prism/src/pta/parser/Token.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ /* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package pta.parser; package pta.parser;
@ -128,4 +128,4 @@ public class Token implements java.io.Serializable {
} }
} }
/* JavaCC - OriginalChecksum=30180ca4550a56d1b05d411407c9e400 (do not edit this line) */
/* JavaCC - OriginalChecksum=7324b9615dc37b7f09c5841bfcbd980c (do not edit this line) */

4
prism/src/pta/parser/TokenMgrError.java

@ -1,4 +1,4 @@
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 6.0 */
/* JavaCCOptions: */ /* JavaCCOptions: */
package pta.parser; package pta.parser;
@ -144,4 +144,4 @@ public class TokenMgrError extends Error
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
} }
} }
/* JavaCC - OriginalChecksum=3ba52b1aad3a7caf3b9352f06a64b532 (do not edit this line) */
/* JavaCC - OriginalChecksum=baf3841bbc9582adae0bb96d10781ed7 (do not edit this line) */
Loading…
Cancel
Save