0001: /* Generated By:JavaCC: Do not edit this line. PrecedenceQueryParserTokenManager.java */
0002: package org.apache.lucene.queryParser.precedence;
0003:
0004: import java.util.Vector;
0005: import java.io.*;
0006: import java.text.*;
0007: import java.util.*;
0008: import org.apache.lucene.index.Term;
0009: import org.apache.lucene.analysis.*;
0010: import org.apache.lucene.document.*;
0011: import org.apache.lucene.search.*;
0012: import org.apache.lucene.util.Parameter;
0013:
0014: public class PrecedenceQueryParserTokenManager implements
0015: PrecedenceQueryParserConstants {
0016: public java.io.PrintStream debugStream = System.out;
0017:
0018: public void setDebugStream(java.io.PrintStream ds) {
0019: debugStream = ds;
0020: }
0021:
0022: private final int jjStopStringLiteralDfa_3(int pos, long active0) {
0023: switch (pos) {
0024: default:
0025: return -1;
0026: }
0027: }
0028:
0029: private final int jjStartNfa_3(int pos, long active0) {
0030: return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0),
0031: pos + 1);
0032: }
0033:
0034: private final int jjStopAtPos(int pos, int kind) {
0035: jjmatchedKind = kind;
0036: jjmatchedPos = pos;
0037: return pos + 1;
0038: }
0039:
0040: private final int jjStartNfaWithStates_3(int pos, int kind,
0041: int state) {
0042: jjmatchedKind = kind;
0043: jjmatchedPos = pos;
0044: try {
0045: curChar = input_stream.readChar();
0046: } catch (java.io.IOException e) {
0047: return pos + 1;
0048: }
0049: return jjMoveNfa_3(state, pos + 1);
0050: }
0051:
0052: private final int jjMoveStringLiteralDfa0_3() {
0053: switch (curChar) {
0054: case 40:
0055: return jjStopAtPos(0, 12);
0056: case 41:
0057: return jjStopAtPos(0, 13);
0058: case 43:
0059: return jjStopAtPos(0, 10);
0060: case 45:
0061: return jjStopAtPos(0, 11);
0062: case 58:
0063: return jjStopAtPos(0, 14);
0064: case 91:
0065: return jjStopAtPos(0, 21);
0066: case 94:
0067: return jjStopAtPos(0, 15);
0068: case 123:
0069: return jjStopAtPos(0, 22);
0070: default:
0071: return jjMoveNfa_3(0, 0);
0072: }
0073: }
0074:
0075: private final void jjCheckNAdd(int state) {
0076: if (jjrounds[state] != jjround) {
0077: jjstateSet[jjnewStateCnt++] = state;
0078: jjrounds[state] = jjround;
0079: }
0080: }
0081:
0082: private final void jjAddStates(int start, int end) {
0083: do {
0084: jjstateSet[jjnewStateCnt++] = jjnextStates[start];
0085: } while (start++ != end);
0086: }
0087:
0088: private final void jjCheckNAddTwoStates(int state1, int state2) {
0089: jjCheckNAdd(state1);
0090: jjCheckNAdd(state2);
0091: }
0092:
0093: private final void jjCheckNAddStates(int start, int end) {
0094: do {
0095: jjCheckNAdd(jjnextStates[start]);
0096: } while (start++ != end);
0097: }
0098:
0099: private final void jjCheckNAddStates(int start) {
0100: jjCheckNAdd(jjnextStates[start]);
0101: jjCheckNAdd(jjnextStates[start + 1]);
0102: }
0103:
0104: static final long[] jjbitVec0 = { 0xfffffffffffffffeL,
0105: 0xffffffffffffffffL, 0xffffffffffffffffL,
0106: 0xffffffffffffffffL };
0107: static final long[] jjbitVec2 = { 0x0L, 0x0L, 0xffffffffffffffffL,
0108: 0xffffffffffffffffL };
0109:
0110: private final int jjMoveNfa_3(int startState, int curPos) {
0111: int[] nextStates;
0112: int startsAt = 0;
0113: jjnewStateCnt = 33;
0114: int i = 1;
0115: jjstateSet[0] = startState;
0116: int j, kind = 0x7fffffff;
0117: for (;;) {
0118: if (++jjround == 0x7fffffff)
0119: ReInitRounds();
0120: if (curChar < 64) {
0121: long l = 1L << curChar;
0122: MatchLoop: do {
0123: switch (jjstateSet[--i]) {
0124: case 0:
0125: if ((0x7bffd0f8ffffd9ffL & l) != 0L) {
0126: if (kind > 17)
0127: kind = 17;
0128: jjCheckNAddStates(0, 6);
0129: } else if ((0x100002600L & l) != 0L) {
0130: if (kind > 6)
0131: kind = 6;
0132: } else if (curChar == 34)
0133: jjCheckNAdd(15);
0134: else if (curChar == 33) {
0135: if (kind > 9)
0136: kind = 9;
0137: }
0138: if (curChar == 38)
0139: jjstateSet[jjnewStateCnt++] = 4;
0140: break;
0141: case 4:
0142: if (curChar == 38 && kind > 7)
0143: kind = 7;
0144: break;
0145: case 5:
0146: if (curChar == 38)
0147: jjstateSet[jjnewStateCnt++] = 4;
0148: break;
0149: case 13:
0150: if (curChar == 33 && kind > 9)
0151: kind = 9;
0152: break;
0153: case 14:
0154: if (curChar == 34)
0155: jjCheckNAdd(15);
0156: break;
0157: case 15:
0158: if ((0xfffffffbffffffffL & l) != 0L)
0159: jjCheckNAddTwoStates(15, 16);
0160: break;
0161: case 16:
0162: if (curChar == 34 && kind > 16)
0163: kind = 16;
0164: break;
0165: case 18:
0166: if ((0x3ff000000000000L & l) == 0L)
0167: break;
0168: if (kind > 18)
0169: kind = 18;
0170: jjAddStates(7, 8);
0171: break;
0172: case 19:
0173: if (curChar == 46)
0174: jjCheckNAdd(20);
0175: break;
0176: case 20:
0177: if ((0x3ff000000000000L & l) == 0L)
0178: break;
0179: if (kind > 18)
0180: kind = 18;
0181: jjCheckNAdd(20);
0182: break;
0183: case 21:
0184: if ((0x7bffd0f8ffffd9ffL & l) == 0L)
0185: break;
0186: if (kind > 17)
0187: kind = 17;
0188: jjCheckNAddStates(0, 6);
0189: break;
0190: case 22:
0191: if ((0x7bfff8f8ffffd9ffL & l) == 0L)
0192: break;
0193: if (kind > 17)
0194: kind = 17;
0195: jjCheckNAddTwoStates(22, 23);
0196: break;
0197: case 24:
0198: if ((0x84002f0600000000L & l) == 0L)
0199: break;
0200: if (kind > 17)
0201: kind = 17;
0202: jjCheckNAddTwoStates(22, 23);
0203: break;
0204: case 25:
0205: if ((0x7bfff8f8ffffd9ffL & l) != 0L)
0206: jjCheckNAddStates(9, 11);
0207: break;
0208: case 26:
0209: if (curChar == 42 && kind > 19)
0210: kind = 19;
0211: break;
0212: case 28:
0213: if ((0x84002f0600000000L & l) != 0L)
0214: jjCheckNAddStates(9, 11);
0215: break;
0216: case 29:
0217: if ((0xfbfffcf8ffffd9ffL & l) == 0L)
0218: break;
0219: if (kind > 20)
0220: kind = 20;
0221: jjCheckNAddTwoStates(29, 30);
0222: break;
0223: case 31:
0224: if ((0x84002f0600000000L & l) == 0L)
0225: break;
0226: if (kind > 20)
0227: kind = 20;
0228: jjCheckNAddTwoStates(29, 30);
0229: break;
0230: default:
0231: break;
0232: }
0233: } while (i != startsAt);
0234: } else if (curChar < 128) {
0235: long l = 1L << (curChar & 077);
0236: MatchLoop: do {
0237: switch (jjstateSet[--i]) {
0238: case 0:
0239: if ((0x97ffffff97ffffffL & l) != 0L) {
0240: if (kind > 17)
0241: kind = 17;
0242: jjCheckNAddStates(0, 6);
0243: } else if (curChar == 126) {
0244: if (kind > 18)
0245: kind = 18;
0246: jjstateSet[jjnewStateCnt++] = 18;
0247: }
0248: if (curChar == 92)
0249: jjCheckNAddStates(12, 14);
0250: else if (curChar == 78)
0251: jjstateSet[jjnewStateCnt++] = 11;
0252: else if (curChar == 124)
0253: jjstateSet[jjnewStateCnt++] = 8;
0254: else if (curChar == 79)
0255: jjstateSet[jjnewStateCnt++] = 6;
0256: else if (curChar == 65)
0257: jjstateSet[jjnewStateCnt++] = 2;
0258: break;
0259: case 1:
0260: if (curChar == 68 && kind > 7)
0261: kind = 7;
0262: break;
0263: case 2:
0264: if (curChar == 78)
0265: jjstateSet[jjnewStateCnt++] = 1;
0266: break;
0267: case 3:
0268: if (curChar == 65)
0269: jjstateSet[jjnewStateCnt++] = 2;
0270: break;
0271: case 6:
0272: if (curChar == 82 && kind > 8)
0273: kind = 8;
0274: break;
0275: case 7:
0276: if (curChar == 79)
0277: jjstateSet[jjnewStateCnt++] = 6;
0278: break;
0279: case 8:
0280: if (curChar == 124 && kind > 8)
0281: kind = 8;
0282: break;
0283: case 9:
0284: if (curChar == 124)
0285: jjstateSet[jjnewStateCnt++] = 8;
0286: break;
0287: case 10:
0288: if (curChar == 84 && kind > 9)
0289: kind = 9;
0290: break;
0291: case 11:
0292: if (curChar == 79)
0293: jjstateSet[jjnewStateCnt++] = 10;
0294: break;
0295: case 12:
0296: if (curChar == 78)
0297: jjstateSet[jjnewStateCnt++] = 11;
0298: break;
0299: case 15:
0300: jjAddStates(15, 16);
0301: break;
0302: case 17:
0303: if (curChar != 126)
0304: break;
0305: if (kind > 18)
0306: kind = 18;
0307: jjstateSet[jjnewStateCnt++] = 18;
0308: break;
0309: case 21:
0310: if ((0x97ffffff97ffffffL & l) == 0L)
0311: break;
0312: if (kind > 17)
0313: kind = 17;
0314: jjCheckNAddStates(0, 6);
0315: break;
0316: case 22:
0317: if ((0x97ffffff97ffffffL & l) == 0L)
0318: break;
0319: if (kind > 17)
0320: kind = 17;
0321: jjCheckNAddTwoStates(22, 23);
0322: break;
0323: case 23:
0324: if (curChar == 92)
0325: jjCheckNAddTwoStates(24, 24);
0326: break;
0327: case 24:
0328: if ((0x6800000078000000L & l) == 0L)
0329: break;
0330: if (kind > 17)
0331: kind = 17;
0332: jjCheckNAddTwoStates(22, 23);
0333: break;
0334: case 25:
0335: if ((0x97ffffff97ffffffL & l) != 0L)
0336: jjCheckNAddStates(9, 11);
0337: break;
0338: case 27:
0339: if (curChar == 92)
0340: jjCheckNAddTwoStates(28, 28);
0341: break;
0342: case 28:
0343: if ((0x6800000078000000L & l) != 0L)
0344: jjCheckNAddStates(9, 11);
0345: break;
0346: case 29:
0347: if ((0x97ffffff97ffffffL & l) == 0L)
0348: break;
0349: if (kind > 20)
0350: kind = 20;
0351: jjCheckNAddTwoStates(29, 30);
0352: break;
0353: case 30:
0354: if (curChar == 92)
0355: jjCheckNAddTwoStates(31, 31);
0356: break;
0357: case 31:
0358: if ((0x6800000078000000L & l) == 0L)
0359: break;
0360: if (kind > 20)
0361: kind = 20;
0362: jjCheckNAddTwoStates(29, 30);
0363: break;
0364: case 32:
0365: if (curChar == 92)
0366: jjCheckNAddStates(12, 14);
0367: break;
0368: default:
0369: break;
0370: }
0371: } while (i != startsAt);
0372: } else {
0373: int hiByte = (int) (curChar >> 8);
0374: int i1 = hiByte >> 6;
0375: long l1 = 1L << (hiByte & 077);
0376: int i2 = (curChar & 0xff) >> 6;
0377: long l2 = 1L << (curChar & 077);
0378: MatchLoop: do {
0379: switch (jjstateSet[--i]) {
0380: case 0:
0381: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0382: break;
0383: if (kind > 17)
0384: kind = 17;
0385: jjCheckNAddStates(0, 6);
0386: break;
0387: case 15:
0388: if (jjCanMove_0(hiByte, i1, i2, l1, l2))
0389: jjAddStates(15, 16);
0390: break;
0391: case 22:
0392: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0393: break;
0394: if (kind > 17)
0395: kind = 17;
0396: jjCheckNAddTwoStates(22, 23);
0397: break;
0398: case 25:
0399: if (jjCanMove_0(hiByte, i1, i2, l1, l2))
0400: jjCheckNAddStates(9, 11);
0401: break;
0402: case 29:
0403: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0404: break;
0405: if (kind > 20)
0406: kind = 20;
0407: jjCheckNAddTwoStates(29, 30);
0408: break;
0409: default:
0410: break;
0411: }
0412: } while (i != startsAt);
0413: }
0414: if (kind != 0x7fffffff) {
0415: jjmatchedKind = kind;
0416: jjmatchedPos = curPos;
0417: kind = 0x7fffffff;
0418: }
0419: ++curPos;
0420: if ((i = jjnewStateCnt) == (startsAt = 33 - (jjnewStateCnt = startsAt)))
0421: return curPos;
0422: try {
0423: curChar = input_stream.readChar();
0424: } catch (java.io.IOException e) {
0425: return curPos;
0426: }
0427: }
0428: }
0429:
0430: private final int jjStopStringLiteralDfa_1(int pos, long active0) {
0431: switch (pos) {
0432: case 0:
0433: if ((active0 & 0x10000000L) != 0L) {
0434: jjmatchedKind = 31;
0435: return 4;
0436: }
0437: return -1;
0438: default:
0439: return -1;
0440: }
0441: }
0442:
0443: private final int jjStartNfa_1(int pos, long active0) {
0444: return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0),
0445: pos + 1);
0446: }
0447:
0448: private final int jjStartNfaWithStates_1(int pos, int kind,
0449: int state) {
0450: jjmatchedKind = kind;
0451: jjmatchedPos = pos;
0452: try {
0453: curChar = input_stream.readChar();
0454: } catch (java.io.IOException e) {
0455: return pos + 1;
0456: }
0457: return jjMoveNfa_1(state, pos + 1);
0458: }
0459:
0460: private final int jjMoveStringLiteralDfa0_1() {
0461: switch (curChar) {
0462: case 84:
0463: return jjMoveStringLiteralDfa1_1(0x10000000L);
0464: case 125:
0465: return jjStopAtPos(0, 29);
0466: default:
0467: return jjMoveNfa_1(0, 0);
0468: }
0469: }
0470:
0471: private final int jjMoveStringLiteralDfa1_1(long active0) {
0472: try {
0473: curChar = input_stream.readChar();
0474: } catch (java.io.IOException e) {
0475: jjStopStringLiteralDfa_1(0, active0);
0476: return 1;
0477: }
0478: switch (curChar) {
0479: case 79:
0480: if ((active0 & 0x10000000L) != 0L)
0481: return jjStartNfaWithStates_1(1, 28, 4);
0482: break;
0483: default:
0484: break;
0485: }
0486: return jjStartNfa_1(0, active0);
0487: }
0488:
0489: private final int jjMoveNfa_1(int startState, int curPos) {
0490: int[] nextStates;
0491: int startsAt = 0;
0492: jjnewStateCnt = 5;
0493: int i = 1;
0494: jjstateSet[0] = startState;
0495: int j, kind = 0x7fffffff;
0496: for (;;) {
0497: if (++jjround == 0x7fffffff)
0498: ReInitRounds();
0499: if (curChar < 64) {
0500: long l = 1L << curChar;
0501: MatchLoop: do {
0502: switch (jjstateSet[--i]) {
0503: case 0:
0504: if ((0xfffffffeffffffffL & l) != 0L) {
0505: if (kind > 31)
0506: kind = 31;
0507: jjCheckNAdd(4);
0508: }
0509: if ((0x100002600L & l) != 0L) {
0510: if (kind > 6)
0511: kind = 6;
0512: } else if (curChar == 34)
0513: jjCheckNAdd(2);
0514: break;
0515: case 1:
0516: if (curChar == 34)
0517: jjCheckNAdd(2);
0518: break;
0519: case 2:
0520: if ((0xfffffffbffffffffL & l) != 0L)
0521: jjCheckNAddTwoStates(2, 3);
0522: break;
0523: case 3:
0524: if (curChar == 34 && kind > 30)
0525: kind = 30;
0526: break;
0527: case 4:
0528: if ((0xfffffffeffffffffL & l) == 0L)
0529: break;
0530: if (kind > 31)
0531: kind = 31;
0532: jjCheckNAdd(4);
0533: break;
0534: default:
0535: break;
0536: }
0537: } while (i != startsAt);
0538: } else if (curChar < 128) {
0539: long l = 1L << (curChar & 077);
0540: MatchLoop: do {
0541: switch (jjstateSet[--i]) {
0542: case 0:
0543: case 4:
0544: if ((0xdfffffffffffffffL & l) == 0L)
0545: break;
0546: if (kind > 31)
0547: kind = 31;
0548: jjCheckNAdd(4);
0549: break;
0550: case 2:
0551: jjAddStates(17, 18);
0552: break;
0553: default:
0554: break;
0555: }
0556: } while (i != startsAt);
0557: } else {
0558: int hiByte = (int) (curChar >> 8);
0559: int i1 = hiByte >> 6;
0560: long l1 = 1L << (hiByte & 077);
0561: int i2 = (curChar & 0xff) >> 6;
0562: long l2 = 1L << (curChar & 077);
0563: MatchLoop: do {
0564: switch (jjstateSet[--i]) {
0565: case 0:
0566: case 4:
0567: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0568: break;
0569: if (kind > 31)
0570: kind = 31;
0571: jjCheckNAdd(4);
0572: break;
0573: case 2:
0574: if (jjCanMove_0(hiByte, i1, i2, l1, l2))
0575: jjAddStates(17, 18);
0576: break;
0577: default:
0578: break;
0579: }
0580: } while (i != startsAt);
0581: }
0582: if (kind != 0x7fffffff) {
0583: jjmatchedKind = kind;
0584: jjmatchedPos = curPos;
0585: kind = 0x7fffffff;
0586: }
0587: ++curPos;
0588: if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
0589: return curPos;
0590: try {
0591: curChar = input_stream.readChar();
0592: } catch (java.io.IOException e) {
0593: return curPos;
0594: }
0595: }
0596: }
0597:
0598: private final int jjMoveStringLiteralDfa0_0() {
0599: return jjMoveNfa_0(0, 0);
0600: }
0601:
0602: private final int jjMoveNfa_0(int startState, int curPos) {
0603: int[] nextStates;
0604: int startsAt = 0;
0605: jjnewStateCnt = 3;
0606: int i = 1;
0607: jjstateSet[0] = startState;
0608: int j, kind = 0x7fffffff;
0609: for (;;) {
0610: if (++jjround == 0x7fffffff)
0611: ReInitRounds();
0612: if (curChar < 64) {
0613: long l = 1L << curChar;
0614: MatchLoop: do {
0615: switch (jjstateSet[--i]) {
0616: case 0:
0617: if ((0x3ff000000000000L & l) == 0L)
0618: break;
0619: if (kind > 23)
0620: kind = 23;
0621: jjAddStates(19, 20);
0622: break;
0623: case 1:
0624: if (curChar == 46)
0625: jjCheckNAdd(2);
0626: break;
0627: case 2:
0628: if ((0x3ff000000000000L & l) == 0L)
0629: break;
0630: if (kind > 23)
0631: kind = 23;
0632: jjCheckNAdd(2);
0633: break;
0634: default:
0635: break;
0636: }
0637: } while (i != startsAt);
0638: } else if (curChar < 128) {
0639: long l = 1L << (curChar & 077);
0640: MatchLoop: do {
0641: switch (jjstateSet[--i]) {
0642: default:
0643: break;
0644: }
0645: } while (i != startsAt);
0646: } else {
0647: int hiByte = (int) (curChar >> 8);
0648: int i1 = hiByte >> 6;
0649: long l1 = 1L << (hiByte & 077);
0650: int i2 = (curChar & 0xff) >> 6;
0651: long l2 = 1L << (curChar & 077);
0652: MatchLoop: do {
0653: switch (jjstateSet[--i]) {
0654: default:
0655: break;
0656: }
0657: } while (i != startsAt);
0658: }
0659: if (kind != 0x7fffffff) {
0660: jjmatchedKind = kind;
0661: jjmatchedPos = curPos;
0662: kind = 0x7fffffff;
0663: }
0664: ++curPos;
0665: if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
0666: return curPos;
0667: try {
0668: curChar = input_stream.readChar();
0669: } catch (java.io.IOException e) {
0670: return curPos;
0671: }
0672: }
0673: }
0674:
0675: private final int jjStopStringLiteralDfa_2(int pos, long active0) {
0676: switch (pos) {
0677: case 0:
0678: if ((active0 & 0x1000000L) != 0L) {
0679: jjmatchedKind = 27;
0680: return 4;
0681: }
0682: return -1;
0683: default:
0684: return -1;
0685: }
0686: }
0687:
0688: private final int jjStartNfa_2(int pos, long active0) {
0689: return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0),
0690: pos + 1);
0691: }
0692:
0693: private final int jjStartNfaWithStates_2(int pos, int kind,
0694: int state) {
0695: jjmatchedKind = kind;
0696: jjmatchedPos = pos;
0697: try {
0698: curChar = input_stream.readChar();
0699: } catch (java.io.IOException e) {
0700: return pos + 1;
0701: }
0702: return jjMoveNfa_2(state, pos + 1);
0703: }
0704:
0705: private final int jjMoveStringLiteralDfa0_2() {
0706: switch (curChar) {
0707: case 84:
0708: return jjMoveStringLiteralDfa1_2(0x1000000L);
0709: case 93:
0710: return jjStopAtPos(0, 25);
0711: default:
0712: return jjMoveNfa_2(0, 0);
0713: }
0714: }
0715:
0716: private final int jjMoveStringLiteralDfa1_2(long active0) {
0717: try {
0718: curChar = input_stream.readChar();
0719: } catch (java.io.IOException e) {
0720: jjStopStringLiteralDfa_2(0, active0);
0721: return 1;
0722: }
0723: switch (curChar) {
0724: case 79:
0725: if ((active0 & 0x1000000L) != 0L)
0726: return jjStartNfaWithStates_2(1, 24, 4);
0727: break;
0728: default:
0729: break;
0730: }
0731: return jjStartNfa_2(0, active0);
0732: }
0733:
0734: private final int jjMoveNfa_2(int startState, int curPos) {
0735: int[] nextStates;
0736: int startsAt = 0;
0737: jjnewStateCnt = 5;
0738: int i = 1;
0739: jjstateSet[0] = startState;
0740: int j, kind = 0x7fffffff;
0741: for (;;) {
0742: if (++jjround == 0x7fffffff)
0743: ReInitRounds();
0744: if (curChar < 64) {
0745: long l = 1L << curChar;
0746: MatchLoop: do {
0747: switch (jjstateSet[--i]) {
0748: case 0:
0749: if ((0xfffffffeffffffffL & l) != 0L) {
0750: if (kind > 27)
0751: kind = 27;
0752: jjCheckNAdd(4);
0753: }
0754: if ((0x100002600L & l) != 0L) {
0755: if (kind > 6)
0756: kind = 6;
0757: } else if (curChar == 34)
0758: jjCheckNAdd(2);
0759: break;
0760: case 1:
0761: if (curChar == 34)
0762: jjCheckNAdd(2);
0763: break;
0764: case 2:
0765: if ((0xfffffffbffffffffL & l) != 0L)
0766: jjCheckNAddTwoStates(2, 3);
0767: break;
0768: case 3:
0769: if (curChar == 34 && kind > 26)
0770: kind = 26;
0771: break;
0772: case 4:
0773: if ((0xfffffffeffffffffL & l) == 0L)
0774: break;
0775: if (kind > 27)
0776: kind = 27;
0777: jjCheckNAdd(4);
0778: break;
0779: default:
0780: break;
0781: }
0782: } while (i != startsAt);
0783: } else if (curChar < 128) {
0784: long l = 1L << (curChar & 077);
0785: MatchLoop: do {
0786: switch (jjstateSet[--i]) {
0787: case 0:
0788: case 4:
0789: if ((0xffffffffdfffffffL & l) == 0L)
0790: break;
0791: if (kind > 27)
0792: kind = 27;
0793: jjCheckNAdd(4);
0794: break;
0795: case 2:
0796: jjAddStates(17, 18);
0797: break;
0798: default:
0799: break;
0800: }
0801: } while (i != startsAt);
0802: } else {
0803: int hiByte = (int) (curChar >> 8);
0804: int i1 = hiByte >> 6;
0805: long l1 = 1L << (hiByte & 077);
0806: int i2 = (curChar & 0xff) >> 6;
0807: long l2 = 1L << (curChar & 077);
0808: MatchLoop: do {
0809: switch (jjstateSet[--i]) {
0810: case 0:
0811: case 4:
0812: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0813: break;
0814: if (kind > 27)
0815: kind = 27;
0816: jjCheckNAdd(4);
0817: break;
0818: case 2:
0819: if (jjCanMove_0(hiByte, i1, i2, l1, l2))
0820: jjAddStates(17, 18);
0821: break;
0822: default:
0823: break;
0824: }
0825: } while (i != startsAt);
0826: }
0827: if (kind != 0x7fffffff) {
0828: jjmatchedKind = kind;
0829: jjmatchedPos = curPos;
0830: kind = 0x7fffffff;
0831: }
0832: ++curPos;
0833: if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
0834: return curPos;
0835: try {
0836: curChar = input_stream.readChar();
0837: } catch (java.io.IOException e) {
0838: return curPos;
0839: }
0840: }
0841: }
0842:
0843: static final int[] jjnextStates = { 22, 25, 26, 29, 30, 27, 23, 18,
0844: 19, 25, 26, 27, 24, 28, 31, 15, 16, 2, 3, 0, 1, };
0845:
0846: private static final boolean jjCanMove_0(int hiByte, int i1,
0847: int i2, long l1, long l2) {
0848: switch (hiByte) {
0849: case 0:
0850: return ((jjbitVec2[i2] & l2) != 0L);
0851: default:
0852: if ((jjbitVec0[i1] & l1) != 0L)
0853: return true;
0854: return false;
0855: }
0856: }
0857:
0858: public static final String[] jjstrLiteralImages = { "", null, null,
0859: null, null, null, null, null, null, null, "\53", "\55",
0860: "\50", "\51", "\72", "\136", null, null, null, null, null,
0861: "\133", "\173", null, "\124\117", "\135", null, null,
0862: "\124\117", "\175", null, null, };
0863: public static final String[] lexStateNames = { "Boost", "RangeEx",
0864: "RangeIn", "DEFAULT", };
0865: public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1,
0866: -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
0867: 2, 1, 3, -1, 3, -1, -1, -1, 3, -1, -1, };
0868: static final long[] jjtoToken = { 0xffffff81L, };
0869: static final long[] jjtoSkip = { 0x40L, };
0870: protected CharStream input_stream;
0871: private final int[] jjrounds = new int[33];
0872: private final int[] jjstateSet = new int[66];
0873: protected char curChar;
0874:
0875: public PrecedenceQueryParserTokenManager(CharStream stream) {
0876: input_stream = stream;
0877: }
0878:
0879: public PrecedenceQueryParserTokenManager(CharStream stream,
0880: int lexState) {
0881: this (stream);
0882: SwitchTo(lexState);
0883: }
0884:
0885: public void ReInit(CharStream stream) {
0886: jjmatchedPos = jjnewStateCnt = 0;
0887: curLexState = defaultLexState;
0888: input_stream = stream;
0889: ReInitRounds();
0890: }
0891:
0892: private final void ReInitRounds() {
0893: int i;
0894: jjround = 0x80000001;
0895: for (i = 33; i-- > 0;)
0896: jjrounds[i] = 0x80000000;
0897: }
0898:
0899: public void ReInit(CharStream stream, int lexState) {
0900: ReInit(stream);
0901: SwitchTo(lexState);
0902: }
0903:
0904: public void SwitchTo(int lexState) {
0905: if (lexState >= 4 || lexState < 0)
0906: throw new TokenMgrError(
0907: "Error: Ignoring invalid lexical state : "
0908: + lexState + ". State unchanged.",
0909: TokenMgrError.INVALID_LEXICAL_STATE);
0910: else
0911: curLexState = lexState;
0912: }
0913:
0914: protected Token jjFillToken() {
0915: Token t = Token.newToken(jjmatchedKind);
0916: t.kind = jjmatchedKind;
0917: String im = jjstrLiteralImages[jjmatchedKind];
0918: t.image = (im == null) ? input_stream.GetImage() : im;
0919: t.beginLine = input_stream.getBeginLine();
0920: t.beginColumn = input_stream.getBeginColumn();
0921: t.endLine = input_stream.getEndLine();
0922: t.endColumn = input_stream.getEndColumn();
0923: return t;
0924: }
0925:
0926: int curLexState = 3;
0927: int defaultLexState = 3;
0928: int jjnewStateCnt;
0929: int jjround;
0930: int jjmatchedPos;
0931: int jjmatchedKind;
0932:
0933: public Token getNextToken() {
0934: int kind;
0935: Token specialToken = null;
0936: Token matchedToken;
0937: int curPos = 0;
0938:
0939: EOFLoop: for (;;) {
0940: try {
0941: curChar = input_stream.BeginToken();
0942: } catch (java.io.IOException e) {
0943: jjmatchedKind = 0;
0944: matchedToken = jjFillToken();
0945: return matchedToken;
0946: }
0947:
0948: switch (curLexState) {
0949: case 0:
0950: jjmatchedKind = 0x7fffffff;
0951: jjmatchedPos = 0;
0952: curPos = jjMoveStringLiteralDfa0_0();
0953: break;
0954: case 1:
0955: jjmatchedKind = 0x7fffffff;
0956: jjmatchedPos = 0;
0957: curPos = jjMoveStringLiteralDfa0_1();
0958: break;
0959: case 2:
0960: jjmatchedKind = 0x7fffffff;
0961: jjmatchedPos = 0;
0962: curPos = jjMoveStringLiteralDfa0_2();
0963: break;
0964: case 3:
0965: jjmatchedKind = 0x7fffffff;
0966: jjmatchedPos = 0;
0967: curPos = jjMoveStringLiteralDfa0_3();
0968: break;
0969: }
0970: if (jjmatchedKind != 0x7fffffff) {
0971: if (jjmatchedPos + 1 < curPos)
0972: input_stream.backup(curPos - jjmatchedPos - 1);
0973: if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
0974: matchedToken = jjFillToken();
0975: if (jjnewLexState[jjmatchedKind] != -1)
0976: curLexState = jjnewLexState[jjmatchedKind];
0977: return matchedToken;
0978: } else {
0979: if (jjnewLexState[jjmatchedKind] != -1)
0980: curLexState = jjnewLexState[jjmatchedKind];
0981: continue EOFLoop;
0982: }
0983: }
0984: int error_line = input_stream.getEndLine();
0985: int error_column = input_stream.getEndColumn();
0986: String error_after = null;
0987: boolean EOFSeen = false;
0988: try {
0989: input_stream.readChar();
0990: input_stream.backup(1);
0991: } catch (java.io.IOException e1) {
0992: EOFSeen = true;
0993: error_after = curPos <= 1 ? "" : input_stream
0994: .GetImage();
0995: if (curChar == '\n' || curChar == '\r') {
0996: error_line++;
0997: error_column = 0;
0998: } else
0999: error_column++;
1000: }
1001: if (!EOFSeen) {
1002: input_stream.backup(1);
1003: error_after = curPos <= 1 ? "" : input_stream
1004: .GetImage();
1005: }
1006: throw new TokenMgrError(EOFSeen, curLexState, error_line,
1007: error_column, error_after, curChar,
1008: TokenMgrError.LEXICAL_ERROR);
1009: }
1010: }
1011:
1012: }
|