| // $ANTLR : "Emfatic.g" -> "EmfaticLexer.java"$ |
| |
| package org.eclipse.emf.emfatic.core.lang.gen.parser; |
| import org.eclipse.emf.emfatic.core.lang.gen.ast.*; |
| import org.eclipse.gymnast.runtime.core.parser.*; |
| import org.eclipse.gymnast.runtime.core.ast.*; |
| |
| import java.io.InputStream; |
| import antlr.TokenStreamException; |
| import antlr.TokenStreamIOException; |
| import antlr.TokenStreamRecognitionException; |
| import antlr.CharStreamException; |
| import antlr.CharStreamIOException; |
| import antlr.ANTLRException; |
| import java.io.Reader; |
| import java.util.Hashtable; |
| import antlr.CharScanner; |
| import antlr.InputBuffer; |
| import antlr.ByteBuffer; |
| import antlr.CharBuffer; |
| import antlr.Token; |
| import antlr.CommonToken; |
| import antlr.RecognitionException; |
| import antlr.NoViableAltForCharException; |
| import antlr.MismatchedCharException; |
| import antlr.TokenStream; |
| import antlr.ANTLRHashString; |
| import antlr.LexerSharedInputState; |
| import antlr.collections.impl.BitSet; |
| import antlr.SemanticException; |
| |
| public class EmfaticLexer extends antlr.CharScanner implements EmfaticParserTokenTypes, TokenStream |
| { |
| public EmfaticLexer(InputStream in) { |
| this(new ByteBuffer(in)); |
| } |
| public EmfaticLexer(Reader in) { |
| this(new CharBuffer(in)); |
| } |
| public EmfaticLexer(InputBuffer ib) { |
| this(new LexerSharedInputState(ib)); |
| } |
| public EmfaticLexer(LexerSharedInputState state) { |
| super(state); |
| caseSensitiveLiterals = true; |
| setCaseSensitive(true); |
| literals = new Hashtable(); |
| literals.put(new ANTLRHashString("super", this), new Integer(27)); |
| literals.put(new ANTLRHashString("abstract", this), new Integer(20)); |
| literals.put(new ANTLRHashString("ref", this), new Integer(36)); |
| literals.put(new ANTLRHashString("unsettable", this), new Integer(42)); |
| literals.put(new ANTLRHashString("op", this), new Integer(52)); |
| literals.put(new ANTLRHashString("datatype", this), new Integer(55)); |
| literals.put(new ANTLRHashString("class", this), new Integer(21)); |
| literals.put(new ANTLRHashString("val", this), new Integer(37)); |
| literals.put(new ANTLRHashString("throws", this), new Integer(53)); |
| literals.put(new ANTLRHashString("derived", this), new Integer(43)); |
| literals.put(new ANTLRHashString("transient", this), new Integer(41)); |
| literals.put(new ANTLRHashString("unique", this), new Integer(44)); |
| literals.put(new ANTLRHashString("ordered", this), new Integer(45)); |
| literals.put(new ANTLRHashString("enum", this), new Integer(56)); |
| literals.put(new ANTLRHashString("extends", this), new Integer(18)); |
| literals.put(new ANTLRHashString("attr", this), new Integer(28)); |
| literals.put(new ANTLRHashString("void", this), new Integer(54)); |
| literals.put(new ANTLRHashString("import", this), new Integer(15)); |
| literals.put(new ANTLRHashString("true", this), new Integer(48)); |
| literals.put(new ANTLRHashString("interface", this), new Integer(22)); |
| literals.put(new ANTLRHashString("id", this), new Integer(47)); |
| literals.put(new ANTLRHashString("readonly", this), new Integer(39)); |
| literals.put(new ANTLRHashString("package", this), new Integer(4)); |
| literals.put(new ANTLRHashString("false", this), new Integer(49)); |
| literals.put(new ANTLRHashString("volatile", this), new Integer(40)); |
| literals.put(new ANTLRHashString("mapentry", this), new Integer(57)); |
| literals.put(new ANTLRHashString("resolve", this), new Integer(46)); |
| } |
| |
| public Token nextToken() throws TokenStreamException { |
| Token theRetToken=null; |
| tryAgain: |
| for (;;) { |
| Token _token = null; |
| int _ttype = Token.INVALID_TYPE; |
| resetText(); |
| try { // for char stream error handling |
| try { // for lexical error handling |
| switch ( LA(1)) { |
| case '{': |
| { |
| mLCURLY(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '}': |
| { |
| mRCURLY(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '[': |
| { |
| mLSQUARE(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case ']': |
| { |
| mRSQUARE(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '(': |
| { |
| mLPAREN(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case ')': |
| { |
| mRPAREN(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case ',': |
| { |
| mCOMMA(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case ':': |
| { |
| mCOLON(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case ';': |
| { |
| mSEMI(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '*': |
| { |
| mSTAR(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '+': |
| { |
| mPLUS(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '=': |
| { |
| mEQUALS(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '?': |
| { |
| mQMARK(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '!': |
| { |
| mBANG(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '$': |
| { |
| mDOLLAR(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '#': |
| { |
| mHASH(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '@': |
| { |
| mAT(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '"': |
| { |
| mSTRING_LITERAL(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '\'': |
| { |
| mCHAR_LITERAL(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case 'A': case 'B': case 'C': case 'D': |
| case 'E': case 'F': case 'G': case 'H': |
| case 'I': case 'J': case 'K': case 'L': |
| case 'M': case 'N': case 'O': case 'P': |
| case 'Q': case 'R': case 'S': case 'T': |
| case 'U': case 'V': case 'W': case 'X': |
| case 'Y': case 'Z': case '_': case 'a': |
| case 'b': case 'c': case 'd': case 'e': |
| case 'f': case 'g': case 'h': case 'i': |
| case 'j': case 'k': case 'l': case 'm': |
| case 'n': case 'o': case 'p': case 'q': |
| case 'r': case 's': case 't': case 'u': |
| case 'v': case 'w': case 'x': case 'y': |
| case 'z': case '~': |
| { |
| mID(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '0': case '1': case '2': case '3': |
| case '4': case '5': case '6': case '7': |
| case '8': case '9': |
| { |
| mINT_LITERAL(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '\t': case '\n': case '\u000c': case '\r': |
| case ' ': |
| { |
| mWS(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| case '&': |
| { |
| mAMP(true); |
| theRetToken=_returnToken; |
| break; |
| } |
| default: |
| if ((LA(1)=='.') && (LA(2)=='.')) { |
| mDOT_DOT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='-') && (LA(2)=='>')) { |
| mMINUS_GT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='>') && (LA(2)=='<')) { |
| mGT_LT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='<') && (LA(2)=='>')) { |
| mLT_GT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='/') && (LA(2)=='/')) { |
| mSINGLE_LINE_COMMENT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='/') && (LA(2)=='*')) { |
| mMULTI_LINE_COMMENT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='.') && (true)) { |
| mDOT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='-') && (true)) { |
| mMINUS(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='<') && (true)) { |
| mLT(true); |
| theRetToken=_returnToken; |
| } |
| else if ((LA(1)=='>') && (true)) { |
| mGT(true); |
| theRetToken=_returnToken; |
| } |
| else { |
| if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} |
| else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} |
| } |
| } |
| if ( _returnToken==null ) continue tryAgain; // found SKIP token |
| _ttype = _returnToken.getType(); |
| _returnToken.setType(_ttype); |
| return _returnToken; |
| } |
| catch (RecognitionException e) { |
| throw new TokenStreamRecognitionException(e); |
| } |
| } |
| catch (CharStreamException cse) { |
| if ( cse instanceof CharStreamIOException ) { |
| throw new TokenStreamIOException(((CharStreamIOException)cse).io); |
| } |
| else { |
| throw new TokenStreamException(cse.getMessage()); |
| } |
| } |
| } |
| } |
| |
| public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = LCURLY; |
| int _saveIndex; |
| |
| match('{'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = RCURLY; |
| int _saveIndex; |
| |
| match('}'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mLSQUARE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = LSQUARE; |
| int _saveIndex; |
| |
| match('['); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mRSQUARE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = RSQUARE; |
| int _saveIndex; |
| |
| match(']'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = LPAREN; |
| int _saveIndex; |
| |
| match('('); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = RPAREN; |
| int _saveIndex; |
| |
| match(')'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = DOT; |
| int _saveIndex; |
| |
| match('.'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = COMMA; |
| int _saveIndex; |
| |
| match(','); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = COLON; |
| int _saveIndex; |
| |
| match(':'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = SEMI; |
| int _saveIndex; |
| |
| match(';'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = STAR; |
| int _saveIndex; |
| |
| match('*'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = PLUS; |
| int _saveIndex; |
| |
| match('+'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = MINUS; |
| int _saveIndex; |
| |
| match('-'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mEQUALS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = EQUALS; |
| int _saveIndex; |
| |
| match('='); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mQMARK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = QMARK; |
| int _saveIndex; |
| |
| match('?'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mBANG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = BANG; |
| int _saveIndex; |
| |
| match('!'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mDOLLAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = DOLLAR; |
| int _saveIndex; |
| |
| match('$'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mHASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = HASH; |
| int _saveIndex; |
| |
| match('#'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = AT; |
| int _saveIndex; |
| |
| match('@'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mDOT_DOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = DOT_DOT; |
| int _saveIndex; |
| |
| match(".."); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mMINUS_GT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = MINUS_GT; |
| int _saveIndex; |
| |
| match("->"); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mGT_LT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = GT_LT; |
| int _saveIndex; |
| |
| match("><"); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mLT_GT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = LT_GT; |
| int _saveIndex; |
| |
| match("<>"); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = STRING_LITERAL; |
| int _saveIndex; |
| |
| match('"'); |
| { |
| _loop144: |
| do { |
| if ((LA(1)=='\\')) { |
| mESC(false); |
| } |
| else if ((_tokenSet_0.member(LA(1)))) { |
| matchNot('"'); |
| } |
| else { |
| break _loop144; |
| } |
| |
| } while (true); |
| } |
| match('"'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = ESC; |
| int _saveIndex; |
| |
| match('\\'); |
| { |
| switch ( LA(1)) { |
| case 't': |
| { |
| match('t'); |
| break; |
| } |
| case 'f': |
| { |
| match('f'); |
| break; |
| } |
| case 'r': |
| { |
| match('r'); |
| break; |
| } |
| case 'n': |
| { |
| match('n'); |
| break; |
| } |
| case '"': |
| { |
| match('"'); |
| break; |
| } |
| case '\'': |
| { |
| match('\''); |
| break; |
| } |
| case '\\': |
| { |
| match('\\'); |
| break; |
| } |
| case '0': case '1': case '2': case '3': |
| case '4': case '5': case '6': case '7': |
| case '8': case '9': |
| { |
| { |
| mDIGIT(false); |
| mDIGIT(false); |
| mDIGIT(false); |
| } |
| break; |
| } |
| default: |
| { |
| throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); |
| } |
| } |
| } |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = CHAR_LITERAL; |
| int _saveIndex; |
| |
| match('\''); |
| { |
| if ((LA(1)=='\\')) { |
| mESC(false); |
| } |
| else if ((_tokenSet_1.member(LA(1)))) { |
| matchNot('\''); |
| } |
| else { |
| throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); |
| } |
| |
| } |
| match('\''); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = DIGIT; |
| int _saveIndex; |
| |
| matchRange('0','9'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = ID; |
| int _saveIndex; |
| |
| { |
| switch ( LA(1)) { |
| case '~': |
| { |
| match('~'); |
| break; |
| } |
| case 'A': case 'B': case 'C': case 'D': |
| case 'E': case 'F': case 'G': case 'H': |
| case 'I': case 'J': case 'K': case 'L': |
| case 'M': case 'N': case 'O': case 'P': |
| case 'Q': case 'R': case 'S': case 'T': |
| case 'U': case 'V': case 'W': case 'X': |
| case 'Y': case 'Z': case '_': case 'a': |
| case 'b': case 'c': case 'd': case 'e': |
| case 'f': case 'g': case 'h': case 'i': |
| case 'j': case 'k': case 'l': case 'm': |
| case 'n': case 'o': case 'p': case 'q': |
| case 'r': case 's': case 't': case 'u': |
| case 'v': case 'w': case 'x': case 'y': |
| case 'z': |
| { |
| break; |
| } |
| default: |
| { |
| throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); |
| } |
| } |
| } |
| { |
| switch ( LA(1)) { |
| case 'a': case 'b': case 'c': case 'd': |
| case 'e': case 'f': case 'g': case 'h': |
| case 'i': case 'j': case 'k': case 'l': |
| case 'm': case 'n': case 'o': case 'p': |
| case 'q': case 'r': case 's': case 't': |
| case 'u': case 'v': case 'w': case 'x': |
| case 'y': case 'z': |
| { |
| matchRange('a','z'); |
| break; |
| } |
| case 'A': case 'B': case 'C': case 'D': |
| case 'E': case 'F': case 'G': case 'H': |
| case 'I': case 'J': case 'K': case 'L': |
| case 'M': case 'N': case 'O': case 'P': |
| case 'Q': case 'R': case 'S': case 'T': |
| case 'U': case 'V': case 'W': case 'X': |
| case 'Y': case 'Z': |
| { |
| matchRange('A','Z'); |
| break; |
| } |
| case '_': |
| { |
| match('_'); |
| break; |
| } |
| default: |
| { |
| throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); |
| } |
| } |
| } |
| { |
| _loop154: |
| do { |
| switch ( LA(1)) { |
| case 'a': case 'b': case 'c': case 'd': |
| case 'e': case 'f': case 'g': case 'h': |
| case 'i': case 'j': case 'k': case 'l': |
| case 'm': case 'n': case 'o': case 'p': |
| case 'q': case 'r': case 's': case 't': |
| case 'u': case 'v': case 'w': case 'x': |
| case 'y': case 'z': |
| { |
| matchRange('a','z'); |
| break; |
| } |
| case 'A': case 'B': case 'C': case 'D': |
| case 'E': case 'F': case 'G': case 'H': |
| case 'I': case 'J': case 'K': case 'L': |
| case 'M': case 'N': case 'O': case 'P': |
| case 'Q': case 'R': case 'S': case 'T': |
| case 'U': case 'V': case 'W': case 'X': |
| case 'Y': case 'Z': |
| { |
| matchRange('A','Z'); |
| break; |
| } |
| case '_': |
| { |
| match('_'); |
| break; |
| } |
| case '0': case '1': case '2': case '3': |
| case '4': case '5': case '6': case '7': |
| case '8': case '9': |
| { |
| mDIGIT(false); |
| break; |
| } |
| default: |
| { |
| break _loop154; |
| } |
| } |
| } while (true); |
| } |
| _ttype = testLiteralsTable(_ttype); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mINT_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = INT_LITERAL; |
| int _saveIndex; |
| |
| { |
| int _cnt157=0; |
| _loop157: |
| do { |
| if (((LA(1) >= '0' && LA(1) <= '9'))) { |
| mDIGIT(false); |
| } |
| else { |
| if ( _cnt157>=1 ) { break _loop157; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} |
| } |
| |
| _cnt157++; |
| } while (true); |
| } |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = WS; |
| int _saveIndex; |
| |
| { |
| int _cnt161=0; |
| _loop161: |
| do { |
| switch ( LA(1)) { |
| case ' ': |
| { |
| match(' '); |
| break; |
| } |
| case '\t': |
| { |
| match('\t'); |
| break; |
| } |
| case '\u000c': |
| { |
| match('\f'); |
| break; |
| } |
| case '\r': |
| { |
| match('\r'); |
| break; |
| } |
| case '\n': |
| { |
| match('\n'); |
| break; |
| } |
| default: |
| { |
| if ( _cnt161>=1 ) { break _loop161; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} |
| } |
| } |
| _cnt161++; |
| } while (true); |
| } |
| _ttype = Token.SKIP; |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mSINGLE_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = SINGLE_LINE_COMMENT; |
| int _saveIndex; |
| |
| match("//"); |
| { |
| _loop165: |
| do { |
| if ((_tokenSet_2.member(LA(1)))) { |
| { |
| match(_tokenSet_2); |
| } |
| } |
| else { |
| break _loop165; |
| } |
| |
| } while (true); |
| } |
| { |
| switch ( LA(1)) { |
| case '\n': |
| { |
| match('\n'); |
| break; |
| } |
| case '\r': |
| { |
| match('\r'); |
| break; |
| } |
| default: |
| { |
| } |
| } |
| } |
| _ttype = Token.SKIP; |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mMULTI_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = MULTI_LINE_COMMENT; |
| int _saveIndex; |
| |
| match("/*"); |
| { |
| if ((_tokenSet_3.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0000' && LA(3) <= '\ufffe'))) { |
| { |
| matchNot('!'); |
| { |
| _loop171: |
| do { |
| if ((LA(1)=='*') && (_tokenSet_4.member(LA(2)))) { |
| match('*'); |
| matchNot('/'); |
| } |
| else if ((_tokenSet_5.member(LA(1)))) { |
| matchNot('*'); |
| } |
| else { |
| break _loop171; |
| } |
| |
| } while (true); |
| } |
| match("*/"); |
| } |
| } |
| else if ((LA(1)=='*') && (LA(2)=='/') && (true)) { |
| match("*/"); |
| } |
| else { |
| throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); |
| } |
| |
| } |
| _ttype = Token.SKIP; |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mAMP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = AMP; |
| int _saveIndex; |
| |
| match('&'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = LT; |
| int _saveIndex; |
| |
| match('<'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { |
| int _ttype; Token _token=null; int _begin=text.length(); |
| _ttype = GT; |
| int _saveIndex; |
| |
| match('>'); |
| if ( _createToken && _token==null && _ttype!=Token.SKIP ) { |
| _token = makeToken(_ttype); |
| _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); |
| } |
| _returnToken = _token; |
| } |
| |
| |
| private static final long[] mk_tokenSet_0() { |
| long[] data = new long[2048]; |
| data[0]=-17179869185L; |
| data[1]=-268435457L; |
| for (int i = 2; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); |
| private static final long[] mk_tokenSet_1() { |
| long[] data = new long[2048]; |
| data[0]=-549755813889L; |
| data[1]=-268435457L; |
| for (int i = 2; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); |
| private static final long[] mk_tokenSet_2() { |
| long[] data = new long[2048]; |
| data[0]=-9217L; |
| for (int i = 1; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); |
| private static final long[] mk_tokenSet_3() { |
| long[] data = new long[2048]; |
| data[0]=-8589934593L; |
| for (int i = 1; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); |
| private static final long[] mk_tokenSet_4() { |
| long[] data = new long[2048]; |
| data[0]=-140737488355329L; |
| for (int i = 1; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); |
| private static final long[] mk_tokenSet_5() { |
| long[] data = new long[2048]; |
| data[0]=-4398046511105L; |
| for (int i = 1; i<=1022; i++) { data[i]=-1L; } |
| data[1023]=9223372036854775807L; |
| return data; |
| } |
| public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); |
| |
| } |