0001: /* Generated By:JJTree&JavaCC: Do not edit this line. OgnlParserTokenManager.java */
0002: package ognl;
0003:
0004: import java.math.*;
0005:
0006: public class OgnlParserTokenManager implements OgnlParserConstants {
0007: /** Holds the last value computed by a constant token. */
0008: Object literalValue;
0009: /** Holds the last character escaped or in a character literal. */
0010: private char charValue;
0011: /** Holds char literal start token. */
0012: private char charLiteralStartQuote;
0013: /** Holds the last string literal parsed. */
0014: private StringBuffer stringBuffer;
0015:
0016: /** Converts an escape sequence into a character value. */
0017: private char escapeChar() {
0018: int ofs = image.length() - 1;
0019: switch (image.charAt(ofs)) {
0020: case 'n':
0021: return '\n';
0022: case 'r':
0023: return '\r';
0024: case 't':
0025: return '\t';
0026: case 'b':
0027: return '\b';
0028: case 'f':
0029: return '\f';
0030: case '\\':
0031: return '\\';
0032: case '\'':
0033: return '\'';
0034: case '\"':
0035: return '\"';
0036: }
0037:
0038: // Otherwise, it's an octal number. Find the backslash and convert.
0039: while (image.charAt(--ofs) != '\\') {
0040: }
0041: int value = 0;
0042: while (++ofs < image.length())
0043: value = (value << 3) | (image.charAt(ofs) - '0');
0044: return (char) value;
0045: }
0046:
0047: private Object makeInt() {
0048: Object result;
0049: String s = image.toString();
0050: int base = 10;
0051:
0052: if (s.charAt(0) == '0')
0053: base = (s.length() > 1 && (s.charAt(1) == 'x' || s
0054: .charAt(1) == 'X')) ? 16 : 8;
0055: if (base == 16)
0056: s = s.substring(2); // Trim the 0x off the front
0057: switch (s.charAt(s.length() - 1)) {
0058: case 'l':
0059: case 'L':
0060: result = Long.valueOf(s.substring(0, s.length() - 1), base);
0061: break;
0062:
0063: case 'h':
0064: case 'H':
0065: result = new BigInteger(s.substring(0, s.length() - 1),
0066: base);
0067: break;
0068:
0069: default:
0070: result = Integer.valueOf(s, base);
0071: break;
0072: }
0073: return result;
0074: }
0075:
0076: private Object makeFloat() {
0077: String s = image.toString();
0078: switch (s.charAt(s.length() - 1)) {
0079: case 'f':
0080: case 'F':
0081: return Float.valueOf(s);
0082:
0083: case 'b':
0084: case 'B':
0085: return new BigDecimal(s.substring(0, s.length() - 1));
0086:
0087: case 'd':
0088: case 'D':
0089: default:
0090: return Double.valueOf(s);
0091: }
0092: }
0093:
0094: public java.io.PrintStream debugStream = System.out;
0095:
0096: public void setDebugStream(java.io.PrintStream ds) {
0097: debugStream = ds;
0098: }
0099:
0100: private final int jjStopStringLiteralDfa_0(int pos, long active0,
0101: long active1) {
0102: switch (pos) {
0103: case 0:
0104: if ((active0 & 0x201c4055d555540L) != 0L) {
0105: jjmatchedKind = 64;
0106: return 1;
0107: }
0108: if ((active0 & 0x400000000000000L) != 0L)
0109: return 1;
0110: if ((active0 & 0x10000000000000L) != 0L)
0111: return 3;
0112: if ((active0 & 0x80000000000L) != 0L)
0113: return 9;
0114: return -1;
0115: case 1:
0116: if ((active0 & 0x201c00550045500L) != 0L) {
0117: if (jjmatchedPos != 1) {
0118: jjmatchedKind = 64;
0119: jjmatchedPos = 1;
0120: }
0121: return 1;
0122: }
0123: if ((active0 & 0x4000d510040L) != 0L)
0124: return 1;
0125: return -1;
0126: case 2:
0127: if ((active0 & 0x1c40400004000L) != 0L) {
0128: jjmatchedKind = 64;
0129: jjmatchedPos = 2;
0130: return 1;
0131: }
0132: if ((active0 & 0x200000155041500L) != 0L)
0133: return 1;
0134: return -1;
0135: case 3:
0136: if ((active0 & 0x1400400004000L) != 0L)
0137: return 1;
0138: if ((active0 & 0x840000000000L) != 0L) {
0139: jjmatchedKind = 64;
0140: jjmatchedPos = 3;
0141: return 1;
0142: }
0143: return -1;
0144: case 4:
0145: if ((active0 & 0x800000000000L) != 0L)
0146: return 1;
0147: if ((active0 & 0x40000000000L) != 0L) {
0148: jjmatchedKind = 64;
0149: jjmatchedPos = 4;
0150: return 1;
0151: }
0152: return -1;
0153: case 5:
0154: if ((active0 & 0x40000000000L) != 0L) {
0155: jjmatchedKind = 64;
0156: jjmatchedPos = 5;
0157: return 1;
0158: }
0159: return -1;
0160: case 6:
0161: if ((active0 & 0x40000000000L) != 0L) {
0162: jjmatchedKind = 64;
0163: jjmatchedPos = 6;
0164: return 1;
0165: }
0166: return -1;
0167: case 7:
0168: if ((active0 & 0x40000000000L) != 0L) {
0169: jjmatchedKind = 64;
0170: jjmatchedPos = 7;
0171: return 1;
0172: }
0173: return -1;
0174: case 8:
0175: if ((active0 & 0x40000000000L) != 0L) {
0176: jjmatchedKind = 64;
0177: jjmatchedPos = 8;
0178: return 1;
0179: }
0180: return -1;
0181: default:
0182: return -1;
0183: }
0184: }
0185:
0186: private final int jjStartNfa_0(int pos, long active0, long active1) {
0187: return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0,
0188: active1), pos + 1);
0189: }
0190:
0191: private final int jjStopAtPos(int pos, int kind) {
0192: jjmatchedKind = kind;
0193: jjmatchedPos = pos;
0194: return pos + 1;
0195: }
0196:
0197: private final int jjStartNfaWithStates_0(int pos, int kind,
0198: int state) {
0199: jjmatchedKind = kind;
0200: jjmatchedPos = pos;
0201: try {
0202: curChar = input_stream.readChar();
0203: } catch (java.io.IOException e) {
0204: return pos + 1;
0205: }
0206: return jjMoveNfa_0(state, pos + 1);
0207: }
0208:
0209: private final int jjMoveStringLiteralDfa0_0() {
0210: switch (curChar) {
0211: case 33:
0212: jjmatchedKind = 41;
0213: return jjMoveStringLiteralDfa1_0(0x20000L);
0214: case 34:
0215: return jjStopAtPos(0, 70);
0216: case 35:
0217: jjmatchedKind = 51;
0218: return jjMoveStringLiteralDfa1_0(0x6000000000000L);
0219: case 36:
0220: return jjStartNfaWithStates_0(0, 58, 1);
0221: case 37:
0222: return jjStopAtPos(0, 39);
0223: case 38:
0224: jjmatchedKind = 13;
0225: return jjMoveStringLiteralDfa1_0(0x80L);
0226: case 39:
0227: return jjStopAtPos(0, 69);
0228: case 40:
0229: return jjStopAtPos(0, 44);
0230: case 41:
0231: return jjStopAtPos(0, 45);
0232: case 42:
0233: return jjStopAtPos(0, 37);
0234: case 43:
0235: return jjStopAtPos(0, 35);
0236: case 44:
0237: return jjStopAtPos(0, 1);
0238: case 45:
0239: return jjStopAtPos(0, 36);
0240: case 46:
0241: return jjStartNfaWithStates_0(0, 43, 9);
0242: case 47:
0243: return jjStopAtPos(0, 38);
0244: case 58:
0245: return jjStopAtPos(0, 4);
0246: case 60:
0247: jjmatchedKind = 19;
0248: return jjMoveStringLiteralDfa1_0(0x20800000L);
0249: case 61:
0250: jjmatchedKind = 2;
0251: return jjMoveStringLiteralDfa1_0(0x8000L);
0252: case 62:
0253: jjmatchedKind = 21;
0254: return jjMoveStringLiteralDfa1_0(0x282000000L);
0255: case 63:
0256: return jjStopAtPos(0, 3);
0257: case 64:
0258: return jjStopAtPos(0, 56);
0259: case 91:
0260: return jjStartNfaWithStates_0(0, 52, 3);
0261: case 93:
0262: return jjStopAtPos(0, 53);
0263: case 94:
0264: return jjStopAtPos(0, 11);
0265: case 96:
0266: return jjStopAtPos(0, 68);
0267: case 97:
0268: return jjMoveStringLiteralDfa1_0(0x100L);
0269: case 98:
0270: return jjMoveStringLiteralDfa1_0(0x4400L);
0271: case 101:
0272: return jjMoveStringLiteralDfa1_0(0x10000L);
0273: case 102:
0274: return jjMoveStringLiteralDfa1_0(0x800000000000L);
0275: case 103:
0276: return jjMoveStringLiteralDfa1_0(0x4400000L);
0277: case 105:
0278: return jjMoveStringLiteralDfa1_0(0x40008000000L);
0279: case 108:
0280: return jjMoveStringLiteralDfa1_0(0x1100000L);
0281: case 110:
0282: return jjMoveStringLiteralDfa1_0(0x201000010040000L);
0283: case 111:
0284: return jjMoveStringLiteralDfa1_0(0x40L);
0285: case 115:
0286: return jjMoveStringLiteralDfa1_0(0x140000000L);
0287: case 116:
0288: return jjMoveStringLiteralDfa1_0(0x400000000000L);
0289: case 117:
0290: return jjMoveStringLiteralDfa1_0(0x400000000L);
0291: case 120:
0292: return jjMoveStringLiteralDfa1_0(0x1000L);
0293: case 123:
0294: return jjStopAtPos(0, 54);
0295: case 124:
0296: jjmatchedKind = 9;
0297: return jjMoveStringLiteralDfa1_0(0x20L);
0298: case 125:
0299: return jjStopAtPos(0, 55);
0300: case 126:
0301: return jjStopAtPos(0, 40);
0302: default:
0303: return jjMoveNfa_0(0, 0);
0304: }
0305: }
0306:
0307: private final int jjMoveStringLiteralDfa1_0(long active0) {
0308: try {
0309: curChar = input_stream.readChar();
0310: } catch (java.io.IOException e) {
0311: jjStopStringLiteralDfa_0(0, active0, 0L);
0312: return 1;
0313: }
0314: switch (curChar) {
0315: case 38:
0316: if ((active0 & 0x80L) != 0L)
0317: return jjStopAtPos(1, 7);
0318: break;
0319: case 60:
0320: if ((active0 & 0x20000000L) != 0L)
0321: return jjStopAtPos(1, 29);
0322: break;
0323: case 61:
0324: if ((active0 & 0x8000L) != 0L)
0325: return jjStopAtPos(1, 15);
0326: else if ((active0 & 0x20000L) != 0L)
0327: return jjStopAtPos(1, 17);
0328: else if ((active0 & 0x800000L) != 0L)
0329: return jjStopAtPos(1, 23);
0330: else if ((active0 & 0x2000000L) != 0L)
0331: return jjStopAtPos(1, 25);
0332: break;
0333: case 62:
0334: if ((active0 & 0x80000000L) != 0L) {
0335: jjmatchedKind = 31;
0336: jjmatchedPos = 1;
0337: }
0338: return jjMoveStringLiteralDfa2_0(active0, 0x200000000L);
0339: case 97:
0340: return jjMoveStringLiteralDfa2_0(active0, 0x800000004000L);
0341: case 101:
0342: return jjMoveStringLiteralDfa2_0(active0,
0343: 0x200000000040000L);
0344: case 104:
0345: return jjMoveStringLiteralDfa2_0(active0, 0x140000000L);
0346: case 110:
0347: if ((active0 & 0x8000000L) != 0L) {
0348: jjmatchedKind = 27;
0349: jjmatchedPos = 1;
0350: }
0351: return jjMoveStringLiteralDfa2_0(active0, 0x40000000100L);
0352: case 111:
0353: return jjMoveStringLiteralDfa2_0(active0, 0x10001400L);
0354: case 113:
0355: if ((active0 & 0x10000L) != 0L)
0356: return jjStartNfaWithStates_0(1, 16, 1);
0357: break;
0358: case 114:
0359: if ((active0 & 0x40L) != 0L)
0360: return jjStartNfaWithStates_0(1, 6, 1);
0361: return jjMoveStringLiteralDfa2_0(active0, 0x4400000000000L);
0362: case 115:
0363: return jjMoveStringLiteralDfa2_0(active0, 0x400000000L);
0364: case 116:
0365: if ((active0 & 0x100000L) != 0L) {
0366: jjmatchedKind = 20;
0367: jjmatchedPos = 1;
0368: } else if ((active0 & 0x400000L) != 0L) {
0369: jjmatchedKind = 22;
0370: jjmatchedPos = 1;
0371: }
0372: return jjMoveStringLiteralDfa2_0(active0, 0x2000005000000L);
0373: case 117:
0374: return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L);
0375: case 124:
0376: if ((active0 & 0x20L) != 0L)
0377: return jjStopAtPos(1, 5);
0378: break;
0379: default:
0380: break;
0381: }
0382: return jjStartNfa_0(0, active0, 0L);
0383: }
0384:
0385: private final int jjMoveStringLiteralDfa2_0(long old0, long active0) {
0386: if (((active0 &= old0)) == 0L)
0387: return jjStartNfa_0(0, old0, 0L);
0388: try {
0389: curChar = input_stream.readChar();
0390: } catch (java.io.IOException e) {
0391: jjStopStringLiteralDfa_0(1, active0, 0L);
0392: return 2;
0393: }
0394: switch (curChar) {
0395: case 62:
0396: if ((active0 & 0x200000000L) != 0L)
0397: return jjStopAtPos(2, 33);
0398: break;
0399: case 100:
0400: if ((active0 & 0x100L) != 0L)
0401: return jjStartNfaWithStates_0(2, 8, 1);
0402: break;
0403: case 101:
0404: if ((active0 & 0x1000000L) != 0L)
0405: return jjStartNfaWithStates_0(2, 24, 1);
0406: else if ((active0 & 0x4000000L) != 0L)
0407: return jjStartNfaWithStates_0(2, 26, 1);
0408: break;
0409: case 104:
0410: return jjMoveStringLiteralDfa3_0(active0, 0x2000400000000L);
0411: case 108:
0412: if ((active0 & 0x40000000L) != 0L)
0413: return jjStartNfaWithStates_0(2, 30, 1);
0414: return jjMoveStringLiteralDfa3_0(active0, 0x1800000000000L);
0415: case 110:
0416: return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
0417: case 111:
0418: return jjMoveStringLiteralDfa3_0(active0, 0x4000000000000L);
0419: case 113:
0420: if ((active0 & 0x40000L) != 0L)
0421: return jjStartNfaWithStates_0(2, 18, 1);
0422: break;
0423: case 114:
0424: if ((active0 & 0x400L) != 0L)
0425: return jjStartNfaWithStates_0(2, 10, 1);
0426: else if ((active0 & 0x1000L) != 0L)
0427: return jjStartNfaWithStates_0(2, 12, 1);
0428: else if ((active0 & 0x100000000L) != 0L)
0429: return jjStartNfaWithStates_0(2, 32, 1);
0430: break;
0431: case 115:
0432: return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L);
0433: case 116:
0434: if ((active0 & 0x10000000L) != 0L)
0435: return jjStartNfaWithStates_0(2, 28, 1);
0436: break;
0437: case 117:
0438: return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L);
0439: case 119:
0440: if ((active0 & 0x200000000000000L) != 0L)
0441: return jjStartNfaWithStates_0(2, 57, 1);
0442: break;
0443: default:
0444: break;
0445: }
0446: return jjStartNfa_0(1, active0, 0L);
0447: }
0448:
0449: private final int jjMoveStringLiteralDfa3_0(long old0, long active0) {
0450: if (((active0 &= old0)) == 0L)
0451: return jjStartNfa_0(1, old0, 0L);
0452: try {
0453: curChar = input_stream.readChar();
0454: } catch (java.io.IOException e) {
0455: jjStopStringLiteralDfa_0(2, active0, 0L);
0456: return 3;
0457: }
0458: switch (curChar) {
0459: case 100:
0460: if ((active0 & 0x4000L) != 0L)
0461: return jjStartNfaWithStates_0(3, 14, 1);
0462: break;
0463: case 101:
0464: if ((active0 & 0x400000000000L) != 0L)
0465: return jjStartNfaWithStates_0(3, 46, 1);
0466: break;
0467: case 105:
0468: return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L);
0469: case 108:
0470: if ((active0 & 0x1000000000000L) != 0L)
0471: return jjStartNfaWithStates_0(3, 48, 1);
0472: break;
0473: case 111:
0474: return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L);
0475: case 114:
0476: if ((active0 & 0x400000000L) != 0L)
0477: return jjStartNfaWithStates_0(3, 34, 1);
0478: break;
0479: case 115:
0480: return jjMoveStringLiteralDfa4_0(active0, 0x800000000000L);
0481: case 116:
0482: return jjMoveStringLiteralDfa4_0(active0, 0x40000000000L);
0483: default:
0484: break;
0485: }
0486: return jjStartNfa_0(2, active0, 0L);
0487: }
0488:
0489: private final int jjMoveStringLiteralDfa4_0(long old0, long active0) {
0490: if (((active0 &= old0)) == 0L)
0491: return jjStartNfa_0(2, old0, 0L);
0492: try {
0493: curChar = input_stream.readChar();
0494: } catch (java.io.IOException e) {
0495: jjStopStringLiteralDfa_0(3, active0, 0L);
0496: return 4;
0497: }
0498: switch (curChar) {
0499: case 97:
0500: return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);
0501: case 101:
0502: if ((active0 & 0x800000000000L) != 0L)
0503: return jjStartNfaWithStates_0(4, 47, 1);
0504: break;
0505: case 115:
0506: if ((active0 & 0x2000000000000L) != 0L)
0507: return jjStopAtPos(4, 49);
0508: break;
0509: case 116:
0510: if ((active0 & 0x4000000000000L) != 0L)
0511: return jjStopAtPos(4, 50);
0512: break;
0513: default:
0514: break;
0515: }
0516: return jjStartNfa_0(3, active0, 0L);
0517: }
0518:
0519: private final int jjMoveStringLiteralDfa5_0(long old0, long active0) {
0520: if (((active0 &= old0)) == 0L)
0521: return jjStartNfa_0(3, old0, 0L);
0522: try {
0523: curChar = input_stream.readChar();
0524: } catch (java.io.IOException e) {
0525: jjStopStringLiteralDfa_0(4, active0, 0L);
0526: return 5;
0527: }
0528: switch (curChar) {
0529: case 110:
0530: return jjMoveStringLiteralDfa6_0(active0, 0x40000000000L);
0531: default:
0532: break;
0533: }
0534: return jjStartNfa_0(4, active0, 0L);
0535: }
0536:
0537: private final int jjMoveStringLiteralDfa6_0(long old0, long active0) {
0538: if (((active0 &= old0)) == 0L)
0539: return jjStartNfa_0(4, old0, 0L);
0540: try {
0541: curChar = input_stream.readChar();
0542: } catch (java.io.IOException e) {
0543: jjStopStringLiteralDfa_0(5, active0, 0L);
0544: return 6;
0545: }
0546: switch (curChar) {
0547: case 99:
0548: return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L);
0549: default:
0550: break;
0551: }
0552: return jjStartNfa_0(5, active0, 0L);
0553: }
0554:
0555: private final int jjMoveStringLiteralDfa7_0(long old0, long active0) {
0556: if (((active0 &= old0)) == 0L)
0557: return jjStartNfa_0(5, old0, 0L);
0558: try {
0559: curChar = input_stream.readChar();
0560: } catch (java.io.IOException e) {
0561: jjStopStringLiteralDfa_0(6, active0, 0L);
0562: return 7;
0563: }
0564: switch (curChar) {
0565: case 101:
0566: return jjMoveStringLiteralDfa8_0(active0, 0x40000000000L);
0567: default:
0568: break;
0569: }
0570: return jjStartNfa_0(6, active0, 0L);
0571: }
0572:
0573: private final int jjMoveStringLiteralDfa8_0(long old0, long active0) {
0574: if (((active0 &= old0)) == 0L)
0575: return jjStartNfa_0(6, old0, 0L);
0576: try {
0577: curChar = input_stream.readChar();
0578: } catch (java.io.IOException e) {
0579: jjStopStringLiteralDfa_0(7, active0, 0L);
0580: return 8;
0581: }
0582: switch (curChar) {
0583: case 111:
0584: return jjMoveStringLiteralDfa9_0(active0, 0x40000000000L);
0585: default:
0586: break;
0587: }
0588: return jjStartNfa_0(7, active0, 0L);
0589: }
0590:
0591: private final int jjMoveStringLiteralDfa9_0(long old0, long active0) {
0592: if (((active0 &= old0)) == 0L)
0593: return jjStartNfa_0(7, old0, 0L);
0594: try {
0595: curChar = input_stream.readChar();
0596: } catch (java.io.IOException e) {
0597: jjStopStringLiteralDfa_0(8, active0, 0L);
0598: return 9;
0599: }
0600: switch (curChar) {
0601: case 102:
0602: if ((active0 & 0x40000000000L) != 0L)
0603: return jjStartNfaWithStates_0(9, 42, 1);
0604: break;
0605: default:
0606: break;
0607: }
0608: return jjStartNfa_0(8, active0, 0L);
0609: }
0610:
0611: private final void jjCheckNAdd(int state) {
0612: if (jjrounds[state] != jjround) {
0613: jjstateSet[jjnewStateCnt++] = state;
0614: jjrounds[state] = jjround;
0615: }
0616: }
0617:
0618: private final void jjAddStates(int start, int end) {
0619: do {
0620: jjstateSet[jjnewStateCnt++] = jjnextStates[start];
0621: } while (start++ != end);
0622: }
0623:
0624: private final void jjCheckNAddTwoStates(int state1, int state2) {
0625: jjCheckNAdd(state1);
0626: jjCheckNAdd(state2);
0627: }
0628:
0629: private final void jjCheckNAddStates(int start, int end) {
0630: do {
0631: jjCheckNAdd(jjnextStates[start]);
0632: } while (start++ != end);
0633: }
0634:
0635: private final void jjCheckNAddStates(int start) {
0636: jjCheckNAdd(jjnextStates[start]);
0637: jjCheckNAdd(jjnextStates[start + 1]);
0638: }
0639:
0640: static final long[] jjbitVec0 = { 0x1ff00000fffffffeL,
0641: 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L };
0642: static final long[] jjbitVec2 = { 0x0L, 0x0L, 0x0L,
0643: 0xff7fffffff7fffffL };
0644: static final long[] jjbitVec3 = { 0x0L, 0xffffffffffffffffL,
0645: 0xffffffffffffffffL, 0xffffffffffffffffL };
0646: static final long[] jjbitVec4 = { 0xffffffffffffffffL,
0647: 0xffffffffffffffffL, 0xffffL, 0x0L };
0648: static final long[] jjbitVec5 = { 0xffffffffffffffffL,
0649: 0xffffffffffffffffL, 0x0L, 0x0L };
0650: static final long[] jjbitVec6 = { 0x3fffffffffffL, 0x0L, 0x0L, 0x0L };
0651:
0652: private final int jjMoveNfa_0(int startState, int curPos) {
0653: int[] nextStates;
0654: int startsAt = 0;
0655: jjnewStateCnt = 27;
0656: int i = 1;
0657: jjstateSet[0] = startState;
0658: int j, kind = 0x7fffffff;
0659: for (;;) {
0660: if (++jjround == 0x7fffffff)
0661: ReInitRounds();
0662: if (curChar < 64) {
0663: long l = 1L << curChar;
0664: MatchLoop: do {
0665: switch (jjstateSet[--i]) {
0666: case 0:
0667: if ((0x3ff000000000000L & l) != 0L)
0668: jjCheckNAddStates(0, 5);
0669: else if (curChar == 46)
0670: jjCheckNAdd(9);
0671: else if (curChar == 36) {
0672: if (kind > 64)
0673: kind = 64;
0674: jjCheckNAdd(1);
0675: }
0676: if ((0x3fe000000000000L & l) != 0L) {
0677: if (kind > 80)
0678: kind = 80;
0679: jjCheckNAddTwoStates(6, 7);
0680: } else if (curChar == 48) {
0681: if (kind > 80)
0682: kind = 80;
0683: jjCheckNAddStates(6, 8);
0684: }
0685: break;
0686: case 1:
0687: if ((0x3ff001000000000L & l) == 0L)
0688: break;
0689: if (kind > 64)
0690: kind = 64;
0691: jjCheckNAdd(1);
0692: break;
0693: case 3:
0694: if ((0x41000000000L & l) != 0L)
0695: jjstateSet[jjnewStateCnt++] = 4;
0696: break;
0697: case 5:
0698: if ((0x3fe000000000000L & l) == 0L)
0699: break;
0700: if (kind > 80)
0701: kind = 80;
0702: jjCheckNAddTwoStates(6, 7);
0703: break;
0704: case 6:
0705: if ((0x3ff000000000000L & l) == 0L)
0706: break;
0707: if (kind > 80)
0708: kind = 80;
0709: jjCheckNAddTwoStates(6, 7);
0710: break;
0711: case 8:
0712: if (curChar == 46)
0713: jjCheckNAdd(9);
0714: break;
0715: case 9:
0716: if ((0x3ff000000000000L & l) == 0L)
0717: break;
0718: if (kind > 81)
0719: kind = 81;
0720: jjCheckNAddStates(9, 11);
0721: break;
0722: case 11:
0723: if ((0x280000000000L & l) != 0L)
0724: jjCheckNAdd(12);
0725: break;
0726: case 12:
0727: if ((0x3ff000000000000L & l) == 0L)
0728: break;
0729: if (kind > 81)
0730: kind = 81;
0731: jjCheckNAddTwoStates(12, 13);
0732: break;
0733: case 14:
0734: if ((0x3ff000000000000L & l) != 0L)
0735: jjCheckNAddStates(0, 5);
0736: break;
0737: case 15:
0738: if ((0x3ff000000000000L & l) != 0L)
0739: jjCheckNAddTwoStates(15, 16);
0740: break;
0741: case 16:
0742: if (curChar != 46)
0743: break;
0744: if (kind > 81)
0745: kind = 81;
0746: jjCheckNAddStates(12, 14);
0747: break;
0748: case 17:
0749: if ((0x3ff000000000000L & l) == 0L)
0750: break;
0751: if (kind > 81)
0752: kind = 81;
0753: jjCheckNAddStates(12, 14);
0754: break;
0755: case 18:
0756: if ((0x3ff000000000000L & l) != 0L)
0757: jjCheckNAddTwoStates(18, 19);
0758: break;
0759: case 20:
0760: if ((0x280000000000L & l) != 0L)
0761: jjCheckNAdd(21);
0762: break;
0763: case 21:
0764: if ((0x3ff000000000000L & l) == 0L)
0765: break;
0766: if (kind > 81)
0767: kind = 81;
0768: jjCheckNAddTwoStates(21, 13);
0769: break;
0770: case 22:
0771: if ((0x3ff000000000000L & l) != 0L)
0772: jjCheckNAddTwoStates(22, 13);
0773: break;
0774: case 23:
0775: if (curChar != 48)
0776: break;
0777: if (kind > 80)
0778: kind = 80;
0779: jjCheckNAddStates(6, 8);
0780: break;
0781: case 24:
0782: if ((0xff000000000000L & l) == 0L)
0783: break;
0784: if (kind > 80)
0785: kind = 80;
0786: jjCheckNAddTwoStates(24, 7);
0787: break;
0788: case 26:
0789: if ((0x3ff000000000000L & l) == 0L)
0790: break;
0791: if (kind > 80)
0792: kind = 80;
0793: jjCheckNAddTwoStates(26, 7);
0794: break;
0795: default:
0796: break;
0797: }
0798: } while (i != startsAt);
0799: } else if (curChar < 128) {
0800: long l = 1L << (curChar & 077);
0801: MatchLoop: do {
0802: switch (jjstateSet[--i]) {
0803: case 0:
0804: if ((0x7fffffe87fffffeL & l) != 0L) {
0805: if (kind > 64)
0806: kind = 64;
0807: jjCheckNAdd(1);
0808: } else if (curChar == 91)
0809: jjstateSet[jjnewStateCnt++] = 3;
0810: break;
0811: case 1:
0812: if ((0x7fffffe87fffffeL & l) == 0L)
0813: break;
0814: if (kind > 64)
0815: kind = 64;
0816: jjCheckNAdd(1);
0817: break;
0818: case 2:
0819: if (curChar == 91)
0820: jjstateSet[jjnewStateCnt++] = 3;
0821: break;
0822: case 3:
0823: if ((0x1000000040000000L & l) != 0L)
0824: jjstateSet[jjnewStateCnt++] = 4;
0825: break;
0826: case 4:
0827: if (curChar == 93)
0828: kind = 67;
0829: break;
0830: case 7:
0831: if ((0x110000001100L & l) != 0L && kind > 80)
0832: kind = 80;
0833: break;
0834: case 10:
0835: if ((0x2000000020L & l) != 0L)
0836: jjAddStates(15, 16);
0837: break;
0838: case 13:
0839: if ((0x5400000054L & l) != 0L && kind > 81)
0840: kind = 81;
0841: break;
0842: case 19:
0843: if ((0x2000000020L & l) != 0L)
0844: jjAddStates(17, 18);
0845: break;
0846: case 25:
0847: if ((0x100000001000000L & l) != 0L)
0848: jjCheckNAdd(26);
0849: break;
0850: case 26:
0851: if ((0x7e0000007eL & l) == 0L)
0852: break;
0853: if (kind > 80)
0854: kind = 80;
0855: jjCheckNAddTwoStates(26, 7);
0856: break;
0857: default:
0858: break;
0859: }
0860: } while (i != startsAt);
0861: } else {
0862: int hiByte = (int) (curChar >> 8);
0863: int i1 = hiByte >> 6;
0864: long l1 = 1L << (hiByte & 077);
0865: int i2 = (curChar & 0xff) >> 6;
0866: long l2 = 1L << (curChar & 077);
0867: MatchLoop: do {
0868: switch (jjstateSet[--i]) {
0869: case 0:
0870: case 1:
0871: if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
0872: break;
0873: if (kind > 64)
0874: kind = 64;
0875: jjCheckNAdd(1);
0876: break;
0877: default:
0878: break;
0879: }
0880: } while (i != startsAt);
0881: }
0882: if (kind != 0x7fffffff) {
0883: jjmatchedKind = kind;
0884: jjmatchedPos = curPos;
0885: kind = 0x7fffffff;
0886: }
0887: ++curPos;
0888: if ((i = jjnewStateCnt) == (startsAt = 27 - (jjnewStateCnt = startsAt)))
0889: return curPos;
0890: try {
0891: curChar = input_stream.readChar();
0892: } catch (java.io.IOException e) {
0893: return curPos;
0894: }
0895: }
0896: }
0897:
0898: private final int jjStopStringLiteralDfa_2(int pos, long active0,
0899: long active1) {
0900: switch (pos) {
0901: default:
0902: return -1;
0903: }
0904: }
0905:
0906: private final int jjStartNfa_2(int pos, long active0, long active1) {
0907: return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0,
0908: active1), pos + 1);
0909: }
0910:
0911: private final int jjStartNfaWithStates_2(int pos, int kind,
0912: int state) {
0913: jjmatchedKind = kind;
0914: jjmatchedPos = pos;
0915: try {
0916: curChar = input_stream.readChar();
0917: } catch (java.io.IOException e) {
0918: return pos + 1;
0919: }
0920: return jjMoveNfa_2(state, pos + 1);
0921: }
0922:
0923: private final int jjMoveStringLiteralDfa0_2() {
0924: switch (curChar) {
0925: case 96:
0926: return jjStopAtPos(0, 76);
0927: default:
0928: return jjMoveNfa_2(0, 0);
0929: }
0930: }
0931:
0932: static final long[] jjbitVec7 = { 0xfffffffffffffffeL,
0933: 0xffffffffffffffffL, 0xffffffffffffffffL,
0934: 0xffffffffffffffffL };
0935: static final long[] jjbitVec8 = { 0x0L, 0x0L, 0xffffffffffffffffL,
0936: 0xffffffffffffffffL };
0937:
0938: private final int jjMoveNfa_2(int startState, int curPos) {
0939: int[] nextStates;
0940: int startsAt = 0;
0941: jjnewStateCnt = 6;
0942: int i = 1;
0943: jjstateSet[0] = startState;
0944: int j, kind = 0x7fffffff;
0945: for (;;) {
0946: if (++jjround == 0x7fffffff)
0947: ReInitRounds();
0948: if (curChar < 64) {
0949: long l = 1L << curChar;
0950: MatchLoop: do {
0951: switch (jjstateSet[--i]) {
0952: case 0:
0953: if (kind > 75)
0954: kind = 75;
0955: break;
0956: case 1:
0957: if ((0x8400000000L & l) != 0L && kind > 74)
0958: kind = 74;
0959: break;
0960: case 2:
0961: if ((0xf000000000000L & l) != 0L)
0962: jjstateSet[jjnewStateCnt++] = 3;
0963: break;
0964: case 3:
0965: if ((0xff000000000000L & l) == 0L)
0966: break;
0967: if (kind > 74)
0968: kind = 74;
0969: jjstateSet[jjnewStateCnt++] = 4;
0970: break;
0971: case 4:
0972: if ((0xff000000000000L & l) != 0L && kind > 74)
0973: kind = 74;
0974: break;
0975: default:
0976: break;
0977: }
0978: } while (i != startsAt);
0979: } else if (curChar < 128) {
0980: long l = 1L << (curChar & 077);
0981: MatchLoop: do {
0982: switch (jjstateSet[--i]) {
0983: case 0:
0984: if ((0xfffffffeefffffffL & l) != 0L) {
0985: if (kind > 75)
0986: kind = 75;
0987: } else if (curChar == 92)
0988: jjAddStates(19, 21);
0989: break;
0990: case 1:
0991: if ((0x14404510000000L & l) != 0L && kind > 74)
0992: kind = 74;
0993: break;
0994: case 5:
0995: if ((0xfffffffeefffffffL & l) != 0L
0996: && kind > 75)
0997: kind = 75;
0998: break;
0999: default:
1000: break;
1001: }
1002: } while (i != startsAt);
1003: } else {
1004: int hiByte = (int) (curChar >> 8);
1005: int i1 = hiByte >> 6;
1006: long l1 = 1L << (hiByte & 077);
1007: int i2 = (curChar & 0xff) >> 6;
1008: long l2 = 1L << (curChar & 077);
1009: MatchLoop: do {
1010: switch (jjstateSet[--i]) {
1011: case 0:
1012: if (jjCanMove_1(hiByte, i1, i2, l1, l2)
1013: && kind > 75)
1014: kind = 75;
1015: break;
1016: default:
1017: break;
1018: }
1019: } while (i != startsAt);
1020: }
1021: if (kind != 0x7fffffff) {
1022: jjmatchedKind = kind;
1023: jjmatchedPos = curPos;
1024: kind = 0x7fffffff;
1025: }
1026: ++curPos;
1027: if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt)))
1028: return curPos;
1029: try {
1030: curChar = input_stream.readChar();
1031: } catch (java.io.IOException e) {
1032: return curPos;
1033: }
1034: }
1035: }
1036:
1037: private final int jjStopStringLiteralDfa_1(int pos, long active0,
1038: long active1) {
1039: switch (pos) {
1040: default:
1041: return -1;
1042: }
1043: }
1044:
1045: private final int jjStartNfa_1(int pos, long active0, long active1) {
1046: return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0,
1047: active1), pos + 1);
1048: }
1049:
1050: private final int jjStartNfaWithStates_1(int pos, int kind,
1051: int state) {
1052: jjmatchedKind = kind;
1053: jjmatchedPos = pos;
1054: try {
1055: curChar = input_stream.readChar();
1056: } catch (java.io.IOException e) {
1057: return pos + 1;
1058: }
1059: return jjMoveNfa_1(state, pos + 1);
1060: }
1061:
1062: private final int jjMoveStringLiteralDfa0_1() {
1063: switch (curChar) {
1064: case 39:
1065: return jjStopAtPos(0, 73);
1066: default:
1067: return jjMoveNfa_1(0, 0);
1068: }
1069: }
1070:
1071: private final int jjMoveNfa_1(int startState, int curPos) {
1072: int[] nextStates;
1073: int startsAt = 0;
1074: jjnewStateCnt = 6;
1075: int i = 1;
1076: jjstateSet[0] = startState;
1077: int j, kind = 0x7fffffff;
1078: for (;;) {
1079: if (++jjround == 0x7fffffff)
1080: ReInitRounds();
1081: if (curChar < 64) {
1082: long l = 1L << curChar;
1083: MatchLoop: do {
1084: switch (jjstateSet[--i]) {
1085: case 0:
1086: if ((0xffffff7fffffffffL & l) != 0L
1087: && kind > 72)
1088: kind = 72;
1089: break;
1090: case 1:
1091: if ((0x8400000000L & l) != 0L && kind > 71)
1092: kind = 71;
1093: break;
1094: case 2:
1095: if ((0xf000000000000L & l) != 0L)
1096: jjstateSet[jjnewStateCnt++] = 3;
1097: break;
1098: case 3:
1099: if ((0xff000000000000L & l) == 0L)
1100: break;
1101: if (kind > 71)
1102: kind = 71;
1103: jjstateSet[jjnewStateCnt++] = 4;
1104: break;
1105: case 4:
1106: if ((0xff000000000000L & l) != 0L && kind > 71)
1107: kind = 71;
1108: break;
1109: default:
1110: break;
1111: }
1112: } while (i != startsAt);
1113: } else if (curChar < 128) {
1114: long l = 1L << (curChar & 077);
1115: MatchLoop: do {
1116: switch (jjstateSet[--i]) {
1117: case 0:
1118: if ((0xffffffffefffffffL & l) != 0L) {
1119: if (kind > 72)
1120: kind = 72;
1121: } else if (curChar == 92)
1122: jjAddStates(19, 21);
1123: break;
1124: case 1:
1125: if ((0x14404510000000L & l) != 0L && kind > 71)
1126: kind = 71;
1127: break;
1128: case 5:
1129: if ((0xffffffffefffffffL & l) != 0L
1130: && kind > 72)
1131: kind = 72;
1132: break;
1133: default:
1134: break;
1135: }
1136: } while (i != startsAt);
1137: } else {
1138: int hiByte = (int) (curChar >> 8);
1139: int i1 = hiByte >> 6;
1140: long l1 = 1L << (hiByte & 077);
1141: int i2 = (curChar & 0xff) >> 6;
1142: long l2 = 1L << (curChar & 077);
1143: MatchLoop: do {
1144: switch (jjstateSet[--i]) {
1145: case 0:
1146: if (jjCanMove_1(hiByte, i1, i2, l1, l2)
1147: && kind > 72)
1148: kind = 72;
1149: break;
1150: default:
1151: break;
1152: }
1153: } while (i != startsAt);
1154: }
1155: if (kind != 0x7fffffff) {
1156: jjmatchedKind = kind;
1157: jjmatchedPos = curPos;
1158: kind = 0x7fffffff;
1159: }
1160: ++curPos;
1161: if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt)))
1162: return curPos;
1163: try {
1164: curChar = input_stream.readChar();
1165: } catch (java.io.IOException e) {
1166: return curPos;
1167: }
1168: }
1169: }
1170:
1171: private final int jjStopStringLiteralDfa_3(int pos, long active0,
1172: long active1) {
1173: switch (pos) {
1174: default:
1175: return -1;
1176: }
1177: }
1178:
1179: private final int jjStartNfa_3(int pos, long active0, long active1) {
1180: return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0,
1181: active1), pos + 1);
1182: }
1183:
1184: private final int jjStartNfaWithStates_3(int pos, int kind,
1185: int state) {
1186: jjmatchedKind = kind;
1187: jjmatchedPos = pos;
1188: try {
1189: curChar = input_stream.readChar();
1190: } catch (java.io.IOException e) {
1191: return pos + 1;
1192: }
1193: return jjMoveNfa_3(state, pos + 1);
1194: }
1195:
1196: private final int jjMoveStringLiteralDfa0_3() {
1197: switch (curChar) {
1198: case 34:
1199: return jjStopAtPos(0, 79);
1200: default:
1201: return jjMoveNfa_3(0, 0);
1202: }
1203: }
1204:
1205: private final int jjMoveNfa_3(int startState, int curPos) {
1206: int[] nextStates;
1207: int startsAt = 0;
1208: jjnewStateCnt = 6;
1209: int i = 1;
1210: jjstateSet[0] = startState;
1211: int j, kind = 0x7fffffff;
1212: for (;;) {
1213: if (++jjround == 0x7fffffff)
1214: ReInitRounds();
1215: if (curChar < 64) {
1216: long l = 1L << curChar;
1217: MatchLoop: do {
1218: switch (jjstateSet[--i]) {
1219: case 0:
1220: if ((0xfffffffbffffffffL & l) != 0L
1221: && kind > 78)
1222: kind = 78;
1223: break;
1224: case 1:
1225: if ((0x8400000000L & l) != 0L && kind > 77)
1226: kind = 77;
1227: break;
1228: case 2:
1229: if ((0xf000000000000L & l) != 0L)
1230: jjstateSet[jjnewStateCnt++] = 3;
1231: break;
1232: case 3:
1233: if ((0xff000000000000L & l) == 0L)
1234: break;
1235: if (kind > 77)
1236: kind = 77;
1237: jjstateSet[jjnewStateCnt++] = 4;
1238: break;
1239: case 4:
1240: if ((0xff000000000000L & l) != 0L && kind > 77)
1241: kind = 77;
1242: break;
1243: default:
1244: break;
1245: }
1246: } while (i != startsAt);
1247: } else if (curChar < 128) {
1248: long l = 1L << (curChar & 077);
1249: MatchLoop: do {
1250: switch (jjstateSet[--i]) {
1251: case 0:
1252: if ((0xffffffffefffffffL & l) != 0L) {
1253: if (kind > 78)
1254: kind = 78;
1255: } else if (curChar == 92)
1256: jjAddStates(19, 21);
1257: break;
1258: case 1:
1259: if ((0x14404510000000L & l) != 0L && kind > 77)
1260: kind = 77;
1261: break;
1262: case 5:
1263: if ((0xffffffffefffffffL & l) != 0L
1264: && kind > 78)
1265: kind = 78;
1266: break;
1267: default:
1268: break;
1269: }
1270: } while (i != startsAt);
1271: } else {
1272: int hiByte = (int) (curChar >> 8);
1273: int i1 = hiByte >> 6;
1274: long l1 = 1L << (hiByte & 077);
1275: int i2 = (curChar & 0xff) >> 6;
1276: long l2 = 1L << (curChar & 077);
1277: MatchLoop: do {
1278: switch (jjstateSet[--i]) {
1279: case 0:
1280: if (jjCanMove_1(hiByte, i1, i2, l1, l2)
1281: && kind > 78)
1282: kind = 78;
1283: break;
1284: default:
1285: break;
1286: }
1287: } while (i != startsAt);
1288: }
1289: if (kind != 0x7fffffff) {
1290: jjmatchedKind = kind;
1291: jjmatchedPos = curPos;
1292: kind = 0x7fffffff;
1293: }
1294: ++curPos;
1295: if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt)))
1296: return curPos;
1297: try {
1298: curChar = input_stream.readChar();
1299: } catch (java.io.IOException e) {
1300: return curPos;
1301: }
1302: }
1303: }
1304:
1305: static final int[] jjnextStates = { 15, 16, 18, 19, 22, 13, 24, 25,
1306: 7, 9, 10, 13, 17, 10, 13, 11, 12, 20, 21, 1, 2, 3, };
1307:
1308: private static final boolean jjCanMove_0(int hiByte, int i1,
1309: int i2, long l1, long l2) {
1310: switch (hiByte) {
1311: case 0:
1312: return ((jjbitVec2[i2] & l2) != 0L);
1313: case 48:
1314: return ((jjbitVec3[i2] & l2) != 0L);
1315: case 49:
1316: return ((jjbitVec4[i2] & l2) != 0L);
1317: case 51:
1318: return ((jjbitVec5[i2] & l2) != 0L);
1319: case 61:
1320: return ((jjbitVec6[i2] & l2) != 0L);
1321: default:
1322: if ((jjbitVec0[i1] & l1) != 0L)
1323: return true;
1324: return false;
1325: }
1326: }
1327:
1328: private static final boolean jjCanMove_1(int hiByte, int i1,
1329: int i2, long l1, long l2) {
1330: switch (hiByte) {
1331: case 0:
1332: return ((jjbitVec8[i2] & l2) != 0L);
1333: default:
1334: if ((jjbitVec7[i1] & l1) != 0L)
1335: return true;
1336: return false;
1337: }
1338: }
1339:
1340: public static final String[] jjstrLiteralImages = { "", "\54",
1341: "\75", "\77", "\72", "\174\174", "\157\162", "\46\46",
1342: "\141\156\144", "\174", "\142\157\162", "\136",
1343: "\170\157\162", "\46", "\142\141\156\144", "\75\75",
1344: "\145\161", "\41\75", "\156\145\161", "\74", "\154\164",
1345: "\76", "\147\164", "\74\75", "\154\164\145", "\76\75",
1346: "\147\164\145", "\151\156", "\156\157\164", "\74\74",
1347: "\163\150\154", "\76\76", "\163\150\162", "\76\76\76",
1348: "\165\163\150\162", "\53", "\55", "\52", "\57", "\45",
1349: "\176", "\41", "\151\156\163\164\141\156\143\145\157\146",
1350: "\56", "\50", "\51", "\164\162\165\145",
1351: "\146\141\154\163\145", "\156\165\154\154",
1352: "\43\164\150\151\163", "\43\162\157\157\164", "\43",
1353: "\133", "\135", "\173", "\175", "\100", "\156\145\167",
1354: "\44", null, null, null, null, null, null, null, null,
1355: null, null, null, null, null, null, null, null, null, null,
1356: null, null, null, null, null, null, null, null, null, };
1357: public static final String[] lexStateNames = { "DEFAULT",
1358: "WithinCharLiteral", "WithinBackCharLiteral",
1359: "WithinStringLiteral", };
1360: public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1,
1361: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1362: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1363: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1364: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1365: -1, -1, 2, 1, 3, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1,
1366: -1, -1, -1, -1, };
1367: static final long[] jjtoToken = { 0x7ffffffffffffffL, 0x39209L, };
1368: static final long[] jjtoSkip = { 0xf800000000000000L, 0x0L, };
1369: static final long[] jjtoMore = { 0x0L, 0x6df0L, };
1370: protected JavaCharStream input_stream;
1371: private final int[] jjrounds = new int[27];
1372: private final int[] jjstateSet = new int[54];
1373: StringBuffer image;
1374: int jjimageLen;
1375: int lengthOfMatch;
1376: protected char curChar;
1377:
1378: public OgnlParserTokenManager(JavaCharStream stream) {
1379: if (JavaCharStream.staticFlag)
1380: throw new Error(
1381: "ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
1382: input_stream = stream;
1383: }
1384:
1385: public OgnlParserTokenManager(JavaCharStream stream, int lexState) {
1386: this (stream);
1387: SwitchTo(lexState);
1388: }
1389:
1390: public void ReInit(JavaCharStream stream) {
1391: jjmatchedPos = jjnewStateCnt = 0;
1392: curLexState = defaultLexState;
1393: input_stream = stream;
1394: ReInitRounds();
1395: }
1396:
1397: private final void ReInitRounds() {
1398: int i;
1399: jjround = 0x80000001;
1400: for (i = 27; i-- > 0;)
1401: jjrounds[i] = 0x80000000;
1402: }
1403:
1404: public void ReInit(JavaCharStream stream, int lexState) {
1405: ReInit(stream);
1406: SwitchTo(lexState);
1407: }
1408:
1409: public void SwitchTo(int lexState) {
1410: if (lexState >= 4 || lexState < 0)
1411: throw new TokenMgrError(
1412: "Error: Ignoring invalid lexical state : "
1413: + lexState + ". State unchanged.",
1414: TokenMgrError.INVALID_LEXICAL_STATE);
1415: else
1416: curLexState = lexState;
1417: }
1418:
1419: protected Token jjFillToken() {
1420: Token t = Token.newToken(jjmatchedKind);
1421: t.kind = jjmatchedKind;
1422: String im = jjstrLiteralImages[jjmatchedKind];
1423: t.image = (im == null) ? input_stream.GetImage() : im;
1424: t.beginLine = input_stream.getBeginLine();
1425: t.beginColumn = input_stream.getBeginColumn();
1426: t.endLine = input_stream.getEndLine();
1427: t.endColumn = input_stream.getEndColumn();
1428: return t;
1429: }
1430:
1431: int curLexState = 0;
1432: int defaultLexState = 0;
1433: int jjnewStateCnt;
1434: int jjround;
1435: int jjmatchedPos;
1436: int jjmatchedKind;
1437:
1438: public Token getNextToken() {
1439: int kind;
1440: Token specialToken = null;
1441: Token matchedToken;
1442: int curPos = 0;
1443:
1444: EOFLoop: for (;;) {
1445: try {
1446: curChar = input_stream.BeginToken();
1447: } catch (java.io.IOException e) {
1448: jjmatchedKind = 0;
1449: matchedToken = jjFillToken();
1450: return matchedToken;
1451: }
1452: image = null;
1453: jjimageLen = 0;
1454:
1455: for (;;) {
1456: switch (curLexState) {
1457: case 0:
1458: try {
1459: input_stream.backup(0);
1460: while (curChar <= 32
1461: && (0x100003600L & (1L << curChar)) != 0L)
1462: curChar = input_stream.BeginToken();
1463: } catch (java.io.IOException e1) {
1464: continue EOFLoop;
1465: }
1466: jjmatchedKind = 0x7fffffff;
1467: jjmatchedPos = 0;
1468: curPos = jjMoveStringLiteralDfa0_0();
1469: break;
1470: case 1:
1471: jjmatchedKind = 0x7fffffff;
1472: jjmatchedPos = 0;
1473: curPos = jjMoveStringLiteralDfa0_1();
1474: break;
1475: case 2:
1476: jjmatchedKind = 0x7fffffff;
1477: jjmatchedPos = 0;
1478: curPos = jjMoveStringLiteralDfa0_2();
1479: break;
1480: case 3:
1481: jjmatchedKind = 0x7fffffff;
1482: jjmatchedPos = 0;
1483: curPos = jjMoveStringLiteralDfa0_3();
1484: break;
1485: }
1486: if (jjmatchedKind != 0x7fffffff) {
1487: if (jjmatchedPos + 1 < curPos)
1488: input_stream.backup(curPos - jjmatchedPos - 1);
1489: if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
1490: matchedToken = jjFillToken();
1491: TokenLexicalActions(matchedToken);
1492: if (jjnewLexState[jjmatchedKind] != -1)
1493: curLexState = jjnewLexState[jjmatchedKind];
1494: return matchedToken;
1495: } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
1496: if (jjnewLexState[jjmatchedKind] != -1)
1497: curLexState = jjnewLexState[jjmatchedKind];
1498: continue EOFLoop;
1499: }
1500: MoreLexicalActions();
1501: if (jjnewLexState[jjmatchedKind] != -1)
1502: curLexState = jjnewLexState[jjmatchedKind];
1503: curPos = 0;
1504: jjmatchedKind = 0x7fffffff;
1505: try {
1506: curChar = input_stream.readChar();
1507: continue;
1508: } catch (java.io.IOException e1) {
1509: }
1510: }
1511: int error_line = input_stream.getEndLine();
1512: int error_column = input_stream.getEndColumn();
1513: String error_after = null;
1514: boolean EOFSeen = false;
1515: try {
1516: input_stream.readChar();
1517: input_stream.backup(1);
1518: } catch (java.io.IOException e1) {
1519: EOFSeen = true;
1520: error_after = curPos <= 1 ? "" : input_stream
1521: .GetImage();
1522: if (curChar == '\n' || curChar == '\r') {
1523: error_line++;
1524: error_column = 0;
1525: } else
1526: error_column++;
1527: }
1528: if (!EOFSeen) {
1529: input_stream.backup(1);
1530: error_after = curPos <= 1 ? "" : input_stream
1531: .GetImage();
1532: }
1533: throw new TokenMgrError(EOFSeen, curLexState,
1534: error_line, error_column, error_after, curChar,
1535: TokenMgrError.LEXICAL_ERROR);
1536: }
1537: }
1538: }
1539:
1540: void MoreLexicalActions() {
1541: jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
1542: switch (jjmatchedKind) {
1543: case 69:
1544: if (image == null)
1545: image = new StringBuffer(new String(input_stream
1546: .GetSuffix(jjimageLen)));
1547: else
1548: image.append(input_stream.GetSuffix(jjimageLen));
1549: jjimageLen = 0;
1550: stringBuffer = new StringBuffer();
1551: break;
1552: case 70:
1553: if (image == null)
1554: image = new StringBuffer(new String(input_stream
1555: .GetSuffix(jjimageLen)));
1556: else
1557: image.append(input_stream.GetSuffix(jjimageLen));
1558: jjimageLen = 0;
1559: stringBuffer = new StringBuffer();
1560: break;
1561: case 71:
1562: if (image == null)
1563: image = new StringBuffer(new String(input_stream
1564: .GetSuffix(jjimageLen)));
1565: else
1566: image.append(input_stream.GetSuffix(jjimageLen));
1567: jjimageLen = 0;
1568: charValue = escapeChar();
1569: stringBuffer.append(charValue);
1570: break;
1571: case 72:
1572: if (image == null)
1573: image = new StringBuffer(new String(input_stream
1574: .GetSuffix(jjimageLen)));
1575: else
1576: image.append(input_stream.GetSuffix(jjimageLen));
1577: jjimageLen = 0;
1578: charValue = image.charAt(image.length() - 1);
1579: stringBuffer.append(charValue);
1580: break;
1581: case 74:
1582: if (image == null)
1583: image = new StringBuffer(new String(input_stream
1584: .GetSuffix(jjimageLen)));
1585: else
1586: image.append(input_stream.GetSuffix(jjimageLen));
1587: jjimageLen = 0;
1588: charValue = escapeChar();
1589: break;
1590: case 75:
1591: if (image == null)
1592: image = new StringBuffer(new String(input_stream
1593: .GetSuffix(jjimageLen)));
1594: else
1595: image.append(input_stream.GetSuffix(jjimageLen));
1596: jjimageLen = 0;
1597: charValue = image.charAt(image.length() - 1);
1598: break;
1599: case 77:
1600: if (image == null)
1601: image = new StringBuffer(new String(input_stream
1602: .GetSuffix(jjimageLen)));
1603: else
1604: image.append(input_stream.GetSuffix(jjimageLen));
1605: jjimageLen = 0;
1606: stringBuffer.append(escapeChar());
1607: break;
1608: case 78:
1609: if (image == null)
1610: image = new StringBuffer(new String(input_stream
1611: .GetSuffix(jjimageLen)));
1612: else
1613: image.append(input_stream.GetSuffix(jjimageLen));
1614: jjimageLen = 0;
1615: stringBuffer.append(image.charAt(image.length() - 1));
1616: break;
1617: default:
1618: break;
1619: }
1620: }
1621:
1622: void TokenLexicalActions(Token matchedToken) {
1623: switch (jjmatchedKind) {
1624: case 67:
1625: if (image == null)
1626: image = new StringBuffer(new String(input_stream
1627: .GetSuffix(jjimageLen
1628: + (lengthOfMatch = jjmatchedPos + 1))));
1629: else
1630: image.append(input_stream.GetSuffix(jjimageLen
1631: + (lengthOfMatch = jjmatchedPos + 1)));
1632: switch (image.charAt(1)) {
1633: case '^':
1634: literalValue = DynamicSubscript.first;
1635: break;
1636: case '|':
1637: literalValue = DynamicSubscript.mid;
1638: break;
1639: case '$':
1640: literalValue = DynamicSubscript.last;
1641: break;
1642: case '*':
1643: literalValue = DynamicSubscript.all;
1644: break;
1645: }
1646: break;
1647: case 73:
1648: if (image == null)
1649: image = new StringBuffer(new String(input_stream
1650: .GetSuffix(jjimageLen
1651: + (lengthOfMatch = jjmatchedPos + 1))));
1652: else
1653: image.append(input_stream.GetSuffix(jjimageLen
1654: + (lengthOfMatch = jjmatchedPos + 1)));
1655: if (stringBuffer.length() == 1) {
1656: literalValue = new Character(charValue);
1657: } else {
1658: literalValue = new String(stringBuffer);
1659: }
1660: break;
1661: case 76:
1662: if (image == null)
1663: image = new StringBuffer(new String(input_stream
1664: .GetSuffix(jjimageLen
1665: + (lengthOfMatch = jjmatchedPos + 1))));
1666: else
1667: image.append(input_stream.GetSuffix(jjimageLen
1668: + (lengthOfMatch = jjmatchedPos + 1)));
1669: literalValue = new Character(charValue);
1670: break;
1671: case 79:
1672: if (image == null)
1673: image = new StringBuffer(new String(input_stream
1674: .GetSuffix(jjimageLen
1675: + (lengthOfMatch = jjmatchedPos + 1))));
1676: else
1677: image.append(input_stream.GetSuffix(jjimageLen
1678: + (lengthOfMatch = jjmatchedPos + 1)));
1679: literalValue = new String(stringBuffer);
1680: break;
1681: case 80:
1682: if (image == null)
1683: image = new StringBuffer(new String(input_stream
1684: .GetSuffix(jjimageLen
1685: + (lengthOfMatch = jjmatchedPos + 1))));
1686: else
1687: image.append(input_stream.GetSuffix(jjimageLen
1688: + (lengthOfMatch = jjmatchedPos + 1)));
1689: literalValue = makeInt();
1690: break;
1691: case 81:
1692: if (image == null)
1693: image = new StringBuffer(new String(input_stream
1694: .GetSuffix(jjimageLen
1695: + (lengthOfMatch = jjmatchedPos + 1))));
1696: else
1697: image.append(input_stream.GetSuffix(jjimageLen
1698: + (lengthOfMatch = jjmatchedPos + 1)));
1699: literalValue = makeFloat();
1700: break;
1701: default:
1702: break;
1703: }
1704: }
1705: }
|