0001: // $ANTLR 2.7.2: "java.g" -> "JavaLexer.java"$
0002:
0003: package org.codehaus.groovy.antlr.java;
0004:
0005: import org.codehaus.groovy.antlr.*;
0006: import org.codehaus.groovy.antlr.parser.*;
0007: import java.util.*;
0008: import java.io.InputStream;
0009: import java.io.Reader;
0010: import antlr.InputBuffer;
0011: import antlr.LexerSharedInputState;
0012:
0013: import java.io.InputStream;
0014: import antlr.TokenStreamException;
0015: import antlr.TokenStreamIOException;
0016: import antlr.TokenStreamRecognitionException;
0017: import antlr.CharStreamException;
0018: import antlr.CharStreamIOException;
0019: import antlr.ANTLRException;
0020: import java.io.Reader;
0021: import java.util.Hashtable;
0022: import antlr.CharScanner;
0023: import antlr.InputBuffer;
0024: import antlr.ByteBuffer;
0025: import antlr.CharBuffer;
0026: import antlr.Token;
0027: import antlr.CommonToken;
0028: import antlr.RecognitionException;
0029: import antlr.NoViableAltForCharException;
0030: import antlr.MismatchedCharException;
0031: import antlr.TokenStream;
0032: import antlr.ANTLRHashString;
0033: import antlr.LexerSharedInputState;
0034: import antlr.collections.impl.BitSet;
0035: import antlr.SemanticException;
0036:
0037: public class JavaLexer extends antlr.CharScanner implements
0038: JavaTokenTypes, TokenStream {
0039:
0040: protected static final int SCS_TYPE = 3, SCS_VAL = 4, SCS_LIT = 8,
0041: SCS_LIMIT = 16;
0042: protected static final int SCS_SQ_TYPE = 0, SCS_TQ_TYPE = 1,
0043: SCS_RE_TYPE = 2;
0044: protected int stringCtorState = 0; // hack string and regexp constructor boundaries
0045: protected int lastSigTokenType = EOF; // last returned non-whitespace token
0046:
0047: /** flag for enabling the "assert" keyword */
0048: private boolean assertEnabled = true;
0049: /** flag for enabling the "enum" keyword */
0050: private boolean enumEnabled = true;
0051: /** flag for including whitespace tokens (for IDE preparsing) */
0052: private boolean whitespaceIncluded = false;
0053:
0054: /** Enable the "assert" keyword */
0055: public void enableAssert(boolean shouldEnable) {
0056: assertEnabled = shouldEnable;
0057: }
0058:
0059: /** Query the "assert" keyword state */
0060: public boolean isAssertEnabled() {
0061: return assertEnabled;
0062: }
0063:
0064: /** Enable the "enum" keyword */
0065: public void enableEnum(boolean shouldEnable) {
0066: enumEnabled = shouldEnable;
0067: }
0068:
0069: /** Query the "enum" keyword state */
0070: public boolean isEnumEnabled() {
0071: return enumEnabled;
0072: }
0073:
0074: /** This is a bit of plumbing which resumes collection of string constructor bodies,
0075: * after an embedded expression has been parsed.
0076: * Usage: new JavaRecognizer(new JavaLexer(in).plumb()).
0077: */
0078: public TokenStream plumb() {
0079: return new TokenStream() {
0080: public Token nextToken() throws TokenStreamException {
0081: if (stringCtorState >= SCS_LIT) {
0082: // This goo is modeled upon the ANTLR code for nextToken:
0083: int quoteType = (stringCtorState & SCS_TYPE);
0084: stringCtorState = 0; // get out of this mode, now
0085: resetText();
0086: /* try {
0087: switch (quoteType) {
0088: case SCS_SQ_TYPE:
0089: //todo: suitable replacement??? mSTRING_CTOR_END(true, false, false);
0090: break;
0091: case SCS_TQ_TYPE:
0092: // mSTRING_CTOR_END(true, false, true);
0093: break;
0094: case SCS_RE_TYPE:
0095: // mREGEXP_CTOR_END(true, false);
0096: break;
0097: default: throw new AssertionError(false);
0098: }
0099: lastSigTokenType = _returnToken.getType();
0100: return _returnToken;
0101: }*//* catch (RecognitionException e) {
0102: throw new TokenStreamRecognitionException(e);
0103: }*//*catch (CharStreamException cse) {
0104: if ( cse instanceof CharStreamIOException ) {
0105: throw new TokenStreamIOException(((CharStreamIOException)cse).io);
0106: }
0107: else {
0108: throw new TokenStreamException(cse.getMessage());
0109: }
0110: }*/
0111: }
0112: Token token = JavaLexer.this .nextToken();
0113: int lasttype = token.getType();
0114: if (whitespaceIncluded) {
0115: switch (lasttype) { // filter out insignificant types
0116: case WS:
0117: case SL_COMMENT:
0118: case ML_COMMENT:
0119: lasttype = lastSigTokenType; // back up!
0120: }
0121: }
0122: lastSigTokenType = lasttype;
0123: return token;
0124: }
0125: };
0126: }
0127:
0128: protected JavaRecognizer parser; // little-used link; TODO: get rid of
0129:
0130: public JavaLexer(InputStream in) {
0131: this (new ByteBuffer(in));
0132: }
0133:
0134: public JavaLexer(Reader in) {
0135: this (new CharBuffer(in));
0136: }
0137:
0138: public JavaLexer(InputBuffer ib) {
0139: this (new LexerSharedInputState(ib));
0140: }
0141:
0142: public JavaLexer(LexerSharedInputState state) {
0143: super (state);
0144: caseSensitiveLiterals = true;
0145: setCaseSensitive(true);
0146: literals = new Hashtable();
0147: literals
0148: .put(new ANTLRHashString("byte", this ), new Integer(79));
0149: literals.put(new ANTLRHashString("public", this ), new Integer(
0150: 88));
0151: literals.put(new ANTLRHashString("case", this ),
0152: new Integer(121));
0153: literals.put(new ANTLRHashString("short", this ),
0154: new Integer(81));
0155: literals.put(new ANTLRHashString("break", this ), new Integer(
0156: 114));
0157: literals.put(new ANTLRHashString("while", this ), new Integer(
0158: 113));
0159: literals
0160: .put(new ANTLRHashString("new", this ), new Integer(157));
0161: literals.put(new ANTLRHashString("instanceof", this ),
0162: new Integer(144));
0163: literals.put(new ANTLRHashString("implements", this ),
0164: new Integer(106));
0165: literals.put(new ANTLRHashString("synchronized", this ),
0166: new Integer(93));
0167: literals.put(new ANTLRHashString("float", this ),
0168: new Integer(83));
0169: literals.put(new ANTLRHashString("package", this ), new Integer(
0170: 61));
0171: literals.put(new ANTLRHashString("return", this ), new Integer(
0172: 116));
0173: literals.put(new ANTLRHashString("throw", this ), new Integer(
0174: 118));
0175: literals.put(new ANTLRHashString("null", this ),
0176: new Integer(156));
0177: literals.put(new ANTLRHashString("threadsafe", this ),
0178: new Integer(92));
0179: literals.put(new ANTLRHashString("protected", this ),
0180: new Integer(89));
0181: literals.put(new ANTLRHashString("class", this ), new Integer(
0182: 101));
0183: literals.put(new ANTLRHashString("throws", this ), new Integer(
0184: 108));
0185: literals.put(new ANTLRHashString("strictfp", this ),
0186: new Integer(40));
0187: literals.put(new ANTLRHashString("super", this ),
0188: new Integer(71));
0189: literals.put(new ANTLRHashString("transient", this ),
0190: new Integer(90));
0191: literals.put(new ANTLRHashString("native", this ), new Integer(
0192: 91));
0193: literals.put(new ANTLRHashString("interface", this ),
0194: new Integer(102));
0195: literals.put(new ANTLRHashString("final", this ),
0196: new Integer(38));
0197: literals.put(new ANTLRHashString("if", this ), new Integer(111));
0198: literals.put(new ANTLRHashString("double", this ), new Integer(
0199: 85));
0200: literals.put(new ANTLRHashString("volatile", this ),
0201: new Integer(94));
0202: literals.put(new ANTLRHashString("assert", this ), new Integer(
0203: 119));
0204: literals.put(new ANTLRHashString("catch", this ), new Integer(
0205: 124));
0206: literals
0207: .put(new ANTLRHashString("try", this ), new Integer(122));
0208: literals.put(new ANTLRHashString("enum", this ),
0209: new Integer(103));
0210: literals.put(new ANTLRHashString("int", this ), new Integer(82));
0211: literals
0212: .put(new ANTLRHashString("for", this ), new Integer(120));
0213: literals.put(new ANTLRHashString("extends", this ), new Integer(
0214: 70));
0215: literals.put(new ANTLRHashString("boolean", this ), new Integer(
0216: 78));
0217: literals
0218: .put(new ANTLRHashString("char", this ), new Integer(80));
0219: literals.put(new ANTLRHashString("private", this ), new Integer(
0220: 87));
0221: literals.put(new ANTLRHashString("default", this ), new Integer(
0222: 105));
0223: literals.put(new ANTLRHashString("false", this ), new Integer(
0224: 155));
0225: literals.put(new ANTLRHashString("this", this ),
0226: new Integer(107));
0227: literals.put(new ANTLRHashString("static", this ), new Integer(
0228: 64));
0229: literals.put(new ANTLRHashString("abstract", this ),
0230: new Integer(39));
0231: literals.put(new ANTLRHashString("continue", this ),
0232: new Integer(115));
0233: literals.put(new ANTLRHashString("finally", this ), new Integer(
0234: 123));
0235: literals.put(new ANTLRHashString("else", this ),
0236: new Integer(112));
0237: literals.put(new ANTLRHashString("import", this ), new Integer(
0238: 63));
0239: literals
0240: .put(new ANTLRHashString("void", this ), new Integer(77));
0241: literals.put(new ANTLRHashString("switch", this ), new Integer(
0242: 117));
0243: literals.put(new ANTLRHashString("true", this ),
0244: new Integer(154));
0245: literals
0246: .put(new ANTLRHashString("long", this ), new Integer(84));
0247: }
0248:
0249: public Token nextToken() throws TokenStreamException {
0250: Token theRetToken = null;
0251: tryAgain: for (;;) {
0252: Token _token = null;
0253: int _ttype = Token.INVALID_TYPE;
0254: resetText();
0255: try { // for char stream error handling
0256: try { // for lexical error handling
0257: switch (LA(1)) {
0258: case '?': {
0259: mQUESTION(true);
0260: theRetToken = _returnToken;
0261: break;
0262: }
0263: case '(': {
0264: mLPAREN(true);
0265: theRetToken = _returnToken;
0266: break;
0267: }
0268: case ')': {
0269: mRPAREN(true);
0270: theRetToken = _returnToken;
0271: break;
0272: }
0273: case '[': {
0274: mLBRACK(true);
0275: theRetToken = _returnToken;
0276: break;
0277: }
0278: case ']': {
0279: mRBRACK(true);
0280: theRetToken = _returnToken;
0281: break;
0282: }
0283: case '{': {
0284: mLCURLY(true);
0285: theRetToken = _returnToken;
0286: break;
0287: }
0288: case '}': {
0289: mRCURLY(true);
0290: theRetToken = _returnToken;
0291: break;
0292: }
0293: case ':': {
0294: mCOLON(true);
0295: theRetToken = _returnToken;
0296: break;
0297: }
0298: case ',': {
0299: mCOMMA(true);
0300: theRetToken = _returnToken;
0301: break;
0302: }
0303: case '~': {
0304: mBNOT(true);
0305: theRetToken = _returnToken;
0306: break;
0307: }
0308: case ';': {
0309: mSEMI(true);
0310: theRetToken = _returnToken;
0311: break;
0312: }
0313: case '\t':
0314: case '\n':
0315: case '\u000c':
0316: case '\r':
0317: case ' ': {
0318: mWS(true);
0319: theRetToken = _returnToken;
0320: break;
0321: }
0322: case '"':
0323: case '\'': {
0324: mSTRING_LITERAL(true);
0325: theRetToken = _returnToken;
0326: break;
0327: }
0328: case '$':
0329: case 'A':
0330: case 'B':
0331: case 'C':
0332: case 'D':
0333: case 'E':
0334: case 'F':
0335: case 'G':
0336: case 'H':
0337: case 'I':
0338: case 'J':
0339: case 'K':
0340: case 'L':
0341: case 'M':
0342: case 'N':
0343: case 'O':
0344: case 'P':
0345: case 'Q':
0346: case 'R':
0347: case 'S':
0348: case 'T':
0349: case 'U':
0350: case 'V':
0351: case 'W':
0352: case 'X':
0353: case 'Y':
0354: case 'Z':
0355: case '_':
0356: case 'a':
0357: case 'b':
0358: case 'c':
0359: case 'd':
0360: case 'e':
0361: case 'f':
0362: case 'g':
0363: case 'h':
0364: case 'i':
0365: case 'j':
0366: case 'k':
0367: case 'l':
0368: case 'm':
0369: case 'n':
0370: case 'o':
0371: case 'p':
0372: case 'q':
0373: case 'r':
0374: case 's':
0375: case 't':
0376: case 'u':
0377: case 'v':
0378: case 'w':
0379: case 'x':
0380: case 'y':
0381: case 'z': {
0382: mIDENT(true);
0383: theRetToken = _returnToken;
0384: break;
0385: }
0386: case '.':
0387: case '0':
0388: case '1':
0389: case '2':
0390: case '3':
0391: case '4':
0392: case '5':
0393: case '6':
0394: case '7':
0395: case '8':
0396: case '9': {
0397: mNUM_INT(true);
0398: theRetToken = _returnToken;
0399: break;
0400: }
0401: case '@': {
0402: mAT(true);
0403: theRetToken = _returnToken;
0404: break;
0405: }
0406: default:
0407: if ((LA(1) == '>') && (LA(2) == '>')
0408: && (LA(3) == '>') && (LA(4) == '=')) {
0409: mBSR_ASSIGN(true);
0410: theRetToken = _returnToken;
0411: } else if ((LA(1) == '>') && (LA(2) == '>')
0412: && (LA(3) == '=')) {
0413: mSR_ASSIGN(true);
0414: theRetToken = _returnToken;
0415: } else if ((LA(1) == '>') && (LA(2) == '>')
0416: && (LA(3) == '>') && (true)) {
0417: mBSR(true);
0418: theRetToken = _returnToken;
0419: } else if ((LA(1) == '<') && (LA(2) == '<')
0420: && (LA(3) == '=')) {
0421: mSL_ASSIGN(true);
0422: theRetToken = _returnToken;
0423: } else if ((LA(1) == '=') && (LA(2) == '=')) {
0424: mEQUAL(true);
0425: theRetToken = _returnToken;
0426: } else if ((LA(1) == '!') && (LA(2) == '=')) {
0427: mNOT_EQUAL(true);
0428: theRetToken = _returnToken;
0429: } else if ((LA(1) == '/') && (LA(2) == '=')) {
0430: mDIV_ASSIGN(true);
0431: theRetToken = _returnToken;
0432: } else if ((LA(1) == '+') && (LA(2) == '=')) {
0433: mPLUS_ASSIGN(true);
0434: theRetToken = _returnToken;
0435: } else if ((LA(1) == '+') && (LA(2) == '+')) {
0436: mINC(true);
0437: theRetToken = _returnToken;
0438: } else if ((LA(1) == '-') && (LA(2) == '=')) {
0439: mMINUS_ASSIGN(true);
0440: theRetToken = _returnToken;
0441: } else if ((LA(1) == '-') && (LA(2) == '-')) {
0442: mDEC(true);
0443: theRetToken = _returnToken;
0444: } else if ((LA(1) == '*') && (LA(2) == '=')) {
0445: mSTAR_ASSIGN(true);
0446: theRetToken = _returnToken;
0447: } else if ((LA(1) == '%') && (LA(2) == '=')) {
0448: mMOD_ASSIGN(true);
0449: theRetToken = _returnToken;
0450: } else if ((LA(1) == '>') && (LA(2) == '>')
0451: && (true)) {
0452: mSR(true);
0453: theRetToken = _returnToken;
0454: } else if ((LA(1) == '>') && (LA(2) == '=')) {
0455: mGE(true);
0456: theRetToken = _returnToken;
0457: } else if ((LA(1) == '<') && (LA(2) == '<')
0458: && (true)) {
0459: mSL(true);
0460: theRetToken = _returnToken;
0461: } else if ((LA(1) == '<') && (LA(2) == '=')) {
0462: mLE(true);
0463: theRetToken = _returnToken;
0464: } else if ((LA(1) == '^') && (LA(2) == '=')) {
0465: mBXOR_ASSIGN(true);
0466: theRetToken = _returnToken;
0467: } else if ((LA(1) == '|') && (LA(2) == '=')) {
0468: mBOR_ASSIGN(true);
0469: theRetToken = _returnToken;
0470: } else if ((LA(1) == '|') && (LA(2) == '|')) {
0471: mLOR(true);
0472: theRetToken = _returnToken;
0473: } else if ((LA(1) == '&') && (LA(2) == '=')) {
0474: mBAND_ASSIGN(true);
0475: theRetToken = _returnToken;
0476: } else if ((LA(1) == '&') && (LA(2) == '&')) {
0477: mLAND(true);
0478: theRetToken = _returnToken;
0479: } else if ((LA(1) == '/') && (LA(2) == '/')) {
0480: mSL_COMMENT(true);
0481: theRetToken = _returnToken;
0482: } else if ((LA(1) == '/') && (LA(2) == '*')) {
0483: mML_COMMENT(true);
0484: theRetToken = _returnToken;
0485: } else if ((LA(1) == '=') && (true)) {
0486: mASSIGN(true);
0487: theRetToken = _returnToken;
0488: } else if ((LA(1) == '!') && (true)) {
0489: mLNOT(true);
0490: theRetToken = _returnToken;
0491: } else if ((LA(1) == '/') && (true)) {
0492: mDIV(true);
0493: theRetToken = _returnToken;
0494: } else if ((LA(1) == '+') && (true)) {
0495: mPLUS(true);
0496: theRetToken = _returnToken;
0497: } else if ((LA(1) == '-') && (true)) {
0498: mMINUS(true);
0499: theRetToken = _returnToken;
0500: } else if ((LA(1) == '*') && (true)) {
0501: mSTAR(true);
0502: theRetToken = _returnToken;
0503: } else if ((LA(1) == '%') && (true)) {
0504: mMOD(true);
0505: theRetToken = _returnToken;
0506: } else if ((LA(1) == '>') && (true)) {
0507: mGT(true);
0508: theRetToken = _returnToken;
0509: } else if ((LA(1) == '<') && (true)) {
0510: mLT(true);
0511: theRetToken = _returnToken;
0512: } else if ((LA(1) == '^') && (true)) {
0513: mBXOR(true);
0514: theRetToken = _returnToken;
0515: } else if ((LA(1) == '|') && (true)) {
0516: mBOR(true);
0517: theRetToken = _returnToken;
0518: } else if ((LA(1) == '&') && (true)) {
0519: mBAND(true);
0520: theRetToken = _returnToken;
0521: } else {
0522: if (LA(1) == EOF_CHAR) {
0523: uponEOF();
0524: _returnToken = makeToken(Token.EOF_TYPE);
0525: } else {
0526: throw new NoViableAltForCharException(
0527: (char) LA(1), getFilename(),
0528: getLine(), getColumn());
0529: }
0530: }
0531: }
0532: if (_returnToken == null)
0533: continue tryAgain; // found SKIP token
0534: _ttype = _returnToken.getType();
0535: _returnToken.setType(_ttype);
0536: return _returnToken;
0537: } catch (RecognitionException e) {
0538: throw new TokenStreamRecognitionException(e);
0539: }
0540: } catch (CharStreamException cse) {
0541: if (cse instanceof CharStreamIOException) {
0542: throw new TokenStreamIOException(
0543: ((CharStreamIOException) cse).io);
0544: } else {
0545: throw new TokenStreamException(cse.getMessage());
0546: }
0547: }
0548: }
0549: }
0550:
0551: public final void mQUESTION(boolean _createToken)
0552: throws RecognitionException, CharStreamException,
0553: TokenStreamException {
0554: int _ttype;
0555: Token _token = null;
0556: int _begin = text.length();
0557: _ttype = QUESTION;
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 mLPAREN(boolean _createToken)
0571: throws RecognitionException, CharStreamException,
0572: TokenStreamException {
0573: int _ttype;
0574: Token _token = null;
0575: int _begin = text.length();
0576: _ttype = LPAREN;
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 mRPAREN(boolean _createToken)
0590: throws RecognitionException, CharStreamException,
0591: TokenStreamException {
0592: int _ttype;
0593: Token _token = null;
0594: int _begin = text.length();
0595: _ttype = RPAREN;
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: public final void mLBRACK(boolean _createToken)
0609: throws RecognitionException, CharStreamException,
0610: TokenStreamException {
0611: int _ttype;
0612: Token _token = null;
0613: int _begin = text.length();
0614: _ttype = LBRACK;
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: public final void mRBRACK(boolean _createToken)
0628: throws RecognitionException, CharStreamException,
0629: TokenStreamException {
0630: int _ttype;
0631: Token _token = null;
0632: int _begin = text.length();
0633: _ttype = RBRACK;
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: public final void mLCURLY(boolean _createToken)
0647: throws RecognitionException, CharStreamException,
0648: TokenStreamException {
0649: int _ttype;
0650: Token _token = null;
0651: int _begin = text.length();
0652: _ttype = LCURLY;
0653: int _saveIndex;
0654:
0655: match('{');
0656: if (_createToken && _token == null && _ttype != Token.SKIP) {
0657: _token = makeToken(_ttype);
0658: _token.setText(new String(text.getBuffer(), _begin, text
0659: .length()
0660: - _begin));
0661: }
0662: _returnToken = _token;
0663: }
0664:
0665: public final void mRCURLY(boolean _createToken)
0666: throws RecognitionException, CharStreamException,
0667: TokenStreamException {
0668: int _ttype;
0669: Token _token = null;
0670: int _begin = text.length();
0671: _ttype = RCURLY;
0672: int _saveIndex;
0673:
0674: match('}');
0675: if (_createToken && _token == null && _ttype != Token.SKIP) {
0676: _token = makeToken(_ttype);
0677: _token.setText(new String(text.getBuffer(), _begin, text
0678: .length()
0679: - _begin));
0680: }
0681: _returnToken = _token;
0682: }
0683:
0684: public final void mCOLON(boolean _createToken)
0685: throws RecognitionException, CharStreamException,
0686: TokenStreamException {
0687: int _ttype;
0688: Token _token = null;
0689: int _begin = text.length();
0690: _ttype = COLON;
0691: int _saveIndex;
0692:
0693: match(':');
0694: if (_createToken && _token == null && _ttype != Token.SKIP) {
0695: _token = makeToken(_ttype);
0696: _token.setText(new String(text.getBuffer(), _begin, text
0697: .length()
0698: - _begin));
0699: }
0700: _returnToken = _token;
0701: }
0702:
0703: public final void mCOMMA(boolean _createToken)
0704: throws RecognitionException, CharStreamException,
0705: TokenStreamException {
0706: int _ttype;
0707: Token _token = null;
0708: int _begin = text.length();
0709: _ttype = COMMA;
0710: int _saveIndex;
0711:
0712: match(',');
0713: if (_createToken && _token == null && _ttype != Token.SKIP) {
0714: _token = makeToken(_ttype);
0715: _token.setText(new String(text.getBuffer(), _begin, text
0716: .length()
0717: - _begin));
0718: }
0719: _returnToken = _token;
0720: }
0721:
0722: public final void mASSIGN(boolean _createToken)
0723: throws RecognitionException, CharStreamException,
0724: TokenStreamException {
0725: int _ttype;
0726: Token _token = null;
0727: int _begin = text.length();
0728: _ttype = ASSIGN;
0729: int _saveIndex;
0730:
0731: match('=');
0732: if (_createToken && _token == null && _ttype != Token.SKIP) {
0733: _token = makeToken(_ttype);
0734: _token.setText(new String(text.getBuffer(), _begin, text
0735: .length()
0736: - _begin));
0737: }
0738: _returnToken = _token;
0739: }
0740:
0741: public final void mEQUAL(boolean _createToken)
0742: throws RecognitionException, CharStreamException,
0743: TokenStreamException {
0744: int _ttype;
0745: Token _token = null;
0746: int _begin = text.length();
0747: _ttype = EQUAL;
0748: int _saveIndex;
0749:
0750: match("==");
0751: if (_createToken && _token == null && _ttype != Token.SKIP) {
0752: _token = makeToken(_ttype);
0753: _token.setText(new String(text.getBuffer(), _begin, text
0754: .length()
0755: - _begin));
0756: }
0757: _returnToken = _token;
0758: }
0759:
0760: public final void mLNOT(boolean _createToken)
0761: throws RecognitionException, CharStreamException,
0762: TokenStreamException {
0763: int _ttype;
0764: Token _token = null;
0765: int _begin = text.length();
0766: _ttype = LNOT;
0767: int _saveIndex;
0768:
0769: match('!');
0770: if (_createToken && _token == null && _ttype != Token.SKIP) {
0771: _token = makeToken(_ttype);
0772: _token.setText(new String(text.getBuffer(), _begin, text
0773: .length()
0774: - _begin));
0775: }
0776: _returnToken = _token;
0777: }
0778:
0779: public final void mBNOT(boolean _createToken)
0780: throws RecognitionException, CharStreamException,
0781: TokenStreamException {
0782: int _ttype;
0783: Token _token = null;
0784: int _begin = text.length();
0785: _ttype = BNOT;
0786: int _saveIndex;
0787:
0788: match('~');
0789: if (_createToken && _token == null && _ttype != Token.SKIP) {
0790: _token = makeToken(_ttype);
0791: _token.setText(new String(text.getBuffer(), _begin, text
0792: .length()
0793: - _begin));
0794: }
0795: _returnToken = _token;
0796: }
0797:
0798: public final void mNOT_EQUAL(boolean _createToken)
0799: throws RecognitionException, CharStreamException,
0800: TokenStreamException {
0801: int _ttype;
0802: Token _token = null;
0803: int _begin = text.length();
0804: _ttype = NOT_EQUAL;
0805: int _saveIndex;
0806:
0807: match("!=");
0808: if (_createToken && _token == null && _ttype != Token.SKIP) {
0809: _token = makeToken(_ttype);
0810: _token.setText(new String(text.getBuffer(), _begin, text
0811: .length()
0812: - _begin));
0813: }
0814: _returnToken = _token;
0815: }
0816:
0817: public final void mDIV(boolean _createToken)
0818: throws RecognitionException, CharStreamException,
0819: TokenStreamException {
0820: int _ttype;
0821: Token _token = null;
0822: int _begin = text.length();
0823: _ttype = DIV;
0824: int _saveIndex;
0825:
0826: match('/');
0827: if (_createToken && _token == null && _ttype != Token.SKIP) {
0828: _token = makeToken(_ttype);
0829: _token.setText(new String(text.getBuffer(), _begin, text
0830: .length()
0831: - _begin));
0832: }
0833: _returnToken = _token;
0834: }
0835:
0836: public final void mDIV_ASSIGN(boolean _createToken)
0837: throws RecognitionException, CharStreamException,
0838: TokenStreamException {
0839: int _ttype;
0840: Token _token = null;
0841: int _begin = text.length();
0842: _ttype = DIV_ASSIGN;
0843: int _saveIndex;
0844:
0845: match("/=");
0846: if (_createToken && _token == null && _ttype != Token.SKIP) {
0847: _token = makeToken(_ttype);
0848: _token.setText(new String(text.getBuffer(), _begin, text
0849: .length()
0850: - _begin));
0851: }
0852: _returnToken = _token;
0853: }
0854:
0855: public final void mPLUS(boolean _createToken)
0856: throws RecognitionException, CharStreamException,
0857: TokenStreamException {
0858: int _ttype;
0859: Token _token = null;
0860: int _begin = text.length();
0861: _ttype = PLUS;
0862: int _saveIndex;
0863:
0864: match('+');
0865: if (_createToken && _token == null && _ttype != Token.SKIP) {
0866: _token = makeToken(_ttype);
0867: _token.setText(new String(text.getBuffer(), _begin, text
0868: .length()
0869: - _begin));
0870: }
0871: _returnToken = _token;
0872: }
0873:
0874: public final void mPLUS_ASSIGN(boolean _createToken)
0875: throws RecognitionException, CharStreamException,
0876: TokenStreamException {
0877: int _ttype;
0878: Token _token = null;
0879: int _begin = text.length();
0880: _ttype = PLUS_ASSIGN;
0881: int _saveIndex;
0882:
0883: match("+=");
0884: if (_createToken && _token == null && _ttype != Token.SKIP) {
0885: _token = makeToken(_ttype);
0886: _token.setText(new String(text.getBuffer(), _begin, text
0887: .length()
0888: - _begin));
0889: }
0890: _returnToken = _token;
0891: }
0892:
0893: public final void mINC(boolean _createToken)
0894: throws RecognitionException, CharStreamException,
0895: TokenStreamException {
0896: int _ttype;
0897: Token _token = null;
0898: int _begin = text.length();
0899: _ttype = INC;
0900: int _saveIndex;
0901:
0902: match("++");
0903: if (_createToken && _token == null && _ttype != Token.SKIP) {
0904: _token = makeToken(_ttype);
0905: _token.setText(new String(text.getBuffer(), _begin, text
0906: .length()
0907: - _begin));
0908: }
0909: _returnToken = _token;
0910: }
0911:
0912: public final void mMINUS(boolean _createToken)
0913: throws RecognitionException, CharStreamException,
0914: TokenStreamException {
0915: int _ttype;
0916: Token _token = null;
0917: int _begin = text.length();
0918: _ttype = MINUS;
0919: int _saveIndex;
0920:
0921: match('-');
0922: if (_createToken && _token == null && _ttype != Token.SKIP) {
0923: _token = makeToken(_ttype);
0924: _token.setText(new String(text.getBuffer(), _begin, text
0925: .length()
0926: - _begin));
0927: }
0928: _returnToken = _token;
0929: }
0930:
0931: public final void mMINUS_ASSIGN(boolean _createToken)
0932: throws RecognitionException, CharStreamException,
0933: TokenStreamException {
0934: int _ttype;
0935: Token _token = null;
0936: int _begin = text.length();
0937: _ttype = MINUS_ASSIGN;
0938: int _saveIndex;
0939:
0940: match("-=");
0941: if (_createToken && _token == null && _ttype != Token.SKIP) {
0942: _token = makeToken(_ttype);
0943: _token.setText(new String(text.getBuffer(), _begin, text
0944: .length()
0945: - _begin));
0946: }
0947: _returnToken = _token;
0948: }
0949:
0950: public final void mDEC(boolean _createToken)
0951: throws RecognitionException, CharStreamException,
0952: TokenStreamException {
0953: int _ttype;
0954: Token _token = null;
0955: int _begin = text.length();
0956: _ttype = DEC;
0957: int _saveIndex;
0958:
0959: match("--");
0960: if (_createToken && _token == null && _ttype != Token.SKIP) {
0961: _token = makeToken(_ttype);
0962: _token.setText(new String(text.getBuffer(), _begin, text
0963: .length()
0964: - _begin));
0965: }
0966: _returnToken = _token;
0967: }
0968:
0969: public final void mSTAR(boolean _createToken)
0970: throws RecognitionException, CharStreamException,
0971: TokenStreamException {
0972: int _ttype;
0973: Token _token = null;
0974: int _begin = text.length();
0975: _ttype = STAR;
0976: int _saveIndex;
0977:
0978: match('*');
0979: if (_createToken && _token == null && _ttype != Token.SKIP) {
0980: _token = makeToken(_ttype);
0981: _token.setText(new String(text.getBuffer(), _begin, text
0982: .length()
0983: - _begin));
0984: }
0985: _returnToken = _token;
0986: }
0987:
0988: public final void mSTAR_ASSIGN(boolean _createToken)
0989: throws RecognitionException, CharStreamException,
0990: TokenStreamException {
0991: int _ttype;
0992: Token _token = null;
0993: int _begin = text.length();
0994: _ttype = STAR_ASSIGN;
0995: int _saveIndex;
0996:
0997: match("*=");
0998: if (_createToken && _token == null && _ttype != Token.SKIP) {
0999: _token = makeToken(_ttype);
1000: _token.setText(new String(text.getBuffer(), _begin, text
1001: .length()
1002: - _begin));
1003: }
1004: _returnToken = _token;
1005: }
1006:
1007: public final void mMOD(boolean _createToken)
1008: throws RecognitionException, CharStreamException,
1009: TokenStreamException {
1010: int _ttype;
1011: Token _token = null;
1012: int _begin = text.length();
1013: _ttype = MOD;
1014: int _saveIndex;
1015:
1016: match('%');
1017: if (_createToken && _token == null && _ttype != Token.SKIP) {
1018: _token = makeToken(_ttype);
1019: _token.setText(new String(text.getBuffer(), _begin, text
1020: .length()
1021: - _begin));
1022: }
1023: _returnToken = _token;
1024: }
1025:
1026: public final void mMOD_ASSIGN(boolean _createToken)
1027: throws RecognitionException, CharStreamException,
1028: TokenStreamException {
1029: int _ttype;
1030: Token _token = null;
1031: int _begin = text.length();
1032: _ttype = MOD_ASSIGN;
1033: int _saveIndex;
1034:
1035: match("%=");
1036: if (_createToken && _token == null && _ttype != Token.SKIP) {
1037: _token = makeToken(_ttype);
1038: _token.setText(new String(text.getBuffer(), _begin, text
1039: .length()
1040: - _begin));
1041: }
1042: _returnToken = _token;
1043: }
1044:
1045: public final void mSR(boolean _createToken)
1046: throws RecognitionException, CharStreamException,
1047: TokenStreamException {
1048: int _ttype;
1049: Token _token = null;
1050: int _begin = text.length();
1051: _ttype = SR;
1052: int _saveIndex;
1053:
1054: match(">>");
1055: if (_createToken && _token == null && _ttype != Token.SKIP) {
1056: _token = makeToken(_ttype);
1057: _token.setText(new String(text.getBuffer(), _begin, text
1058: .length()
1059: - _begin));
1060: }
1061: _returnToken = _token;
1062: }
1063:
1064: public final void mSR_ASSIGN(boolean _createToken)
1065: throws RecognitionException, CharStreamException,
1066: TokenStreamException {
1067: int _ttype;
1068: Token _token = null;
1069: int _begin = text.length();
1070: _ttype = SR_ASSIGN;
1071: int _saveIndex;
1072:
1073: match(">>=");
1074: if (_createToken && _token == null && _ttype != Token.SKIP) {
1075: _token = makeToken(_ttype);
1076: _token.setText(new String(text.getBuffer(), _begin, text
1077: .length()
1078: - _begin));
1079: }
1080: _returnToken = _token;
1081: }
1082:
1083: public final void mBSR(boolean _createToken)
1084: throws RecognitionException, CharStreamException,
1085: TokenStreamException {
1086: int _ttype;
1087: Token _token = null;
1088: int _begin = text.length();
1089: _ttype = BSR;
1090: int _saveIndex;
1091:
1092: match(">>>");
1093: if (_createToken && _token == null && _ttype != Token.SKIP) {
1094: _token = makeToken(_ttype);
1095: _token.setText(new String(text.getBuffer(), _begin, text
1096: .length()
1097: - _begin));
1098: }
1099: _returnToken = _token;
1100: }
1101:
1102: public final void mBSR_ASSIGN(boolean _createToken)
1103: throws RecognitionException, CharStreamException,
1104: TokenStreamException {
1105: int _ttype;
1106: Token _token = null;
1107: int _begin = text.length();
1108: _ttype = BSR_ASSIGN;
1109: int _saveIndex;
1110:
1111: match(">>>=");
1112: if (_createToken && _token == null && _ttype != Token.SKIP) {
1113: _token = makeToken(_ttype);
1114: _token.setText(new String(text.getBuffer(), _begin, text
1115: .length()
1116: - _begin));
1117: }
1118: _returnToken = _token;
1119: }
1120:
1121: public final void mGE(boolean _createToken)
1122: throws RecognitionException, CharStreamException,
1123: TokenStreamException {
1124: int _ttype;
1125: Token _token = null;
1126: int _begin = text.length();
1127: _ttype = GE;
1128: int _saveIndex;
1129:
1130: match(">=");
1131: if (_createToken && _token == null && _ttype != Token.SKIP) {
1132: _token = makeToken(_ttype);
1133: _token.setText(new String(text.getBuffer(), _begin, text
1134: .length()
1135: - _begin));
1136: }
1137: _returnToken = _token;
1138: }
1139:
1140: public final void mGT(boolean _createToken)
1141: throws RecognitionException, CharStreamException,
1142: TokenStreamException {
1143: int _ttype;
1144: Token _token = null;
1145: int _begin = text.length();
1146: _ttype = GT;
1147: int _saveIndex;
1148:
1149: match(">");
1150: if (_createToken && _token == null && _ttype != Token.SKIP) {
1151: _token = makeToken(_ttype);
1152: _token.setText(new String(text.getBuffer(), _begin, text
1153: .length()
1154: - _begin));
1155: }
1156: _returnToken = _token;
1157: }
1158:
1159: public final void mSL(boolean _createToken)
1160: throws RecognitionException, CharStreamException,
1161: TokenStreamException {
1162: int _ttype;
1163: Token _token = null;
1164: int _begin = text.length();
1165: _ttype = SL;
1166: int _saveIndex;
1167:
1168: match("<<");
1169: if (_createToken && _token == null && _ttype != Token.SKIP) {
1170: _token = makeToken(_ttype);
1171: _token.setText(new String(text.getBuffer(), _begin, text
1172: .length()
1173: - _begin));
1174: }
1175: _returnToken = _token;
1176: }
1177:
1178: public final void mSL_ASSIGN(boolean _createToken)
1179: throws RecognitionException, CharStreamException,
1180: TokenStreamException {
1181: int _ttype;
1182: Token _token = null;
1183: int _begin = text.length();
1184: _ttype = SL_ASSIGN;
1185: int _saveIndex;
1186:
1187: match("<<=");
1188: if (_createToken && _token == null && _ttype != Token.SKIP) {
1189: _token = makeToken(_ttype);
1190: _token.setText(new String(text.getBuffer(), _begin, text
1191: .length()
1192: - _begin));
1193: }
1194: _returnToken = _token;
1195: }
1196:
1197: public final void mLE(boolean _createToken)
1198: throws RecognitionException, CharStreamException,
1199: TokenStreamException {
1200: int _ttype;
1201: Token _token = null;
1202: int _begin = text.length();
1203: _ttype = LE;
1204: int _saveIndex;
1205:
1206: match("<=");
1207: if (_createToken && _token == null && _ttype != Token.SKIP) {
1208: _token = makeToken(_ttype);
1209: _token.setText(new String(text.getBuffer(), _begin, text
1210: .length()
1211: - _begin));
1212: }
1213: _returnToken = _token;
1214: }
1215:
1216: public final void mLT(boolean _createToken)
1217: throws RecognitionException, CharStreamException,
1218: TokenStreamException {
1219: int _ttype;
1220: Token _token = null;
1221: int _begin = text.length();
1222: _ttype = LT;
1223: int _saveIndex;
1224:
1225: match('<');
1226: if (_createToken && _token == null && _ttype != Token.SKIP) {
1227: _token = makeToken(_ttype);
1228: _token.setText(new String(text.getBuffer(), _begin, text
1229: .length()
1230: - _begin));
1231: }
1232: _returnToken = _token;
1233: }
1234:
1235: public final void mBXOR(boolean _createToken)
1236: throws RecognitionException, CharStreamException,
1237: TokenStreamException {
1238: int _ttype;
1239: Token _token = null;
1240: int _begin = text.length();
1241: _ttype = BXOR;
1242: int _saveIndex;
1243:
1244: match('^');
1245: if (_createToken && _token == null && _ttype != Token.SKIP) {
1246: _token = makeToken(_ttype);
1247: _token.setText(new String(text.getBuffer(), _begin, text
1248: .length()
1249: - _begin));
1250: }
1251: _returnToken = _token;
1252: }
1253:
1254: public final void mBXOR_ASSIGN(boolean _createToken)
1255: throws RecognitionException, CharStreamException,
1256: TokenStreamException {
1257: int _ttype;
1258: Token _token = null;
1259: int _begin = text.length();
1260: _ttype = BXOR_ASSIGN;
1261: int _saveIndex;
1262:
1263: match("^=");
1264: if (_createToken && _token == null && _ttype != Token.SKIP) {
1265: _token = makeToken(_ttype);
1266: _token.setText(new String(text.getBuffer(), _begin, text
1267: .length()
1268: - _begin));
1269: }
1270: _returnToken = _token;
1271: }
1272:
1273: public final void mBOR(boolean _createToken)
1274: throws RecognitionException, CharStreamException,
1275: TokenStreamException {
1276: int _ttype;
1277: Token _token = null;
1278: int _begin = text.length();
1279: _ttype = BOR;
1280: int _saveIndex;
1281:
1282: match('|');
1283: if (_createToken && _token == null && _ttype != Token.SKIP) {
1284: _token = makeToken(_ttype);
1285: _token.setText(new String(text.getBuffer(), _begin, text
1286: .length()
1287: - _begin));
1288: }
1289: _returnToken = _token;
1290: }
1291:
1292: public final void mBOR_ASSIGN(boolean _createToken)
1293: throws RecognitionException, CharStreamException,
1294: TokenStreamException {
1295: int _ttype;
1296: Token _token = null;
1297: int _begin = text.length();
1298: _ttype = BOR_ASSIGN;
1299: int _saveIndex;
1300:
1301: match("|=");
1302: if (_createToken && _token == null && _ttype != Token.SKIP) {
1303: _token = makeToken(_ttype);
1304: _token.setText(new String(text.getBuffer(), _begin, text
1305: .length()
1306: - _begin));
1307: }
1308: _returnToken = _token;
1309: }
1310:
1311: public final void mLOR(boolean _createToken)
1312: throws RecognitionException, CharStreamException,
1313: TokenStreamException {
1314: int _ttype;
1315: Token _token = null;
1316: int _begin = text.length();
1317: _ttype = LOR;
1318: int _saveIndex;
1319:
1320: match("||");
1321: if (_createToken && _token == null && _ttype != Token.SKIP) {
1322: _token = makeToken(_ttype);
1323: _token.setText(new String(text.getBuffer(), _begin, text
1324: .length()
1325: - _begin));
1326: }
1327: _returnToken = _token;
1328: }
1329:
1330: public final void mBAND(boolean _createToken)
1331: throws RecognitionException, CharStreamException,
1332: TokenStreamException {
1333: int _ttype;
1334: Token _token = null;
1335: int _begin = text.length();
1336: _ttype = BAND;
1337: int _saveIndex;
1338:
1339: match('&');
1340: if (_createToken && _token == null && _ttype != Token.SKIP) {
1341: _token = makeToken(_ttype);
1342: _token.setText(new String(text.getBuffer(), _begin, text
1343: .length()
1344: - _begin));
1345: }
1346: _returnToken = _token;
1347: }
1348:
1349: public final void mBAND_ASSIGN(boolean _createToken)
1350: throws RecognitionException, CharStreamException,
1351: TokenStreamException {
1352: int _ttype;
1353: Token _token = null;
1354: int _begin = text.length();
1355: _ttype = BAND_ASSIGN;
1356: int _saveIndex;
1357:
1358: match("&=");
1359: if (_createToken && _token == null && _ttype != Token.SKIP) {
1360: _token = makeToken(_ttype);
1361: _token.setText(new String(text.getBuffer(), _begin, text
1362: .length()
1363: - _begin));
1364: }
1365: _returnToken = _token;
1366: }
1367:
1368: public final void mLAND(boolean _createToken)
1369: throws RecognitionException, CharStreamException,
1370: TokenStreamException {
1371: int _ttype;
1372: Token _token = null;
1373: int _begin = text.length();
1374: _ttype = LAND;
1375: int _saveIndex;
1376:
1377: match("&&");
1378: if (_createToken && _token == null && _ttype != Token.SKIP) {
1379: _token = makeToken(_ttype);
1380: _token.setText(new String(text.getBuffer(), _begin, text
1381: .length()
1382: - _begin));
1383: }
1384: _returnToken = _token;
1385: }
1386:
1387: public final void mSEMI(boolean _createToken)
1388: throws RecognitionException, CharStreamException,
1389: TokenStreamException {
1390: int _ttype;
1391: Token _token = null;
1392: int _begin = text.length();
1393: _ttype = SEMI;
1394: int _saveIndex;
1395:
1396: match(';');
1397: if (_createToken && _token == null && _ttype != Token.SKIP) {
1398: _token = makeToken(_ttype);
1399: _token.setText(new String(text.getBuffer(), _begin, text
1400: .length()
1401: - _begin));
1402: }
1403: _returnToken = _token;
1404: }
1405:
1406: public final void mWS(boolean _createToken)
1407: throws RecognitionException, CharStreamException,
1408: TokenStreamException {
1409: int _ttype;
1410: Token _token = null;
1411: int _begin = text.length();
1412: _ttype = WS;
1413: int _saveIndex;
1414:
1415: {
1416: int _cnt363 = 0;
1417: _loop363: do {
1418: switch (LA(1)) {
1419: case ' ': {
1420: match(' ');
1421: break;
1422: }
1423: case '\t': {
1424: match('\t');
1425: break;
1426: }
1427: case '\u000c': {
1428: match('\f');
1429: break;
1430: }
1431: case '\n':
1432: case '\r': {
1433: {
1434: if ((LA(1) == '\r') && (LA(2) == '\n')
1435: && (true) && (true)) {
1436: match("\r\n");
1437: } else if ((LA(1) == '\r') && (true) && (true) && (true)) {
1438: match('\r');
1439: } else if ((LA(1) == '\n')) {
1440: match('\n');
1441: } else {
1442: throw new NoViableAltForCharException(
1443: (char) LA(1), getFilename(),
1444: getLine(), getColumn());
1445: }
1446:
1447: }
1448: if (inputState.guessing == 0) {
1449: newline();
1450: }
1451: break;
1452: }
1453: default: {
1454: if (_cnt363 >= 1) {
1455: break _loop363;
1456: } else {
1457: throw new NoViableAltForCharException(
1458: (char) LA(1), getFilename(), getLine(),
1459: getColumn());
1460: }
1461: }
1462: }
1463: _cnt363++;
1464: } while (true);
1465: }
1466: if (inputState.guessing == 0) {
1467: _ttype = Token.SKIP;
1468: }
1469: if (_createToken && _token == null && _ttype != Token.SKIP) {
1470: _token = makeToken(_ttype);
1471: _token.setText(new String(text.getBuffer(), _begin, text
1472: .length()
1473: - _begin));
1474: }
1475: _returnToken = _token;
1476: }
1477:
1478: public final void mSL_COMMENT(boolean _createToken)
1479: throws RecognitionException, CharStreamException,
1480: TokenStreamException {
1481: int _ttype;
1482: Token _token = null;
1483: int _begin = text.length();
1484: _ttype = SL_COMMENT;
1485: int _saveIndex;
1486:
1487: match("//");
1488: {
1489: _loop367: do {
1490: if ((_tokenSet_0.member(LA(1)))) {
1491: {
1492: match(_tokenSet_0);
1493: }
1494: } else {
1495: break _loop367;
1496: }
1497:
1498: } while (true);
1499: }
1500: {
1501: switch (LA(1)) {
1502: case '\n': {
1503: match('\n');
1504: break;
1505: }
1506: case '\r': {
1507: match('\r');
1508: {
1509: if ((LA(1) == '\n')) {
1510: match('\n');
1511: } else {
1512: }
1513:
1514: }
1515: break;
1516: }
1517: default: {
1518: throw new NoViableAltForCharException((char) LA(1),
1519: getFilename(), getLine(), getColumn());
1520: }
1521: }
1522: }
1523: if (inputState.guessing == 0) {
1524: _ttype = Token.SKIP;
1525: newline();
1526: }
1527: if (_createToken && _token == null && _ttype != Token.SKIP) {
1528: _token = makeToken(_ttype);
1529: _token.setText(new String(text.getBuffer(), _begin, text
1530: .length()
1531: - _begin));
1532: }
1533: _returnToken = _token;
1534: }
1535:
1536: public final void mML_COMMENT(boolean _createToken)
1537: throws RecognitionException, CharStreamException,
1538: TokenStreamException {
1539: int _ttype;
1540: Token _token = null;
1541: int _begin = text.length();
1542: _ttype = ML_COMMENT;
1543: int _saveIndex;
1544:
1545: match("/*");
1546: {
1547: _loop373: do {
1548: if ((LA(1) == '\r') && (LA(2) == '\n')
1549: && ((LA(3) >= '\u0003' && LA(3) <= '\uffff'))
1550: && ((LA(4) >= '\u0003' && LA(4) <= '\uffff'))) {
1551: match('\r');
1552: match('\n');
1553: if (inputState.guessing == 0) {
1554: newline();
1555: }
1556: } else if (((LA(1) == '*')
1557: && ((LA(2) >= '\u0003' && LA(2) <= '\uffff')) && ((LA(3) >= '\u0003' && LA(3) <= '\uffff')))
1558: && (LA(2) != '/')) {
1559: match('*');
1560: } else if ((LA(1) == '\r')
1561: && ((LA(2) >= '\u0003' && LA(2) <= '\uffff'))
1562: && ((LA(3) >= '\u0003' && LA(3) <= '\uffff'))
1563: && (true)) {
1564: match('\r');
1565: if (inputState.guessing == 0) {
1566: newline();
1567: }
1568: } else if ((LA(1) == '\n')) {
1569: match('\n');
1570: if (inputState.guessing == 0) {
1571: newline();
1572: }
1573: } else if ((_tokenSet_1.member(LA(1)))) {
1574: {
1575: match(_tokenSet_1);
1576: }
1577: } else {
1578: break _loop373;
1579: }
1580:
1581: } while (true);
1582: }
1583: match("*/");
1584: if (inputState.guessing == 0) {
1585: _ttype = Token.SKIP;
1586: }
1587: if (_createToken && _token == null && _ttype != Token.SKIP) {
1588: _token = makeToken(_ttype);
1589: _token.setText(new String(text.getBuffer(), _begin, text
1590: .length()
1591: - _begin));
1592: }
1593: _returnToken = _token;
1594: }
1595:
1596: public final void mSTRING_LITERAL(boolean _createToken)
1597: throws RecognitionException, CharStreamException,
1598: TokenStreamException {
1599: int _ttype;
1600: Token _token = null;
1601: int _begin = text.length();
1602: _ttype = STRING_LITERAL;
1603: int _saveIndex;
1604:
1605: switch (LA(1)) {
1606: case '"': {
1607: match('"');
1608: {
1609: _loop377: do {
1610: if ((LA(1) == '\\')) {
1611: mESC(false);
1612: } else if ((_tokenSet_2.member(LA(1)))) {
1613: {
1614: match(_tokenSet_2);
1615: }
1616: } else {
1617: break _loop377;
1618: }
1619:
1620: } while (true);
1621: }
1622: match('"');
1623: break;
1624: }
1625: case '\'': {
1626: match('\'');
1627: {
1628: if ((LA(1) == '\\')) {
1629: mESC(false);
1630: } else if ((_tokenSet_3.member(LA(1)))) {
1631: {
1632: match(_tokenSet_3);
1633: }
1634: } else {
1635: throw new NoViableAltForCharException((char) LA(1),
1636: getFilename(), getLine(), getColumn());
1637: }
1638:
1639: }
1640: match('\'');
1641: break;
1642: }
1643: default: {
1644: throw new NoViableAltForCharException((char) LA(1),
1645: getFilename(), getLine(), getColumn());
1646: }
1647: }
1648: if (_createToken && _token == null && _ttype != Token.SKIP) {
1649: _token = makeToken(_ttype);
1650: _token.setText(new String(text.getBuffer(), _begin, text
1651: .length()
1652: - _begin));
1653: }
1654: _returnToken = _token;
1655: }
1656:
1657: protected final void mESC(boolean _createToken)
1658: throws RecognitionException, CharStreamException,
1659: TokenStreamException {
1660: int _ttype;
1661: Token _token = null;
1662: int _begin = text.length();
1663: _ttype = ESC;
1664: int _saveIndex;
1665:
1666: match('\\');
1667: {
1668: switch (LA(1)) {
1669: case 'n': {
1670: match('n');
1671: break;
1672: }
1673: case 'r': {
1674: match('r');
1675: break;
1676: }
1677: case 't': {
1678: match('t');
1679: break;
1680: }
1681: case 'b': {
1682: match('b');
1683: break;
1684: }
1685: case 'f': {
1686: match('f');
1687: break;
1688: }
1689: case '"': {
1690: match('"');
1691: break;
1692: }
1693: case '\'': {
1694: match('\'');
1695: break;
1696: }
1697: case '\\': {
1698: match('\\');
1699: break;
1700: }
1701: case 'u': {
1702: {
1703: int _cnt383 = 0;
1704: _loop383: do {
1705: if ((LA(1) == 'u')) {
1706: match('u');
1707: } else {
1708: if (_cnt383 >= 1) {
1709: break _loop383;
1710: } else {
1711: throw new NoViableAltForCharException(
1712: (char) LA(1), getFilename(),
1713: getLine(), getColumn());
1714: }
1715: }
1716:
1717: _cnt383++;
1718: } while (true);
1719: }
1720: mHEX_DIGIT(false);
1721: mHEX_DIGIT(false);
1722: mHEX_DIGIT(false);
1723: mHEX_DIGIT(false);
1724: break;
1725: }
1726: case '0':
1727: case '1':
1728: case '2':
1729: case '3': {
1730: matchRange('0', '3');
1731: {
1732: if (((LA(1) >= '0' && LA(1) <= '7'))
1733: && (_tokenSet_0.member(LA(2))) && (true)
1734: && (true)) {
1735: matchRange('0', '7');
1736: {
1737: if (((LA(1) >= '0' && LA(1) <= '7'))
1738: && (_tokenSet_0.member(LA(2)))
1739: && (true) && (true)) {
1740: matchRange('0', '7');
1741: } else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) {
1742: } else {
1743: throw new NoViableAltForCharException(
1744: (char) LA(1), getFilename(),
1745: getLine(), getColumn());
1746: }
1747:
1748: }
1749: } else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) {
1750: } else {
1751: throw new NoViableAltForCharException(
1752: (char) LA(1), getFilename(), getLine(),
1753: getColumn());
1754: }
1755:
1756: }
1757: break;
1758: }
1759: case '4':
1760: case '5':
1761: case '6':
1762: case '7': {
1763: matchRange('4', '7');
1764: {
1765: if (((LA(1) >= '0' && LA(1) <= '7'))
1766: && (_tokenSet_0.member(LA(2))) && (true)
1767: && (true)) {
1768: matchRange('0', '7');
1769: } else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) {
1770: } else {
1771: throw new NoViableAltForCharException(
1772: (char) LA(1), getFilename(), getLine(),
1773: getColumn());
1774: }
1775:
1776: }
1777: break;
1778: }
1779: default: {
1780: throw new NoViableAltForCharException((char) LA(1),
1781: getFilename(), getLine(), getColumn());
1782: }
1783: }
1784: }
1785: if (_createToken && _token == null && _ttype != Token.SKIP) {
1786: _token = makeToken(_ttype);
1787: _token.setText(new String(text.getBuffer(), _begin, text
1788: .length()
1789: - _begin));
1790: }
1791: _returnToken = _token;
1792: }
1793:
1794: protected final void mHEX_DIGIT(boolean _createToken)
1795: throws RecognitionException, CharStreamException,
1796: TokenStreamException {
1797: int _ttype;
1798: Token _token = null;
1799: int _begin = text.length();
1800: _ttype = HEX_DIGIT;
1801: int _saveIndex;
1802:
1803: {
1804: switch (LA(1)) {
1805: case '0':
1806: case '1':
1807: case '2':
1808: case '3':
1809: case '4':
1810: case '5':
1811: case '6':
1812: case '7':
1813: case '8':
1814: case '9': {
1815: matchRange('0', '9');
1816: break;
1817: }
1818: case 'A':
1819: case 'B':
1820: case 'C':
1821: case 'D':
1822: case 'E':
1823: case 'F': {
1824: matchRange('A', 'F');
1825: break;
1826: }
1827: case 'a':
1828: case 'b':
1829: case 'c':
1830: case 'd':
1831: case 'e':
1832: case 'f': {
1833: matchRange('a', 'f');
1834: break;
1835: }
1836: default: {
1837: throw new NoViableAltForCharException((char) LA(1),
1838: getFilename(), getLine(), getColumn());
1839: }
1840: }
1841: }
1842: if (_createToken && _token == null && _ttype != Token.SKIP) {
1843: _token = makeToken(_ttype);
1844: _token.setText(new String(text.getBuffer(), _begin, text
1845: .length()
1846: - _begin));
1847: }
1848: _returnToken = _token;
1849: }
1850:
1851: protected final void mVOCAB(boolean _createToken)
1852: throws RecognitionException, CharStreamException,
1853: TokenStreamException {
1854: int _ttype;
1855: Token _token = null;
1856: int _begin = text.length();
1857: _ttype = VOCAB;
1858: int _saveIndex;
1859:
1860: matchRange('\3', '\377');
1861: if (_createToken && _token == null && _ttype != Token.SKIP) {
1862: _token = makeToken(_ttype);
1863: _token.setText(new String(text.getBuffer(), _begin, text
1864: .length()
1865: - _begin));
1866: }
1867: _returnToken = _token;
1868: }
1869:
1870: public final void mIDENT(boolean _createToken)
1871: throws RecognitionException, CharStreamException,
1872: TokenStreamException {
1873: int _ttype;
1874: Token _token = null;
1875: int _begin = text.length();
1876: _ttype = IDENT;
1877: int _saveIndex;
1878:
1879: {
1880: switch (LA(1)) {
1881: case 'a':
1882: case 'b':
1883: case 'c':
1884: case 'd':
1885: case 'e':
1886: case 'f':
1887: case 'g':
1888: case 'h':
1889: case 'i':
1890: case 'j':
1891: case 'k':
1892: case 'l':
1893: case 'm':
1894: case 'n':
1895: case 'o':
1896: case 'p':
1897: case 'q':
1898: case 'r':
1899: case 's':
1900: case 't':
1901: case 'u':
1902: case 'v':
1903: case 'w':
1904: case 'x':
1905: case 'y':
1906: case 'z': {
1907: matchRange('a', 'z');
1908: break;
1909: }
1910: case 'A':
1911: case 'B':
1912: case 'C':
1913: case 'D':
1914: case 'E':
1915: case 'F':
1916: case 'G':
1917: case 'H':
1918: case 'I':
1919: case 'J':
1920: case 'K':
1921: case 'L':
1922: case 'M':
1923: case 'N':
1924: case 'O':
1925: case 'P':
1926: case 'Q':
1927: case 'R':
1928: case 'S':
1929: case 'T':
1930: case 'U':
1931: case 'V':
1932: case 'W':
1933: case 'X':
1934: case 'Y':
1935: case 'Z': {
1936: matchRange('A', 'Z');
1937: break;
1938: }
1939: case '_': {
1940: match('_');
1941: break;
1942: }
1943: case '$': {
1944: match('$');
1945: break;
1946: }
1947: default: {
1948: throw new NoViableAltForCharException((char) LA(1),
1949: getFilename(), getLine(), getColumn());
1950: }
1951: }
1952: }
1953: {
1954: _loop393: do {
1955: switch (LA(1)) {
1956: case 'a':
1957: case 'b':
1958: case 'c':
1959: case 'd':
1960: case 'e':
1961: case 'f':
1962: case 'g':
1963: case 'h':
1964: case 'i':
1965: case 'j':
1966: case 'k':
1967: case 'l':
1968: case 'm':
1969: case 'n':
1970: case 'o':
1971: case 'p':
1972: case 'q':
1973: case 'r':
1974: case 's':
1975: case 't':
1976: case 'u':
1977: case 'v':
1978: case 'w':
1979: case 'x':
1980: case 'y':
1981: case 'z': {
1982: matchRange('a', 'z');
1983: break;
1984: }
1985: case 'A':
1986: case 'B':
1987: case 'C':
1988: case 'D':
1989: case 'E':
1990: case 'F':
1991: case 'G':
1992: case 'H':
1993: case 'I':
1994: case 'J':
1995: case 'K':
1996: case 'L':
1997: case 'M':
1998: case 'N':
1999: case 'O':
2000: case 'P':
2001: case 'Q':
2002: case 'R':
2003: case 'S':
2004: case 'T':
2005: case 'U':
2006: case 'V':
2007: case 'W':
2008: case 'X':
2009: case 'Y':
2010: case 'Z': {
2011: matchRange('A', 'Z');
2012: break;
2013: }
2014: case '_': {
2015: match('_');
2016: break;
2017: }
2018: case '0':
2019: case '1':
2020: case '2':
2021: case '3':
2022: case '4':
2023: case '5':
2024: case '6':
2025: case '7':
2026: case '8':
2027: case '9': {
2028: matchRange('0', '9');
2029: break;
2030: }
2031: case '$': {
2032: match('$');
2033: break;
2034: }
2035: default: {
2036: break _loop393;
2037: }
2038: }
2039: } while (true);
2040: }
2041: if (inputState.guessing == 0) {
2042:
2043: // check if "assert" keyword is enabled
2044: if (assertEnabled
2045: && "assert".equals(new String(text.getBuffer(),
2046: _begin, text.length() - _begin))) {
2047: _ttype = LITERAL_assert; // set token type for the rule in the parser
2048: }
2049: // check if "enum" keyword is enabled
2050: if (enumEnabled
2051: && "enum".equals(new String(text.getBuffer(),
2052: _begin, text.length() - _begin))) {
2053: _ttype = LITERAL_enum; // set token type for the rule in the parser
2054: }
2055:
2056: }
2057: _ttype = testLiteralsTable(_ttype);
2058: if (_createToken && _token == null && _ttype != Token.SKIP) {
2059: _token = makeToken(_ttype);
2060: _token.setText(new String(text.getBuffer(), _begin, text
2061: .length()
2062: - _begin));
2063: }
2064: _returnToken = _token;
2065: }
2066:
2067: public final void mNUM_INT(boolean _createToken)
2068: throws RecognitionException, CharStreamException,
2069: TokenStreamException {
2070: int _ttype;
2071: Token _token = null;
2072: int _begin = text.length();
2073: _ttype = NUM_INT;
2074: int _saveIndex;
2075: Token f1 = null;
2076: Token f2 = null;
2077: Token f3 = null;
2078: Token f4 = null;
2079: boolean isDecimal = false;
2080: Token t = null;
2081:
2082: switch (LA(1)) {
2083: case '.': {
2084: match('.');
2085: if (inputState.guessing == 0) {
2086: _ttype = DOT;
2087: }
2088: {
2089: switch (LA(1)) {
2090: case '0':
2091: case '1':
2092: case '2':
2093: case '3':
2094: case '4':
2095: case '5':
2096: case '6':
2097: case '7':
2098: case '8':
2099: case '9': {
2100: {
2101: {
2102: int _cnt398 = 0;
2103: _loop398: do {
2104: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2105: matchRange('0', '9');
2106: } else {
2107: if (_cnt398 >= 1) {
2108: break _loop398;
2109: } else {
2110: throw new NoViableAltForCharException(
2111: (char) LA(1),
2112: getFilename(),
2113: getLine(), getColumn());
2114: }
2115: }
2116:
2117: _cnt398++;
2118: } while (true);
2119: }
2120: {
2121: if ((LA(1) == 'E' || LA(1) == 'e')) {
2122: mEXPONENT(false);
2123: } else {
2124: }
2125:
2126: }
2127: {
2128: if ((LA(1) == 'D' || LA(1) == 'F'
2129: || LA(1) == 'd' || LA(1) == 'f')) {
2130: mFLOAT_SUFFIX(true);
2131: f1 = _returnToken;
2132: if (inputState.guessing == 0) {
2133: t = f1;
2134: }
2135: } else {
2136: }
2137:
2138: }
2139: if (inputState.guessing == 0) {
2140:
2141: if (t != null
2142: && t.getText().toUpperCase()
2143: .indexOf('F') >= 0) {
2144: _ttype = NUM_FLOAT;
2145: } else {
2146: _ttype = NUM_DOUBLE; // assume double
2147: }
2148:
2149: }
2150: }
2151: break;
2152: }
2153: case '.': {
2154: {
2155: match("..");
2156: if (inputState.guessing == 0) {
2157: _ttype = TRIPLE_DOT;
2158: }
2159: }
2160: break;
2161: }
2162: default: {
2163: }
2164: }
2165: }
2166: break;
2167: }
2168: case '0':
2169: case '1':
2170: case '2':
2171: case '3':
2172: case '4':
2173: case '5':
2174: case '6':
2175: case '7':
2176: case '8':
2177: case '9': {
2178: {
2179: switch (LA(1)) {
2180: case '0': {
2181: match('0');
2182: if (inputState.guessing == 0) {
2183: isDecimal = true;
2184: }
2185: {
2186: if ((LA(1) == 'X' || LA(1) == 'x')) {
2187: {
2188: switch (LA(1)) {
2189: case 'x': {
2190: match('x');
2191: break;
2192: }
2193: case 'X': {
2194: match('X');
2195: break;
2196: }
2197: default: {
2198: throw new NoViableAltForCharException(
2199: (char) LA(1),
2200: getFilename(), getLine(),
2201: getColumn());
2202: }
2203: }
2204: }
2205: {
2206: int _cnt406 = 0;
2207: _loop406: do {
2208: if ((_tokenSet_4.member(LA(1))) && (true) && (true) && (true)) {
2209: mHEX_DIGIT(false);
2210: } else {
2211: if (_cnt406 >= 1) {
2212: break _loop406;
2213: } else {
2214: throw new NoViableAltForCharException(
2215: (char) LA(1),
2216: getFilename(),
2217: getLine(),
2218: getColumn());
2219: }
2220: }
2221:
2222: _cnt406++;
2223: } while (true);
2224: }
2225: } else {
2226: boolean synPredMatched411 = false;
2227: if ((((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true) && (true))) {
2228: int _m411 = mark();
2229: synPredMatched411 = true;
2230: inputState.guessing++;
2231: try {
2232: {
2233: {
2234: int _cnt409 = 0;
2235: _loop409: do {
2236: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2237: matchRange('0', '9');
2238: } else {
2239: if (_cnt409 >= 1) {
2240: break _loop409;
2241: } else {
2242: throw new NoViableAltForCharException(
2243: (char) LA(1),
2244: getFilename(),
2245: getLine(),
2246: getColumn());
2247: }
2248: }
2249:
2250: _cnt409++;
2251: } while (true);
2252: }
2253: {
2254: switch (LA(1)) {
2255: case '.': {
2256: match('.');
2257: break;
2258: }
2259: case 'E':
2260: case 'e': {
2261: mEXPONENT(false);
2262: break;
2263: }
2264: case 'D':
2265: case 'F':
2266: case 'd':
2267: case 'f': {
2268: mFLOAT_SUFFIX(false);
2269: break;
2270: }
2271: default: {
2272: throw new NoViableAltForCharException(
2273: (char) LA(1),
2274: getFilename(),
2275: getLine(),
2276: getColumn());
2277: }
2278: }
2279: }
2280: }
2281: } catch (RecognitionException pe) {
2282: synPredMatched411 = false;
2283: }
2284: rewind(_m411);
2285: inputState.guessing--;
2286: }
2287: if (synPredMatched411) {
2288: {
2289: int _cnt413 = 0;
2290: _loop413: do {
2291: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2292: matchRange('0', '9');
2293: } else {
2294: if (_cnt413 >= 1) {
2295: break _loop413;
2296: } else {
2297: throw new NoViableAltForCharException(
2298: (char) LA(1),
2299: getFilename(),
2300: getLine(),
2301: getColumn());
2302: }
2303: }
2304:
2305: _cnt413++;
2306: } while (true);
2307: }
2308: } else if (((LA(1) >= '0' && LA(1) <= '7')) && (true) && (true) && (true)) {
2309: {
2310: int _cnt415 = 0;
2311: _loop415: do {
2312: if (((LA(1) >= '0' && LA(1) <= '7'))) {
2313: matchRange('0', '7');
2314: } else {
2315: if (_cnt415 >= 1) {
2316: break _loop415;
2317: } else {
2318: throw new NoViableAltForCharException(
2319: (char) LA(1),
2320: getFilename(),
2321: getLine(),
2322: getColumn());
2323: }
2324: }
2325:
2326: _cnt415++;
2327: } while (true);
2328: }
2329: } else {
2330: }
2331: }
2332: }
2333: break;
2334: }
2335: case '1':
2336: case '2':
2337: case '3':
2338: case '4':
2339: case '5':
2340: case '6':
2341: case '7':
2342: case '8':
2343: case '9': {
2344: {
2345: matchRange('1', '9');
2346: }
2347: {
2348: _loop418: do {
2349: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2350: matchRange('0', '9');
2351: } else {
2352: break _loop418;
2353: }
2354:
2355: } while (true);
2356: }
2357: if (inputState.guessing == 0) {
2358: isDecimal = true;
2359: }
2360: break;
2361: }
2362: default: {
2363: throw new NoViableAltForCharException((char) LA(1),
2364: getFilename(), getLine(), getColumn());
2365: }
2366: }
2367: }
2368: {
2369: if ((LA(1) == 'L' || LA(1) == 'l')) {
2370: {
2371: switch (LA(1)) {
2372: case 'l': {
2373: match('l');
2374: break;
2375: }
2376: case 'L': {
2377: match('L');
2378: break;
2379: }
2380: default: {
2381: throw new NoViableAltForCharException(
2382: (char) LA(1), getFilename(),
2383: getLine(), getColumn());
2384: }
2385: }
2386: }
2387: if (inputState.guessing == 0) {
2388: _ttype = NUM_LONG;
2389: }
2390: } else if (((LA(1) == '.' || LA(1) == 'D'
2391: || LA(1) == 'E' || LA(1) == 'F' || LA(1) == 'd'
2392: || LA(1) == 'e' || LA(1) == 'f'))
2393: && (isDecimal)) {
2394: {
2395: switch (LA(1)) {
2396: case '.': {
2397: match('.');
2398: {
2399: _loop423: do {
2400: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2401: matchRange('0', '9');
2402: } else {
2403: break _loop423;
2404: }
2405:
2406: } while (true);
2407: }
2408: {
2409: if ((LA(1) == 'E' || LA(1) == 'e')) {
2410: mEXPONENT(false);
2411: } else {
2412: }
2413:
2414: }
2415: {
2416: if ((LA(1) == 'D' || LA(1) == 'F'
2417: || LA(1) == 'd' || LA(1) == 'f')) {
2418: mFLOAT_SUFFIX(true);
2419: f2 = _returnToken;
2420: if (inputState.guessing == 0) {
2421: t = f2;
2422: }
2423: } else {
2424: }
2425:
2426: }
2427: break;
2428: }
2429: case 'E':
2430: case 'e': {
2431: mEXPONENT(false);
2432: {
2433: if ((LA(1) == 'D' || LA(1) == 'F'
2434: || LA(1) == 'd' || LA(1) == 'f')) {
2435: mFLOAT_SUFFIX(true);
2436: f3 = _returnToken;
2437: if (inputState.guessing == 0) {
2438: t = f3;
2439: }
2440: } else {
2441: }
2442:
2443: }
2444: break;
2445: }
2446: case 'D':
2447: case 'F':
2448: case 'd':
2449: case 'f': {
2450: mFLOAT_SUFFIX(true);
2451: f4 = _returnToken;
2452: if (inputState.guessing == 0) {
2453: t = f4;
2454: }
2455: break;
2456: }
2457: default: {
2458: throw new NoViableAltForCharException(
2459: (char) LA(1), getFilename(),
2460: getLine(), getColumn());
2461: }
2462: }
2463: }
2464: if (inputState.guessing == 0) {
2465:
2466: if (t != null
2467: && t.getText().toUpperCase().indexOf(
2468: 'F') >= 0) {
2469: _ttype = NUM_FLOAT;
2470: } else {
2471: _ttype = NUM_DOUBLE; // assume double
2472: }
2473:
2474: }
2475: } else {
2476: }
2477:
2478: }
2479: break;
2480: }
2481: default: {
2482: throw new NoViableAltForCharException((char) LA(1),
2483: getFilename(), getLine(), getColumn());
2484: }
2485: }
2486: if (_createToken && _token == null && _ttype != Token.SKIP) {
2487: _token = makeToken(_ttype);
2488: _token.setText(new String(text.getBuffer(), _begin, text
2489: .length()
2490: - _begin));
2491: }
2492: _returnToken = _token;
2493: }
2494:
2495: protected final void mEXPONENT(boolean _createToken)
2496: throws RecognitionException, CharStreamException,
2497: TokenStreamException {
2498: int _ttype;
2499: Token _token = null;
2500: int _begin = text.length();
2501: _ttype = EXPONENT;
2502: int _saveIndex;
2503:
2504: {
2505: switch (LA(1)) {
2506: case 'e': {
2507: match('e');
2508: break;
2509: }
2510: case 'E': {
2511: match('E');
2512: break;
2513: }
2514: default: {
2515: throw new NoViableAltForCharException((char) LA(1),
2516: getFilename(), getLine(), getColumn());
2517: }
2518: }
2519: }
2520: {
2521: switch (LA(1)) {
2522: case '+': {
2523: match('+');
2524: break;
2525: }
2526: case '-': {
2527: match('-');
2528: break;
2529: }
2530: case '0':
2531: case '1':
2532: case '2':
2533: case '3':
2534: case '4':
2535: case '5':
2536: case '6':
2537: case '7':
2538: case '8':
2539: case '9': {
2540: break;
2541: }
2542: default: {
2543: throw new NoViableAltForCharException((char) LA(1),
2544: getFilename(), getLine(), getColumn());
2545: }
2546: }
2547: }
2548: {
2549: int _cnt432 = 0;
2550: _loop432: do {
2551: if (((LA(1) >= '0' && LA(1) <= '9'))) {
2552: matchRange('0', '9');
2553: } else {
2554: if (_cnt432 >= 1) {
2555: break _loop432;
2556: } else {
2557: throw new NoViableAltForCharException(
2558: (char) LA(1), getFilename(), getLine(),
2559: getColumn());
2560: }
2561: }
2562:
2563: _cnt432++;
2564: } while (true);
2565: }
2566: if (_createToken && _token == null && _ttype != Token.SKIP) {
2567: _token = makeToken(_ttype);
2568: _token.setText(new String(text.getBuffer(), _begin, text
2569: .length()
2570: - _begin));
2571: }
2572: _returnToken = _token;
2573: }
2574:
2575: protected final void mFLOAT_SUFFIX(boolean _createToken)
2576: throws RecognitionException, CharStreamException,
2577: TokenStreamException {
2578: int _ttype;
2579: Token _token = null;
2580: int _begin = text.length();
2581: _ttype = FLOAT_SUFFIX;
2582: int _saveIndex;
2583:
2584: switch (LA(1)) {
2585: case 'f': {
2586: match('f');
2587: break;
2588: }
2589: case 'F': {
2590: match('F');
2591: break;
2592: }
2593: case 'd': {
2594: match('d');
2595: break;
2596: }
2597: case 'D': {
2598: match('D');
2599: break;
2600: }
2601: default: {
2602: throw new NoViableAltForCharException((char) LA(1),
2603: getFilename(), getLine(), getColumn());
2604: }
2605: }
2606: if (_createToken && _token == null && _ttype != Token.SKIP) {
2607: _token = makeToken(_ttype);
2608: _token.setText(new String(text.getBuffer(), _begin, text
2609: .length()
2610: - _begin));
2611: }
2612: _returnToken = _token;
2613: }
2614:
2615: public final void mAT(boolean _createToken)
2616: throws RecognitionException, CharStreamException,
2617: TokenStreamException {
2618: int _ttype;
2619: Token _token = null;
2620: int _begin = text.length();
2621: _ttype = AT;
2622: int _saveIndex;
2623:
2624: match('@');
2625: if (_createToken && _token == null && _ttype != Token.SKIP) {
2626: _token = makeToken(_ttype);
2627: _token.setText(new String(text.getBuffer(), _begin, text
2628: .length()
2629: - _begin));
2630: }
2631: _returnToken = _token;
2632: }
2633:
2634: private static final long[] mk_tokenSet_0() {
2635: long[] data = new long[2048];
2636: data[0] = -9224L;
2637: for (int i = 1; i <= 1023; i++) {
2638: data[i] = -1L;
2639: }
2640: return data;
2641: }
2642:
2643: public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
2644:
2645: private static final long[] mk_tokenSet_1() {
2646: long[] data = new long[2048];
2647: data[0] = -4398046520328L;
2648: for (int i = 1; i <= 1023; i++) {
2649: data[i] = -1L;
2650: }
2651: return data;
2652: }
2653:
2654: public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
2655:
2656: private static final long[] mk_tokenSet_2() {
2657: long[] data = new long[2048];
2658: data[0] = -17179878408L;
2659: data[1] = -268435457L;
2660: for (int i = 2; i <= 1023; i++) {
2661: data[i] = -1L;
2662: }
2663: return data;
2664: }
2665:
2666: public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
2667:
2668: private static final long[] mk_tokenSet_3() {
2669: long[] data = new long[2048];
2670: data[0] = -549755823112L;
2671: data[1] = -268435457L;
2672: for (int i = 2; i <= 1023; i++) {
2673: data[i] = -1L;
2674: }
2675: return data;
2676: }
2677:
2678: public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
2679:
2680: private static final long[] mk_tokenSet_4() {
2681: long[] data = new long[1025];
2682: data[0] = 287948901175001088L;
2683: data[1] = 541165879422L;
2684: return data;
2685: }
2686:
2687: public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
2688:
2689: }
|