liquibase.util.grammar.SimpleSqlGrammarTokenManager Maven / Gradle / Ivy
/* Generated By:JavaCC: Do not edit this line. SimpleSqlGrammarTokenManager.java */
package liquibase.util.grammar;
/** Token Manager. */
public class SimpleSqlGrammarTokenManager implements SimpleSqlGrammarConstants
{
/** Debug output. */
public java.io.PrintStream debugStream = System.out;
/** Set debug output. */
public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private int jjMoveStringLiteralDfa0_0()
{
return jjMoveNfa_0(3, 0);
}
static final long[] jjbitVec0 = {
0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
};
static final long[] jjbitVec2 = {
0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
};
static final long[] jjbitVec3 = {
0x0L, 0x0L, 0x0L, 0x1040001090400010L
};
private int jjMoveNfa_0(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 75;
int i = 1;
jjstateSet[0] = startState;
int kind = 0x7fffffff;
for (;;)
{
if (++jjround == 0x7fffffff)
ReInitRounds();
if (curChar < 64)
{
long l = 1L << curChar;
do
{
switch(jjstateSet[--i])
{
case 3:
if ((0xfc00fffe00000000L & l) != 0L)
{
if (kind > 15)
kind = 15;
}
else if ((0x3ff000000000000L & l) != 0L)
{
if (kind > 5)
kind = 5;
jjCheckNAddStates(0, 6);
}
else if ((0x100002600L & l) != 0L)
{
if (kind > 1)
kind = 1;
jjCheckNAdd(0);
}
if (curChar == 34)
jjCheckNAddStates(7, 9);
else if (curChar == 36)
{
if (kind > 8)
kind = 8;
jjCheckNAddStates(10, 15);
}
else if (curChar == 39)
jjCheckNAddStates(16, 18);
else if (curChar == 46)
jjCheckNAdd(12);
else if (curChar == 47)
jjstateSet[jjnewStateCnt++] = 4;
else if (curChar == 45)
jjstateSet[jjnewStateCnt++] = 1;
break;
case 0:
if ((0x100002600L & l) == 0L)
break;
if (kind > 1)
kind = 1;
jjCheckNAdd(0);
break;
case 1:
if (curChar != 45)
break;
if (kind > 2)
kind = 2;
jjCheckNAdd(2);
break;
case 2:
if ((0xffffffffffffdbffL & l) == 0L)
break;
if (kind > 2)
kind = 2;
jjCheckNAdd(2);
break;
case 4:
if (curChar == 42)
jjCheckNAddTwoStates(5, 6);
break;
case 5:
if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(5, 6);
break;
case 6:
if (curChar == 42)
jjCheckNAddStates(19, 21);
break;
case 7:
if ((0xffff7bffffffffffL & l) != 0L)
jjCheckNAddTwoStates(8, 6);
break;
case 8:
if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(8, 6);
break;
case 9:
if (curChar == 47 && kind > 3)
kind = 3;
break;
case 10:
if (curChar == 47)
jjstateSet[jjnewStateCnt++] = 4;
break;
case 11:
if (curChar == 46)
jjCheckNAdd(12);
break;
case 12:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 4)
kind = 4;
jjCheckNAddTwoStates(12, 13);
break;
case 14:
if ((0x280000000000L & l) != 0L)
jjCheckNAdd(15);
break;
case 15:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 4)
kind = 4;
jjCheckNAdd(15);
break;
case 16:
case 18:
if (curChar == 39)
jjCheckNAddStates(16, 18);
break;
case 17:
if ((0xffffff7fffffffffL & l) != 0L)
jjCheckNAddStates(16, 18);
break;
case 20:
if (curChar != 39)
break;
if (kind > 11)
kind = 11;
jjstateSet[jjnewStateCnt++] = 21;
break;
case 21:
case 23:
if (curChar == 39)
jjCheckNAddStates(22, 24);
break;
case 22:
if ((0xffffff7fffffffffL & l) != 0L)
jjCheckNAddStates(22, 24);
break;
case 25:
if ((0xfc00fffe00000000L & l) != 0L && kind > 15)
kind = 15;
break;
case 26:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 5)
kind = 5;
jjCheckNAddStates(0, 6);
break;
case 27:
if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(27, 11);
break;
case 28:
if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(28, 29);
break;
case 29:
if (curChar != 46)
break;
if (kind > 4)
kind = 4;
jjstateSet[jjnewStateCnt++] = 30;
break;
case 31:
if ((0x280000000000L & l) != 0L)
jjCheckNAdd(32);
break;
case 32:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 4)
kind = 4;
jjCheckNAdd(32);
break;
case 33:
if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(33, 34);
break;
case 35:
if ((0x280000000000L & l) != 0L)
jjCheckNAdd(36);
break;
case 36:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 4)
kind = 4;
jjCheckNAdd(36);
break;
case 37:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 5)
kind = 5;
jjCheckNAdd(37);
break;
case 38:
if (curChar != 36)
break;
if (kind > 8)
kind = 8;
jjCheckNAddStates(10, 15);
break;
case 39:
if (curChar == 36)
jjCheckNAddStates(25, 28);
break;
case 40:
if ((0x3ff001800000000L & l) != 0L)
jjCheckNAddStates(29, 31);
break;
case 41:
if ((0x100002400L & l) != 0L)
jjCheckNAddTwoStates(41, 42);
break;
case 42:
if (curChar == 46)
jjCheckNAddStates(32, 35);
break;
case 43:
if (curChar != 36)
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(36, 39);
break;
case 44:
if ((0x3ff001800000000L & l) == 0L)
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(40, 42);
break;
case 46:
if ((0xfc00ffffffffffffL & l) != 0L)
jjCheckNAddTwoStates(47, 48);
break;
case 47:
if ((0xffffffffffffdbffL & l) != 0L)
jjCheckNAddTwoStates(47, 48);
break;
case 50:
if ((0xffffffffffffdbffL & l) != 0L)
jjAddStates(43, 44);
break;
case 52:
if (curChar == 34)
jjCheckNAdd(53);
break;
case 53:
if ((0xfffffffbffffdbffL & l) != 0L)
jjCheckNAddTwoStates(53, 54);
break;
case 54:
if (curChar != 34)
break;
if (kind > 7)
kind = 7;
jjCheckNAddTwoStates(41, 42);
break;
case 55:
if (curChar != 36)
break;
if (kind > 8)
kind = 8;
jjCheckNAddTwoStates(55, 56);
break;
case 56:
if ((0x3ff001800000000L & l) == 0L)
break;
if (kind > 8)
kind = 8;
jjCheckNAdd(56);
break;
case 58:
if ((0xfc00ffffffffffffL & l) != 0L)
jjCheckNAddTwoStates(59, 60);
break;
case 59:
if ((0xffffffffffffdbffL & l) != 0L)
jjCheckNAddTwoStates(59, 60);
break;
case 61:
if ((0xfc00ffffffffffffL & l) != 0L)
jjCheckNAddTwoStates(62, 63);
break;
case 62:
if ((0xffffffffffffdbffL & l) != 0L)
jjCheckNAddTwoStates(62, 63);
break;
case 65:
if ((0xffffffffffffdbffL & l) != 0L)
jjAddStates(45, 46);
break;
case 67:
if ((0xffffffffffffdbffL & l) != 0L)
jjAddStates(47, 48);
break;
case 69:
if (curChar == 34)
jjCheckNAddStates(7, 9);
break;
case 70:
if ((0xfffffffbffffdbffL & l) != 0L)
jjCheckNAddTwoStates(70, 71);
break;
case 71:
if (curChar == 34)
jjCheckNAddTwoStates(41, 42);
break;
case 72:
if ((0xfffffffbffffdbffL & l) != 0L)
jjCheckNAddTwoStates(72, 73);
break;
case 73:
if (curChar == 34 && kind > 12)
kind = 12;
break;
case 74:
if (curChar == 34 && kind > 13)
kind = 13;
break;
default : break;
}
} while(i != startsAt);
}
else if (curChar < 128)
{
long l = 1L << (curChar & 077);
do
{
switch(jjstateSet[--i])
{
case 3:
if ((0x7fffffe87fffffeL & l) != 0L)
{
if (kind > 8)
kind = 8;
jjCheckNAddStates(10, 15);
}
else if (curChar == 96)
jjCheckNAddTwoStates(65, 67);
else if (curChar == 91)
jjAddStates(49, 50);
if ((0x78000001f8000001L & l) != 0L)
{
if (kind > 15)
kind = 15;
}
break;
case 2:
if (kind > 2)
kind = 2;
jjstateSet[jjnewStateCnt++] = 2;
break;
case 5:
jjCheckNAddTwoStates(5, 6);
break;
case 7:
case 8:
jjCheckNAddTwoStates(8, 6);
break;
case 13:
if ((0x2000000020L & l) != 0L)
jjAddStates(51, 52);
break;
case 17:
jjCheckNAddStates(16, 18);
break;
case 19:
if (curChar == 92)
jjstateSet[jjnewStateCnt++] = 18;
break;
case 22:
jjCheckNAddStates(22, 24);
break;
case 24:
if (curChar == 92)
jjstateSet[jjnewStateCnt++] = 23;
break;
case 25:
if ((0x78000001f8000001L & l) != 0L && kind > 15)
kind = 15;
break;
case 30:
if ((0x2000000020L & l) != 0L)
jjAddStates(53, 54);
break;
case 34:
if ((0x2000000020L & l) != 0L)
jjAddStates(55, 56);
break;
case 38:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 8)
kind = 8;
jjCheckNAddStates(10, 15);
break;
case 39:
if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddStates(25, 28);
break;
case 40:
if ((0x7fffffe87ffffffL & l) != 0L)
jjCheckNAddStates(29, 31);
break;
case 43:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(36, 39);
break;
case 44:
if ((0x7fffffe87ffffffL & l) == 0L)
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(40, 42);
break;
case 45:
if (curChar == 91)
jjstateSet[jjnewStateCnt++] = 46;
break;
case 46:
case 47:
if ((0xffffffffdfffffffL & l) != 0L)
jjCheckNAddTwoStates(47, 48);
break;
case 48:
if (curChar != 93)
break;
if (kind > 7)
kind = 7;
jjCheckNAddTwoStates(41, 42);
break;
case 49:
if (curChar == 96)
jjCheckNAdd(50);
break;
case 50:
if ((0xfffffffeffffffffL & l) != 0L)
jjCheckNAddTwoStates(50, 51);
break;
case 51:
if (curChar != 96)
break;
if (kind > 7)
kind = 7;
jjCheckNAddTwoStates(41, 42);
break;
case 53:
jjAddStates(57, 58);
break;
case 55:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 8)
kind = 8;
jjCheckNAddTwoStates(55, 56);
break;
case 56:
if ((0x7fffffe87ffffffL & l) == 0L)
break;
if (kind > 8)
kind = 8;
jjCheckNAdd(56);
break;
case 57:
if (curChar == 91)
jjAddStates(49, 50);
break;
case 58:
case 59:
if ((0xffffffffdfffffffL & l) != 0L)
jjCheckNAddTwoStates(59, 60);
break;
case 60:
if (curChar == 93)
jjCheckNAddTwoStates(41, 42);
break;
case 61:
case 62:
if ((0xffffffffdfffffffL & l) != 0L)
jjCheckNAddTwoStates(62, 63);
break;
case 63:
if (curChar == 93 && kind > 12)
kind = 12;
break;
case 64:
if (curChar == 96)
jjCheckNAddTwoStates(65, 67);
break;
case 65:
if ((0xfffffffeffffffffL & l) != 0L)
jjCheckNAddTwoStates(65, 66);
break;
case 66:
if (curChar == 96)
jjCheckNAddTwoStates(41, 42);
break;
case 67:
if ((0xfffffffeffffffffL & l) != 0L)
jjCheckNAddTwoStates(67, 68);
break;
case 68:
if (curChar == 96 && kind > 12)
kind = 12;
break;
case 70:
jjAddStates(59, 60);
break;
case 72:
jjAddStates(61, 62);
break;
default : break;
}
} while(i != startsAt);
}
else
{
int hiByte = (int)(curChar >> 8);
int i1 = hiByte >> 6;
long l1 = 1L << (hiByte & 077);
int i2 = (curChar & 0xff) >> 6;
long l2 = 1L << (curChar & 077);
do
{
switch(jjstateSet[--i])
{
case 3:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 8)
kind = 8;
jjCheckNAddStates(10, 15);
break;
case 2:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 2)
kind = 2;
jjstateSet[jjnewStateCnt++] = 2;
break;
case 5:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(5, 6);
break;
case 7:
case 8:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(8, 6);
break;
case 17:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddStates(16, 18);
break;
case 22:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddStates(22, 24);
break;
case 39:
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
jjCheckNAddStates(25, 28);
break;
case 40:
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
jjCheckNAddStates(29, 31);
break;
case 43:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(36, 39);
break;
case 44:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 7)
kind = 7;
jjCheckNAddStates(40, 42);
break;
case 46:
case 47:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(47, 48);
break;
case 50:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(43, 44);
break;
case 53:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(57, 58);
break;
case 55:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 8)
kind = 8;
jjCheckNAddTwoStates(55, 56);
break;
case 56:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 8)
kind = 8;
jjCheckNAdd(56);
break;
case 58:
case 59:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(59, 60);
break;
case 61:
case 62:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(62, 63);
break;
case 65:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(45, 46);
break;
case 67:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(47, 48);
break;
case 70:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(59, 60);
break;
case 72:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(61, 62);
break;
default : break;
}
} while(i != startsAt);
}
if (kind != 0x7fffffff)
{
jjmatchedKind = kind;
jjmatchedPos = curPos;
kind = 0x7fffffff;
}
++curPos;
if ((i = jjnewStateCnt) == (startsAt = 75 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = {
27, 11, 28, 29, 33, 34, 37, 70, 72, 74, 39, 40, 41, 42, 55, 56,
17, 19, 20, 6, 7, 9, 22, 24, 20, 39, 40, 41, 42, 40, 41, 42,
43, 45, 49, 52, 41, 42, 43, 44, 41, 42, 44, 50, 51, 65, 66, 67,
68, 58, 61, 14, 15, 31, 32, 35, 36, 53, 54, 70, 71, 72, 73,
};
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
{
switch(hiByte)
{
case 0:
return ((jjbitVec2[i2] & l2) != 0L);
default :
if ((jjbitVec0[i1] & l1) != 0L)
return true;
return false;
}
}
private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
{
switch(hiByte)
{
case 0:
return ((jjbitVec3[i2] & l2) != 0L);
default :
return false;
}
}
/** Token literal values. */
public static final String[] jjstrLiteralImages = {
"", null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
protected CharStream input_stream;
private final int[] jjrounds = new int[75];
private final int[] jjstateSet = new int[150];
protected char curChar;
/** Constructor. */
public SimpleSqlGrammarTokenManager(CharStream stream){
input_stream = stream;
}
/** Constructor. */
public SimpleSqlGrammarTokenManager(CharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
/** Reinitialise parser. */
public void ReInit(CharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 75; i-- > 0;)
jjrounds[i] = 0x80000000;
}
/** Reinitialise parser. */
public void ReInit(CharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
/** Switch to specified lex state. */
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;
}
protected Token jjFillToken()
{
final Token t;
final String curTokenImage;
final int beginLine;
final int endLine;
final int beginColumn;
final int endColumn;
String im = jjstrLiteralImages[jjmatchedKind];
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, curTokenImage);
t.beginLine = beginLine;
t.endLine = endLine;
t.beginColumn = beginColumn;
t.endColumn = endColumn;
return t;
}
int curLexState = 0;
int defaultLexState = 0;
int jjnewStateCnt;
int jjround;
int jjmatchedPos;
int jjmatchedKind;
/** Get the next Token. */
public Token getNextToken()
{
Token matchedToken;
int curPos = 0;
EOFLoop :
for (;;)
{
try
{
curChar = input_stream.BeginToken();
}
catch(java.io.IOException e)
{
jjmatchedKind = 0;
matchedToken = jjFillToken();
return matchedToken;
}
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_0();
if (jjmatchedKind != 0x7fffffff)
{
if (jjmatchedPos + 1 < curPos)
input_stream.backup(curPos - jjmatchedPos - 1);
matchedToken = jjFillToken();
return matchedToken;
}
int error_line = input_stream.getEndLine();
int error_column = input_stream.getEndColumn();
String error_after = null;
boolean EOFSeen = false;
try { input_stream.readChar(); input_stream.backup(1); }
catch (java.io.IOException e1) {
EOFSeen = true;
error_after = curPos <= 1 ? "" : input_stream.GetImage();
if (curChar == '\n' || curChar == '\r') {
error_line++;
error_column = 0;
}
else
error_column++;
}
if (!EOFSeen) {
input_stream.backup(1);
error_after = curPos <= 1 ? "" : input_stream.GetImage();
}
throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
}
}
private void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
{
jjstateSet[jjnewStateCnt++] = state;
jjrounds[state] = jjround;
}
}
private void jjAddStates(int start, int end)
{
do {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
} while (start++ != end);
}
private void jjCheckNAddTwoStates(int state1, int state2)
{
jjCheckNAdd(state1);
jjCheckNAdd(state2);
}
private void jjCheckNAddStates(int start, int end)
{
do {
jjCheckNAdd(jjnextStates[start]);
} while (start++ != end);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy