// $ANTLR 2.7.7 (2006-11-01): "cp51.g" -> "Ob51Lexer.cs"$ namespace Ob51.Parsing { // Generate header specific to lexer CSharp file using System; using Stream = System.IO.Stream; using TextReader = System.IO.TextReader; using Hashtable = System.Collections.Hashtable; using Comparer = System.Collections.Comparer; using TokenStreamException = antlr.TokenStreamException; using TokenStreamIOException = antlr.TokenStreamIOException; using TokenStreamRecognitionException = antlr.TokenStreamRecognitionException; using CharStreamException = antlr.CharStreamException; using CharStreamIOException = antlr.CharStreamIOException; using ANTLRException = antlr.ANTLRException; using CharScanner = antlr.CharScanner; using InputBuffer = antlr.InputBuffer; using ByteBuffer = antlr.ByteBuffer; using CharBuffer = antlr.CharBuffer; using Token = antlr.Token; using IToken = antlr.IToken; using CommonToken = antlr.CommonToken; using SemanticException = antlr.SemanticException; using RecognitionException = antlr.RecognitionException; using NoViableAltForCharException = antlr.NoViableAltForCharException; using MismatchedCharException = antlr.MismatchedCharException; using TokenStream = antlr.TokenStream; using LexerSharedInputState = antlr.LexerSharedInputState; using BitSet = antlr.collections.impl.BitSet; /*************************** LEXICAL ANALISYS ***************************/ public class Ob51Lexer : antlr.CharScanner , TokenStream { public const int EOF = 1; public const int NULL_TREE_LOOKAHEAD = 3; public const int BOOLEAN = 4; public const int SHORTCHAR = 5; public const int CHAR = 6; public const int BYTE = 7; public const int SHORTINT = 8; public const int INTEGER = 9; public const int LONGINT = 10; public const int SHORTREAL = 11; public const int REAL = 12; public const int SET = 13; public const int MODULEID = 14; public const int WS = 15; public const int COMMENTTEXT = 16; public const int COMMENT = 17; public const int DIGIT = 18; public const int HEXDIGIT = 19; public const int LETTER = 20; public const int ID = 21; public const int SCALEFACTOR = 22; public const int NUM_VALUE = 23; public const int STRING = 24; public const int PUNCTUATION = 25; public const int ConstDeclToken = 26; public const int CycleToken = 27; public const int DeclsSeqToken = 28; public const int EmptyToken = 29; public const int IfToken = 30; public const int ModuleToken = 31; public const int OperationToken = 32; public const int ProcDeclToken = 33; public const int StatsSeqToken = 34; public const int TypeDeclToken = 35; public const int VarDeclToken = 36; public const int LITERAL_MODULE = 37; // ";" = 38 public const int LITERAL_BEGIN = 39; public const int LITERAL_CLOSE = 40; public const int LITERAL_END = 41; // "." = 42 public const int LITERAL_IMPORT = 43; // ":=" = 44 // "*" = 45 // "-" = 46 public const int LITERAL_CONST = 47; public const int LITERAL_TYPE = 48; public const int LITERAL_VAR = 49; // "=" = 50 // ":" = 51 // "," = 52 public const int LITERAL_PROCEDURE = 53; public const int IdentDef = 54; // "^" = 55 // "(" = 56 // ")" = 57 public const int LITERAL_IN = 58; public const int LITERAL_OUT = 59; public const int LITERAL_NEW = 60; public const int LITERAL_ABSTRACT = 61; public const int LITERAL_EMPTY = 62; public const int LITERAL_EXTENSIBLE = 63; public const int LITERAL_HANDLER = 64; public const int LITERAL_OF = 65; public const int LITERAL_ARRAY = 66; public const int LITERAL_LIMITED = 67; public const int LITERAL_RECORD = 68; public const int LITERAL_POINTER = 69; public const int LITERAL_TO = 70; public const int IdentList = 71; public const int LITERAL_IF = 72; public const int LITERAL_THEN = 73; public const int LITERAL_ELSIF = 74; public const int LITERAL_ELSE = 75; public const int LITERAL_CASE = 76; // "|" = 77 public const int LITERAL_WHILE = 78; public const int LITERAL_DO = 79; public const int LITERAL_REPEAT = 80; public const int LITERAL_UNTIL = 81; public const int LITERAL_FOR = 82; public const int TYPE = 83; public const int LITERAL_BY = 84; public const int LITERAL_LOOP = 85; public const int LITERAL_WITH = 86; public const int LITERAL_EXIT = 87; public const int LITERAL_RETURN = 88; // ".." = 89 // "#" = 90 // "<" = 91 // "<=" = 92 // ">" = 93 // ">=" = 94 public const int LITERAL_IS = 95; // "+" = 96 public const int LITERAL_OR = 97; // "/" = 98 public const int LITERAL_DIV = 99; public const int LITERAL_MOD = 100; // "&" = 101 public const int CHARACTER = 102; public const int LITERAL_NIL = 103; // "~" = 104 // "{" = 105 // "}" = 106 // "[" = 107 // "]" = 108 // "$" = 109 interface IModuleIDChecker { bool IsModuleID(string id); } IModuleIDChecker ModuleIDChecker = null; bool IsModuleID(string id) { if (ModuleIDChecker != null) { return ModuleIDChecker.IsModuleID(id); } else { return false; } } public Ob51Lexer(Stream ins) : this(new ByteBuffer(ins)) { } public Ob51Lexer(TextReader r) : this(new CharBuffer(r)) { } public Ob51Lexer(InputBuffer ib) : this(new LexerSharedInputState(ib)) { } public Ob51Lexer(LexerSharedInputState state) : base(state) { initialize(); } private void initialize() { caseSensitiveLiterals = true; setCaseSensitive(true); literals = new Hashtable(100, (float) 0.4, null, Comparer.Default); literals.Add("<", 91); literals.Add("BEGIN", 39); literals.Add("IF", 72); literals.Add("WHILE", 78); literals.Add("#", 90); literals.Add(")", 57); literals.Add("MODULE", 37); literals.Add("/", 98); literals.Add("NEW", 60); literals.Add("ARRAY", 66); literals.Add("OUT", 59); literals.Add(";", 38); literals.Add("BY", 84); literals.Add("CONST", 47); literals.Add("CLOSE", 40); literals.Add("TO", 70); literals.Add("(", 56); literals.Add(".", 42); literals.Add("~", 104); literals.Add("VAR", 49); literals.Add("ELSE", 75); literals.Add(":", 51); literals.Add("WITH", 86); literals.Add("PROCEDURE", 53); literals.Add("THEN", 73); literals.Add("CASE", 76); literals.Add("LOOP", 85); literals.Add("LIMITED", 67); literals.Add("-", 46); literals.Add("FOR", 82); literals.Add("}", 106); literals.Add("POINTER", 69); literals.Add("^", 55); literals.Add("IMPORT", 43); literals.Add("EXIT", 87); literals.Add("&", 101); literals.Add(",", 52); literals.Add("|", 77); literals.Add("]", 108); literals.Add("RECORD", 68); literals.Add("HANDLER", 64); literals.Add("ELSIF", 74); literals.Add(">", 93); literals.Add("END", 41); literals.Add("DO", 79); literals.Add("IN", 58); literals.Add("+", 96); literals.Add("EXTENSIBLE", 63); literals.Add("{", 105); literals.Add("..", 89); literals.Add("NIL", 103); literals.Add("ABSTRACT", 61); literals.Add("=", 50); literals.Add(">=", 94); literals.Add("UNTIL", 81); literals.Add("OF", 65); literals.Add("REPEAT", 80); literals.Add("$", 109); literals.Add("MOD", 100); literals.Add("OR", 97); literals.Add("<=", 92); literals.Add("*", 45); literals.Add("DIV", 99); literals.Add("IS", 95); literals.Add("TYPE", 48); literals.Add("EMPTY", 62); literals.Add("[", 107); literals.Add("RETURN", 88); literals.Add(":=", 44); } override public IToken nextToken() //throws TokenStreamException { IToken theRetToken = null; tryAgain: for (;;) { IToken _token = null; int _ttype = Token.INVALID_TYPE; resetText(); try // for char stream error handling { try // for lexical error handling { switch ( cached_LA1 ) { case '\t': case '\n': case '\u000c': case '\r': case ' ': case '\u0085': case '\u2028': case '\u2029': { mWS(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': { 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': { mNUM_VALUE(true); theRetToken = returnToken_; break; } case '"': case '\'': { mSTRING(true); theRetToken = returnToken_; break; } default: if ((cached_LA1=='(') && (cached_LA2=='*')) { mCOMMENT(true); theRetToken = returnToken_; } else if ((tokenSet_0_.member(cached_LA1)) && (true)) { mPUNCTUATION(true); theRetToken = returnToken_; } else { if (cached_LA1==EOF_CHAR) { uponEOF(); returnToken_ = makeToken(Token.EOF_TYPE); } else {throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());} } break; } if ( null==returnToken_ ) goto tryAgain; // found SKIP token _ttype = returnToken_.Type; returnToken_.Type = _ttype; return returnToken_; } catch (RecognitionException e) { throw new TokenStreamRecognitionException(e); } } catch (CharStreamException cse) { if ( cse is CharStreamIOException ) { throw new TokenStreamIOException(((CharStreamIOException)cse).io); } else { throw new TokenStreamException(cse.Message); } } } } public void mWS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = WS; { // ( ... )+ int _cnt4=0; for (;;) { switch ( cached_LA1 ) { case '\t': { match('\t'); break; } case ' ': { match(' '); break; } case '\r': { match('\r'); break; } case '\n': case '\u000c': case '\u0085': case '\u2028': case '\u2029': { { switch ( cached_LA1 ) { case '\n': { match('\n'); break; } case '\u000c': { match('\f'); break; } case '\u0085': { match('\u0085'); break; } case '\u2028': { match('\u2028'); break; } case '\u2029': { match('\u2029'); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } if (0==inputState.guessing) { newline(); } break; } default: { if (_cnt4 >= 1) { goto _loop4_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } break; } _cnt4++; } _loop4_breakloop: ; } // ( ... )+ if (0==inputState.guessing) { _ttype = Token.SKIP; } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mCOMMENTTEXT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = COMMENTTEXT; { // ( ... )* for (;;) { if (((cached_LA1=='*') && ((cached_LA2 >= '\u0001' && cached_LA2 <= '\ufffd')))&&( LA(2) != ')' )) { match('*'); } else if (((cached_LA1=='(') && ((cached_LA2 >= '\u0001' && cached_LA2 <= '\ufffd')))&&( LA(2) != '*' )) { match('('); } else if ((tokenSet_1_.member(cached_LA1))) { { match(tokenSet_1_); } } else if ((tokenSet_2_.member(cached_LA1))) { { switch ( cached_LA1 ) { case '\n': { match('\n'); break; } case '\u000c': { match('\f'); break; } case '\u0085': { match('\u0085'); break; } case '\u2028': { match('\u2028'); break; } case '\u2029': { match('\u2029'); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } if (0==inputState.guessing) { newline(); } } else { goto _loop9_breakloop; } } _loop9_breakloop: ; } // ( ... )* if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } public void mCOMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = COMMENT; match("(*"); mCOMMENTTEXT(false); { // ( ... )* for (;;) { if ((cached_LA1=='(')) { mCOMMENT(false); mCOMMENTTEXT(false); } else { goto _loop12_breakloop; } } _loop12_breakloop: ; } // ( ... )* match("*)"); if (0==inputState.guessing) { _ttype = Token.SKIP; } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mDIGIT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = DIGIT; matchRange('0','9'); if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mHEXDIGIT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = HEXDIGIT; switch ( cached_LA1 ) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': { matchRange('A','F'); 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: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mLETTER(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = LETTER; switch ( cached_LA1 ) { 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; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } public void mID(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = ID; { switch ( cached_LA1 ) { 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 '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': { mLETTER(false); break; } case '_': { match('_'); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } { // ( ... )* for (;;) { switch ( cached_LA1 ) { 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 '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': { mLETTER(false); break; } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { mDIGIT(false); break; } case '_': { match('_'); break; } default: { goto _loop19_breakloop; } } } _loop19_breakloop: ; } // ( ... )* if (0==inputState.guessing) { if (IsModuleID(text.ToString(_begin, text.Length-_begin))) _ttype = MODULEID; } _ttype = testLiteralsTable(_ttype); if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mINTEGER(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = INTEGER; bool synPredMatched25 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_3_.member(cached_LA2)))) { int _m25 = mark(); synPredMatched25 = true; inputState.guessing++; try { { mDIGIT(false); { // ( ... )* for (;;) { if ((tokenSet_4_.member(cached_LA1))) { mHEXDIGIT(false); } else { goto _loop23_breakloop; } } _loop23_breakloop: ; } // ( ... )* { switch ( cached_LA1 ) { case 'H': { match('H'); break; } case 'L': { match('L'); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } } } catch (RecognitionException) { synPredMatched25 = false; } rewind(_m25); inputState.guessing--; } if ( synPredMatched25 ) { mDIGIT(false); { // ( ... )* for (;;) { if ((tokenSet_4_.member(cached_LA1))) { mHEXDIGIT(false); } else { goto _loop27_breakloop; } } _loop27_breakloop: ; } // ( ... )* { switch ( cached_LA1 ) { case 'H': { match('H'); if (0==inputState.guessing) { _token = NumericToken.MakeHexInt(text.ToString(_begin, text.Length-_begin)); } break; } case 'L': { match('L'); if (0==inputState.guessing) { _token = NumericToken.MakeHexLong(text.ToString(_begin, text.Length-_begin)); } break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } } else if (((cached_LA1 >= '0' && cached_LA1 <= '9')) && (true)) { { // ( ... )+ int _cnt30=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) { mDIGIT(false); } else { if (_cnt30 >= 1) { goto _loop30_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } _cnt30++; } _loop30_breakloop: ; } // ( ... )+ if (0==inputState.guessing) { _token = NumericToken.MakeInt(text.ToString(_begin, text.Length-_begin)); } } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mREAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = REAL; { // ( ... )+ int _cnt33=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) { mDIGIT(false); } else { if (_cnt33 >= 1) { goto _loop33_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } _cnt33++; } _loop33_breakloop: ; } // ( ... )+ match('.'); { // ( ... )* for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) { mDIGIT(false); } else { goto _loop35_breakloop; } } _loop35_breakloop: ; } // ( ... )* { if ((cached_LA1=='E')) { mSCALEFACTOR(false); } else { } } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mSCALEFACTOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = SCALEFACTOR; match('E'); { switch ( cached_LA1 ) { case '+': { match('+'); break; } case '-': { match('-'); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } } { // ( ... )+ int _cnt40=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) { mDIGIT(false); } else { if (_cnt40 >= 1) { goto _loop40_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } _cnt40++; } _loop40_breakloop: ; } // ( ... )+ if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } protected void mCHAR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = CHAR; mDIGIT(false); { // ( ... )* for (;;) { if ((tokenSet_4_.member(cached_LA1))) { mHEXDIGIT(false); } else { goto _loop43_breakloop; } } _loop43_breakloop: ; } // ( ... )* match('X'); if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } public void mNUM_VALUE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = NUM_VALUE; bool synPredMatched48 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_5_.member(cached_LA2)))) { int _m48 = mark(); synPredMatched48 = true; inputState.guessing++; try { { { // ( ... )+ int _cnt47=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) { mDIGIT(false); } else { if (_cnt47 >= 1) { goto _loop47_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } _cnt47++; } _loop47_breakloop: ; } // ( ... )+ match('.'); } } catch (RecognitionException) { synPredMatched48 = false; } rewind(_m48); inputState.guessing--; } if ( synPredMatched48 ) { mREAL(false); if (0==inputState.guessing) { _token = NumericToken.MakeReal(text.ToString(_begin, text.Length-_begin)); } } else { bool synPredMatched53 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_6_.member(cached_LA2)))) { int _m53 = mark(); synPredMatched53 = true; inputState.guessing++; try { { { mDIGIT(false); } { // ( ... )* for (;;) { if ((tokenSet_4_.member(cached_LA1))) { mHEXDIGIT(false); } else { goto _loop52_breakloop; } } _loop52_breakloop: ; } // ( ... )* match('X'); } } catch (RecognitionException) { synPredMatched53 = false; } rewind(_m53); inputState.guessing--; } if ( synPredMatched53 ) { mCHAR(false); if (0==inputState.guessing) { _token = NumericToken.MakeChar(text.ToString(_begin, text.Length-_begin)); } } else if (((cached_LA1 >= '0' && cached_LA1 <= '9')) && (true)) { mINTEGER(false); } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } public void mSTRING(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = STRING; switch ( cached_LA1 ) { case '"': { match('"'); { // ( ... )* for (;;) { if ((tokenSet_7_.member(cached_LA1))) { matchNot('"'); } else { goto _loop56_breakloop; } } _loop56_breakloop: ; } // ( ... )* match('"'); break; } case '\'': { match('\''); { // ( ... )* for (;;) { if ((tokenSet_8_.member(cached_LA1))) { matchNot('\''); } else { goto _loop58_breakloop; } } _loop58_breakloop: ; } // ( ... )* match('\''); break; } default: { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } } if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } public void mPUNCTUATION(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; IToken _token=null; int _begin=text.Length; _ttype = PUNCTUATION; switch ( cached_LA1 ) { case ';': { match(';'); break; } case ',': { match(','); break; } case '^': { match('^'); break; } case '|': { match('|'); break; } case '$': { match('$'); break; } case '+': { match('+'); break; } case '-': { match('-'); break; } case '*': { match('*'); break; } case '/': { match('/'); break; } case '&': { match('&'); break; } case '~': { match('~'); break; } case '=': { match('='); break; } case '#': { match('#'); break; } case '(': { match('('); break; } case ')': { match(')'); break; } case '[': { match('['); break; } case ']': { match(']'); break; } case '{': { match('{'); break; } case '}': { match('}'); break; } default: if ((cached_LA1==':') && (cached_LA2=='=')) { match(":="); } else if ((cached_LA1=='<') && (cached_LA2=='=')) { match("<="); } else if ((cached_LA1=='>') && (cached_LA2=='=')) { match(">="); } else if ((cached_LA1=='.') && (cached_LA2=='.')) { match(".."); } else if ((cached_LA1=='.') && (true)) { match('.'); } else if ((cached_LA1==':') && (true)) { match(':'); } else if ((cached_LA1=='<') && (true)) { match('<'); } else if ((cached_LA1=='>') && (true)) { match('>'); } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn()); } break; } _ttype = testLiteralsTable(_ttype); if (_createToken && (null == _token) && (_ttype != Token.SKIP)) { _token = makeToken(_ttype); _token.setText(text.ToString(_begin, text.Length-_begin)); } returnToken_ = _token; } private static long[] mk_tokenSet_0_() { long[] data = new long[1025]; data[0]=8935422414125268992L; data[1]=8646911286296182784L; for (int i = 2; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_()); private static long[] mk_tokenSet_1_() { long[] data = new long[2048]; data[0]=-5497558144002L; data[1]=-1L; data[2]=-33L; for (int i = 3; i<=127; i++) { data[i]=-1L; } data[128]=-3298534883329L; for (int i = 129; i<=1022; i++) { data[i]=-1L; } data[1023]=4611686018427387903L; for (int i = 1024; i<=2047; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_()); private static long[] mk_tokenSet_2_() { long[] data = new long[1025]; data[0]=5120L; data[1]=0L; data[2]=32L; for (int i = 3; i<=127; i++) { data[i]=0L; } data[128]=3298534883328L; for (int i = 129; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_()); private static long[] mk_tokenSet_3_() { long[] data = new long[1025]; data[0]=287948901175001088L; data[1]=4478L; for (int i = 2; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_()); private static long[] mk_tokenSet_4_() { long[] data = new long[1025]; data[0]=287948901175001088L; data[1]=126L; for (int i = 2; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_()); private static long[] mk_tokenSet_5_() { long[] data = new long[1025]; data[0]=288019269919178752L; for (int i = 1; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_()); private static long[] mk_tokenSet_6_() { long[] data = new long[1025]; data[0]=287948901175001088L; data[1]=16777342L; for (int i = 2; i<=1024; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_()); private static long[] mk_tokenSet_7_() { long[] data = new long[2048]; data[0]=-17179869186L; for (int i = 1; i<=1022; i++) { data[i]=-1L; } data[1023]=4611686018427387903L; for (int i = 1024; i<=2047; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_()); private static long[] mk_tokenSet_8_() { long[] data = new long[2048]; data[0]=-549755813890L; for (int i = 1; i<=1022; i++) { data[i]=-1L; } data[1023]=4611686018427387903L; for (int i = 1024; i<=2047; i++) { data[i]=0L; } return data; } public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_()); } }