0001: // $ANTLR 2.7.5 (20050128): "Common.g" -> "CommonLexer.java"$
0002:
0003: package com.jofti.parser;
0004:
0005: import java.io.InputStream;
0006: import antlr.TokenStreamException;
0007: import antlr.TokenStreamIOException;
0008: import antlr.TokenStreamRecognitionException;
0009: import antlr.CharStreamException;
0010: import antlr.CharStreamIOException;
0011: import antlr.ANTLRException;
0012: import java.io.Reader;
0013: import java.util.Hashtable;
0014: import antlr.CharScanner;
0015: import antlr.InputBuffer;
0016: import antlr.ByteBuffer;
0017: import antlr.CharBuffer;
0018: import antlr.Token;
0019: import antlr.CommonToken;
0020: import antlr.RecognitionException;
0021: import antlr.NoViableAltForCharException;
0022: import antlr.MismatchedCharException;
0023: import antlr.TokenStream;
0024: import antlr.ANTLRHashString;
0025: import antlr.LexerSharedInputState;
0026: import antlr.collections.impl.BitSet;
0027: import antlr.SemanticException;
0028:
0029: public class CommonLexer extends antlr.CharScanner implements
0030: CommonLexerTokenTypes, TokenStream {
0031: public CommonLexer(InputStream in) {
0032: this (new ByteBuffer(in));
0033: }
0034:
0035: public CommonLexer(Reader in) {
0036: this (new CharBuffer(in));
0037: }
0038:
0039: public CommonLexer(InputBuffer ib) {
0040: this (new LexerSharedInputState(ib));
0041: }
0042:
0043: public CommonLexer(LexerSharedInputState state) {
0044: super (state);
0045: caseSensitiveLiterals = false;
0046: setCaseSensitive(false);
0047: literals = new Hashtable();
0048: literals.put(new ANTLRHashString("select", this ),
0049: new Integer(4));
0050: literals
0051: .put(new ANTLRHashString("like", this ), new Integer(13));
0052: literals.put(new ANTLRHashString("namespace", this ),
0053: new Integer(15));
0054: literals.put(new ANTLRHashString("asc", this ), new Integer(18));
0055: literals.put(new ANTLRHashString("in", this ), new Integer(14));
0056: literals.put(new ANTLRHashString("or", this ), new Integer(8));
0057: literals
0058: .put(new ANTLRHashString("from", this ), new Integer(11));
0059: literals
0060: .put(new ANTLRHashString("desc", this ), new Integer(19));
0061: literals.put(new ANTLRHashString("by", this ), new Integer(17));
0062: literals.put(new ANTLRHashString("and", this ), new Integer(7));
0063: literals.put(new ANTLRHashString("not", this ), new Integer(9));
0064: literals.put(new ANTLRHashString("as", this ), new Integer(6));
0065: literals.put(new ANTLRHashString("value", this ),
0066: new Integer(10));
0067: literals.put(new ANTLRHashString("is", this ), new Integer(12));
0068: literals.put(new ANTLRHashString("order", this ),
0069: new Integer(16));
0070: literals
0071: .put(new ANTLRHashString("where", this ), new Integer(5));
0072: }
0073:
0074: public Token nextToken() throws TokenStreamException {
0075: Token theRetToken = null;
0076: tryAgain: for (;;) {
0077: Token _token = null;
0078: int _ttype = Token.INVALID_TYPE;
0079: resetText();
0080: try { // for char stream error handling
0081: try { // for lexical error handling
0082: switch (LA(1)) {
0083: case ',': {
0084: mCOMMA(true);
0085: theRetToken = _returnToken;
0086: break;
0087: }
0088: case ';': {
0089: mSEMICOLON(true);
0090: theRetToken = _returnToken;
0091: break;
0092: }
0093: case '(': {
0094: mLPAREN(true);
0095: theRetToken = _returnToken;
0096: break;
0097: }
0098: case ')': {
0099: mRPAREN(true);
0100: theRetToken = _returnToken;
0101: break;
0102: }
0103: case '\\': {
0104: mBACKSLASH(true);
0105: theRetToken = _returnToken;
0106: break;
0107: }
0108: case '/': {
0109: mFORWARDSLASH(true);
0110: theRetToken = _returnToken;
0111: break;
0112: }
0113: case '-': {
0114: mDASH(true);
0115: theRetToken = _returnToken;
0116: break;
0117: }
0118: case '+': {
0119: mPLUS(true);
0120: theRetToken = _returnToken;
0121: break;
0122: }
0123: case '=': {
0124: mASSIGNEQUAL(true);
0125: theRetToken = _returnToken;
0126: break;
0127: }
0128: case '$':
0129: case '.':
0130: case '0':
0131: case '1':
0132: case '2':
0133: case '3':
0134: case '4':
0135: case '5':
0136: case '6':
0137: case '7':
0138: case '8':
0139: case '9':
0140: case ':':
0141: case '?':
0142: case '[':
0143: case ']':
0144: case '_':
0145: case 'a':
0146: case 'b':
0147: case 'c':
0148: case 'd':
0149: case 'e':
0150: case 'f':
0151: case 'g':
0152: case 'h':
0153: case 'i':
0154: case 'j':
0155: case 'k':
0156: case 'l':
0157: case 'm':
0158: case 'n':
0159: case 'o':
0160: case 'p':
0161: case 'q':
0162: case 'r':
0163: case 's':
0164: case 't':
0165: case 'u':
0166: case 'v':
0167: case 'w':
0168: case 'x':
0169: case 'y':
0170: case 'z': {
0171: mIdentifier(true);
0172: theRetToken = _returnToken;
0173: break;
0174: }
0175: case '\t':
0176: case '\n':
0177: case '\u000c':
0178: case '\r':
0179: case ' ': {
0180: mWS(true);
0181: theRetToken = _returnToken;
0182: break;
0183: }
0184: default:
0185: if ((LA(1) == '<') && (LA(2) == '>')) {
0186: mNOTEQUAL1(true);
0187: theRetToken = _returnToken;
0188: } else if ((LA(1) == '!') && (LA(2) == '=')) {
0189: mNOTEQUAL2(true);
0190: theRetToken = _returnToken;
0191: } else if ((LA(1) == '<') && (LA(2) == '=')) {
0192: mLESSTHANOREQUALTO1(true);
0193: theRetToken = _returnToken;
0194: } else if ((LA(1) == '!') && (LA(2) == '>')) {
0195: mLESSTHANOREQUALTO2(true);
0196: theRetToken = _returnToken;
0197: } else if ((LA(1) == '>') && (LA(2) == '=')) {
0198: mGREATERTHANOREQUALTO1(true);
0199: theRetToken = _returnToken;
0200: } else if ((LA(1) == '!') && (LA(2) == '<')) {
0201: mGREATERTHANOREQUALTO2(true);
0202: theRetToken = _returnToken;
0203: } else if ((LA(1) == '\'')
0204: && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) {
0205: mPredicateIdentifier(true);
0206: theRetToken = _returnToken;
0207: } else if ((LA(1) == '\'') && (true)) {
0208: mSINGLE_QUOTE(true);
0209: theRetToken = _returnToken;
0210: } else if ((LA(1) == '<') && (true)) {
0211: mLESSTHAN(true);
0212: theRetToken = _returnToken;
0213: } else if ((LA(1) == '>') && (true)) {
0214: mGREATERTHAN(true);
0215: theRetToken = _returnToken;
0216: } else {
0217: if (LA(1) == EOF_CHAR) {
0218: uponEOF();
0219: _returnToken = makeToken(Token.EOF_TYPE);
0220: } else {
0221: throw new NoViableAltForCharException(
0222: (char) LA(1), getFilename(),
0223: getLine(), getColumn());
0224: }
0225: }
0226: }
0227: if (_returnToken == null)
0228: continue tryAgain; // found SKIP token
0229: _ttype = _returnToken.getType();
0230: _ttype = testLiteralsTable(_ttype);
0231: _returnToken.setType(_ttype);
0232: return _returnToken;
0233: } catch (RecognitionException e) {
0234: throw new TokenStreamRecognitionException(e);
0235: }
0236: } catch (CharStreamException cse) {
0237: if (cse instanceof CharStreamIOException) {
0238: throw new TokenStreamIOException(
0239: ((CharStreamIOException) cse).io);
0240: } else {
0241: throw new TokenStreamException(cse.getMessage());
0242: }
0243: }
0244: }
0245: }
0246:
0247: protected final void mPACKAGE_SEPERATOR(boolean _createToken)
0248: throws RecognitionException, CharStreamException,
0249: TokenStreamException {
0250: int _ttype;
0251: Token _token = null;
0252: int _begin = text.length();
0253: _ttype = PACKAGE_SEPERATOR;
0254: int _saveIndex;
0255:
0256: match('.');
0257: if (_createToken && _token == null && _ttype != Token.SKIP) {
0258: _token = makeToken(_ttype);
0259: _token.setText(new String(text.getBuffer(), _begin, text
0260: .length()
0261: - _begin));
0262: }
0263: _returnToken = _token;
0264: }
0265:
0266: public final void mCOMMA(boolean _createToken)
0267: throws RecognitionException, CharStreamException,
0268: TokenStreamException {
0269: int _ttype;
0270: Token _token = null;
0271: int _begin = text.length();
0272: _ttype = COMMA;
0273: int _saveIndex;
0274:
0275: match(',');
0276: if (_createToken && _token == null && _ttype != Token.SKIP) {
0277: _token = makeToken(_ttype);
0278: _token.setText(new String(text.getBuffer(), _begin, text
0279: .length()
0280: - _begin));
0281: }
0282: _returnToken = _token;
0283: }
0284:
0285: public final void mSEMICOLON(boolean _createToken)
0286: throws RecognitionException, CharStreamException,
0287: TokenStreamException {
0288: int _ttype;
0289: Token _token = null;
0290: int _begin = text.length();
0291: _ttype = SEMICOLON;
0292: int _saveIndex;
0293:
0294: match(';');
0295: if (_createToken && _token == null && _ttype != Token.SKIP) {
0296: _token = makeToken(_ttype);
0297: _token.setText(new String(text.getBuffer(), _begin, text
0298: .length()
0299: - _begin));
0300: }
0301: _returnToken = _token;
0302: }
0303:
0304: public final void mLPAREN(boolean _createToken)
0305: throws RecognitionException, CharStreamException,
0306: TokenStreamException {
0307: int _ttype;
0308: Token _token = null;
0309: int _begin = text.length();
0310: _ttype = LPAREN;
0311: int _saveIndex;
0312:
0313: match('(');
0314: if (_createToken && _token == null && _ttype != Token.SKIP) {
0315: _token = makeToken(_ttype);
0316: _token.setText(new String(text.getBuffer(), _begin, text
0317: .length()
0318: - _begin));
0319: }
0320: _returnToken = _token;
0321: }
0322:
0323: public final void mRPAREN(boolean _createToken)
0324: throws RecognitionException, CharStreamException,
0325: TokenStreamException {
0326: int _ttype;
0327: Token _token = null;
0328: int _begin = text.length();
0329: _ttype = RPAREN;
0330: int _saveIndex;
0331:
0332: match(')');
0333: if (_createToken && _token == null && _ttype != Token.SKIP) {
0334: _token = makeToken(_ttype);
0335: _token.setText(new String(text.getBuffer(), _begin, text
0336: .length()
0337: - _begin));
0338: }
0339: _returnToken = _token;
0340: }
0341:
0342: public final void mSINGLE_QUOTE(boolean _createToken)
0343: throws RecognitionException, CharStreamException,
0344: TokenStreamException {
0345: int _ttype;
0346: Token _token = null;
0347: int _begin = text.length();
0348: _ttype = SINGLE_QUOTE;
0349: int _saveIndex;
0350:
0351: match('\'');
0352: if (_createToken && _token == null && _ttype != Token.SKIP) {
0353: _token = makeToken(_ttype);
0354: _token.setText(new String(text.getBuffer(), _begin, text
0355: .length()
0356: - _begin));
0357: }
0358: _returnToken = _token;
0359: }
0360:
0361: public final void mBACKSLASH(boolean _createToken)
0362: throws RecognitionException, CharStreamException,
0363: TokenStreamException {
0364: int _ttype;
0365: Token _token = null;
0366: int _begin = text.length();
0367: _ttype = BACKSLASH;
0368: int _saveIndex;
0369:
0370: match('\\');
0371: if (_createToken && _token == null && _ttype != Token.SKIP) {
0372: _token = makeToken(_ttype);
0373: _token.setText(new String(text.getBuffer(), _begin, text
0374: .length()
0375: - _begin));
0376: }
0377: _returnToken = _token;
0378: }
0379:
0380: public final void mFORWARDSLASH(boolean _createToken)
0381: throws RecognitionException, CharStreamException,
0382: TokenStreamException {
0383: int _ttype;
0384: Token _token = null;
0385: int _begin = text.length();
0386: _ttype = FORWARDSLASH;
0387: int _saveIndex;
0388:
0389: match('/');
0390: if (_createToken && _token == null && _ttype != Token.SKIP) {
0391: _token = makeToken(_ttype);
0392: _token.setText(new String(text.getBuffer(), _begin, text
0393: .length()
0394: - _begin));
0395: }
0396: _returnToken = _token;
0397: }
0398:
0399: public final void mDASH(boolean _createToken)
0400: throws RecognitionException, CharStreamException,
0401: TokenStreamException {
0402: int _ttype;
0403: Token _token = null;
0404: int _begin = text.length();
0405: _ttype = DASH;
0406: int _saveIndex;
0407:
0408: match('-');
0409: if (_createToken && _token == null && _ttype != Token.SKIP) {
0410: _token = makeToken(_ttype);
0411: _token.setText(new String(text.getBuffer(), _begin, text
0412: .length()
0413: - _begin));
0414: }
0415: _returnToken = _token;
0416: }
0417:
0418: public final void mPLUS(boolean _createToken)
0419: throws RecognitionException, CharStreamException,
0420: TokenStreamException {
0421: int _ttype;
0422: Token _token = null;
0423: int _begin = text.length();
0424: _ttype = PLUS;
0425: int _saveIndex;
0426:
0427: match("+");
0428: if (_createToken && _token == null && _ttype != Token.SKIP) {
0429: _token = makeToken(_ttype);
0430: _token.setText(new String(text.getBuffer(), _begin, text
0431: .length()
0432: - _begin));
0433: }
0434: _returnToken = _token;
0435: }
0436:
0437: public final void mASSIGNEQUAL(boolean _createToken)
0438: throws RecognitionException, CharStreamException,
0439: TokenStreamException {
0440: int _ttype;
0441: Token _token = null;
0442: int _begin = text.length();
0443: _ttype = ASSIGNEQUAL;
0444: int _saveIndex;
0445:
0446: match('=');
0447: if (_createToken && _token == null && _ttype != Token.SKIP) {
0448: _token = makeToken(_ttype);
0449: _token.setText(new String(text.getBuffer(), _begin, text
0450: .length()
0451: - _begin));
0452: }
0453: _returnToken = _token;
0454: }
0455:
0456: public final void mNOTEQUAL1(boolean _createToken)
0457: throws RecognitionException, CharStreamException,
0458: TokenStreamException {
0459: int _ttype;
0460: Token _token = null;
0461: int _begin = text.length();
0462: _ttype = NOTEQUAL1;
0463: int _saveIndex;
0464:
0465: match("<>");
0466: if (_createToken && _token == null && _ttype != Token.SKIP) {
0467: _token = makeToken(_ttype);
0468: _token.setText(new String(text.getBuffer(), _begin, text
0469: .length()
0470: - _begin));
0471: }
0472: _returnToken = _token;
0473: }
0474:
0475: public final void mNOTEQUAL2(boolean _createToken)
0476: throws RecognitionException, CharStreamException,
0477: TokenStreamException {
0478: int _ttype;
0479: Token _token = null;
0480: int _begin = text.length();
0481: _ttype = NOTEQUAL2;
0482: int _saveIndex;
0483:
0484: match("!=");
0485: if (_createToken && _token == null && _ttype != Token.SKIP) {
0486: _token = makeToken(_ttype);
0487: _token.setText(new String(text.getBuffer(), _begin, text
0488: .length()
0489: - _begin));
0490: }
0491: _returnToken = _token;
0492: }
0493:
0494: public final void mLESSTHANOREQUALTO1(boolean _createToken)
0495: throws RecognitionException, CharStreamException,
0496: TokenStreamException {
0497: int _ttype;
0498: Token _token = null;
0499: int _begin = text.length();
0500: _ttype = LESSTHANOREQUALTO1;
0501: int _saveIndex;
0502:
0503: match("<=");
0504: if (_createToken && _token == null && _ttype != Token.SKIP) {
0505: _token = makeToken(_ttype);
0506: _token.setText(new String(text.getBuffer(), _begin, text
0507: .length()
0508: - _begin));
0509: }
0510: _returnToken = _token;
0511: }
0512:
0513: public final void mLESSTHANOREQUALTO2(boolean _createToken)
0514: throws RecognitionException, CharStreamException,
0515: TokenStreamException {
0516: int _ttype;
0517: Token _token = null;
0518: int _begin = text.length();
0519: _ttype = LESSTHANOREQUALTO2;
0520: int _saveIndex;
0521:
0522: match("!>");
0523: if (_createToken && _token == null && _ttype != Token.SKIP) {
0524: _token = makeToken(_ttype);
0525: _token.setText(new String(text.getBuffer(), _begin, text
0526: .length()
0527: - _begin));
0528: }
0529: _returnToken = _token;
0530: }
0531:
0532: public final void mLESSTHAN(boolean _createToken)
0533: throws RecognitionException, CharStreamException,
0534: TokenStreamException {
0535: int _ttype;
0536: Token _token = null;
0537: int _begin = text.length();
0538: _ttype = LESSTHAN;
0539: int _saveIndex;
0540:
0541: match("<");
0542: if (_createToken && _token == null && _ttype != Token.SKIP) {
0543: _token = makeToken(_ttype);
0544: _token.setText(new String(text.getBuffer(), _begin, text
0545: .length()
0546: - _begin));
0547: }
0548: _returnToken = _token;
0549: }
0550:
0551: public final void mGREATERTHANOREQUALTO1(boolean _createToken)
0552: throws RecognitionException, CharStreamException,
0553: TokenStreamException {
0554: int _ttype;
0555: Token _token = null;
0556: int _begin = text.length();
0557: _ttype = GREATERTHANOREQUALTO1;
0558: int _saveIndex;
0559:
0560: match(">=");
0561: if (_createToken && _token == null && _ttype != Token.SKIP) {
0562: _token = makeToken(_ttype);
0563: _token.setText(new String(text.getBuffer(), _begin, text
0564: .length()
0565: - _begin));
0566: }
0567: _returnToken = _token;
0568: }
0569:
0570: public final void mGREATERTHANOREQUALTO2(boolean _createToken)
0571: throws RecognitionException, CharStreamException,
0572: TokenStreamException {
0573: int _ttype;
0574: Token _token = null;
0575: int _begin = text.length();
0576: _ttype = GREATERTHANOREQUALTO2;
0577: int _saveIndex;
0578:
0579: match("!<");
0580: if (_createToken && _token == null && _ttype != Token.SKIP) {
0581: _token = makeToken(_ttype);
0582: _token.setText(new String(text.getBuffer(), _begin, text
0583: .length()
0584: - _begin));
0585: }
0586: _returnToken = _token;
0587: }
0588:
0589: public final void mGREATERTHAN(boolean _createToken)
0590: throws RecognitionException, CharStreamException,
0591: TokenStreamException {
0592: int _ttype;
0593: Token _token = null;
0594: int _begin = text.length();
0595: _ttype = GREATERTHAN;
0596: int _saveIndex;
0597:
0598: match(">");
0599: if (_createToken && _token == null && _ttype != Token.SKIP) {
0600: _token = makeToken(_ttype);
0601: _token.setText(new String(text.getBuffer(), _begin, text
0602: .length()
0603: - _begin));
0604: }
0605: _returnToken = _token;
0606: }
0607:
0608: protected final void mLBRACKET(boolean _createToken)
0609: throws RecognitionException, CharStreamException,
0610: TokenStreamException {
0611: int _ttype;
0612: Token _token = null;
0613: int _begin = text.length();
0614: _ttype = LBRACKET;
0615: int _saveIndex;
0616:
0617: match('[');
0618: if (_createToken && _token == null && _ttype != Token.SKIP) {
0619: _token = makeToken(_ttype);
0620: _token.setText(new String(text.getBuffer(), _begin, text
0621: .length()
0622: - _begin));
0623: }
0624: _returnToken = _token;
0625: }
0626:
0627: protected final void mRBRACKET(boolean _createToken)
0628: throws RecognitionException, CharStreamException,
0629: TokenStreamException {
0630: int _ttype;
0631: Token _token = null;
0632: int _begin = text.length();
0633: _ttype = RBRACKET;
0634: int _saveIndex;
0635:
0636: match(']');
0637: if (_createToken && _token == null && _ttype != Token.SKIP) {
0638: _token = makeToken(_ttype);
0639: _token.setText(new String(text.getBuffer(), _begin, text
0640: .length()
0641: - _begin));
0642: }
0643: _returnToken = _token;
0644: }
0645:
0646: protected final void mLetter(boolean _createToken)
0647: throws RecognitionException, CharStreamException,
0648: TokenStreamException {
0649: int _ttype;
0650: Token _token = null;
0651: int _begin = text.length();
0652: _ttype = Letter;
0653: int _saveIndex;
0654:
0655: switch (LA(1)) {
0656: case 'a':
0657: case 'b':
0658: case 'c':
0659: case 'd':
0660: case 'e':
0661: case 'f':
0662: case 'g':
0663: case 'h':
0664: case 'i':
0665: case 'j':
0666: case 'k':
0667: case 'l':
0668: case 'm':
0669: case 'n':
0670: case 'o':
0671: case 'p':
0672: case 'q':
0673: case 'r':
0674: case 's':
0675: case 't':
0676: case 'u':
0677: case 'v':
0678: case 'w':
0679: case 'x':
0680: case 'y':
0681: case 'z': {
0682: matchRange('a', 'z');
0683: break;
0684: }
0685: case '_': {
0686: match('_');
0687: break;
0688: }
0689: case '$': {
0690: match('$');
0691: break;
0692: }
0693: case ':': {
0694: match(':');
0695: break;
0696: }
0697: case '?': {
0698: match('?');
0699: break;
0700: }
0701: default: {
0702: throw new NoViableAltForCharException((char) LA(1),
0703: getFilename(), getLine(), getColumn());
0704: }
0705: }
0706: if (_createToken && _token == null && _ttype != Token.SKIP) {
0707: _token = makeToken(_ttype);
0708: _token.setText(new String(text.getBuffer(), _begin, text
0709: .length()
0710: - _begin));
0711: }
0712: _returnToken = _token;
0713: }
0714:
0715: protected final void mDigit(boolean _createToken)
0716: throws RecognitionException, CharStreamException,
0717: TokenStreamException {
0718: int _ttype;
0719: Token _token = null;
0720: int _begin = text.length();
0721: _ttype = Digit;
0722: int _saveIndex;
0723:
0724: matchRange('0', '9');
0725: if (_createToken && _token == null && _ttype != Token.SKIP) {
0726: _token = makeToken(_ttype);
0727: _token.setText(new String(text.getBuffer(), _begin, text
0728: .length()
0729: - _begin));
0730: }
0731: _returnToken = _token;
0732: }
0733:
0734: protected final void mSPACE(boolean _createToken)
0735: throws RecognitionException, CharStreamException,
0736: TokenStreamException {
0737: int _ttype;
0738: Token _token = null;
0739: int _begin = text.length();
0740: _ttype = SPACE;
0741: int _saveIndex;
0742:
0743: match(' ');
0744: if (_createToken && _token == null && _ttype != Token.SKIP) {
0745: _token = makeToken(_ttype);
0746: _token.setText(new String(text.getBuffer(), _begin, text
0747: .length()
0748: - _begin));
0749: }
0750: _returnToken = _token;
0751: }
0752:
0753: public final void mIdentifier(boolean _createToken)
0754: throws RecognitionException, CharStreamException,
0755: TokenStreamException {
0756: int _ttype;
0757: Token _token = null;
0758: int _begin = text.length();
0759: _ttype = Identifier;
0760: int _saveIndex;
0761:
0762: {
0763: int _cnt27 = 0;
0764: _loop27: do {
0765: switch (LA(1)) {
0766: case '$':
0767: case ':':
0768: case '?':
0769: case '_':
0770: case 'a':
0771: case 'b':
0772: case 'c':
0773: case 'd':
0774: case 'e':
0775: case 'f':
0776: case 'g':
0777: case 'h':
0778: case 'i':
0779: case 'j':
0780: case 'k':
0781: case 'l':
0782: case 'm':
0783: case 'n':
0784: case 'o':
0785: case 'p':
0786: case 'q':
0787: case 'r':
0788: case 's':
0789: case 't':
0790: case 'u':
0791: case 'v':
0792: case 'w':
0793: case 'x':
0794: case 'y':
0795: case 'z': {
0796: mLetter(false);
0797: break;
0798: }
0799: case '0':
0800: case '1':
0801: case '2':
0802: case '3':
0803: case '4':
0804: case '5':
0805: case '6':
0806: case '7':
0807: case '8':
0808: case '9': {
0809: mDigit(false);
0810: break;
0811: }
0812: case '.': {
0813: mPACKAGE_SEPERATOR(false);
0814: break;
0815: }
0816: case '[': {
0817: mLBRACKET(false);
0818: break;
0819: }
0820: case ']': {
0821: mRBRACKET(false);
0822: break;
0823: }
0824: default: {
0825: if (_cnt27 >= 1) {
0826: break _loop27;
0827: } else {
0828: throw new NoViableAltForCharException(
0829: (char) LA(1), getFilename(), getLine(),
0830: getColumn());
0831: }
0832: }
0833: }
0834: _cnt27++;
0835: } while (true);
0836: }
0837: if (_createToken && _token == null && _ttype != Token.SKIP) {
0838: _token = makeToken(_ttype);
0839: _token.setText(new String(text.getBuffer(), _begin, text
0840: .length()
0841: - _begin));
0842: }
0843: _returnToken = _token;
0844: }
0845:
0846: protected final void mESC(boolean _createToken)
0847: throws RecognitionException, CharStreamException,
0848: TokenStreamException {
0849: int _ttype;
0850: Token _token = null;
0851: int _begin = text.length();
0852: _ttype = ESC;
0853: int _saveIndex;
0854:
0855: boolean synPredMatched30 = false;
0856: if (((LA(1) == '\\') && (LA(2) == '\'' || LA(2) == '\\'))) {
0857: int _m30 = mark();
0858: synPredMatched30 = true;
0859: inputState.guessing++;
0860: try {
0861: {
0862: match('\\');
0863: }
0864: } catch (RecognitionException pe) {
0865: synPredMatched30 = false;
0866: }
0867: rewind(_m30);
0868: inputState.guessing--;
0869: }
0870: if (synPredMatched30) {
0871: _saveIndex = text.length();
0872: match('\\');
0873: text.setLength(_saveIndex);
0874: {
0875: switch (LA(1)) {
0876: case '\'': {
0877: match('\'');
0878: break;
0879: }
0880: case '\\': {
0881: match('\\');
0882: break;
0883: }
0884: default: {
0885: throw new NoViableAltForCharException((char) LA(1),
0886: getFilename(), getLine(), getColumn());
0887: }
0888: }
0889: }
0890: } else if ((LA(1) == '\\')
0891: && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) {
0892: match('\\');
0893: } else {
0894: throw new NoViableAltForCharException((char) LA(1),
0895: getFilename(), getLine(), getColumn());
0896: }
0897:
0898: if (_createToken && _token == null && _ttype != Token.SKIP) {
0899: _token = makeToken(_ttype);
0900: _token.setText(new String(text.getBuffer(), _begin, text
0901: .length()
0902: - _begin));
0903: }
0904: _returnToken = _token;
0905: }
0906:
0907: protected final void mNONESC(boolean _createToken)
0908: throws RecognitionException, CharStreamException,
0909: TokenStreamException {
0910: int _ttype;
0911: Token _token = null;
0912: int _begin = text.length();
0913: _ttype = NONESC;
0914: int _saveIndex;
0915:
0916: {
0917: match(_tokenSet_0);
0918: }
0919: if (_createToken && _token == null && _ttype != Token.SKIP) {
0920: _token = makeToken(_ttype);
0921: _token.setText(new String(text.getBuffer(), _begin, text
0922: .length()
0923: - _begin));
0924: }
0925: _returnToken = _token;
0926: }
0927:
0928: public final void mPredicateIdentifier(boolean _createToken)
0929: throws RecognitionException, CharStreamException,
0930: TokenStreamException {
0931: int _ttype;
0932: Token _token = null;
0933: int _begin = text.length();
0934: _ttype = PredicateIdentifier;
0935: int _saveIndex;
0936:
0937: _saveIndex = text.length();
0938: mSINGLE_QUOTE(false);
0939: text.setLength(_saveIndex);
0940: {
0941: _loop36: do {
0942: switch (LA(1)) {
0943: case '\\': {
0944: mESC(false);
0945: break;
0946: }
0947: case '\u0000':
0948: case '\u0001':
0949: case '\u0002':
0950: case '\u0003':
0951: case '\u0004':
0952: case '\u0005':
0953: case '\u0006':
0954: case '\u0007':
0955: case '\u0008':
0956: case '\t':
0957: case '\n':
0958: case '\u000b':
0959: case '\u000c':
0960: case '\r':
0961: case '\u000e':
0962: case '\u000f':
0963: case '\u0010':
0964: case '\u0011':
0965: case '\u0012':
0966: case '\u0013':
0967: case '\u0014':
0968: case '\u0015':
0969: case '\u0016':
0970: case '\u0017':
0971: case '\u0018':
0972: case '\u0019':
0973: case '\u001a':
0974: case '\u001b':
0975: case '\u001c':
0976: case '\u001d':
0977: case '\u001e':
0978: case '\u001f':
0979: case ' ':
0980: case '!':
0981: case '"':
0982: case '#':
0983: case '$':
0984: case '%':
0985: case '&':
0986: case '(':
0987: case ')':
0988: case '*':
0989: case '+':
0990: case ',':
0991: case '-':
0992: case '.':
0993: case '/':
0994: case '0':
0995: case '1':
0996: case '2':
0997: case '3':
0998: case '4':
0999: case '5':
1000: case '6':
1001: case '7':
1002: case '8':
1003: case '9':
1004: case ':':
1005: case ';':
1006: case '<':
1007: case '=':
1008: case '>':
1009: case '?':
1010: case '@':
1011: case 'A':
1012: case 'B':
1013: case 'C':
1014: case 'D':
1015: case 'E':
1016: case 'F':
1017: case 'G':
1018: case 'H':
1019: case 'I':
1020: case 'J':
1021: case 'K':
1022: case 'L':
1023: case 'M':
1024: case 'N':
1025: case 'O':
1026: case 'P':
1027: case 'Q':
1028: case 'R':
1029: case 'S':
1030: case 'T':
1031: case 'U':
1032: case 'V':
1033: case 'W':
1034: case 'X':
1035: case 'Y':
1036: case 'Z':
1037: case '[':
1038: case ']':
1039: case '^':
1040: case '_':
1041: case '`':
1042: case 'a':
1043: case 'b':
1044: case 'c':
1045: case 'd':
1046: case 'e':
1047: case 'f':
1048: case 'g':
1049: case 'h':
1050: case 'i':
1051: case 'j':
1052: case 'k':
1053: case 'l':
1054: case 'm':
1055: case 'n':
1056: case 'o':
1057: case 'p':
1058: case 'q':
1059: case 'r':
1060: case 's':
1061: case 't':
1062: case 'u':
1063: case 'v':
1064: case 'w':
1065: case 'x':
1066: case 'y':
1067: case 'z':
1068: case '{':
1069: case '|':
1070: case '}':
1071: case '~':
1072: case '\u007f': {
1073: mNONESC(false);
1074: break;
1075: }
1076: default: {
1077: break _loop36;
1078: }
1079: }
1080: } while (true);
1081: }
1082: _saveIndex = text.length();
1083: mSINGLE_QUOTE(false);
1084: text.setLength(_saveIndex);
1085: if (_createToken && _token == null && _ttype != Token.SKIP) {
1086: _token = makeToken(_ttype);
1087: _token.setText(new String(text.getBuffer(), _begin, text
1088: .length()
1089: - _begin));
1090: }
1091: _returnToken = _token;
1092: }
1093:
1094: public final void mWS(boolean _createToken)
1095: throws RecognitionException, CharStreamException,
1096: TokenStreamException {
1097: int _ttype;
1098: Token _token = null;
1099: int _begin = text.length();
1100: _ttype = WS;
1101: int _saveIndex;
1102:
1103: {
1104: int _cnt40 = 0;
1105: _loop40: do {
1106: switch (LA(1)) {
1107: case ' ': {
1108: mSPACE(false);
1109: break;
1110: }
1111: case '\t': {
1112: match('\t');
1113: break;
1114: }
1115: case '\u000c': {
1116: match('\f');
1117: break;
1118: }
1119: case '\n':
1120: case '\r': {
1121: {
1122: if ((LA(1) == '\r') && (LA(2) == '\n')) {
1123: match("\r\n");
1124: } else if ((LA(1) == '\r') && (true)) {
1125: match('\r');
1126: } else if ((LA(1) == '\n')) {
1127: match('\n');
1128: } else {
1129: throw new NoViableAltForCharException(
1130: (char) LA(1), getFilename(),
1131: getLine(), getColumn());
1132: }
1133:
1134: }
1135: if (inputState.guessing == 0) {
1136: newline();
1137: }
1138: break;
1139: }
1140: default: {
1141: if (_cnt40 >= 1) {
1142: break _loop40;
1143: } else {
1144: throw new NoViableAltForCharException(
1145: (char) LA(1), getFilename(), getLine(),
1146: getColumn());
1147: }
1148: }
1149: }
1150: _cnt40++;
1151: } while (true);
1152: }
1153: if (inputState.guessing == 0) {
1154: _ttype = Token.SKIP;
1155: }
1156: if (_createToken && _token == null && _ttype != Token.SKIP) {
1157: _token = makeToken(_ttype);
1158: _token.setText(new String(text.getBuffer(), _begin, text
1159: .length()
1160: - _begin));
1161: }
1162: _returnToken = _token;
1163: }
1164:
1165: private static final long[] mk_tokenSet_0() {
1166: long[] data = { -549755813889L, -268435457L, 0L, 0L };
1167: return data;
1168: }
1169:
1170: public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
1171:
1172: }
|