1 3 package com.quadcap.sql; 4 5 import java.io.InputStream ; 6 import antlr.TokenStreamException; 7 import antlr.TokenStreamIOException; 8 import antlr.TokenStreamRecognitionException; 9 import antlr.CharStreamException; 10 import antlr.CharStreamIOException; 11 import antlr.ANTLRException; 12 import java.io.Reader ; 13 import java.util.Hashtable ; 14 import antlr.CharScanner; 15 import antlr.InputBuffer; 16 import antlr.ByteBuffer; 17 import antlr.CharBuffer; 18 import antlr.Token; 19 import antlr.CommonToken; 20 import antlr.RecognitionException; 21 import antlr.NoViableAltForCharException; 22 import antlr.MismatchedCharException; 23 import antlr.TokenStream; 24 import antlr.ANTLRHashString; 25 import antlr.LexerSharedInputState; 26 import antlr.collections.impl.BitSet; 27 import antlr.SemanticException; 28 29 public class SQLLexer extends antlr.CharScanner implements SQLTokenTypes, TokenStream 30 { 31 public SQLLexer(InputStream in) { 32 this(new ByteBuffer(in)); 33 } 34 public SQLLexer(Reader in) { 35 this(new CharBuffer(in)); 36 } 37 public SQLLexer(InputBuffer ib) { 38 this(new LexerSharedInputState(ib)); 39 } 40 public SQLLexer(LexerSharedInputState state) { 41 super(state); 42 caseSensitiveLiterals = false; 43 setCaseSensitive(true); 44 literals = new Hashtable (); 45 literals.put(new ANTLRHashString("local", this), new Integer (46)); 46 literals.put(new ANTLRHashString("sql_tsi_month", this), new Integer (154)); 47 literals.put(new ANTLRHashString("blob", this), new Integer (72)); 48 literals.put(new ANTLRHashString("action", this), new Integer (63)); 49 literals.put(new ANTLRHashString("public", this), new Integer (48)); 50 literals.put(new ANTLRHashString("smallint", this), new Integer (81)); 51 literals.put(new ANTLRHashString("between", this), new Integer (116)); 52 literals.put(new ANTLRHashString("time", this), new Integer (93)); 53 literals.put(new ANTLRHashString("case", this), new Integer (129)); 54 literals.put(new ANTLRHashString("option", this), new Integer (37)); 55 literals.put(new ANTLRHashString("sql_tsi_frac_second", this), new Integer (148)); 56 literals.put(new ANTLRHashString("tinyint", this), new Integer (82)); 57 literals.put(new ANTLRHashString("delete", this), new Integer (42)); 58 literals.put(new ANTLRHashString("transaction", this), new Integer (15)); 59 literals.put(new ANTLRHashString("end", this), new Integer (133)); 60 literals.put(new ANTLRHashString("object", this), new Integer (74)); 61 literals.put(new ANTLRHashString("view", this), new Integer (10)); 62 literals.put(new ANTLRHashString("system_user", this), new Integer (144)); 63 literals.put(new ANTLRHashString("initially", this), new Integer (64)); 64 literals.put(new ANTLRHashString("timestamp", this), new Integer (95)); 65 literals.put(new ANTLRHashString("insert", this), new Integer (52)); 66 literals.put(new ANTLRHashString("distinct", this), new Integer (104)); 67 literals.put(new ANTLRHashString("check", this), new Integer (24)); 68 literals.put(new ANTLRHashString("binary", this), new Integer (71)); 69 literals.put(new ANTLRHashString("grant", this), new Integer (47)); 70 literals.put(new ANTLRHashString("where", this), new Integer (40)); 71 literals.put(new ANTLRHashString("alter", this), new Integer (19)); 72 literals.put(new ANTLRHashString("varbinary", this), new Integer (70)); 73 literals.put(new ANTLRHashString("zone", this), new Integer (94)); 74 literals.put(new ANTLRHashString("integer", this), new Integer (80)); 75 literals.put(new ANTLRHashString("sql_tsi_minute", this), new Integer (150)); 76 literals.put(new ANTLRHashString("then", this), new Integer (131)); 77 literals.put(new ANTLRHashString("match", this), new Integer (59)); 78 literals.put(new ANTLRHashString("decimal", this), new Integer (85)); 79 literals.put(new ANTLRHashString("select", this), new Integer (51)); 80 literals.put(new ANTLRHashString("cascade", this), new Integer (30)); 81 literals.put(new ANTLRHashString("to", this), new Integer (33)); 82 literals.put(new ANTLRHashString("and", this), new Integer (113)); 83 literals.put(new ANTLRHashString("outer", this), new Integer (181)); 84 literals.put(new ANTLRHashString("float", this), new Integer (90)); 85 literals.put(new ANTLRHashString("not", this), new Integer (55)); 86 literals.put(new ANTLRHashString("constraint", this), new Integer (21)); 87 literals.put(new ANTLRHashString("interval", this), new Integer (96)); 88 literals.put(new ANTLRHashString("schema", this), new Integer (7)); 89 literals.put(new ANTLRHashString("numeric", this), new Integer (86)); 90 literals.put(new ANTLRHashString("usage", this), new Integer (54)); 91 literals.put(new ANTLRHashString("date", this), new Integer (92)); 92 literals.put(new ANTLRHashString("using", this), new Integer (109)); 93 literals.put(new ANTLRHashString("no", this), new Integer (62)); 94 literals.put(new ANTLRHashString("key", this), new Integer (57)); 95 literals.put(new ANTLRHashString("month", this), new Integer (137)); 96 literals.put(new ANTLRHashString("from", this), new Integer (43)); 97 literals.put(new ANTLRHashString("bigint", this), new Integer (83)); 98 literals.put(new ANTLRHashString("null", this), new Integer (56)); 99 literals.put(new ANTLRHashString("count", this), new Integer (165)); 100 literals.put(new ANTLRHashString("real", this), new Integer (87)); 101 literals.put(new ANTLRHashString("add", this), new Integer (20)); 102 literals.put(new ANTLRHashString("deferrable", this), new Integer (67)); 103 literals.put(new ANTLRHashString("current_user", this), new Integer (142)); 104 literals.put(new ANTLRHashString("like", this), new Integer (115)); 105 literals.put(new ANTLRHashString("natural", this), new Integer (178)); 106 literals.put(new ANTLRHashString("when", this), new Integer (130)); 107 literals.put(new ANTLRHashString("inner", this), new Integer (180)); 108 literals.put(new ANTLRHashString("except", this), new Integer (183)); 109 literals.put(new ANTLRHashString("sql_tsi_quarter", this), new Integer (155)); 110 literals.put(new ANTLRHashString("character", this), new Integer (76)); 111 literals.put(new ANTLRHashString("authorization", this), new Integer (44)); 112 literals.put(new ANTLRHashString("sql_tsi_day", this), new Integer (152)); 113 literals.put(new ANTLRHashString("cascaded", this), new Integer (36)); 114 literals.put(new ANTLRHashString("with", this), new Integer (35)); 115 literals.put(new ANTLRHashString("set", this), new Integer (31)); 116 literals.put(new ANTLRHashString("current_time", this), new Integer (146)); 117 literals.put(new ANTLRHashString("escape", this), new Integer (119)); 118 literals.put(new ANTLRHashString("only", this), new Integer (99)); 119 literals.put(new ANTLRHashString("global", this), new Integer (45)); 120 literals.put(new ANTLRHashString("foreign", this), new Integer (23)); 121 literals.put(new ANTLRHashString("intersect", this), new Integer (182)); 122 literals.put(new ANTLRHashString("work", this), new Integer (13)); 123 literals.put(new ANTLRHashString("**", this), new Integer (120)); 124 literals.put(new ANTLRHashString("join", this), new Integer (177)); 125 literals.put(new ANTLRHashString("rollback", this), new Integer (14)); 126 literals.put(new ANTLRHashString("commit", this), new Integer (12)); 127 literals.put(new ANTLRHashString("is", this), new Integer (114)); 128 literals.put(new ANTLRHashString("or", this), new Integer (112)); 129 literals.put(new ANTLRHashString("any", this), new Integer (173)); 130 literals.put(new ANTLRHashString("create", this), new Integer (4)); 131 literals.put(new ANTLRHashString("dec", this), new Integer (84)); 132 literals.put(new ANTLRHashString("full", this), new Integer (60)); 133 literals.put(new ANTLRHashString("double", this), new Integer (88)); 134 literals.put(new ANTLRHashString("min", this), new Integer (162)); 135 literals.put(new ANTLRHashString("sql_tsi_hour", this), new Integer (151)); 136 literals.put(new ANTLRHashString("as", this), new Integer (34)); 137 literals.put(new ANTLRHashString("first", this), new Integer (27)); 138 literals.put(new ANTLRHashString("by", this), new Integer (101)); 139 literals.put(new ANTLRHashString("second", this), new Integer (139)); 140 literals.put(new ANTLRHashString("all", this), new Integer (49)); 141 literals.put(new ANTLRHashString("union", this), new Integer (179)); 142 literals.put(new ANTLRHashString("drop", this), new Integer (11)); 143 literals.put(new ANTLRHashString("order", this), new Integer (100)); 144 literals.put(new ANTLRHashString("privileges", this), new Integer (50)); 145 literals.put(new ANTLRHashString("hour", this), new Integer (134)); 146 literals.put(new ANTLRHashString("primary", this), new Integer (22)); 147 literals.put(new ANTLRHashString("current_date", this), new Integer (145)); 148 literals.put(new ANTLRHashString("some", this), new Integer (174)); 149 literals.put(new ANTLRHashString("values", this), new Integer (108)); 150 literals.put(new ANTLRHashString("int", this), new Integer (79)); 151 literals.put(new ANTLRHashString("for", this), new Integer (97)); 152 literals.put(new ANTLRHashString("boolean", this), new Integer (91)); 153 literals.put(new ANTLRHashString("cross", this), new Integer (176)); 154 literals.put(new ANTLRHashString("varchar", this), new Integer (78)); 155 literals.put(new ANTLRHashString("char", this), new Integer (77)); 156 literals.put(new ANTLRHashString("bit", this), new Integer (68)); 157 literals.put(new ANTLRHashString("large", this), new Integer (73)); 158 literals.put(new ANTLRHashString("index", this), new Integer (6)); 159 literals.put(new ANTLRHashString("default", this), new Integer (32)); 160 literals.put(new ANTLRHashString("clob", this), new Integer (75)); 161 literals.put(new ANTLRHashString("false", this), new Integer (160)); 162 literals.put(new ANTLRHashString("session_user", this), new Integer (143)); 163 literals.put(new ANTLRHashString("exists", this), new Integer (118)); 164 literals.put(new ANTLRHashString("table", this), new Integer (9)); 165 literals.put(new ANTLRHashString("asc", this), new Integer (102)); 166 literals.put(new ANTLRHashString("unknown", this), new Integer (167)); 167 literals.put(new ANTLRHashString("sql_tsi_year", this), new Integer (156)); 168 literals.put(new ANTLRHashString("minute", this), new Integer (136)); 169 literals.put(new ANTLRHashString("left", this), new Integer (135)); 170 literals.put(new ANTLRHashString("day", this), new Integer (158)); 171 literals.put(new ANTLRHashString("partial", this), new Integer (61)); 172 literals.put(new ANTLRHashString("desc", this), new Integer (103)); 173 literals.put(new ANTLRHashString("temporary", this), new Integer (8)); 174 literals.put(new ANTLRHashString("max", this), new Integer (163)); 175 literals.put(new ANTLRHashString("sum", this), new Integer (164)); 176 literals.put(new ANTLRHashString("year", this), new Integer (140)); 177 literals.put(new ANTLRHashString("on", this), new Integer (16)); 178 literals.put(new ANTLRHashString("after", this), new Integer (28)); 179 literals.put(new ANTLRHashString("cast", this), new Integer (157)); 180 literals.put(new ANTLRHashString("identity", this), new Integer (58)); 181 literals.put(new ANTLRHashString("restrict", this), new Integer (29)); 182 literals.put(new ANTLRHashString("into", this), new Integer (166)); 183 literals.put(new ANTLRHashString("rename", this), new Integer (25)); 184 literals.put(new ANTLRHashString("sql_tsi_week", this), new Integer (153)); 185 literals.put(new ANTLRHashString("else", this), new Integer (132)); 186 literals.put(new ANTLRHashString("right", this), new Integer (138)); 187 literals.put(new ANTLRHashString("in", this), new Integer (117)); 188 literals.put(new ANTLRHashString("sql_tsi_second", this), new Integer (149)); 189 literals.put(new ANTLRHashString("avg", this), new Integer (161)); 190 literals.put(new ANTLRHashString("precision", this), new Integer (89)); 191 literals.put(new ANTLRHashString("update", this), new Integer (38)); 192 literals.put(new ANTLRHashString("true", this), new Integer (159)); 193 literals.put(new ANTLRHashString("group", this), new Integer (110)); 194 literals.put(new ANTLRHashString("immediate", this), new Integer (66)); 195 literals.put(new ANTLRHashString("read", this), new Integer (98)); 196 literals.put(new ANTLRHashString("having", this), new Integer (106)); 197 literals.put(new ANTLRHashString("column", this), new Integer (26)); 198 literals.put(new ANTLRHashString("corresponding", this), new Integer (107)); 199 literals.put(new ANTLRHashString("user", this), new Integer (141)); 200 literals.put(new ANTLRHashString("unique", this), new Integer (5)); 201 literals.put(new ANTLRHashString("references", this), new Integer (53)); 202 literals.put(new ANTLRHashString("current_timestamp", this), new Integer (147)); 203 literals.put(new ANTLRHashString("varying", this), new Integer (69)); 204 literals.put(new ANTLRHashString("deferred", this), new Integer (65)); 205 } 206 207 public Token nextToken() throws TokenStreamException { 208 Token theRetToken=null; 209 tryAgain: 210 for (;;) { 211 Token _token = null; 212 int _ttype = Token.INVALID_TYPE; 213 resetText(); 214 try { try { switch ( LA(1)) { 217 case '\t': case '\r': case ' ': 218 { 219 mWS(true); 220 theRetToken=_returnToken; 221 break; 222 } 223 case '\n': 224 { 225 mNL(true); 226 theRetToken=_returnToken; 227 break; 228 } 229 case '(': 230 { 231 mLPAREN(true); 232 theRetToken=_returnToken; 233 break; 234 } 235 case ')': 236 { 237 mRPAREN(true); 238 theRetToken=_returnToken; 239 break; 240 } 241 case ',': 242 { 243 mCOMMA(true); 244 theRetToken=_returnToken; 245 break; 246 } 247 case '?': 248 { 249 mQUESTION(true); 250 theRetToken=_returnToken; 251 break; 252 } 253 case '+': 254 { 255 mPLUS(true); 256 theRetToken=_returnToken; 257 break; 258 } 259 case '|': 260 { 261 mCONCAT(true); 262 theRetToken=_returnToken; 263 break; 264 } 265 case '=': 266 { 267 mEQ(true); 268 theRetToken=_returnToken; 269 break; 270 } 271 case '*': 272 { 273 mSTAR(true); 274 theRetToken=_returnToken; 275 break; 276 } 277 case '{': 278 { 279 mLCURLY(true); 280 theRetToken=_returnToken; 281 break; 282 } 283 case '}': 284 { 285 mRCURLY(true); 286 theRetToken=_returnToken; 287 break; 288 } 289 case ';': 290 { 291 mSEMI(true); 292 theRetToken=_returnToken; 293 break; 294 } 295 case '\'': 296 { 297 mSTRING_LITERAL(true); 298 theRetToken=_returnToken; 299 break; 300 } 301 case '.': case '0': case '1': case '2': 302 case '3': case '4': case '5': case '6': 303 case '7': case '8': case '9': 304 { 305 mINT_OR_REAL(true); 306 theRetToken=_returnToken; 307 break; 308 } 309 default: 310 if ((LA(1)=='B') && (LA(2)=='\'') && (LA(3)=='0'||LA(3)=='1') && (LA(4)=='\''||LA(4)=='0'||LA(4)=='1')) { 311 mBINSTR(true); 312 theRetToken=_returnToken; 313 } 314 else if ((LA(1)=='X') && (LA(2)=='\'') && (_tokenSet_0.member(LA(3))) && (_tokenSet_1.member(LA(4)))) { 315 mHEXSTR(true); 316 theRetToken=_returnToken; 317 } 318 else if ((LA(1)=='-') && (LA(2)=='-')) { 319 mSL_COMMENT(true); 320 theRetToken=_returnToken; 321 } 322 else if ((LA(1)=='/') && (LA(2)=='*')) { 323 mML_COMMENT(true); 324 theRetToken=_returnToken; 325 } 326 else if ((LA(1)=='<') && (LA(2)=='=')) { 327 mLE(true); 328 theRetToken=_returnToken; 329 } 330 else if ((LA(1)=='>') && (LA(2)=='=')) { 331 mGE(true); 332 theRetToken=_returnToken; 333 } 334 else if ((LA(1)=='<') && (LA(2)=='>')) { 335 mNE(true); 336 theRetToken=_returnToken; 337 } 338 else if ((LA(1)=='-') && (true)) { 339 mMINUS(true); 340 theRetToken=_returnToken; 341 } 342 else if ((LA(1)=='<') && (true)) { 343 mLT(true); 344 theRetToken=_returnToken; 345 } 346 else if ((LA(1)=='>') && (true)) { 347 mGT(true); 348 theRetToken=_returnToken; 349 } 350 else if ((LA(1)=='/') && (true)) { 351 mSLASH(true); 352 theRetToken=_returnToken; 353 } 354 else if ((_tokenSet_2.member(LA(1))) && (true) && (true) && (true)) { 355 mID(true); 356 theRetToken=_returnToken; 357 } 358 else { 359 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} 360 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 361 } 362 } 363 if ( _returnToken==null ) continue tryAgain; _ttype = _returnToken.getType(); 365 _returnToken.setType(_ttype); 366 return _returnToken; 367 } 368 catch (RecognitionException e) { 369 throw new TokenStreamRecognitionException(e); 370 } 371 } 372 catch (CharStreamException cse) { 373 if ( cse instanceof CharStreamIOException ) { 374 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 375 } 376 else { 377 throw new TokenStreamException(cse.getMessage()); 378 } 379 } 380 } 381 } 382 383 public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 384 int _ttype; Token _token=null; int _begin=text.length(); 385 _ttype = WS; 386 int _saveIndex; 387 388 { 389 int _cnt349=0; 390 _loop349: 391 do { 392 switch ( LA(1)) { 393 case ' ': 394 { 395 match(' '); 396 break; 397 } 398 case '\t': 399 { 400 match('\t'); 401 break; 402 } 403 case '\r': 404 { 405 match('\r'); 406 break; 407 } 408 default: 409 { 410 if ( _cnt349>=1 ) { break _loop349; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 411 } 412 } 413 _cnt349++; 414 } while (true); 415 } 416 if ( inputState.guessing==0 ) { 417 _ttype = Token.SKIP; 418 } 419 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 420 _token = makeToken(_ttype); 421 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 422 } 423 _returnToken = _token; 424 } 425 426 public final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 427 int _ttype; Token _token=null; int _begin=text.length(); 428 _ttype = SL_COMMENT; 429 int _saveIndex; 430 431 match("--"); 432 { 433 _loop352: 434 do { 435 if ((_tokenSet_3.member(LA(1)))) { 436 matchNot('\n'); 437 } 438 else { 439 break _loop352; 440 } 441 442 } while (true); 443 } 444 if ( inputState.guessing==0 ) { 445 _ttype = Token.SKIP; 446 } 447 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 448 _token = makeToken(_ttype); 449 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 450 } 451 _returnToken = _token; 452 } 453 454 public final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 455 int _ttype; Token _token=null; int _begin=text.length(); 456 _ttype = ML_COMMENT; 457 int _saveIndex; 458 459 match("/*"); 460 { 461 _loop356: 462 do { 463 if (((LA(1)=='*') && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0000' && LA(3) <= '\ufffe')))&&( LA(2)!='/' )) { 464 match('*'); 465 } 466 else if ((LA(1)=='\n')) { 467 match('\n'); 468 if ( inputState.guessing==0 ) { 469 newline(); 470 } 471 } 472 else if ((_tokenSet_4.member(LA(1)))) { 473 { 474 match(_tokenSet_4); 475 } 476 } 477 else { 478 break _loop356; 479 } 480 481 } while (true); 482 } 483 match("*/"); 484 if ( inputState.guessing==0 ) { 485 _ttype = Token.SKIP; 486 } 487 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 488 _token = makeToken(_ttype); 489 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 490 } 491 _returnToken = _token; 492 } 493 494 public final void mNL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 495 int _ttype; Token _token=null; int _begin=text.length(); 496 _ttype = NL; 497 int _saveIndex; 498 499 match('\n'); 500 if ( inputState.guessing==0 ) { 501 _ttype = Token.SKIP; newline(); 502 } 503 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 504 _token = makeToken(_ttype); 505 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 506 } 507 _returnToken = _token; 508 } 509 510 public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 511 int _ttype; Token _token=null; int _begin=text.length(); 512 _ttype = LPAREN; 513 int _saveIndex; 514 515 match('('); 516 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 517 _token = makeToken(_ttype); 518 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 519 } 520 _returnToken = _token; 521 } 522 523 public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 524 int _ttype; Token _token=null; int _begin=text.length(); 525 _ttype = RPAREN; 526 int _saveIndex; 527 528 match(')'); 529 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 530 _token = makeToken(_ttype); 531 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 532 } 533 _returnToken = _token; 534 } 535 536 public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 537 int _ttype; Token _token=null; int _begin=text.length(); 538 _ttype = COMMA; 539 int _saveIndex; 540 541 match(','); 542 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 543 _token = makeToken(_ttype); 544 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 545 } 546 _returnToken = _token; 547 } 548 549 public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 550 int _ttype; Token _token=null; int _begin=text.length(); 551 _ttype = QUESTION; 552 int _saveIndex; 553 554 match('?'); 555 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 556 _token = makeToken(_ttype); 557 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 558 } 559 _returnToken = _token; 560 } 561 562 public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 563 int _ttype; Token _token=null; int _begin=text.length(); 564 _ttype = PLUS; 565 int _saveIndex; 566 567 match('+'); 568 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 569 _token = makeToken(_ttype); 570 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 571 } 572 _returnToken = _token; 573 } 574 575 public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 576 int _ttype; Token _token=null; int _begin=text.length(); 577 _ttype = MINUS; 578 int _saveIndex; 579 580 match('-'); 581 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 582 _token = makeToken(_ttype); 583 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 584 } 585 _returnToken = _token; 586 } 587 588 public final void mCONCAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 589 int _ttype; Token _token=null; int _begin=text.length(); 590 _ttype = CONCAT; 591 int _saveIndex; 592 593 match("||"); 594 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 595 _token = makeToken(_ttype); 596 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 597 } 598 _returnToken = _token; 599 } 600 601 public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 602 int _ttype; Token _token=null; int _begin=text.length(); 603 _ttype = LT; 604 int _saveIndex; 605 606 match('<'); 607 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 608 _token = makeToken(_ttype); 609 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 610 } 611 _returnToken = _token; 612 } 613 614 public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 615 int _ttype; Token _token=null; int _begin=text.length(); 616 _ttype = GT; 617 int _saveIndex; 618 619 match('>'); 620 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 621 _token = makeToken(_ttype); 622 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 623 } 624 _returnToken = _token; 625 } 626 627 public final void mLE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 628 int _ttype; Token _token=null; int _begin=text.length(); 629 _ttype = LE; 630 int _saveIndex; 631 632 match("<="); 633 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 634 _token = makeToken(_ttype); 635 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 636 } 637 _returnToken = _token; 638 } 639 640 public final void mGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 641 int _ttype; Token _token=null; int _begin=text.length(); 642 _ttype = GE; 643 int _saveIndex; 644 645 match(">="); 646 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 647 _token = makeToken(_ttype); 648 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 649 } 650 _returnToken = _token; 651 } 652 653 public final void mEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 654 int _ttype; Token _token=null; int _begin=text.length(); 655 _ttype = EQ; 656 int _saveIndex; 657 658 match('='); 659 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 660 _token = makeToken(_ttype); 661 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 662 } 663 _returnToken = _token; 664 } 665 666 public final void mNE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 667 int _ttype; Token _token=null; int _begin=text.length(); 668 _ttype = NE; 669 int _saveIndex; 670 671 match("<>"); 672 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 673 _token = makeToken(_ttype); 674 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 675 } 676 _returnToken = _token; 677 } 678 679 public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 680 int _ttype; Token _token=null; int _begin=text.length(); 681 _ttype = STAR; 682 int _saveIndex; 683 684 match('*'); 685 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 686 _token = makeToken(_ttype); 687 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 688 } 689 _returnToken = _token; 690 } 691 692 public final void mSLASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 693 int _ttype; Token _token=null; int _begin=text.length(); 694 _ttype = SLASH; 695 int _saveIndex; 696 697 match('/'); 698 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 699 _token = makeToken(_ttype); 700 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 701 } 702 _returnToken = _token; 703 } 704 705 public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 706 int _ttype; Token _token=null; int _begin=text.length(); 707 _ttype = LCURLY; 708 int _saveIndex; 709 710 match('{'); 711 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 712 _token = makeToken(_ttype); 713 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 714 } 715 _returnToken = _token; 716 } 717 718 public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 719 int _ttype; Token _token=null; int _begin=text.length(); 720 _ttype = RCURLY; 721 int _saveIndex; 722 723 match('}'); 724 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 725 _token = makeToken(_ttype); 726 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 727 } 728 _returnToken = _token; 729 } 730 731 public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 732 int _ttype; Token _token=null; int _begin=text.length(); 733 _ttype = SEMI; 734 int _saveIndex; 735 736 match(';'); 737 if ( inputState.guessing==0 ) { 738 _ttype = Token.SKIP; 739 } 740 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 741 _token = makeToken(_ttype); 742 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 743 } 744 _returnToken = _token; 745 } 746 747 public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 748 int _ttype; Token _token=null; int _begin=text.length(); 749 _ttype = STRING_LITERAL; 750 int _saveIndex; 751 752 _saveIndex=text.length(); 753 match('\''); 754 text.setLength(_saveIndex); 755 { 756 _loop379: 757 do { 758 if ((LA(1)=='\'') && (LA(2)=='\'')) { 759 match('\''); 760 { 761 _saveIndex=text.length(); 762 match('\''); 763 text.setLength(_saveIndex); 764 } 765 } 766 else if ((_tokenSet_5.member(LA(1)))) { 767 matchNot('\''); 768 } 769 else { 770 break _loop379; 771 } 772 773 } while (true); 774 } 775 _saveIndex=text.length(); 776 match('\''); 777 text.setLength(_saveIndex); 778 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 779 _token = makeToken(_ttype); 780 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 781 } 782 _returnToken = _token; 783 } 784 785 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 786 int _ttype; Token _token=null; int _begin=text.length(); 787 _ttype = DIGIT; 788 int _saveIndex; 789 790 matchRange('0','9'); 791 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 792 _token = makeToken(_ttype); 793 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 794 } 795 _returnToken = _token; 796 } 797 798 protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 799 int _ttype; Token _token=null; int _begin=text.length(); 800 _ttype = INT; 801 int _saveIndex; 802 803 { 804 int _cnt383=0; 805 _loop383: 806 do { 807 if (((LA(1) >= '0' && LA(1) <= '9'))) { 808 mDIGIT(false); 809 } 810 else { 811 if ( _cnt383>=1 ) { break _loop383; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 812 } 813 814 _cnt383++; 815 } while (true); 816 } 817 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 818 _token = makeToken(_ttype); 819 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 820 } 821 _returnToken = _token; 822 } 823 824 protected final void mREAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 825 int _ttype; Token _token=null; int _begin=text.length(); 826 _ttype = REAL; 827 int _saveIndex; 828 829 { 830 _loop386: 831 do { 832 if (((LA(1) >= '0' && LA(1) <= '9'))) { 833 mDIGIT(false); 834 } 835 else { 836 break _loop386; 837 } 838 839 } while (true); 840 } 841 match('.'); 842 { 843 if (((LA(1) >= '0' && LA(1) <= '9'))) { 844 mINT(false); 845 { 846 if ((LA(1)=='E'||LA(1)=='e')) { 847 { 848 switch ( LA(1)) { 849 case 'E': 850 { 851 match('E'); 852 break; 853 } 854 case 'e': 855 { 856 match('e'); 857 break; 858 } 859 default: 860 { 861 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 862 } 863 } 864 } 865 { 866 switch ( LA(1)) { 867 case '-': 868 { 869 match('-'); 870 break; 871 } 872 case '+': 873 { 874 match('+'); 875 break; 876 } 877 case '0': case '1': case '2': case '3': 878 case '4': case '5': case '6': case '7': 879 case '8': case '9': 880 { 881 break; 882 } 883 default: 884 { 885 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 886 } 887 } 888 } 889 mINT(false); 890 } 891 else { 892 } 893 894 } 895 } 896 else { 897 } 898 899 } 900 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 901 _token = makeToken(_ttype); 902 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 903 } 904 _returnToken = _token; 905 } 906 907 protected final void mEXP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 908 int _ttype; Token _token=null; int _begin=text.length(); 909 _ttype = EXP; 910 int _saveIndex; 911 912 mINT(false); 913 { 914 switch ( LA(1)) { 915 case 'E': 916 { 917 match('E'); 918 break; 919 } 920 case 'e': 921 { 922 match('e'); 923 break; 924 } 925 default: 926 { 927 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 928 } 929 } 930 } 931 { 932 switch ( LA(1)) { 933 case '-': 934 { 935 match('-'); 936 break; 937 } 938 case '+': 939 { 940 match('+'); 941 break; 942 } 943 case '0': case '1': case '2': case '3': 944 case '4': case '5': case '6': case '7': 945 case '8': case '9': 946 { 947 break; 948 } 949 default: 950 { 951 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 952 } 953 } 954 } 955 mINT(false); 956 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 957 _token = makeToken(_ttype); 958 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 959 } 960 _returnToken = _token; 961 } 962 963 public final void mINT_OR_REAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 964 int _ttype; Token _token=null; int _begin=text.length(); 965 _ttype = INT_OR_REAL; 966 int _saveIndex; 967 968 boolean synPredMatched401 = false; 969 if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_6.member(LA(2))) && (_tokenSet_7.member(LA(3))) && (true))) { 970 int _m401 = mark(); 971 synPredMatched401 = true; 972 inputState.guessing++; 973 try { 974 { 975 mINT(false); 976 { 977 switch ( LA(1)) { 978 case 'E': 979 { 980 match('E'); 981 break; 982 } 983 case 'e': 984 { 985 match('e'); 986 break; 987 } 988 default: 989 { 990 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 991 } 992 } 993 } 994 mINT(false); 995 } 996 } 997 catch (RecognitionException pe) { 998 synPredMatched401 = false; 999 } 1000 rewind(_m401); 1001 inputState.guessing--; 1002 } 1003 if ( synPredMatched401 ) { 1004 mEXP(false); 1005 if ( inputState.guessing==0 ) { 1006 _ttype = REAL; 1007 } 1008 } 1009 else { 1010 boolean synPredMatched404 = false; 1011 if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_6.member(LA(2))) && (_tokenSet_7.member(LA(3))) && (true))) { 1012 int _m404 = mark(); 1013 synPredMatched404 = true; 1014 inputState.guessing++; 1015 try { 1016 { 1017 mINT(false); 1018 { 1019 switch ( LA(1)) { 1020 case 'E': 1021 { 1022 match('E'); 1023 break; 1024 } 1025 case 'e': 1026 { 1027 match('e'); 1028 break; 1029 } 1030 default: 1031 { 1032 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1033 } 1034 } 1035 } 1036 match('-'); 1037 mINT(false); 1038 } 1039 } 1040 catch (RecognitionException pe) { 1041 synPredMatched404 = false; 1042 } 1043 rewind(_m404); 1044 inputState.guessing--; 1045 } 1046 if ( synPredMatched404 ) { 1047 mEXP(false); 1048 if ( inputState.guessing==0 ) { 1049 _ttype = REAL; 1050 } 1051 } 1052 else { 1053 boolean synPredMatched407 = false; 1054 if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_6.member(LA(2))) && (_tokenSet_7.member(LA(3))) && (true))) { 1055 int _m407 = mark(); 1056 synPredMatched407 = true; 1057 inputState.guessing++; 1058 try { 1059 { 1060 mINT(false); 1061 { 1062 switch ( LA(1)) { 1063 case 'E': 1064 { 1065 match('E'); 1066 break; 1067 } 1068 case 'e': 1069 { 1070 match('e'); 1071 break; 1072 } 1073 default: 1074 { 1075 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1076 } 1077 } 1078 } 1079 match('+'); 1080 mINT(false); 1081 } 1082 } 1083 catch (RecognitionException pe) { 1084 synPredMatched407 = false; 1085 } 1086 rewind(_m407); 1087 inputState.guessing--; 1088 } 1089 if ( synPredMatched407 ) { 1090 mEXP(false); 1091 if ( inputState.guessing==0 ) { 1092 _ttype = REAL; 1093 } 1094 } 1095 else { 1096 boolean synPredMatched396 = false; 1097 if (((_tokenSet_8.member(LA(1))) && (true) && (true) && (true))) { 1098 int _m396 = mark(); 1099 synPredMatched396 = true; 1100 inputState.guessing++; 1101 try { 1102 { 1103 mINT(false); 1104 match('.'); 1105 } 1106 } 1107 catch (RecognitionException pe) { 1108 synPredMatched396 = false; 1109 } 1110 rewind(_m396); 1111 inputState.guessing--; 1112 } 1113 if ( synPredMatched396 ) { 1114 mREAL(false); 1115 if ( inputState.guessing==0 ) { 1116 _ttype = REAL; 1117 } 1118 } 1119 else { 1120 boolean synPredMatched398 = false; 1121 if (((_tokenSet_8.member(LA(1))) && (true) && (true) && (true))) { 1122 int _m398 = mark(); 1123 synPredMatched398 = true; 1124 inputState.guessing++; 1125 try { 1126 { 1127 match('.'); 1128 mINT(false); 1129 } 1130 } 1131 catch (RecognitionException pe) { 1132 synPredMatched398 = false; 1133 } 1134 rewind(_m398); 1135 inputState.guessing--; 1136 } 1137 if ( synPredMatched398 ) { 1138 mREAL(false); 1139 if ( inputState.guessing==0 ) { 1140 _ttype = REAL; 1141 } 1142 } 1143 else { 1144 boolean synPredMatched409 = false; 1145 if ((((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true) && (true))) { 1146 int _m409 = mark(); 1147 synPredMatched409 = true; 1148 inputState.guessing++; 1149 try { 1150 { 1151 mINT(false); 1152 } 1153 } 1154 catch (RecognitionException pe) { 1155 synPredMatched409 = false; 1156 } 1157 rewind(_m409); 1158 inputState.guessing--; 1159 } 1160 if ( synPredMatched409 ) { 1161 mINT(false); 1162 if ( inputState.guessing==0 ) { 1163 _ttype = INT; 1164 } 1165 } 1166 else { 1167 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1168 } 1169 }}}}} 1170 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1171 _token = makeToken(_ttype); 1172 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1173 } 1174 _returnToken = _token; 1175 } 1176 1177 protected final void mHEXDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1178 int _ttype; Token _token=null; int _begin=text.length(); 1179 _ttype = HEXDIGIT; 1180 int _saveIndex; 1181 1182 switch ( LA(1)) { 1183 case '0': case '1': case '2': case '3': 1184 case '4': case '5': case '6': case '7': 1185 case '8': case '9': 1186 { 1187 mDIGIT(false); 1188 break; 1189 } 1190 case 'A': case 'B': case 'C': case 'D': 1191 case 'E': case 'F': 1192 { 1193 matchRange('A','F'); 1194 break; 1195 } 1196 default: 1197 { 1198 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1199 } 1200 } 1201 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1202 _token = makeToken(_ttype); 1203 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1204 } 1205 _returnToken = _token; 1206 } 1207 1208 public final void mBINSTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1209 int _ttype; Token _token=null; int _begin=text.length(); 1210 _ttype = BINSTR; 1211 int _saveIndex; 1212 1213 match('B'); 1214 match('\''); 1215 { 1216 int _cnt413=0; 1217 _loop413: 1218 do { 1219 switch ( LA(1)) { 1220 case '0': 1221 { 1222 match('0'); 1223 break; 1224 } 1225 case '1': 1226 { 1227 match('1'); 1228 break; 1229 } 1230 default: 1231 { 1232 if ( _cnt413>=1 ) { break _loop413; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 1233 } 1234 } 1235 _cnt413++; 1236 } while (true); 1237 } 1238 match('\''); 1239 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1240 _token = makeToken(_ttype); 1241 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1242 } 1243 _returnToken = _token; 1244 } 1245 1246 public final void mHEXSTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1247 int _ttype; Token _token=null; int _begin=text.length(); 1248 _ttype = HEXSTR; 1249 int _saveIndex; 1250 1251 match('X'); 1252 match('\''); 1253 { 1254 int _cnt416=0; 1255 _loop416: 1256 do { 1257 if ((_tokenSet_0.member(LA(1)))) { 1258 mHEXDIGIT(false); 1259 } 1260 else { 1261 if ( _cnt416>=1 ) { break _loop416; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 1262 } 1263 1264 _cnt416++; 1265 } while (true); 1266 } 1267 match('\''); 1268 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1269 _token = makeToken(_ttype); 1270 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1271 } 1272 _returnToken = _token; 1273 } 1274 1275 public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1276 int _ttype; Token _token=null; int _begin=text.length(); 1277 _ttype = ID; 1278 int _saveIndex; 1279 1280 mIDTERM(false); 1281 { 1282 if ((LA(1)=='.')) { 1283 match('.'); 1284 { 1285 switch ( LA(1)) { 1286 case '*': 1287 { 1288 match('*'); 1289 break; 1290 } 1291 case '"': case 'A': case 'B': case 'C': 1292 case 'D': case 'E': case 'F': case 'G': 1293 case 'H': case 'I': case 'J': case 'K': 1294 case 'L': case 'M': case 'N': case 'O': 1295 case 'P': case 'Q': case 'R': case 'S': 1296 case 'T': case 'U': case 'V': case 'W': 1297 case 'X': case 'Y': case 'Z': case '_': 1298 case 'a': case 'b': case 'c': case 'd': 1299 case 'e': case 'f': case 'g': case 'h': 1300 case 'i': case 'j': case 'k': case 'l': 1301 case 'm': case 'n': case 'o': case 'p': 1302 case 'q': case 'r': case 's': case 't': 1303 case 'u': case 'v': case 'w': case 'x': 1304 case 'y': case 'z': 1305 { 1306 { 1307 mIDTERM(false); 1308 { 1309 if ((LA(1)=='.')) { 1310 match('.'); 1311 { 1312 switch ( LA(1)) { 1313 case '*': 1314 { 1315 match('*'); 1316 break; 1317 } 1318 case '"': case 'A': case 'B': case 'C': 1319 case 'D': case 'E': case 'F': case 'G': 1320 case 'H': case 'I': case 'J': case 'K': 1321 case 'L': case 'M': case 'N': case 'O': 1322 case 'P': case 'Q': case 'R': case 'S': 1323 case 'T': case 'U': case 'V': case 'W': 1324 case 'X': case 'Y': case 'Z': case '_': 1325 case 'a': case 'b': case 'c': case 'd': 1326 case 'e': case 'f': case 'g': case 'h': 1327 case 'i': case 'j': case 'k': case 'l': 1328 case 'm': case 'n': case 'o': case 'p': 1329 case 'q': case 'r': case 's': case 't': 1330 case 'u': case 'v': case 'w': case 'x': 1331 case 'y': case 'z': 1332 { 1333 mIDTERM(false); 1334 break; 1335 } 1336 default: 1337 { 1338 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1339 } 1340 } 1341 } 1342 } 1343 else { 1344 } 1345 1346 } 1347 } 1348 break; 1349 } 1350 default: 1351 { 1352 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1353 } 1354 } 1355 } 1356 } 1357 else { 1358 } 1359 1360 } 1361 _ttype = testLiteralsTable(_ttype); 1362 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1363 _token = makeToken(_ttype); 1364 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1365 } 1366 _returnToken = _token; 1367 } 1368 1369 protected final void mIDTERM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1370 int _ttype; Token _token=null; int _begin=text.length(); 1371 _ttype = IDTERM; 1372 int _saveIndex; 1373 1374 switch ( LA(1)) { 1375 case 'A': case 'B': case 'C': case 'D': 1376 case 'E': case 'F': case 'G': case 'H': 1377 case 'I': case 'J': case 'K': case 'L': 1378 case 'M': case 'N': case 'O': case 'P': 1379 case 'Q': case 'R': case 'S': case 'T': 1380 case 'U': case 'V': case 'W': case 'X': 1381 case 'Y': case 'Z': case '_': case 'a': 1382 case 'b': case 'c': case 'd': case 'e': 1383 case 'f': case 'g': case 'h': case 'i': 1384 case 'j': case 'k': case 'l': case 'm': 1385 case 'n': case 'o': case 'p': case 'q': 1386 case 'r': case 's': case 't': case 'u': 1387 case 'v': case 'w': case 'x': case 'y': 1388 case 'z': 1389 { 1390 mSIMPID(false); 1391 break; 1392 } 1393 case '"': 1394 { 1395 mCASEID(false); 1396 break; 1397 } 1398 default: 1399 { 1400 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1401 } 1402 } 1403 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1404 _token = makeToken(_ttype); 1405 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1406 } 1407 _returnToken = _token; 1408 } 1409 1410 protected final void mIDCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1411 int _ttype; Token _token=null; int _begin=text.length(); 1412 _ttype = IDCHAR; 1413 int _saveIndex; 1414 1415 { 1416 switch ( LA(1)) { 1417 case 'a': case 'b': case 'c': case 'd': 1418 case 'e': case 'f': case 'g': case 'h': 1419 case 'i': case 'j': case 'k': case 'l': 1420 case 'm': case 'n': case 'o': case 'p': 1421 case 'q': case 'r': case 's': case 't': 1422 case 'u': case 'v': case 'w': case 'x': 1423 case 'y': case 'z': 1424 { 1425 matchRange('a','z'); 1426 break; 1427 } 1428 case 'A': case 'B': case 'C': case 'D': 1429 case 'E': case 'F': case 'G': case 'H': 1430 case 'I': case 'J': case 'K': case 'L': 1431 case 'M': case 'N': case 'O': case 'P': 1432 case 'Q': case 'R': case 'S': case 'T': 1433 case 'U': case 'V': case 'W': case 'X': 1434 case 'Y': case 'Z': 1435 { 1436 matchRange('A','Z'); 1437 break; 1438 } 1439 case '_': 1440 { 1441 match('_'); 1442 break; 1443 } 1444 default: 1445 { 1446 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1447 } 1448 } 1449 } 1450 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1451 _token = makeToken(_ttype); 1452 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1453 } 1454 _returnToken = _token; 1455 } 1456 1457 protected final void mIDCHAR2(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1458 int _ttype; Token _token=null; int _begin=text.length(); 1459 _ttype = IDCHAR2; 1460 int _saveIndex; 1461 1462 switch ( LA(1)) { 1463 case 'A': case 'B': case 'C': case 'D': 1464 case 'E': case 'F': case 'G': case 'H': 1465 case 'I': case 'J': case 'K': case 'L': 1466 case 'M': case 'N': case 'O': case 'P': 1467 case 'Q': case 'R': case 'S': case 'T': 1468 case 'U': case 'V': case 'W': case 'X': 1469 case 'Y': case 'Z': case '_': case 'a': 1470 case 'b': case 'c': case 'd': case 'e': 1471 case 'f': case 'g': case 'h': case 'i': 1472 case 'j': case 'k': case 'l': case 'm': 1473 case 'n': case 'o': case 'p': case 'q': 1474 case 'r': case 's': case 't': case 'u': 1475 case 'v': case 'w': case 'x': case 'y': 1476 case 'z': 1477 { 1478 mIDCHAR(false); 1479 break; 1480 } 1481 case '0': case '1': case '2': case '3': 1482 case '4': case '5': case '6': case '7': 1483 case '8': case '9': 1484 { 1485 mDIGIT(false); 1486 break; 1487 } 1488 default: 1489 { 1490 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1491 } 1492 } 1493 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1494 _token = makeToken(_ttype); 1495 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1496 } 1497 _returnToken = _token; 1498 } 1499 1500 protected final void mSIMPID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1501 int _ttype; Token _token=null; int _begin=text.length(); 1502 _ttype = SIMPID; 1503 int _saveIndex; 1504 1505 mIDCHAR(false); 1506 { 1507 _loop428: 1508 do { 1509 if ((_tokenSet_9.member(LA(1)))) { 1510 mIDCHAR2(false); 1511 } 1512 else { 1513 break _loop428; 1514 } 1515 1516 } while (true); 1517 } 1518 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1519 _token = makeToken(_ttype); 1520 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1521 } 1522 _returnToken = _token; 1523 } 1524 1525 protected final void mCASEID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1526 int _ttype; Token _token=null; int _begin=text.length(); 1527 _ttype = CASEID; 1528 int _saveIndex; 1529 1530 match('"'); 1531 { 1532 _loop432: 1533 do { 1534 if ((LA(1)=='"') && (LA(2)=='"')) { 1535 match('"'); 1536 { 1537 _saveIndex=text.length(); 1538 match('"'); 1539 text.setLength(_saveIndex); 1540 } 1541 } 1542 else if ((_tokenSet_10.member(LA(1)))) { 1543 matchNot('"'); 1544 } 1545 else { 1546 break _loop432; 1547 } 1548 1549 } while (true); 1550 } 1551 match('"'); 1552 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1553 _token = makeToken(_ttype); 1554 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1555 } 1556 _returnToken = _token; 1557 } 1558 1559 1560 private static final long[] mk_tokenSet_0() { 1561 long[] data = new long[1025]; 1562 data[0]=287948901175001088L; 1563 data[1]=126L; 1564 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1565 return data; 1566 } 1567 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); 1568 private static final long[] mk_tokenSet_1() { 1569 long[] data = new long[1025]; 1570 data[0]=287949450930814976L; 1571 data[1]=126L; 1572 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1573 return data; 1574 } 1575 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); 1576 private static final long[] mk_tokenSet_2() { 1577 long[] data = new long[1025]; 1578 data[0]=17179869184L; 1579 data[1]=576460745995190270L; 1580 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1581 return data; 1582 } 1583 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); 1584 private static final long[] mk_tokenSet_3() { 1585 long[] data = new long[2048]; 1586 data[0]=-1025L; 1587 for (int i = 1; i<=1022; i++) { data[i]=-1L; } 1588 data[1023]=9223372036854775807L; 1589 for (int i = 1024; i<=2047; i++) { data[i]=0L; } 1590 return data; 1591 } 1592 public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); 1593 private static final long[] mk_tokenSet_4() { 1594 long[] data = new long[2048]; 1595 data[0]=-4398046512129L; 1596 for (int i = 1; i<=1022; i++) { data[i]=-1L; } 1597 data[1023]=9223372036854775807L; 1598 for (int i = 1024; i<=2047; i++) { data[i]=0L; } 1599 return data; 1600 } 1601 public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); 1602 private static final long[] mk_tokenSet_5() { 1603 long[] data = new long[2048]; 1604 data[0]=-549755813889L; 1605 for (int i = 1; i<=1022; i++) { data[i]=-1L; } 1606 data[1023]=9223372036854775807L; 1607 for (int i = 1024; i<=2047; i++) { data[i]=0L; } 1608 return data; 1609 } 1610 public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); 1611 private static final long[] mk_tokenSet_6() { 1612 long[] data = new long[1025]; 1613 data[0]=287948901175001088L; 1614 data[1]=137438953504L; 1615 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1616 return data; 1617 } 1618 public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); 1619 private static final long[] mk_tokenSet_7() { 1620 long[] data = new long[1025]; 1621 data[0]=287992881640112128L; 1622 data[1]=137438953504L; 1623 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1624 return data; 1625 } 1626 public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); 1627 private static final long[] mk_tokenSet_8() { 1628 long[] data = new long[1025]; 1629 data[0]=288019269919178752L; 1630 for (int i = 1; i<=1024; i++) { data[i]=0L; } 1631 return data; 1632 } 1633 public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); 1634 private static final long[] mk_tokenSet_9() { 1635 long[] data = new long[1025]; 1636 data[0]=287948901175001088L; 1637 data[1]=576460745995190270L; 1638 for (int i = 2; i<=1024; i++) { data[i]=0L; } 1639 return data; 1640 } 1641 public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); 1642 private static final long[] mk_tokenSet_10() { 1643 long[] data = new long[2048]; 1644 data[0]=-17179869185L; 1645 for (int i = 1; i<=1022; i++) { data[i]=-1L; } 1646 data[1023]=9223372036854775807L; 1647 for (int i = 1024; i<=2047; i++) { data[i]=0L; } 1648 return data; 1649 } 1650 public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); 1651 1652 } 1653 | Popular Tags |