@ -7,9 +7,13 @@ import parser.type.*;
import prism.ModelType ;
import prism.PrismLangException ;
/** Token Manager. */
public class PrismParserTokenManager implements PrismParserConstants
{
/** Debug output. */
public static java . io . PrintStream debugStream = System . out ;
/** Set debug output. */
public static void setDebugStream ( java . io . PrintStream ds ) { debugStream = ds ; }
private static final int jjStopStringLiteralDfa_0 ( int pos , long active0 , long active1 )
{
@ -169,21 +173,13 @@ private static final int jjStartNfa_0(int pos, long active0, long active1)
{
return jjMoveNfa_0 ( jjStopStringLiteralDfa_0 ( pos , active0 , active1 ) , pos + 1 ) ;
}
static private final int jjStopAtPos ( int pos , int kind )
static private int jjStopAtPos ( int pos , int kind )
{
jjmatchedKind = kind ;
jjmatchedPos = pos ;
return pos + 1 ;
}
static private final int jjStartNfaWithStates_0 ( int pos , int kind , int state )
{
jjmatchedKind = kind ;
jjmatchedPos = pos ;
try { curChar = input_stream . readChar ( ) ; }
catch ( java . io . IOException e ) { return pos + 1 ; }
return jjMoveNfa_0 ( state , pos + 1 ) ;
}
static private final int jjMoveStringLiteralDfa0_0 ( )
static private int jjMoveStringLiteralDfa0_0 ( )
{
switch ( curChar )
{
@ -296,7 +292,7 @@ static private final int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0 ( 0 , 0 ) ;
}
}
static private final int jjMoveStringLiteralDfa1_0 ( long active0 , long active1 )
static private int jjMoveStringLiteralDfa1_0 ( long active0 , long active1 )
{
try { curChar = input_stream . readChar ( ) ; }
catch ( java . io . IOException e ) {
@ -356,10 +352,10 @@ static private final int jjMoveStringLiteralDfa1_0(long active0, long active1)
}
return jjStartNfa_0 ( 0 , active0 , active1 ) ;
}
static private final 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 )
return jjStartNfa_0 ( 0 , old0 , old1 ) ;
return jjStartNfa_0 ( 0 , old0 , old1 ) ;
try { curChar = input_stream . readChar ( ) ; }
catch ( java . io . IOException e ) {
jjStopStringLiteralDfa_0 ( 1 , active0 , 0L ) ;
@ -414,7 +410,7 @@ static private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long
}
return jjStartNfa_0 ( 1 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa3_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa3_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 1 , old0 , 0L ) ;
@ -485,7 +481,7 @@ static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
}
return jjStartNfa_0 ( 2 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa4_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa4_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 2 , old0 , 0L ) ;
@ -531,7 +527,7 @@ static private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
}
return jjStartNfa_0 ( 3 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa5_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa5_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 3 , old0 , 0L ) ;
@ -581,7 +577,7 @@ static private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
}
return jjStartNfa_0 ( 4 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa6_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa6_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 4 , old0 , 0L ) ;
@ -615,7 +611,7 @@ static private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
}
return jjStartNfa_0 ( 5 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa7_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa7_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 5 , old0 , 0L ) ;
@ -641,7 +637,7 @@ static private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
}
return jjStartNfa_0 ( 6 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa8_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa8_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 6 , old0 , 0L ) ;
@ -673,7 +669,7 @@ static private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
}
return jjStartNfa_0 ( 7 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa9_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa9_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 7 , old0 , 0L ) ;
@ -701,7 +697,7 @@ static private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
}
return jjStartNfa_0 ( 8 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa10_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa10_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 8 , old0 , 0L ) ;
@ -721,7 +717,7 @@ static private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
}
return jjStartNfa_0 ( 9 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa11_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa11_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 9 , old0 , 0L ) ;
@ -743,7 +739,7 @@ static private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
}
return jjStartNfa_0 ( 10 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa12_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa12_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 10 , old0 , 0L ) ;
@ -765,7 +761,7 @@ static private final int jjMoveStringLiteralDfa12_0(long old0, long active0)
}
return jjStartNfa_0 ( 11 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa13_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa13_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 11 , old0 , 0L ) ;
@ -783,7 +779,7 @@ static private final int jjMoveStringLiteralDfa13_0(long old0, long active0)
}
return jjStartNfa_0 ( 12 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa14_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa14_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 12 , old0 , 0L ) ;
@ -801,7 +797,7 @@ static private final int jjMoveStringLiteralDfa14_0(long old0, long active0)
}
return jjStartNfa_0 ( 13 , active0 , 0L ) ;
}
static private final int jjMoveStringLiteralDfa15_0 ( long old0 , long active0 )
static private int jjMoveStringLiteralDfa15_0 ( long old0 , long active0 )
{
if ( ( ( active0 & = old0 ) ) = = 0L )
return jjStartNfa_0 ( 13 , old0 , 0L ) ;
@ -821,47 +817,24 @@ static private final int jjMoveStringLiteralDfa15_0(long old0, long active0)
}
return jjStartNfa_0 ( 14 , active0 , 0L ) ;
}
static private final void jjCheckNAdd ( int state )
{
if ( jjrounds [ state ] ! = jjround )
{
jjstateSet [ jjnewStateCnt + + ] = state ;
jjrounds [ state ] = jjround ;
}
}
static private final void jjAddStates ( int start , int end )
static private int jjStartNfaWithStates_0 ( int pos , int kind , int state )
{
do {
jjstateSet [ jjnewStateCnt + + ] = jjnextStates [ start ] ;
} while ( start + + ! = end ) ;
}
static private final void jjCheckNAddTwoStates ( int state1 , int state2 )
{
jjCheckNAdd ( state1 ) ;
jjCheckNAdd ( state2 ) ;
}
static private final void jjCheckNAddStates ( int start , int end )
{
do {
jjCheckNAdd ( jjnextStates [ start ] ) ;
} while ( start + + ! = end ) ;
}
static private final void jjCheckNAddStates ( int start )
{
jjCheckNAdd ( jjnextStates [ start ] ) ;
jjCheckNAdd ( jjnextStates [ start + 1 ] ) ;
jjmatchedKind = kind ;
jjmatchedPos = pos ;
try { curChar = input_stream . readChar ( ) ; }
catch ( java . io . IOException e ) { return pos + 1 ; }
return jjMoveNfa_0 ( state , pos + 1 ) ;
}
static final long [ ] jjbitVec0 = {
0x0L , 0x0L , 0xffffffffffffffffL , 0xffffffffffffffffL
} ;
static private final int jjMoveNfa_0 ( int startState , int curPos )
static private int jjMoveNfa_0 ( int startState , int curPos )
{
int [ ] nextStates ;
int startsAt = 0 ;
jjnewStateCnt = 23 ;
int i = 1 ;
jjstateSet [ 0 ] = startState ;
int j , kind = 0x7fffffff ;
int kind = 0x7fffffff ;
for ( ; ; )
{
if ( + + jjround = = 0x7fffffff )
@ -869,7 +842,7 @@ static private final int jjMoveNfa_0(int startState, int curPos)
if ( curChar < 64 )
{
long l = 1L < < curChar ;
MatchLoop : do
do
{
switch ( jjstateSet [ - - i ] )
{
@ -1023,7 +996,7 @@ static private final int jjMoveNfa_0(int startState, int curPos)
else if ( curChar < 128 )
{
long l = 1L < < ( curChar & 077 ) ;
MatchLoop : do
do
{
switch ( jjstateSet [ - - i ] )
{
@ -1073,7 +1046,7 @@ static private final int jjMoveNfa_0(int startState, int curPos)
{
int i2 = ( curChar & 0xff ) > > 6 ;
long l2 = 1L < < ( curChar & 077 ) ;
MatchLoop : do
do
{
switch ( jjstateSet [ - - i ] )
{
@ -1105,6 +1078,8 @@ static private final int jjMoveNfa_0(int startState, int curPos)
static final int [ ] jjnextStates = {
10 , 11 , 12 , 18 , 2 , 3 , 5 , 20 , 21 , 22 , 13 , 14 , 16 , 17 ,
} ;
/** Token literal values. */
public static final String [ ] jjstrLiteralImages = {
"" , null , null , "\101" , "\142\157\157\154" , "\143\154\157\143\153" ,
"\143\157\156\163\164" , "\143\164\155\143" , "\103" , "\144\157\165\142\154\145" , "\144\164\155\143" ,
@ -1123,8 +1098,10 @@ public static final String[] jjstrLiteralImages = {
"\135" , "\173" , "\175" , "\75" , "\41\75" , "\74" , "\76" , "\74\75" , "\76\75" , "\53" ,
"\55" , "\52" , "\57" , "\47" , "\74\55" , "\77" , "\42" , null , null , null , null , null ,
null , } ;
/** Lexer state names. */
public static final String [ ] lexStateNames = {
"DEFAULT" ,
"DEFAULT" ,
} ;
static final long [ ] jjtoToken = {
0xfffffffffffffff9L , 0x7fffffL ,
@ -1139,15 +1116,20 @@ 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 ;
@ -1155,18 +1137,22 @@ static public void ReInit(SimpleCharStream stream)
input_stream = stream ;
ReInitRounds ( ) ;
}
static private final void 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 )
@ -1177,14 +1163,27 @@ static public void SwitchTo(int lexState)
static protected Token jjFillToken ( )
{
Token t = Token . newToken ( jjmatchedKind ) ;
t . kind = jjmatchedKind ;
final Token t ;
final String curTokenImage ;
final int beginLine ;
final int endLine ;
final int beginColumn ;
final int endColumn ;
String im = jjstrLiteralImages [ jjmatchedKind ] ;
t . image = ( im = = null ) ? input_stream . GetImage ( ) : im ;
t . beginLine = input_stream . getBeginLine ( ) ;
t . beginColumn = input_stream . getBeginColumn ( ) ;
t . endLine = input_stream . getEndLine ( ) ;
t . endColumn = input_stream . getEndColumn ( ) ;
curTokenImage = ( im = = null ) ? input_stream . GetImage ( ) : im ;
beginLine = input_stream . getBeginLine ( ) ;
beginColumn = input_stream . getBeginColumn ( ) ;
endLine = input_stream . getEndLine ( ) ;
endColumn = input_stream . getEndColumn ( ) ;
t = Token . newToken ( jjmatchedKind ) ;
t . kind = jjmatchedKind ;
t . image = curTokenImage ;
t . beginLine = beginLine ;
t . endLine = endLine ;
t . beginColumn = beginColumn ;
t . endColumn = endColumn ;
return t ;
}
@ -1195,22 +1194,22 @@ static int jjround;
static int jjmatchedPos ;
static int jjmatchedKind ;
/** Get the next Token. */
public static Token getNextToken ( )
{
int kind ;
Token specialToken = null ;
Token matchedToken ;
int curPos = 0 ;
EOFLoop :
for ( ; ; )
{
try
{
{
try
{
curChar = input_stream . BeginToken ( ) ;
}
}
catch ( java . io . IOException e )
{
{
jjmatchedKind = 0 ;
matchedToken = jjFillToken ( ) ;
matchedToken . specialToken = specialToken ;
@ -1273,4 +1272,31 @@ public static Token getNextToken()
}
}
static private void jjCheckNAdd ( int state )
{
if ( jjrounds [ state ] ! = jjround )
{
jjstateSet [ jjnewStateCnt + + ] = state ;
jjrounds [ state ] = jjround ;
}
}
static private void jjAddStates ( int start , int end )
{
do {
jjstateSet [ jjnewStateCnt + + ] = jjnextStates [ start ] ;
} while ( start + + ! = end ) ;
}
static private void jjCheckNAddTwoStates ( int state1 , int state2 )
{
jjCheckNAdd ( state1 ) ;
jjCheckNAdd ( state2 ) ;
}
static private void jjCheckNAddStates ( int start , int end )
{
do {
jjCheckNAdd ( jjnextStates [ start ] ) ;
} while ( start + + ! = end ) ;
}
}