1 30 31 32 package org.hsqldb; 33 34 import org.hsqldb.lib.HashSet; 35 import org.hsqldb.lib.IntValueHashMap; 36 37 46 public class Token { 47 48 private static IntValueHashMap commandSet; 49 50 static final String T_ASTERISK = "*"; 52 static final String T_COMMA = ","; 53 static final String T_CLOSEBRACKET = ")"; 54 static final String T_EQUALS = "="; 55 public static final String T_DIVIDE = "/"; 56 static final String T_OPENBRACKET = "("; 57 static final String T_SEMICOLON = ";"; 58 static final String T_MULTIPLY = "*"; 59 static final String T_PERCENT = "%"; 60 static final String T_PLUS = "+"; 61 static final String T_QUESTION = "?"; 62 63 static final String T_ADD = "ADD"; static final String T_ALL = "ALL"; static final String T_ALLOCATE = "ALLOCATE"; public static final String T_ALTER = "ALTER"; static final String T_AND = "AND"; static final String T_ANY = "ANY"; static final String T_ARE = "ARE"; static final String T_ARRAY = "ARRAY"; static final String T_AS = "AS"; static final String T_ASENSITIVE = 74 "ASENSITIVE"; static final String T_ASYMMETRIC = 76 "ASYMMETRIC"; static final String T_AT = "AT"; static final String T_ATOMIC = "ATOMIC"; static final String T_AUTHORIZATION = 80 "AUTHORIZATION"; static final String T_BEGIN = "BEGIN"; static final String T_BETWEEN = "BETWEEN"; 83 static final String T_BIGINT = "BIGINT"; public static final String T_BINARY = "BINARY"; static final String T_BLOB = "BLOB"; static final String T_BOOLEAN = "BOOLEAN"; static final String T_BOTH = "BOTH"; 88 static final String T_BY = "BY"; static final String T_CALL = "CALL"; static final String T_CALLED = "CALLED"; static final String T_CASCADED = "CASCADED"; static final String T_CASE = "CASE"; static final String T_CAST = "CAST"; static final String T_CHAR = "CHAR"; static final String T_CHARACTER = 96 "CHARACTER"; static final String T_CHECK = "CHECK"; static final String T_CLOB = "CLOB"; static final String T_CLOSE = "CLOSE"; static final String T_COLLATE = "COLLATE"; static final String T_COLUMN = "COLUMN"; public static final String T_COMMIT = "COMMIT"; static final String T_CONDITION = 104 "CONDIITON"; static final String T_CONNECT = "CONNECT"; static final String T_CONSTRAINT = 107 "CONSTRAINT"; static final String T_CONTINUE = "CONTINUE"; static final String T_CORRESPONDING = 110 "CORRESPONDING"; static final String T_CREATE = "CREATE"; static final String T_CROSS = "CROSS"; static final String T_CUBE = "CUBE"; static final String T_CURRENT = "CURRENT"; static final String T_CURRENT_DATE = 116 "CURRENT_DATE"; static final String T_CURRENT_DEFAULT_TRANSFORM_GROUP = 118 "CURRENT_DEFAULT_TRANSFORM_GROUP"; static final String T_CURRENT_PATH = "CURRENT_PATH"; static final String T_CURRENT_ROLE = "CURRENT_ROLE"; static final String T_CURRENT_TIME = "CURRENT_TIME"; static final String T_CURRENT_TIMESTAMP = 123 "CURRENT_TIMESTAMP"; static final String T_CURRENT_TRANSFORM_TROUP_FOR_TYPE = 125 "CURRENT_TRANSFORM_GROUP_FOR_TYPE"; static final String T_CURRENT_USER = "CURRENT_USER"; static final String T_CURSOR = "CURSOR"; static final String T_CYCLE = "CYCLE"; static final String T_DATE = "DATE"; static final String T_DAY = "DAY"; static final String T_DEALLOCATE = "DEALLOCATE"; static final String T_DEC = "DEC"; static final String T_DECIMAL = "DECIMAL"; static final String T_DECLARE = "DECLARE"; static final String T_DEFAULT = "DEFAULT"; public static final String T_DELETE = "DELETE"; static final String T_DEREF = "DEREF"; static final String T_DESCRIBE = "DESCRIBE"; static final String T_DETERMINISTIC = "DETERMINISTIC"; static final String T_DISCONNECT = "DISCONNECT"; static final String T_DISTINCT = "DISTINCT"; static final String T_DO = "DO"; static final String T_DOUBLE = "DOUBLE"; static final String T_DOW = "DAYOFWEEK"; static final String T_DROP = "DROP"; static final String T_DYNAMIC = "DYNAMIC"; static final String T_EACH = "EACH"; static final String T_ELEMENT = "ELEMENT"; static final String T_ELSE = "ELSE"; static final String T_ELSEIF = "ELSEIF"; static final String T_END = "END"; static final String T_ESCAPE = "ESCAPE"; static final String T_EXCEPT = "EXCEPT"; static final String T_EXEC = "EXEC"; static final String T_EXECUTE = "EXECUTE"; static final String T_EXISTS = "EXISTS"; static final String T_EXIT = "EXIT"; static final String T_EXTERNAL = "EXTERNAL"; static final String T_FALSE = "FALSE"; static final String T_FETCH = "FETCH"; static final String T_FILTER = "FILTER"; static final String T_FLOAT = "FLOAT"; static final String T_FOR = "FOR"; static final String T_FOREIGN = "FOREIGN"; static final String T_FREE = "FREE"; static final String T_FROM = "FROM"; static final String T_FULL = "FULL"; static final String T_FUNCTION = "FUNCTION"; static final String T_GET = "GET"; static final String T_GLOBAL = "GLOBAL"; static final String T_GRANT = "GRANT"; static final String T_GROUP = "GROUP"; static final String T_GROUPING = "GROUPING"; static final String T_HANDLER = "HANDLER"; static final String T_HAVING = "HAVING"; static final String T_HEADER = "HEADER"; static final String T_HOLD = "HOLD"; static final String T_HOUR = "HOUR"; static final String T_IDENTITY = "IDENTITY"; static final String T_IF = "IF"; static final String T_IMMEDIATE = "IMMEDIATE"; static final String T_IN = "IN"; static final String T_INDICATOR = "INDICATOR"; static final String T_INNER = "INNER"; static final String T_INOUT = "INOUT"; static final String T_INPUT = "INPUT"; static final String T_INSENSITIVE = "INSENSITIVE"; public static final String T_INSERT = "INSERT"; static final String T_INT = "INT"; static final String T_INTEGER = "INTEGER"; static final String T_INTERSECT = "INTERSECT"; static final String T_INTERVAL = "INTERVAL"; static final String T_INTO = "INTO"; static final String T_IS = "IS"; static final String T_ITERATE = "ITERATE"; static final String T_JOIN = "JOIN"; static final String T_LANGUAGE = "LANGUAGE"; static final String T_LARGE = "LARGE"; static final String T_LATERAL = "LATERAL"; static final String T_LEADING = "LEADING"; static final String T_LEAVE = "LEAVE"; static final String T_LEFT = "LEFT"; static final String T_LIKE = "LIKE"; static final String T_LOCAL = "LOCAL"; static final String T_LOCALTIME = "LOCALTIME"; static final String T_LOCALTIMESTAMP = "LOCALTIMESTAMP"; static final String T_LOOP = "LOOP"; static final String T_MATCH = "MATCH"; static final String T_MEMBER = "MEMBER"; static final String T_METHOD = "METHOD"; static final String T_MINUTE = "MINUTE"; static final String T_MODIFIES = "MODIFIES"; static final String T_MODULE = "MODULE"; static final String T_MONTH = "MONTH"; static final String T_MULTISET = "MULTISET"; static final String T_NATIONAL = "NATIONAL"; static final String T_NATURAL = "NAUTRAL"; static final String T_NCHAR = "NCHAR"; static final String T_NCLOB = "NCLOB"; static final String T_NEW = "NEW"; static final String T_NEXT = "NEXT"; static final String T_NO = "NO"; static final String T_NONE = "NONE"; static final String T_NOT = "NOT"; static final String T_NULL = "NULL"; static final String T_NUMERIC = "NUMERIC"; static final String T_OF = "OF"; static final String T_OLD = "OLD"; static final String T_ON = "ON"; static final String T_ONLY = "ONLY"; static final String T_OPEN = "OPEN"; static final String T_OR = "OR"; static final String T_ORDER = "ORDER"; static final String T_OUT = "OUT"; static final String T_OUTER = "OUTER"; static final String T_OUTPUT = "OUTPUT"; static final String T_OVER = "OVER"; static final String T_OVERLAPS = "OVERLAPS"; static final String T_PARAMETER = "PARAMETER"; static final String T_PARTITION = "PARTITION"; static final String T_PRECISION = "PRECISION"; static final String T_PREPARE = "PREPARE"; static final String T_PRIMARY = "PRIMARY"; static final String T_PROCEDURE = "PROCEDURE"; static final String T_RANGE = "RANGE"; static final String T_READS = "READS"; static final String T_REAL = "REAL"; static final String T_RECURSIVE = "RECURSIVE"; static final String T_REF = "REF"; static final String T_REFERENCES = "REFERENCES"; static final String T_REFERENCING = "REFERENCING"; static final String T_RELEASE = "RELEASE"; static final String T_REPEAT = "REPEAT"; static final String T_RESIGNAL = "RESIGNAL"; static final String T_RESULT = "RESULT"; static final String T_RETURN = "RETURN"; static final String T_RETURNS = "RETURNS"; static final String T_REVOKE = "REVOKE"; static final String T_RIGHT = "RIGHT"; static final String T_ROLLBACK = "ROLLBACK"; static final String T_ROLLUP = "ROLLUP"; static final String T_ROW = "ROW"; static final String T_ROWS = "ROWS"; static final String T_SAVEPOINT = "SAVEPOINT"; static final String T_SCOPE = "SCOPE"; static final String T_SCROLL = "SCROLL"; static final String T_SECOND = "SECOND"; static final String T_SEARCH = "SEARCH"; static final String T_SELECT = "SELECT"; static final String T_SENSITIVE = "SENSITIVE"; static final String T_SESSION_USER = "SESSION_USER"; public static final String T_SET = "SET"; static final String T_SIGNAL = "SIGNAL"; static final String T_SIMILAR = "SIMILAR"; static final String T_SMALLINT = "SMALLINT"; static final String T_SOME = "SOME"; static final String T_SPECIFIC = "SPECIFIC"; static final String T_SPECIFICTYPE = "SPECIFICTYPE"; static final String T_SQL = "SQL"; static final String T_SQLEXCEPTION = "SQLEXCEPTION"; static final String T_SQLSTATE = "SQLSTATE"; static final String T_SQLWARNING = "SQLWARNING"; static final String T_START = "START"; static final String T_STATIC = "STATIC"; static final String T_SUBMULTISET = "SUBMULTISET"; static final String T_SYMMETRIC = "SYMMETRIC"; static final String T_SYSTEM = "SYSTEM"; static final String T_SYSTEM_USER = "SYSTEM_USER"; static final String T_TABLE = "TABLE"; static final String T_TABLESAMPLE = "TABLESAMPLE"; static final String T_THEN = "THEN"; static final String T_TIME = "TIME"; static final String T_TIMESTAMP = "TIMESTAMP"; static final String T_TIMEZONE_HOUR = "TIMEZONE_HOUR"; static final String T_TIMEZONE_MINUTE = "TIMEZONE_MINUTE"; static final String T_TO = "TO"; static final String T_TRAILING = "TRAILING"; static final String T_TRANSLATION = "TRANSLATION"; static final String T_TREAT = "TREAT"; static final String T_TRIGGER = "TRIGGER"; static final String T_TRUE = "TRUE"; static final String T_UNDO = "UNDO"; static final String T_UNION = "UNION"; static final String T_UNIQUE = "UNIQUE"; static final String T_UNKNOWN = "UNKNOWN"; static final String T_UNNEST = "UNNEST"; static final String T_UNTIL = "UNTIL"; static final String T_UPDATE = "UPDATE"; static final String T_USER = "USER"; static final String T_USING = "USING"; static final String T_VALUE = "VALUE"; static final String T_VALUES = "VALUES"; static final String T_VARCHAR = "VARCHAR"; static final String T_VARYING = "VARYING"; static final String T_WHEN = "WHEN"; static final String T_WHENEVER = "WHENEVER"; static final String T_WHERE = "WHERE"; static final String T_WHILE = "WHILE"; static final String T_WINDOW = "WINDOW"; static final String T_WITH = "WITH"; static final String T_WITHIN = "WITHIN"; static final String T_WITHOUT = "WITHOUT"; static final String T_YEAR = "YEAR"; 325 static final String T_ALWAYS = "ALWAYS"; 327 static final String T_ACTION = "ACTION"; 328 static final String T_ADMIN = "ADMIN"; 329 static final String T_AFTER = "AFTER"; 330 static final String T_ALIAS = "ALIAS"; 331 static final String T_ASC = "ASC"; 332 static final String T_AUTOCOMMIT = "AUTOCOMMIT"; 333 static final String T_AVG = "AVG"; 334 static final String T_BACKUP = "BACKUP"; 335 static final String T_BEFORE = "BEFORE"; 336 static final String T_CACHED = "CACHED"; 337 static final String T_CASCADE = "CASCADE"; 338 static final String T_CASEWHEN = "CASEWHEN"; 339 static final String T_CHECKPOINT = "CHECKPOINT"; 340 static final String T_CLASS = "CLASS"; 341 static final String T_COALESCE = "COALESCE"; 342 static final String T_COLLATION = "COLLATION"; 343 static final String T_COMPACT = "COMPACT"; 344 public static final String T_COMPRESSED = "COMPRESSED"; 345 static final String T_CONVERT = "CONVERT"; 346 static final String T_COUNT = "COUNT"; 347 static final String T_DATABASE = "DATABASE"; 348 static final String T_DEFRAG = "DEFRAG"; 349 static final String T_DESC = "DESC"; 350 static final String T_EVERY = "EVERY"; 351 static final String T_EXPLAIN = "EXPLAIN"; 352 static final String T_EXTRACT = "EXTRACT"; 353 static final String T_GENERATED = "GENERATED"; 354 static final String T_IFNULL = "IFNULL"; 355 static final String T_IGNORECASE = "IGNORECASE"; 356 static final String T_IMMEDIATELY = "IMMEDIATELY"; 357 static final String T_INCREMENT = "INCREMENT"; 358 static final String T_INDEX = "INDEX"; 359 static final String T_INITIAL = "INITIAL"; 360 static final String T_KEY = "KEY"; 361 static final String T_LIMIT = "LIMIT"; 362 static final String T_LOGSIZE = "LOGSIZE"; 363 static final String T_MAX = "MAX"; 364 static final String T_MAXROWS = "MAXROWS"; 365 static final String T_MEMORY = "MEMORY"; 366 static final String T_MERGE = "MERGE"; 367 static final String T_MIN = "MIN"; 368 static final String T_MINUS = "MINUS"; 369 static final String T_NOW = "NOW"; 370 static final String T_NOWAIT = "NOWAIT"; 371 static final String T_NULLIF = "NULLIF"; 372 static final String T_NVL = "NVL"; 373 static final String T_OFFSET = "OFFSET"; 374 static final String T_PASSWORD = "PASSWORD"; 375 public static final String T_SCHEMA = "SCHEMA"; 376 static final String T_PLAN = "PLAN"; 377 static final String T_PRESERVE = "PRESERVE"; 378 static final String T_PRIVILEGES = "PRIVILEGES"; 379 static final String T_POSITION = "POSITION"; 380 static final String T_PROPERTY = "PROPERTY"; 381 static final String T_PUBLIC = "PUBLIC"; 382 static final String T_QUEUE = "QUEUE"; 383 static final String T_READONLY = "READONLY"; 384 static final String T_REFERENTIAL_INTEGRITY = "REFERENTIAL_INTEGRITY"; 385 static final String T_RENAME = "RENAME"; 386 static final String T_RESTART = "RESTART"; 387 static final String T_RESTRICT = "RESTRICT"; 388 static final String T_ROLE = "ROLE"; 389 static final String T_SCRIPT = "SCRIPT"; 390 static final String T_SCRIPTFORMAT = "SCRIPTFORMAT"; 391 static final String T_SEQUENCE = "SEQUENCE"; 392 static final String T_SHUTDOWN = "SHUTDOWN"; 393 static final String T_SOURCE = "SOURCE"; 394 static final String T_STDDEV_POP = "STDDEV_POP"; 395 static final String T_STDDEV_SAMP = "STDDEV_SAMP"; 396 static final String T_SUBSTRING = "SUBSTRING"; 397 static final String T_SUM = "SUM"; 398 static final String T_SYSDATE = "SYSDATE"; 399 static final String T_TEMP = "TEMP"; 400 static final String T_TEMPORARY = "TEMPORARY"; 401 public static final String T_TEXT = "TEXT"; 402 static final String T_TODAY = "TODAY"; 403 static final String T_TOP = "TOP"; 404 static final String T_TRIM = "TRIM"; 405 static final String T_VAR_POP = "VAR_POP"; 406 static final String T_VAR_SAMP = "VAR_SAMP"; 407 static final String T_VIEW = "VIEW"; 408 static final String T_WORK = "WORK"; 409 static final String T_WRITE_DELAY = "WRITE_DELAY"; 410 411 static final int ADD = 1; 413 static final int ALL = 2; 414 static final int ALLOCATE = 3; 415 static final int ALTER = 4; 416 static final int AND = 5; 417 static final int ANY = 6; 418 static final int ARE = 7; 419 static final int ARRAY = 8; 420 static final int AS = 9; 421 static final int ASENSITIVE = 10; 422 static final int ASYMMETRIC = 11; 423 static final int AT = 12; 424 static final int ATOMIC = 13; 425 static final int AUTHORIZATION = 14; 426 static final int BEGIN = 15; 427 static final int BETWEEN = 16; 428 static final int BIGINT = 17; 429 static final int BINARY = 18; 430 static final int BLOB = 19; 431 static final int BOOLEAN = 20; 432 static final int BOTH = 21; 433 static final int BY = 22; 434 public static final int CALL = 23; 435 static final int CALLED = 24; 436 static final int CASCADED = 25; 437 static final int CASE = 26; 438 static final int CAST = 27; 439 static final int CHAR = 28; 440 static final int CHARACTER = 29; 441 static final int CHECK = 30; 442 static final int CLOB = 31; 443 static final int CLOSE = 32; 444 static final int COLLATE = 33; 445 static final int COLUMN = 34; 446 static final int COMMIT = 35; 447 static final int CONDITION = 36; 448 static final int CONNECT = 37; 449 static final int CONSTRAINT = 38; 450 static final int CONTINUE = 39; 451 static final int CORRESPONDING = 40; 452 static final int CREATE = 41; 453 static final int CROSS = 42; 454 static final int CUBE = 43; 455 static final int CURRENT = 44; 456 static final int CURRENT_DATE = 45; 457 static final int CURRENT_DEFAULT_TRANSFORM_GRO = 46; 458 static final int CURRENT_PATH = 47; 459 static final int CURRENT_ROLE = 48; 460 static final int CURRENT_TIME = 49; 461 static final int CURRENT_TIMESTAMP = 50; 462 static final int CURRENT_TRANSFORM_GROUP_FOR_T = 51; 463 static final int CURRENT_USER = 52; 464 static final int CURSOR = 53; 465 static final int CYCLE = 54; 466 static final int DATE = 55; 467 static final int DAY = 56; 468 static final int DEALLOCATE = 57; 469 static final int DEC = 58; 470 static final int DECIMAL = 59; 471 static final int DECLARE = 60; 472 static final int DEFAULT = 61; 473 public static final int DELETE = 62; 474 static final int DEREF = 63; 475 static final int DESCRIBE = 64; 476 static final int DETERMINISTIC = 65; 477 static final int DISCONNECT = 66; 478 static final int DISTINCT = 67; 479 static final int DO = 68; 480 static final int DOUBLE = 69; 481 static final int DROP = 70; 482 static final int DYNAMIC = 71; 483 static final int EACH = 72; 484 static final int ELEMENT = 73; 485 static final int ELSE = 74; 486 static final int ELSEIF = 75; 487 static final int END = 76; 488 static final int ESCAPE = 77; 489 static final int EXCEPT = 78; 490 static final int EXEC = 79; 491 static final int EXECUTE = 80; 492 static final int EXISTS = 81; 493 static final int EXIT = 82; 494 static final int EXTERNAL = 83; 495 static final int FALSE = 84; 496 static final int FETCH = 85; 497 static final int FILTER = 86; 498 static final int FLOAT = 87; 499 static final int FOR = 88; 500 static final int FOREIGN = 89; 501 static final int FREE = 90; 502 static final int FROM = 91; 503 static final int FULL = 92; 504 static final int FUNCTION = 93; 505 static final int GET = 94; 506 static final int GLOBAL = 95; 507 static final int GRANT = 96; 508 static final int GROUP = 97; 509 static final int GROUPING = 98; 510 static final int HANDLER = 99; 511 static final int HAVING = 100; 512 static final int HOLD = 101; 513 static final int HOUR = 102; 514 static final int IDENTITY = 103; 515 static final int IF = 104; 516 static final int IMMEDIATE = 105; 517 static final int IN = 106; 518 static final int INDICATOR = 107; 519 static final int INNER = 108; 520 static final int INOUT = 109; 521 static final int INPUT = 110; 522 static final int INSENSITIVE = 111; 523 public static final int INSERT = 112; 524 static final int INT = 113; 525 static final int INTEGER = 114; 526 static final int INTERSECT = 115; 527 static final int INTERVAL = 116; 528 static final int INTO = 117; 529 static final int IS = 118; 530 static final int ITERATE = 119; 531 static final int JOIN = 120; 532 static final int LANGUAGE = 121; 533 static final int LARGE = 122; 534 static final int LATERAL = 123; 535 static final int LEADING = 124; 536 static final int LEAVE = 125; 537 static final int LEFT = 126; 538 static final int LIKE = 127; 539 static final int LOCAL = 128; 540 static final int LOCALTIME = 129; 541 static final int LOCALTIMESTAMP = 130; 542 static final int LOOP = 131; 543 static final int MATCH = 132; 544 static final int MEMBER = 133; 545 static final int MERGE = 134; 546 static final int METHOD = 135; 547 static final int MINUTE = 136; 548 static final int MODIFIES = 137; 549 static final int MODULE = 138; 550 static final int MONTH = 139; 551 static final int MULTISET = 140; 552 static final int NATIONAL = 141; 553 static final int NATURAL = 142; 554 static final int NCHAR = 143; 555 static final int NCLOB = 144; 556 static final int NEW = 145; 557 static final int NO = 146; 558 static final int NONE = 147; 559 static final int NOT = 148; 560 static final int NULL = 149; 561 static final int NUMERIC = 150; 562 static final int OF = 151; 563 static final int OLD = 152; 564 static final int ON = 153; 565 static final int ONLY = 154; 566 static final int OPEN = 155; 567 static final int OR = 156; 568 static final int ORDER = 157; 569 static final int OUT = 158; 570 static final int OUTER = 159; 571 static final int OUTPUT = 160; 572 static final int OVER = 161; 573 static final int OVERLAPS = 162; 574 static final int PARAMETER = 163; 575 static final int PARTITION = 164; 576 static final int PRECISION = 165; 577 static final int PREPARE = 166; 578 static final int PRIMARY = 167; 579 static final int PROCEDURE = 168; 580 static final int RANGE = 169; 581 static final int READS = 170; 582 static final int REAL = 171; 583 static final int RECURSIVE = 172; 584 static final int REF = 173; 585 static final int REFERENCES = 174; 586 static final int REFERENCING = 175; 587 static final int RELEASE = 176; 588 static final int REPEAT = 177; 589 static final int RESIGNAL = 178; 590 static final int RESULT = 179; 591 static final int RETURN = 180; 592 static final int RETURNS = 181; 593 static final int REVOKE = 182; 594 static final int RIGHT = 183; 595 static final int ROLLBACK = 184; 596 static final int ROLLUP = 185; 597 static final int ROW = 186; 598 static final int ROWS = 187; 599 static final int SAVEPOINT = 188; 600 static final int SCOPE = 189; 601 static final int SCROLL = 190; 602 static final int SEARCH = 191; 603 static final int SECOND = 192; 604 public static final int SELECT = 193; 605 static final int SENSITIVE = 194; 606 static final int SESSION_USER = 195; 607 static final int SET = 196; 608 static final int SIGNAL = 197; 609 static final int SIMILAR = 198; 610 static final int SMALLINT = 199; 611 static final int SOME = 200; 612 static final int SPECIFIC = 201; 613 static final int SPECIFICTYPE = 202; 614 static final int SQL = 203; 615 static final int SQLEXCEPTION = 204; 616 static final int SQLSTATE = 205; 617 static final int SQLWARNING = 206; 618 static final int START = 207; 619 static final int STATIC = 208; 620 static final int SUBMULTISET = 209; 621 static final int SYMMETRIC = 210; 622 static final int SYSTEM = 211; 623 static final int SYSTEM_USER = 212; 624 static final int TABLE = 213; 625 static final int TABLESAMPLE = 214; 626 static final int THEN = 215; 627 static final int TIME = 216; 628 static final int TIMESTAMP = 217; 629 static final int TIMEZONE_HOUR = 218; 630 static final int TIMEZONE_MINUTE = 219; 631 static final int TO = 220; 632 static final int TRAILING = 221; 633 static final int TRANSLATION = 222; 634 static final int TREAT = 223; 635 static final int TRIGGER = 224; 636 static final int TRUE = 225; 637 static final int UNDO = 226; 638 static final int UNION = 227; 639 static final int UNIQUE = 228; 640 static final int UNKNOWN = 229; 641 static final int UNNEST = 220; 642 static final int UNTIL = 221; 643 public static final int UPDATE = 222; 644 static final int USER = 223; 645 static final int USING = 224; 646 static final int VALUE = 225; 647 static final int VALUES = 226; 648 static final int VARCHAR = 227; 649 static final int VARYING = 228; 650 static final int WHEN = 229; 651 static final int WHENEVER = 230; 652 static final int WHERE = 231; 653 static final int WHILE = 232; 654 static final int WINDOW = 233; 655 static final int WITH = 234; 656 static final int WITHIN = 235; 657 static final int WITHOUT = 236; 658 static final int YEAR = 237; 659 660 public static final int UNKNOWNTOKEN = -1; 662 static final int ALIAS = 300; 663 static final int AUTOCOMMIT = 301; 664 static final int CACHED = 302; 665 static final int CHECKPOINT = 303; 666 static final int EXPLAIN = 304; 667 static final int IGNORECASE = 305; 668 static final int INDEX = 306; 669 static final int LOGSIZE = 307; 670 static final int MATCHED = 308; 671 static final int MAXROWS = 309; 672 static final int MEMORY = 310; 673 static final int MINUS = 311; 674 static final int NEXT = 312; 675 static final int OPENBRACKET = 313; 676 static final int PASSWORD = 314; 677 static final int PLAN = 315; 678 static final int PROPERTY = 316; 679 static final int READONLY = 317; 680 static final int REFERENTIAL_INTEGRITY = 318; 681 static final int RENAME = 319; 682 static final int RESTART = 320; 683 static final int SCRIPT = 321; 684 static final int SCRIPTFORMAT = 322; 685 static final int SEMICOLON = 323; 686 static final int SEQUENCE = 324; 687 static final int SHUTDOWN = 325; 688 static final int SOURCE = 326; 689 static final int TEMP = 327; 690 static final int TEXT = 328; 691 static final int VIEW = 329; 692 static final int WRITE_DELAY = 330; 693 694 static final int VAR_POP = 330; 696 static final int VAR_SAMP = 331; 697 static final int STDDEV_POP = 332; 698 static final int STDDEV_SAMP = 333; 699 static final int DEFRAG = 334; 700 static final int INCREMENT = 335; 701 static final int TOCHAR = 336; 702 static final int DATABASE = 337; 703 static final int SCHEMA = 338; 704 static final int ROLE = 339; 705 static final int DOW = 340; 706 static final int INITIAL = 341; 707 708 static { 710 commandSet = newCommandSet(); 711 } 712 713 719 private static IntValueHashMap newCommandSet() { 720 721 IntValueHashMap commandSet; 722 723 commandSet = new IntValueHashMap(67); 724 725 commandSet.put(T_ADD, ADD); 726 commandSet.put(T_ALIAS, ALIAS); 727 commandSet.put(T_ALTER, ALTER); 728 commandSet.put(T_AUTOCOMMIT, AUTOCOMMIT); 729 commandSet.put(T_CACHED, CACHED); 730 commandSet.put(T_CALL, CALL); 731 commandSet.put(T_CHECK, CHECK); 732 commandSet.put(T_CHECKPOINT, CHECKPOINT); 733 commandSet.put(T_COLUMN, COLUMN); 734 commandSet.put(T_COMMIT, COMMIT); 735 commandSet.put(T_CONNECT, CONNECT); 736 commandSet.put(T_CONSTRAINT, CONSTRAINT); 737 commandSet.put(T_CREATE, CREATE); 738 commandSet.put(T_DATABASE, DATABASE); 739 commandSet.put(T_DELETE, DELETE); 740 commandSet.put(T_DEFRAG, DEFRAG); 741 commandSet.put(T_DISCONNECT, DISCONNECT); 742 commandSet.put(T_DROP, DROP); 743 commandSet.put(T_EXCEPT, EXCEPT); 744 commandSet.put(T_EXPLAIN, EXPLAIN); 745 commandSet.put(T_FOREIGN, FOREIGN); 746 commandSet.put(T_GRANT, GRANT); 747 commandSet.put(T_IGNORECASE, IGNORECASE); 748 commandSet.put(T_INCREMENT, INCREMENT); 749 commandSet.put(T_INDEX, INDEX); 750 commandSet.put(T_INITIAL, INITIAL); 751 commandSet.put(T_INSERT, INSERT); 752 commandSet.put(T_INTERSECT, INTERSECT); 753 commandSet.put(T_LOGSIZE, LOGSIZE); 754 commandSet.put(T_MAXROWS, MAXROWS); 755 commandSet.put(T_MEMORY, MEMORY); 756 commandSet.put(T_MINUS, MINUS); 757 commandSet.put(T_NEXT, NEXT); 758 commandSet.put(T_NOT, NOT); 759 commandSet.put(T_OPENBRACKET, OPENBRACKET); 760 commandSet.put(T_PASSWORD, PASSWORD); 761 commandSet.put(T_PLAN, PLAN); 762 commandSet.put(T_PRIMARY, PRIMARY); 763 commandSet.put(T_PROPERTY, PROPERTY); 764 commandSet.put(T_READONLY, READONLY); 765 commandSet.put(T_REFERENTIAL_INTEGRITY, REFERENTIAL_INTEGRITY); 766 commandSet.put(T_RELEASE, RELEASE); 767 commandSet.put(T_RENAME, RENAME); 768 commandSet.put(T_RESTART, RESTART); 769 commandSet.put(T_REVOKE, REVOKE); 770 commandSet.put(T_ROLE, ROLE); 771 commandSet.put(T_ROLLBACK, ROLLBACK); 772 commandSet.put(T_SAVEPOINT, SAVEPOINT); 773 commandSet.put(T_SCRIPT, SCRIPT); 774 commandSet.put(T_SCRIPTFORMAT, SCRIPTFORMAT); 775 commandSet.put(T_SELECT, SELECT); 776 commandSet.put(T_SEMICOLON, SEMICOLON); 777 commandSet.put(T_SEQUENCE, SEQUENCE); 778 commandSet.put(T_SET, SET); 779 commandSet.put(T_SHUTDOWN, SHUTDOWN); 780 commandSet.put(T_SOURCE, SOURCE); 781 commandSet.put(T_TABLE, TABLE); 782 commandSet.put(T_TEMP, TEMP); 783 commandSet.put(T_TEXT, TEXT); 784 commandSet.put(T_TRIGGER, TRIGGER); 785 commandSet.put(T_UNIQUE, UNIQUE); 786 commandSet.put(T_UPDATE, UPDATE); 787 commandSet.put(T_UNION, UNION); 788 commandSet.put(T_USER, USER); 789 commandSet.put(T_VALUES, VALUES); 790 commandSet.put(T_VIEW, VIEW); 791 commandSet.put(T_WRITE_DELAY, WRITE_DELAY); 792 commandSet.put(T_SCHEMA, SCHEMA); 793 794 return commandSet; 795 } 796 797 public static int get(String token) { 798 return commandSet.get(token, -1); 799 } 800 801 private static HashSet keywords; 802 static IntValueHashMap valueTokens; 803 804 static { 805 806 keywords = new HashSet(67); 808 809 812 813 814 815 816 817 818 820 821 String [] keyword = { 822 Token.T_AS, Token.T_AND, Token.T_ALL, Token.T_ANY, Token.T_AVG, 823 Token.T_BY, Token.T_BETWEEN, Token.T_BOTH, Token.T_CALL, 824 Token.T_CASE, Token.T_CASEWHEN, Token.T_CAST, Token.T_CONVERT, 825 Token.T_COUNT, Token.T_COALESCE, Token.T_DISTINCT, Token.T_ELSE, 826 Token.T_END, Token.T_EVERY, Token.T_EXISTS, Token.T_EXCEPT, 827 Token.T_EXTRACT, Token.T_FOR, Token.T_FROM, Token.T_GROUP, 828 Token.T_HAVING, Token.T_IF, Token.T_INTO, Token.T_IFNULL, 829 Token.T_IS, Token.T_IN, Token.T_INTERSECT, Token.T_JOIN, 830 Token.T_INNER, Token.T_LEADING, Token.T_LIKE, Token.T_MAX, 831 Token.T_MIN, Token.T_NEXT, Token.T_NULLIF, Token.T_NOT, 832 Token.T_NVL, Token.T_MINUS, Token.T_ON, Token.T_ORDER, Token.T_OR, 833 Token.T_OUTER, Token.T_POSITION, Token.T_PRIMARY, Token.T_SELECT, 834 Token.T_SET, Token.T_SOME, Token.T_STDDEV_POP, 835 Token.T_STDDEV_SAMP, Token.T_SUBSTRING, Token.T_SUM, Token.T_THEN, 836 Token.T_TO, Token.T_TRAILING, Token.T_TRIM, Token.T_UNIQUE, 837 Token.T_UNION, Token.T_VALUES, Token.T_VAR_POP, Token.T_VAR_SAMP, 838 Token.T_WHEN, Token.T_WHERE, 839 }; 840 841 for (int i = 0; i < keyword.length; i++) { 842 keywords.add(keyword[i]); 843 } 844 } 845 846 public static boolean isKeyword(String token) { 847 return keywords.contains(token); 848 } 849 } 850 | Popular Tags |