kexi

sqlparser.cpp

00001 /* A Bison parser, made by GNU Bison 2.2.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004 
00005    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00006    Free Software Foundation, Inc.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2, or (at your option)
00011    any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.  */
00022 
00023 /* As a special exception, you may create a larger work that contains
00024    part or all of the Bison parser skeleton and distribute that work
00025    under terms of your choice, so long as that work isn't itself a
00026    parser generator using the skeleton or a modified version thereof
00027    as a parser skeleton.  Alternatively, if you modify or redistribute
00028    the parser skeleton itself, you may (at your option) remove this
00029    special exception, which will cause the skeleton and the resulting
00030    Bison output files to be licensed under the GNU General Public
00031    License without this special exception.
00032 
00033    This special exception was added by the Free Software Foundation in
00034    version 2.2 of Bison.  */
00035 
00036 /* C LALR(1) parser skeleton written by Richard Stallman, by
00037    simplifying the original so-called "semantic" parser.  */
00038 
00039 /* All symbols defined below should begin with yy or YY, to avoid
00040    infringing on user name space.  This should be done even for local
00041    variables, as they might otherwise be expanded by user macros.
00042    There are some unavoidable exceptions within include files to
00043    define necessary library symbols; they are noted "INFRINGES ON
00044    USER NAME SPACE" below.  */
00045 
00046 /* Identify Bison output.  */
00047 #define YYBISON 1
00048 
00049 /* Bison version.  */
00050 #define YYBISON_VERSION "2.2"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 0
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 0
00060 
00061 
00062 
00063 /* Tokens.  */
00064 #ifndef YYTOKENTYPE
00065 # define YYTOKENTYPE
00066    /* Put the tokens into the symbol table, so that GDB and other debuggers
00067       know about them.  */
00068    enum yytokentype {
00069      UMINUS = 258,
00070      SQL_TYPE = 259,
00071      SQL_ABS = 260,
00072      ACOS = 261,
00073      AMPERSAND = 262,
00074      SQL_ABSOLUTE = 263,
00075      ADA = 264,
00076      ADD = 265,
00077      ADD_DAYS = 266,
00078      ADD_HOURS = 267,
00079      ADD_MINUTES = 268,
00080      ADD_MONTHS = 269,
00081      ADD_SECONDS = 270,
00082      ADD_YEARS = 271,
00083      ALL = 272,
00084      ALLOCATE = 273,
00085      ALTER = 274,
00086      AND = 275,
00087      ANY = 276,
00088      ARE = 277,
00089      AS = 278,
00090      ASIN = 279,
00091      ASC = 280,
00092      ASCII = 281,
00093      ASSERTION = 282,
00094      ATAN = 283,
00095      ATAN2 = 284,
00096      AUTHORIZATION = 285,
00097      AUTO_INCREMENT = 286,
00098      AVG = 287,
00099      BEFORE = 288,
00100      SQL_BEGIN = 289,
00101      BETWEEN = 290,
00102      BIGINT = 291,
00103      BINARY = 292,
00104      BIT = 293,
00105      BIT_LENGTH = 294,
00106      BITWISE_SHIFT_LEFT = 295,
00107      BITWISE_SHIFT_RIGHT = 296,
00108      BREAK = 297,
00109      BY = 298,
00110      CASCADE = 299,
00111      CASCADED = 300,
00112      CASE = 301,
00113      CAST = 302,
00114      CATALOG = 303,
00115      CEILING = 304,
00116      CENTER = 305,
00117      SQL_CHAR = 306,
00118      CHAR_LENGTH = 307,
00119      CHARACTER_STRING_LITERAL = 308,
00120      CHECK = 309,
00121      CLOSE = 310,
00122      COALESCE = 311,
00123      COBOL = 312,
00124      COLLATE = 313,
00125      COLLATION = 314,
00126      COLUMN = 315,
00127      COMMIT = 316,
00128      COMPUTE = 317,
00129      CONCAT = 318,
00130      CONCATENATION = 319,
00131      CONNECT = 320,
00132      CONNECTION = 321,
00133      CONSTRAINT = 322,
00134      CONSTRAINTS = 323,
00135      CONTINUE = 324,
00136      CONVERT = 325,
00137      CORRESPONDING = 326,
00138      COS = 327,
00139      COT = 328,
00140      COUNT = 329,
00141      CREATE = 330,
00142      CURDATE = 331,
00143      CURRENT = 332,
00144      CURRENT_DATE = 333,
00145      CURRENT_TIME = 334,
00146      CURRENT_TIMESTAMP = 335,
00147      CURTIME = 336,
00148      CURSOR = 337,
00149      DATABASE = 338,
00150      SQL_DATE = 339,
00151      DATE_FORMAT = 340,
00152      DATE_REMAINDER = 341,
00153      DATE_VALUE = 342,
00154      DAY = 343,
00155      DAYOFMONTH = 344,
00156      DAYOFWEEK = 345,
00157      DAYOFYEAR = 346,
00158      DAYS_BETWEEN = 347,
00159      DEALLOCATE = 348,
00160      DEC = 349,
00161      DECLARE = 350,
00162      DEFAULT = 351,
00163      DEFERRABLE = 352,
00164      DEFERRED = 353,
00165      SQL_DELETE = 354,
00166      DESC = 355,
00167      DESCRIBE = 356,
00168      DESCRIPTOR = 357,
00169      DIAGNOSTICS = 358,
00170      DICTIONARY = 359,
00171      DIRECTORY = 360,
00172      DISCONNECT = 361,
00173      DISPLACEMENT = 362,
00174      DISTINCT = 363,
00175      DOMAIN_TOKEN = 364,
00176      SQL_DOUBLE = 365,
00177      DOUBLE_QUOTED_STRING = 366,
00178      DROP = 367,
00179      ELSE = 368,
00180      END = 369,
00181      END_EXEC = 370,
00182      EQUAL = 371,
00183      ESCAPE = 372,
00184      EXCEPT = 373,
00185      SQL_EXCEPTION = 374,
00186      EXEC = 375,
00187      EXECUTE = 376,
00188      EXISTS = 377,
00189      EXP = 378,
00190      EXPONENT = 379,
00191      EXTERNAL = 380,
00192      EXTRACT = 381,
00193      SQL_FALSE = 382,
00194      FETCH = 383,
00195      FIRST = 384,
00196      SQL_FLOAT = 385,
00197      FLOOR = 386,
00198      FN = 387,
00199      FOR = 388,
00200      FOREIGN = 389,
00201      FORTRAN = 390,
00202      FOUND = 391,
00203      FOUR_DIGITS = 392,
00204      FROM = 393,
00205      FULL = 394,
00206      GET = 395,
00207      GLOBAL = 396,
00208      GO = 397,
00209      GOTO = 398,
00210      GRANT = 399,
00211      GREATER_OR_EQUAL = 400,
00212      HAVING = 401,
00213      HOUR = 402,
00214      HOURS_BETWEEN = 403,
00215      IDENTITY = 404,
00216      IFNULL = 405,
00217      SQL_IGNORE = 406,
00218      IMMEDIATE = 407,
00219      SQL_IN = 408,
00220      INCLUDE = 409,
00221      INDEX = 410,
00222      INDICATOR = 411,
00223      INITIALLY = 412,
00224      INNER = 413,
00225      INPUT = 414,
00226      INSENSITIVE = 415,
00227      INSERT = 416,
00228      INTEGER = 417,
00229      INTERSECT = 418,
00230      INTERVAL = 419,
00231      INTO = 420,
00232      IS = 421,
00233      ISOLATION = 422,
00234      JOIN = 423,
00235      JUSTIFY = 424,
00236      KEY = 425,
00237      LANGUAGE = 426,
00238      LAST = 427,
00239      LCASE = 428,
00240      LEFT = 429,
00241      LENGTH = 430,
00242      LESS_OR_EQUAL = 431,
00243      LEVEL = 432,
00244      LIKE = 433,
00245      LINE_WIDTH = 434,
00246      LOCAL = 435,
00247      LOCATE = 436,
00248      LOG = 437,
00249      SQL_LONG = 438,
00250      LOWER = 439,
00251      LTRIM = 440,
00252      LTRIP = 441,
00253      MATCH = 442,
00254      SQL_MAX = 443,
00255      MICROSOFT = 444,
00256      SQL_MIN = 445,
00257      MINUS = 446,
00258      MINUTE = 447,
00259      MINUTES_BETWEEN = 448,
00260      MOD = 449,
00261      MODIFY = 450,
00262      MODULE = 451,
00263      MONTH = 452,
00264      MONTHS_BETWEEN = 453,
00265      MUMPS = 454,
00266      NAMES = 455,
00267      NATIONAL = 456,
00268      NCHAR = 457,
00269      NEXT = 458,
00270      NODUP = 459,
00271      NONE = 460,
00272      NOT = 461,
00273      NOT_EQUAL = 462,
00274      NOT_EQUAL2 = 463,
00275      NOW = 464,
00276      SQL_NULL = 465,
00277      SQL_IS = 466,
00278      SQL_IS_NULL = 467,
00279      SQL_IS_NOT_NULL = 468,
00280      NULLIF = 469,
00281      NUMERIC = 470,
00282      OCTET_LENGTH = 471,
00283      ODBC = 472,
00284      OF = 473,
00285      SQL_OFF = 474,
00286      SQL_ON = 475,
00287      ONLY = 476,
00288      OPEN = 477,
00289      OPTION = 478,
00290      OR = 479,
00291      ORDER = 480,
00292      OUTER = 481,
00293      OUTPUT = 482,
00294      OVERLAPS = 483,
00295      PAGE = 484,
00296      PARTIAL = 485,
00297      SQL_PASCAL = 486,
00298      PERSISTENT = 487,
00299      CQL_PI = 488,
00300      PLI = 489,
00301      POSITION = 490,
00302      PRECISION = 491,
00303      PREPARE = 492,
00304      PRESERVE = 493,
00305      PRIMARY = 494,
00306      PRIOR = 495,
00307      PRIVILEGES = 496,
00308      PROCEDURE = 497,
00309      PRODUCT = 498,
00310      PUBLIC = 499,
00311      QUARTER = 500,
00312      QUIT = 501,
00313      RAND = 502,
00314      READ_ONLY = 503,
00315      REAL = 504,
00316      REFERENCES = 505,
00317      REPEAT = 506,
00318      REPLACE = 507,
00319      RESTRICT = 508,
00320      REVOKE = 509,
00321      RIGHT = 510,
00322      ROLLBACK = 511,
00323      ROWS = 512,
00324      RPAD = 513,
00325      RTRIM = 514,
00326      SCHEMA = 515,
00327      SCREEN_WIDTH = 516,
00328      SCROLL = 517,
00329      SECOND = 518,
00330      SECONDS_BETWEEN = 519,
00331      SELECT = 520,
00332      SEQUENCE = 521,
00333      SETOPT = 522,
00334      SET = 523,
00335      SHOWOPT = 524,
00336      SIGN = 525,
00337      SIMILAR_TO = 526,
00338      NOT_SIMILAR_TO = 527,
00339      INTEGER_CONST = 528,
00340      REAL_CONST = 529,
00341      DATE_CONST = 530,
00342      DATETIME_CONST = 531,
00343      TIME_CONST = 532,
00344      SIN = 533,
00345      SQL_SIZE = 534,
00346      SMALLINT = 535,
00347      SOME = 536,
00348      SPACE = 537,
00349      SQL = 538,
00350      SQL_TRUE = 539,
00351      SQLCA = 540,
00352      SQLCODE = 541,
00353      SQLERROR = 542,
00354      SQLSTATE = 543,
00355      SQLWARNING = 544,
00356      SQRT = 545,
00357      STDEV = 546,
00358      SUBSTRING = 547,
00359      SUM = 548,
00360      SYSDATE = 549,
00361      SYSDATE_FORMAT = 550,
00362      SYSTEM = 551,
00363      TABLE = 552,
00364      TAN = 553,
00365      TEMPORARY = 554,
00366      THEN = 555,
00367      THREE_DIGITS = 556,
00368      TIME = 557,
00369      TIMESTAMP = 558,
00370      TIMEZONE_HOUR = 559,
00371      TIMEZONE_MINUTE = 560,
00372      TINYINT = 561,
00373      TO = 562,
00374      TO_CHAR = 563,
00375      TO_DATE = 564,
00376      TRANSACTION = 565,
00377      TRANSLATE = 566,
00378      TRANSLATION = 567,
00379      TRUNCATE = 568,
00380      GENERAL_TITLE = 569,
00381      TWO_DIGITS = 570,
00382      UCASE = 571,
00383      UNION = 572,
00384      UNIQUE = 573,
00385      SQL_UNKNOWN = 574,
00386      UPDATE = 575,
00387      UPPER = 576,
00388      USAGE = 577,
00389      USER = 578,
00390      IDENTIFIER = 579,
00391      IDENTIFIER_DOT_ASTERISK = 580,
00392      USING = 581,
00393      VALUE = 582,
00394      VALUES = 583,
00395      VARBINARY = 584,
00396      VARCHAR = 585,
00397      VARYING = 586,
00398      VENDOR = 587,
00399      VIEW = 588,
00400      WEEK = 589,
00401      WHEN = 590,
00402      WHENEVER = 591,
00403      WHERE = 592,
00404      WHERE_CURRENT_OF = 593,
00405      WITH = 594,
00406      WORD_WRAPPED = 595,
00407      WORK = 596,
00408      WRAPPED = 597,
00409      XOR = 598,
00410      YEAR = 599,
00411      YEARS_BETWEEN = 600,
00412      SCAN_ERROR = 601,
00413      __LAST_TOKEN = 602,
00414      ILIKE = 603
00415    };
00416 #endif
00417 /* Tokens.  */
00418 #define UMINUS 258
00419 #define SQL_TYPE 259
00420 #define SQL_ABS 260
00421 #define ACOS 261
00422 #define AMPERSAND 262
00423 #define SQL_ABSOLUTE 263
00424 #define ADA 264
00425 #define ADD 265
00426 #define ADD_DAYS 266
00427 #define ADD_HOURS 267
00428 #define ADD_MINUTES 268
00429 #define ADD_MONTHS 269
00430 #define ADD_SECONDS 270
00431 #define ADD_YEARS 271
00432 #define ALL 272
00433 #define ALLOCATE 273
00434 #define ALTER 274
00435 #define AND 275
00436 #define ANY 276
00437 #define ARE 277
00438 #define AS 278
00439 #define ASIN 279
00440 #define ASC 280
00441 #define ASCII 281
00442 #define ASSERTION 282
00443 #define ATAN 283
00444 #define ATAN2 284
00445 #define AUTHORIZATION 285
00446 #define AUTO_INCREMENT 286
00447 #define AVG 287
00448 #define BEFORE 288
00449 #define SQL_BEGIN 289
00450 #define BETWEEN 290
00451 #define BIGINT 291
00452 #define BINARY 292
00453 #define BIT 293
00454 #define BIT_LENGTH 294
00455 #define BITWISE_SHIFT_LEFT 295
00456 #define BITWISE_SHIFT_RIGHT 296
00457 #define BREAK 297
00458 #define BY 298
00459 #define CASCADE 299
00460 #define CASCADED 300
00461 #define CASE 301
00462 #define CAST 302
00463 #define CATALOG 303
00464 #define CEILING 304
00465 #define CENTER 305
00466 #define SQL_CHAR 306
00467 #define CHAR_LENGTH 307
00468 #define CHARACTER_STRING_LITERAL 308
00469 #define CHECK 309
00470 #define CLOSE 310
00471 #define COALESCE 311
00472 #define COBOL 312
00473 #define COLLATE 313
00474 #define COLLATION 314
00475 #define COLUMN 315
00476 #define COMMIT 316
00477 #define COMPUTE 317
00478 #define CONCAT 318
00479 #define CONCATENATION 319
00480 #define CONNECT 320
00481 #define CONNECTION 321
00482 #define CONSTRAINT 322
00483 #define CONSTRAINTS 323
00484 #define CONTINUE 324
00485 #define CONVERT 325
00486 #define CORRESPONDING 326
00487 #define COS 327
00488 #define COT 328
00489 #define COUNT 329
00490 #define CREATE 330
00491 #define CURDATE 331
00492 #define CURRENT 332
00493 #define CURRENT_DATE 333
00494 #define CURRENT_TIME 334
00495 #define CURRENT_TIMESTAMP 335
00496 #define CURTIME 336
00497 #define CURSOR 337
00498 #define DATABASE 338
00499 #define SQL_DATE 339
00500 #define DATE_FORMAT 340
00501 #define DATE_REMAINDER 341
00502 #define DATE_VALUE 342
00503 #define DAY 343
00504 #define DAYOFMONTH 344
00505 #define DAYOFWEEK 345
00506 #define DAYOFYEAR 346
00507 #define DAYS_BETWEEN 347
00508 #define DEALLOCATE 348
00509 #define DEC 349
00510 #define DECLARE 350
00511 #define DEFAULT 351
00512 #define DEFERRABLE 352
00513 #define DEFERRED 353
00514 #define SQL_DELETE 354
00515 #define DESC 355
00516 #define DESCRIBE 356
00517 #define DESCRIPTOR 357
00518 #define DIAGNOSTICS 358
00519 #define DICTIONARY 359
00520 #define DIRECTORY 360
00521 #define DISCONNECT 361
00522 #define DISPLACEMENT 362
00523 #define DISTINCT 363
00524 #define DOMAIN_TOKEN 364
00525 #define SQL_DOUBLE 365
00526 #define DOUBLE_QUOTED_STRING 366
00527 #define DROP 367
00528 #define ELSE 368
00529 #define END 369
00530 #define END_EXEC 370
00531 #define EQUAL 371
00532 #define ESCAPE 372
00533 #define EXCEPT 373
00534 #define SQL_EXCEPTION 374
00535 #define EXEC 375
00536 #define EXECUTE 376
00537 #define EXISTS 377
00538 #define EXP 378
00539 #define EXPONENT 379
00540 #define EXTERNAL 380
00541 #define EXTRACT 381
00542 #define SQL_FALSE 382
00543 #define FETCH 383
00544 #define FIRST 384
00545 #define SQL_FLOAT 385
00546 #define FLOOR 386
00547 #define FN 387
00548 #define FOR 388
00549 #define FOREIGN 389
00550 #define FORTRAN 390
00551 #define FOUND 391
00552 #define FOUR_DIGITS 392
00553 #define FROM 393
00554 #define FULL 394
00555 #define GET 395
00556 #define GLOBAL 396
00557 #define GO 397
00558 #define GOTO 398
00559 #define GRANT 399
00560 #define GREATER_OR_EQUAL 400
00561 #define HAVING 401
00562 #define HOUR 402
00563 #define HOURS_BETWEEN 403
00564 #define IDENTITY 404
00565 #define IFNULL 405
00566 #define SQL_IGNORE 406
00567 #define IMMEDIATE 407
00568 #define SQL_IN 408
00569 #define INCLUDE 409
00570 #define INDEX 410
00571 #define INDICATOR 411
00572 #define INITIALLY 412
00573 #define INNER 413
00574 #define INPUT 414
00575 #define INSENSITIVE 415
00576 #define INSERT 416
00577 #define INTEGER 417
00578 #define INTERSECT 418
00579 #define INTERVAL 419
00580 #define INTO 420
00581 #define IS 421
00582 #define ISOLATION 422
00583 #define JOIN 423
00584 #define JUSTIFY 424
00585 #define KEY 425
00586 #define LANGUAGE 426
00587 #define LAST 427
00588 #define LCASE 428
00589 #define LEFT 429
00590 #define LENGTH 430
00591 #define LESS_OR_EQUAL 431
00592 #define LEVEL 432
00593 #define LIKE 433
00594 #define LINE_WIDTH 434
00595 #define LOCAL 435
00596 #define LOCATE 436
00597 #define LOG 437
00598 #define SQL_LONG 438
00599 #define LOWER 439
00600 #define LTRIM 440
00601 #define LTRIP 441
00602 #define MATCH 442
00603 #define SQL_MAX 443
00604 #define MICROSOFT 444
00605 #define SQL_MIN 445
00606 #define MINUS 446
00607 #define MINUTE 447
00608 #define MINUTES_BETWEEN 448
00609 #define MOD 449
00610 #define MODIFY 450
00611 #define MODULE 451
00612 #define MONTH 452
00613 #define MONTHS_BETWEEN 453
00614 #define MUMPS 454
00615 #define NAMES 455
00616 #define NATIONAL 456
00617 #define NCHAR 457
00618 #define NEXT 458
00619 #define NODUP 459
00620 #define NONE 460
00621 #define NOT 461
00622 #define NOT_EQUAL 462
00623 #define NOT_EQUAL2 463
00624 #define NOW 464
00625 #define SQL_NULL 465
00626 #define SQL_IS 466
00627 #define SQL_IS_NULL 467
00628 #define SQL_IS_NOT_NULL 468
00629 #define NULLIF 469
00630 #define NUMERIC 470
00631 #define OCTET_LENGTH 471
00632 #define ODBC 472
00633 #define OF 473
00634 #define SQL_OFF 474
00635 #define SQL_ON 475
00636 #define ONLY 476
00637 #define OPEN 477
00638 #define OPTION 478
00639 #define OR 479
00640 #define ORDER 480
00641 #define OUTER 481
00642 #define OUTPUT 482
00643 #define OVERLAPS 483
00644 #define PAGE 484
00645 #define PARTIAL 485
00646 #define SQL_PASCAL 486
00647 #define PERSISTENT 487
00648 #define CQL_PI 488
00649 #define PLI 489
00650 #define POSITION 490
00651 #define PRECISION 491
00652 #define PREPARE 492
00653 #define PRESERVE 493
00654 #define PRIMARY 494
00655 #define PRIOR 495
00656 #define PRIVILEGES 496
00657 #define PROCEDURE 497
00658 #define PRODUCT 498
00659 #define PUBLIC 499
00660 #define QUARTER 500
00661 #define QUIT 501
00662 #define RAND 502
00663 #define READ_ONLY 503
00664 #define REAL 504
00665 #define REFERENCES 505
00666 #define REPEAT 506
00667 #define REPLACE 507
00668 #define RESTRICT 508
00669 #define REVOKE 509
00670 #define RIGHT 510
00671 #define ROLLBACK 511
00672 #define ROWS 512
00673 #define RPAD 513
00674 #define RTRIM 514
00675 #define SCHEMA 515
00676 #define SCREEN_WIDTH 516
00677 #define SCROLL 517
00678 #define SECOND 518
00679 #define SECONDS_BETWEEN 519
00680 #define SELECT 520
00681 #define SEQUENCE 521
00682 #define SETOPT 522
00683 #define SET 523
00684 #define SHOWOPT 524
00685 #define SIGN 525
00686 #define SIMILAR_TO 526
00687 #define NOT_SIMILAR_TO 527
00688 #define INTEGER_CONST 528
00689 #define REAL_CONST 529
00690 #define DATE_CONST 530
00691 #define DATETIME_CONST 531
00692 #define TIME_CONST 532
00693 #define SIN 533
00694 #define SQL_SIZE 534
00695 #define SMALLINT 535
00696 #define SOME 536
00697 #define SPACE 537
00698 #define SQL 538
00699 #define SQL_TRUE 539
00700 #define SQLCA 540
00701 #define SQLCODE 541
00702 #define SQLERROR 542
00703 #define SQLSTATE 543
00704 #define SQLWARNING 544
00705 #define SQRT 545
00706 #define STDEV 546
00707 #define SUBSTRING 547
00708 #define SUM 548
00709 #define SYSDATE 549
00710 #define SYSDATE_FORMAT 550
00711 #define SYSTEM 551
00712 #define TABLE 552
00713 #define TAN 553
00714 #define TEMPORARY 554
00715 #define THEN 555
00716 #define THREE_DIGITS 556
00717 #define TIME 557
00718 #define TIMESTAMP 558
00719 #define TIMEZONE_HOUR 559
00720 #define TIMEZONE_MINUTE 560
00721 #define TINYINT 561
00722 #define TO 562
00723 #define TO_CHAR 563
00724 #define TO_DATE 564
00725 #define TRANSACTION 565
00726 #define TRANSLATE 566
00727 #define TRANSLATION 567
00728 #define TRUNCATE 568
00729 #define GENERAL_TITLE 569
00730 #define TWO_DIGITS 570
00731 #define UCASE 571
00732 #define UNION 572
00733 #define UNIQUE 573
00734 #define SQL_UNKNOWN 574
00735 #define UPDATE 575
00736 #define UPPER 576
00737 #define USAGE 577
00738 #define USER 578
00739 #define IDENTIFIER 579
00740 #define IDENTIFIER_DOT_ASTERISK 580
00741 #define USING 581
00742 #define VALUE 582
00743 #define VALUES 583
00744 #define VARBINARY 584
00745 #define VARCHAR 585
00746 #define VARYING 586
00747 #define VENDOR 587
00748 #define VIEW 588
00749 #define WEEK 589
00750 #define WHEN 590
00751 #define WHENEVER 591
00752 #define WHERE 592
00753 #define WHERE_CURRENT_OF 593
00754 #define WITH 594
00755 #define WORD_WRAPPED 595
00756 #define WORK 596
00757 #define WRAPPED 597
00758 #define XOR 598
00759 #define YEAR 599
00760 #define YEARS_BETWEEN 600
00761 #define SCAN_ERROR 601
00762 #define __LAST_TOKEN 602
00763 #define ILIKE 603
00764 
00765 
00766 
00767 
00768 /* Copy the first part of user declarations.  */
00769 #line 432 "sqlparser.y"
00770 
00771 #ifndef YYDEBUG /* compat. */
00772 # define YYDEBUG 0
00773 #endif
00774 #include <stdio.h>
00775 #include <string.h>
00776 #include <string>
00777 #include <iostream>
00778 #include <assert.h>
00779 #include <limits.h>
00780 //TODO OK?
00781 #ifdef Q_WS_WIN
00782 //workaround for bug on msvc
00783 # undef LLONG_MIN
00784 #endif
00785 #ifndef LLONG_MAX
00786 # define LLONG_MAX     0x7fffffffffffffffLL
00787 #endif
00788 #ifndef LLONG_MIN
00789 # define LLONG_MIN     0x8000000000000000LL
00790 #endif
00791 #ifndef LLONG_MAX
00792 # define ULLONG_MAX    0xffffffffffffffffLL
00793 #endif
00794 
00795 #ifdef _WIN32
00796 # include <malloc.h>
00797 #endif
00798 
00799 #include <qobject.h>
00800 #include <kdebug.h>
00801 #include <klocale.h>
00802 #include <qptrlist.h>
00803 #include <qcstring.h>
00804 
00805 #include <connection.h>
00806 #include <queryschema.h>
00807 #include <field.h>
00808 #include <tableschema.h>
00809 
00810 #include "parser.h"
00811 #include "parser_p.h"
00812 #include "sqltypes.h"
00813 
00814 int yylex();
00815 
00816 //  using namespace std;
00817 using namespace KexiDB;
00818 
00819 #define YY_NO_UNPUT
00820 #define YYSTACK_USE_ALLOCA 1
00821 #define YYMAXDEPTH 255
00822 
00823     extern "C"
00824     {
00825         int yywrap()
00826         {
00827             return 1;
00828         }
00829     }
00830 
00831 #if 0
00832     struct yyval
00833     {
00834         QString parserUserName;
00835         int integerValue;
00836         KexiDBField::ColumnType coltype;
00837     }
00838 #endif
00839 
00840 
00841 /* Enabling traces.  */
00842 #ifndef YYDEBUG
00843 # define YYDEBUG 0
00844 #endif
00845 
00846 /* Enabling verbose error messages.  */
00847 #ifdef YYERROR_VERBOSE
00848 # undef YYERROR_VERBOSE
00849 # define YYERROR_VERBOSE 1
00850 #else
00851 # define YYERROR_VERBOSE 0
00852 #endif
00853 
00854 /* Enabling the token table.  */
00855 #ifndef YYTOKEN_TABLE
00856 # define YYTOKEN_TABLE 0
00857 #endif
00858 
00859 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00860 typedef union YYSTYPE
00861 #line 503 "sqlparser.y"
00862 {
00863     char stringValue[255];
00864     Q_LLONG integerValue;
00865     struct realType realValue;
00866     KexiDB::Field::Type colType;
00867     KexiDB::Field *field;
00868     KexiDB::BaseExpr *expr;
00869     KexiDB::NArgExpr *exprList;
00870     KexiDB::ConstExpr *constExpr;
00871     KexiDB::QuerySchema *querySchema;
00872 }
00873 /* Line 193 of yacc.c.  */
00874 #line 875 "sqlparser.tab.c"
00875     YYSTYPE;
00876 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00877 # define YYSTYPE_IS_DECLARED 1
00878 # define YYSTYPE_IS_TRIVIAL 1
00879 #endif
00880 
00881 
00882 
00883 /* Copy the second part of user declarations.  */
00884 
00885 
00886 /* Line 216 of yacc.c.  */
00887 #line 888 "sqlparser.tab.c"
00888 
00889 #ifdef short
00890 # undef short
00891 #endif
00892 
00893 #ifdef YYTYPE_UINT8
00894 typedef YYTYPE_UINT8 yytype_uint8;
00895 #else
00896 typedef unsigned char yytype_uint8;
00897 #endif
00898 
00899 #ifdef YYTYPE_INT8
00900 typedef YYTYPE_INT8 yytype_int8;
00901 #elif (defined __STDC__ || defined __C99__FUNC__ \
00902      || defined __cplusplus || defined _MSC_VER)
00903 typedef signed char yytype_int8;
00904 #else
00905 typedef short int yytype_int8;
00906 #endif
00907 
00908 #ifdef YYTYPE_UINT16
00909 typedef YYTYPE_UINT16 yytype_uint16;
00910 #else
00911 typedef unsigned short int yytype_uint16;
00912 #endif
00913 
00914 #ifdef YYTYPE_INT16
00915 typedef YYTYPE_INT16 yytype_int16;
00916 #else
00917 typedef short int yytype_int16;
00918 #endif
00919 
00920 #ifndef YYSIZE_T
00921 # ifdef __SIZE_TYPE__
00922 #  define YYSIZE_T __SIZE_TYPE__
00923 # elif defined size_t
00924 #  define YYSIZE_T size_t
00925 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00926      || defined __cplusplus || defined _MSC_VER)
00927 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00928 #  define YYSIZE_T size_t
00929 # else
00930 #  define YYSIZE_T unsigned int
00931 # endif
00932 #endif
00933 
00934 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00935 
00936 #ifndef YY_
00937 # if YYENABLE_NLS
00938 #  if ENABLE_NLS
00939 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00940 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00941 #  endif
00942 # endif
00943 # ifndef YY_
00944 #  define YY_(msgid) msgid
00945 # endif
00946 #endif
00947 
00948 /* Suppress unused-variable warnings by "using" E.  */
00949 #if ! defined lint || defined __GNUC__
00950 # define YYUSE(e) ((void) (e))
00951 #else
00952 # define YYUSE(e) /* empty */
00953 #endif
00954 
00955 /* Identity function, used to suppress warnings about constant conditions.  */
00956 #ifndef lint
00957 # define YYID(n) (n)
00958 #else
00959 #if (defined __STDC__ || defined __C99__FUNC__ \
00960      || defined __cplusplus || defined _MSC_VER)
00961 static int
00962 YYID (int i)
00963 #else
00964 static int
00965 YYID (i)
00966     int i;
00967 #endif
00968 {
00969   return i;
00970 }
00971 #endif
00972 
00973 #if ! defined yyoverflow || YYERROR_VERBOSE
00974 
00975 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00976 
00977 # ifdef YYSTACK_USE_ALLOCA
00978 #  if YYSTACK_USE_ALLOCA
00979 #   ifdef __GNUC__
00980 #    define YYSTACK_ALLOC __builtin_alloca
00981 #   elif defined __BUILTIN_VA_ARG_INCR
00982 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00983 #   elif defined _AIX
00984 #    define YYSTACK_ALLOC __alloca
00985 #   elif defined _MSC_VER
00986 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00987 #    define alloca _alloca
00988 #   else
00989 #    define YYSTACK_ALLOC alloca
00990 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00991      || defined __cplusplus || defined _MSC_VER)
00992 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00993 #     ifndef _STDLIB_H
00994 #      define _STDLIB_H 1
00995 #     endif
00996 #    endif
00997 #   endif
00998 #  endif
00999 # endif
01000 
01001 # ifdef YYSTACK_ALLOC
01002    /* Pacify GCC's `empty if-body' warning.  */
01003 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
01004 #  ifndef YYSTACK_ALLOC_MAXIMUM
01005     /* The OS might guarantee only one guard page at the bottom of the stack,
01006        and a page size can be as small as 4096 bytes.  So we cannot safely
01007        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
01008        to allow for a few compiler-allocated temporary stack slots.  */
01009 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
01010 #  endif
01011 # else
01012 #  define YYSTACK_ALLOC YYMALLOC
01013 #  define YYSTACK_FREE YYFREE
01014 #  ifndef YYSTACK_ALLOC_MAXIMUM
01015 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
01016 #  endif
01017 #  if (defined __cplusplus && ! defined _STDLIB_H \
01018        && ! ((defined YYMALLOC || defined malloc) \
01019          && (defined YYFREE || defined free)))
01020 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
01021 #   ifndef _STDLIB_H
01022 #    define _STDLIB_H 1
01023 #   endif
01024 #  endif
01025 #  ifndef YYMALLOC
01026 #   define YYMALLOC malloc
01027 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
01028      || defined __cplusplus || defined _MSC_VER)
01029 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
01030 #   endif
01031 #  endif
01032 #  ifndef YYFREE
01033 #   define YYFREE free
01034 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
01035      || defined __cplusplus || defined _MSC_VER)
01036 void free (void *); /* INFRINGES ON USER NAME SPACE */
01037 #   endif
01038 #  endif
01039 # endif
01040 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
01041 
01042 
01043 #if (! defined yyoverflow \
01044      && (! defined __cplusplus \
01045      || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
01046 
01047 /* A type that is properly aligned for any stack member.  */
01048 union yyalloc
01049 {
01050   yytype_int16 yyss;
01051   YYSTYPE yyvs;
01052   };
01053 
01054 /* The size of the maximum gap between one aligned stack and the next.  */
01055 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
01056 
01057 /* The size of an array large to enough to hold all stacks, each with
01058    N elements.  */
01059 # define YYSTACK_BYTES(N) \
01060      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
01061       + YYSTACK_GAP_MAXIMUM)
01062 
01063 /* Copy COUNT objects from FROM to TO.  The source and destination do
01064    not overlap.  */
01065 # ifndef YYCOPY
01066 #  if defined __GNUC__ && 1 < __GNUC__
01067 #   define YYCOPY(To, From, Count) \
01068       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
01069 #  else
01070 #   define YYCOPY(To, From, Count)      \
01071       do                    \
01072     {                   \
01073       YYSIZE_T yyi;             \
01074       for (yyi = 0; yyi < (Count); yyi++)   \
01075         (To)[yyi] = (From)[yyi];        \
01076     }                   \
01077       while (YYID (0))
01078 #  endif
01079 # endif
01080 
01081 /* Relocate STACK from its old location to the new one.  The
01082    local variables YYSIZE and YYSTACKSIZE give the old and new number of
01083    elements in the stack, and YYPTR gives the new location of the
01084    stack.  Advance YYPTR to a properly aligned location for the next
01085    stack.  */
01086 # define YYSTACK_RELOCATE(Stack)                    \
01087     do                                  \
01088       {                                 \
01089     YYSIZE_T yynewbytes;                        \
01090     YYCOPY (&yyptr->Stack, Stack, yysize);              \
01091     Stack = &yyptr->Stack;                      \
01092     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
01093     yyptr += yynewbytes / sizeof (*yyptr);              \
01094       }                                 \
01095     while (YYID (0))
01096 
01097 #endif
01098 
01099 /* YYFINAL -- State number of the termination state.  */
01100 #define YYFINAL  10
01101 /* YYLAST -- Last index in YYTABLE.  */
01102 #define YYLAST   333
01103 
01104 /* YYNTOKENS -- Number of terminals.  */
01105 #define YYNTOKENS  372
01106 /* YYNNTS -- Number of nonterminals.  */
01107 #define YYNNTS  33
01108 /* YYNRULES -- Number of rules.  */
01109 #define YYNRULES  95
01110 /* YYNRULES -- Number of states.  */
01111 #define YYNSTATES  156
01112 
01113 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
01114 #define YYUNDEFTOK  2
01115 #define YYMAXUTOK   603
01116 
01117 #define YYTRANSLATE(YYX)                        \
01118   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
01119 
01120 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
01121 static const yytype_uint16 yytranslate[] =
01122 {
01123        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01124        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01125        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01126        2,     2,     2,     2,     2,     2,   356,   351,   369,   360,
01127      357,   358,   350,   349,   354,   348,   355,   361,     2,     2,
01128        2,     2,     2,     2,     2,     2,     2,     2,     2,   353,
01129      363,   362,   364,   359,   352,     2,     2,     2,     2,     2,
01130        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01131        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01132        2,   367,     2,   368,   366,     2,     2,     2,     2,     2,
01133        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01134        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01135        2,     2,     2,     2,   370,     2,   371,     2,     2,     2,
01136        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01137        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01138        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01139        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01140        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01141        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01142        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01143        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01144        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01145        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01146        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01147        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01148        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
01149        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
01150       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
01151       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
01152       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
01153       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
01154       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
01155       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
01156       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
01157       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
01158       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
01159      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
01160      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
01161      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
01162      135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
01163      145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
01164      155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
01165      165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
01166      175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
01167      185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
01168      195,   196,   197,   198,   199,   200,   201,   202,   203,   204,
01169      205,   206,   207,   208,   209,   210,   211,   212,   213,   214,
01170      215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
01171      225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
01172      235,   236,   237,   238,   239,   240,   241,   242,   243,   244,
01173      245,   246,   247,   248,   249,   250,   251,   252,   253,   254,
01174      255,   256,   257,   258,   259,   260,   261,   262,   263,   264,
01175      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
01176      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
01177      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
01178      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
01179      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
01180      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
01181      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
01182      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
01183      345,   346,   347,   365
01184 };
01185 
01186 #if YYDEBUG
01187 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
01188    YYRHS.  */
01189 static const yytype_uint16 yyprhs[] =
01190 {
01191        0,     0,     3,     5,     9,    11,    14,    16,    18,    19,
01192       27,    31,    33,    36,    40,    43,    45,    48,    51,    53,
01193       55,    60,    65,    66,    69,    73,    76,    80,    85,    89,
01194       91,    94,    96,   100,   104,   108,   110,   114,   118,   122,
01195      126,   130,   132,   136,   140,   144,   148,   152,   156,   158,
01196      161,   164,   166,   170,   174,   176,   180,   184,   188,   192,
01197      194,   198,   202,   206,   208,   211,   214,   217,   220,   222,
01198      225,   229,   231,   233,   235,   237,   239,   243,   247,   251,
01199      255,   258,   262,   264,   266,   269,   273,   277,   279,   281,
01200      283,   287,   290,   292,   297,   299
01201 };
01202 
01203 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
01204 static const yytype_int16 yyrhs[] =
01205 {
01206      373,     0,    -1,   374,    -1,   375,   353,   374,    -1,   375,
01207       -1,   375,   353,    -1,   376,    -1,   383,    -1,    -1,    75,
01208      297,   324,   377,   357,   378,   358,    -1,   378,   354,   379,
01209       -1,   379,    -1,   324,   382,    -1,   324,   382,   380,    -1,
01210      380,   381,    -1,   381,    -1,   239,   170,    -1,   206,   210,
01211       -1,    31,    -1,     4,    -1,     4,   357,   273,   358,    -1,
01212      330,   357,   273,   358,    -1,    -1,   384,   401,    -1,   384,
01213      401,   398,    -1,   384,   398,    -1,   384,   401,   385,    -1,
01214      384,   401,   398,   385,    -1,   384,   398,   385,    -1,   265,
01215       -1,   337,   386,    -1,   387,    -1,   388,    20,   387,    -1,
01216      388,   224,   387,    -1,   388,   343,   387,    -1,   388,    -1,
01217      389,   364,   388,    -1,   389,   145,   388,    -1,   389,   363,
01218      388,    -1,   389,   176,   388,    -1,   389,   362,   388,    -1,
01219      389,    -1,   390,   207,   389,    -1,   390,   208,   389,    -1,
01220      390,   178,   389,    -1,   390,   153,   389,    -1,   390,   271,
01221      389,    -1,   390,   272,   389,    -1,   390,    -1,   390,   212,
01222       -1,   390,   213,    -1,   391,    -1,   392,    40,   391,    -1,
01223      392,    41,   391,    -1,   392,    -1,   393,   349,   392,    -1,
01224      393,   348,   392,    -1,   393,   369,   392,    -1,   393,   370,
01225      392,    -1,   393,    -1,   394,   361,   393,    -1,   394,   350,
01226      393,    -1,   394,   351,   393,    -1,   394,    -1,   348,   394,
01227       -1,   349,   394,    -1,   371,   394,    -1,   206,   394,    -1,
01228      324,    -1,   324,   396,    -1,   324,   355,   324,    -1,   210,
01229       -1,    53,    -1,   273,    -1,   274,    -1,   395,    -1,   357,
01230      386,   358,    -1,   357,   397,   358,    -1,   386,   354,   397,
01231       -1,   386,   354,   386,    -1,   138,   399,    -1,   399,   354,
01232      400,    -1,   400,    -1,   324,    -1,   324,   324,    -1,   324,
01233       23,   324,    -1,   401,   354,   402,    -1,   402,    -1,   403,
01234       -1,   404,    -1,   403,    23,   324,    -1,   403,   324,    -1,
01235      386,    -1,   108,   357,   403,   358,    -1,   350,    -1,   324,
01236      355,   350,    -1
01237 };
01238 
01239 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
01240 static const yytype_uint16 yyrline[] =
01241 {
01242        0,   568,   568,   578,   582,   583,   593,   597,   605,   604,
01243      613,   613,   619,   628,   643,   643,   649,   654,   659,   667,
01244      672,   679,   686,   694,   701,   706,   712,   718,   724,   733,
01245      743,   750,   755,   760,   764,   769,   774,   778,   782,   786,
01246      790,   795,   800,   805,   809,   813,   817,   821,   826,   831,
01247      835,   840,   845,   849,   854,   859,   864,   868,   872,   877,
01248      882,   886,   890,   895,   901,   905,   909,   913,   917,   930,
01249      936,   947,   954,   960,   977,   983,   988,   996,  1006,  1011,
01250     1020,  1061,  1066,  1074,  1109,  1118,  1132,  1138,  1147,  1156,
01251     1161,  1173,  1188,  1232,  1241,  1250
01252 };
01253 #endif
01254 
01255 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
01256 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
01257    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
01258 static const char *const yytname[] =
01259 {
01260   "$end", "error", "$undefined", "UMINUS", "SQL_TYPE", "SQL_ABS", "ACOS",
01261   "AMPERSAND", "SQL_ABSOLUTE", "ADA", "ADD", "ADD_DAYS", "ADD_HOURS",
01262   "ADD_MINUTES", "ADD_MONTHS", "ADD_SECONDS", "ADD_YEARS", "ALL",
01263   "ALLOCATE", "ALTER", "AND", "ANY", "ARE", "AS", "ASIN", "ASC", "ASCII",
01264   "ASSERTION", "ATAN", "ATAN2", "AUTHORIZATION", "AUTO_INCREMENT", "AVG",
01265   "BEFORE", "SQL_BEGIN", "BETWEEN", "BIGINT", "BINARY", "BIT",
01266   "BIT_LENGTH", "BITWISE_SHIFT_LEFT", "BITWISE_SHIFT_RIGHT", "BREAK", "BY",
01267   "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CEILING", "CENTER",
01268   "SQL_CHAR", "CHAR_LENGTH", "CHARACTER_STRING_LITERAL", "CHECK", "CLOSE",
01269   "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLUMN", "COMMIT",
01270   "COMPUTE", "CONCAT", "CONCATENATION", "CONNECT", "CONNECTION",
01271   "CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", "CORRESPONDING",
01272   "COS", "COT", "COUNT", "CREATE", "CURDATE", "CURRENT", "CURRENT_DATE",
01273   "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURTIME", "CURSOR", "DATABASE",
01274   "SQL_DATE", "DATE_FORMAT", "DATE_REMAINDER", "DATE_VALUE", "DAY",
01275   "DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DAYS_BETWEEN", "DEALLOCATE",
01276   "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
01277   "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
01278   "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
01279   "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
01280   "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
01281   "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
01282   "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
01283   "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
01284   "GRANT", "GREATER_OR_EQUAL", "HAVING", "HOUR", "HOURS_BETWEEN",
01285   "IDENTITY", "IFNULL", "SQL_IGNORE", "IMMEDIATE", "SQL_IN", "INCLUDE",
01286   "INDEX", "INDICATOR", "INITIALLY", "INNER", "INPUT", "INSENSITIVE",
01287   "INSERT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ISOLATION",
01288   "JOIN", "JUSTIFY", "KEY", "LANGUAGE", "LAST", "LCASE", "LEFT", "LENGTH",
01289   "LESS_OR_EQUAL", "LEVEL", "LIKE", "LINE_WIDTH", "LOCAL", "LOCATE", "LOG",
01290   "SQL_LONG", "LOWER", "LTRIM", "LTRIP", "MATCH", "SQL_MAX", "MICROSOFT",
01291   "SQL_MIN", "MINUS", "MINUTE", "MINUTES_BETWEEN", "MOD", "MODIFY",
01292   "MODULE", "MONTH", "MONTHS_BETWEEN", "MUMPS", "NAMES", "NATIONAL",
01293   "NCHAR", "NEXT", "NODUP", "NONE", "NOT", "NOT_EQUAL", "NOT_EQUAL2",
01294   "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
01295   "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
01296   "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
01297   "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
01298   "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
01299   "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
01300   "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
01301   "ROLLBACK", "ROWS", "RPAD", "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL",
01302   "SECOND", "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET",
01303   "SHOWOPT", "SIGN", "SIMILAR_TO", "NOT_SIMILAR_TO", "INTEGER_CONST",
01304   "REAL_CONST", "DATE_CONST", "DATETIME_CONST", "TIME_CONST", "SIN",
01305   "SQL_SIZE", "SMALLINT", "SOME", "SPACE", "SQL", "SQL_TRUE", "SQLCA",
01306   "SQLCODE", "SQLERROR", "SQLSTATE", "SQLWARNING", "SQRT", "STDEV",
01307   "SUBSTRING", "SUM", "SYSDATE", "SYSDATE_FORMAT", "SYSTEM", "TABLE",
01308   "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
01309   "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
01310   "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
01311   "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
01312   "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
01313   "IDENTIFIER_DOT_ASTERISK", "USING", "VALUE", "VALUES", "VARBINARY",
01314   "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN", "WHENEVER",
01315   "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", "WORK", "WRAPPED",
01316   "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", "__LAST_TOKEN", "'-'",
01317   "'+'", "'*'", "'%'", "'@'", "';'", "','", "'.'", "'$'", "'('", "')'",
01318   "'?'", "'''", "'/'", "'='", "'<'", "'>'", "ILIKE", "'^'", "'['", "']'",
01319   "'&'", "'|'", "'~'", "$accept", "TopLevelStatement", "StatementList",
01320   "Statement", "CreateTableStatement", "@1", "ColDefs", "ColDef",
01321   "ColKeys", "ColKey", "ColType", "SelectStatement", "Select",
01322   "WhereClause", "aExpr", "aExpr2", "aExpr3", "aExpr4", "aExpr5", "aExpr6",
01323   "aExpr7", "aExpr8", "aExpr9", "aExpr10", "aExprList", "aExprList2",
01324   "Tables", "FlatTableList", "FlatTable", "ColViews", "ColItem",
01325   "ColExpression", "ColWildCard", 0
01326 };
01327 #endif
01328 
01329 # ifdef YYPRINT
01330 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
01331    token YYLEX-NUM.  */
01332 static const yytype_uint16 yytoknum[] =
01333 {
01334        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
01335      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
01336      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
01337      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
01338      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
01339      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
01340      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
01341      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
01342      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
01343      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
01344      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
01345      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
01346      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
01347      385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
01348      395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
01349      405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
01350      415,   416,   417,   418,   419,   420,   421,   422,   423,   424,
01351      425,   426,   427,   428,   429,   430,   431,   432,   433,   434,
01352      435,   436,   437,   438,   439,   440,   441,   442,   443,   444,
01353      445,   446,   447,   448,   449,   450,   451,   452,   453,   454,
01354      455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
01355      465,   466,   467,   468,   469,   470,   471,   472,   473,   474,
01356      475,   476,   477,   478,   479,   480,   481,   482,   483,   484,
01357      485,   486,   487,   488,   489,   490,   491,   492,   493,   494,
01358      495,   496,   497,   498,   499,   500,   501,   502,   503,   504,
01359      505,   506,   507,   508,   509,   510,   511,   512,   513,   514,
01360      515,   516,   517,   518,   519,   520,   521,   522,   523,   524,
01361      525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
01362      535,   536,   537,   538,   539,   540,   541,   542,   543,   544,
01363      545,   546,   547,   548,   549,   550,   551,   552,   553,   554,
01364      555,   556,   557,   558,   559,   560,   561,   562,   563,   564,
01365      565,   566,   567,   568,   569,   570,   571,   572,   573,   574,
01366      575,   576,   577,   578,   579,   580,   581,   582,   583,   584,
01367      585,   586,   587,   588,   589,   590,   591,   592,   593,   594,
01368      595,   596,   597,   598,   599,   600,   601,   602,    45,    43,
01369       42,    37,    64,    59,    44,    46,    36,    40,    41,    63,
01370       39,    47,    61,    60,    62,   603,    94,    91,    93,    38,
01371      124,   126
01372 };
01373 # endif
01374 
01375 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
01376 static const yytype_uint16 yyr1[] =
01377 {
01378        0,   372,   373,   374,   374,   374,   375,   375,   377,   376,
01379      378,   378,   379,   379,   380,   380,   381,   381,   381,   382,
01380      382,   382,   382,   383,   383,   383,   383,   383,   383,   384,
01381      385,   386,   387,   387,   387,   387,   388,   388,   388,   388,
01382      388,   388,   389,   389,   389,   389,   389,   389,   389,   390,
01383      390,   390,   391,   391,   391,   392,   392,   392,   392,   392,
01384      393,   393,   393,   393,   394,   394,   394,   394,   394,   394,
01385      394,   394,   394,   394,   394,   394,   395,   396,   397,   397,
01386      398,   399,   399,   400,   400,   400,   401,   401,   402,   402,
01387      402,   402,   403,   403,   404,   404
01388 };
01389 
01390 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
01391 static const yytype_uint8 yyr2[] =
01392 {
01393        0,     2,     1,     3,     1,     2,     1,     1,     0,     7,
01394        3,     1,     2,     3,     2,     1,     2,     2,     1,     1,
01395        4,     4,     0,     2,     3,     2,     3,     4,     3,     1,
01396        2,     1,     3,     3,     3,     1,     3,     3,     3,     3,
01397        3,     1,     3,     3,     3,     3,     3,     3,     1,     2,
01398        2,     1,     3,     3,     1,     3,     3,     3,     3,     1,
01399        3,     3,     3,     1,     2,     2,     2,     2,     1,     2,
01400        3,     1,     1,     1,     1,     1,     3,     3,     3,     3,
01401        2,     3,     1,     1,     2,     3,     3,     1,     1,     1,
01402        3,     2,     1,     4,     1,     3
01403 };
01404 
01405 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
01406    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
01407    means the default is an error.  */
01408 static const yytype_uint8 yydefact[] =
01409 {
01410        0,     0,    29,     0,     2,     4,     6,     7,     0,     0,
01411        1,     5,    72,     0,     0,     0,    71,    73,    74,    68,
01412        0,     0,    94,     0,     0,    92,    31,    35,    41,    48,
01413       51,    54,    59,    63,    75,    25,    23,    87,    88,    89,
01414        8,     3,     0,    83,    80,    82,    68,    67,     0,     0,
01415       69,    64,    65,     0,    66,     0,     0,     0,     0,     0,
01416        0,     0,     0,     0,     0,     0,     0,    49,    50,     0,
01417        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01418        0,    28,     0,    26,    24,     0,    91,     0,     0,     0,
01419       84,     0,     0,    70,    95,     0,     0,    76,    32,    33,
01420       34,    37,    39,    40,    38,    36,    45,    44,    42,    43,
01421       46,    47,    52,    53,    56,    55,    57,    58,    61,    62,
01422       60,    30,    86,    27,    90,     0,    93,    85,    81,     0,
01423       77,    22,     0,    11,    79,    78,    19,     0,    12,     0,
01424        9,     0,     0,    18,     0,     0,    13,    15,    10,     0,
01425        0,    17,    16,    14,    20,    21
01426 };
01427 
01428 /* YYDEFGOTO[NTERM-NUM].  */
01429 static const yytype_int16 yydefgoto[] =
01430 {
01431       -1,     3,     4,     5,     6,    87,   132,   133,   146,   147,
01432      138,     7,     8,    81,    25,    26,    27,    28,    29,    30,
01433       31,    32,    33,    34,    50,    96,    35,    44,    45,    36,
01434       37,    38,    39
01435 };
01436 
01437 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
01438    STATE-NUM.  */
01439 #define YYPACT_NINF -334
01440 static const yytype_int16 yypact[] =
01441 {
01442      -68,  -275,  -334,    29,  -334,  -307,  -334,  -334,   -51,  -277,
01443     -334,   -68,  -334,  -302,  -266,   -38,  -334,  -334,  -334,  -329,
01444      -38,   -38,  -334,   -38,   -38,  -334,  -334,   -19,  -135,  -144,
01445     -334,    -5,  -332,  -331,  -334,  -262,  -134,  -334,   -20,  -334,
01446     -334,  -334,   -41,   -12,  -292,  -334,  -296,  -334,  -310,   -38,
01447     -334,  -334,  -334,  -279,  -334,   -38,   -38,   -38,   -38,   -38,
01448      -38,   -38,   -38,   -38,   -38,   -38,   -38,  -334,  -334,   -38,
01449      -38,   -38,   -38,   -38,   -38,   -38,   -38,   -38,   -38,   -38,
01450      -38,  -334,   -48,  -334,  -262,  -244,  -334,  -276,  -274,  -242,
01451     -334,  -266,  -241,  -334,  -334,  -269,  -272,  -334,  -334,  -334,
01452     -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,
01453     -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,  -334,
01454     -334,  -334,  -334,  -334,  -334,  -236,  -334,  -334,  -334,   -38,
01455     -334,    -4,  -333,  -334,  -269,  -334,  -268,  -267,   -25,  -236,
01456     -334,  -182,  -181,  -334,  -117,   -76,   -25,  -334,  -334,  -263,
01457     -261,  -334,  -334,  -334,  -334,  -334
01458 };
01459 
01460 /* YYPGOTO[NTERM-NUM].  */
01461 static const yytype_int16 yypgoto[] =
01462 {
01463     -334,  -334,    85,  -334,  -334,  -334,  -334,   -40,  -334,   -46,
01464     -334,  -334,  -334,   -28,   -10,   -24,    -8,   -21,  -334,    -6,
01465       -2,    -1,     3,  -334,  -334,   -31,    65,  -334,    11,  -334,
01466       21,    62,  -334
01467 };
01468 
01469 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
01470    positive, shift that token.  If negative, reduce the rule which
01471    number is the opposite.  If zero, do what YYDEFACT says.
01472    If YYTABLE_NINF, syntax error.  */
01473 #define YYTABLE_NINF -1
01474 static const yytype_uint8 yytable[] =
01475 {
01476      136,    55,    12,    85,    14,    12,   143,     1,    83,    63,
01477       58,    89,    12,    53,    93,    12,    73,    74,    47,    77,
01478       78,   139,     9,    51,    52,   140,    48,    54,    49,    10,
01479       79,    98,    99,   100,    64,    71,    72,    75,    76,    95,
01480       94,    59,   106,   107,   108,   109,    11,    40,   110,   111,
01481      101,   102,   103,   104,   105,    42,   123,    13,    43,    92,
01482       13,    49,    91,    65,    66,   112,   113,    13,    67,    68,
01483      121,   114,   115,   116,   117,    80,   118,   119,   120,    97,
01484      124,   125,   127,    93,   126,   129,   130,    14,   131,   141,
01485      142,   149,   150,   151,   152,   154,    41,   155,   135,   148,
01486      153,    84,   128,   122,    88,     0,     0,     0,     0,     0,
01487        0,     0,     0,     0,     0,     0,     0,     0,     0,   134,
01488        0,     0,     0,     0,     0,     0,     0,    69,    70,     0,
01489        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01490        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01491        0,     0,     0,     0,     0,    15,     0,     0,    15,    16,
01492        0,     0,    16,     0,     0,    15,     0,     0,    15,    16,
01493        0,     0,    16,     0,     0,     0,     0,     0,     0,     0,
01494        0,   144,     0,     0,     0,     0,     0,     0,     0,     0,
01495        0,     0,     0,     0,     0,     0,     0,     2,     0,     0,
01496        0,     0,     0,    80,     0,    56,     0,     0,     0,     0,
01497        0,     0,     0,     0,   145,     0,     0,     0,     0,     0,
01498       82,     0,    17,    18,     0,    17,    18,    60,    61,    62,
01499        0,     0,    17,    18,     0,    17,    18,     0,     0,     0,
01500        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01501        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01502        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01503        0,     0,     0,    19,     0,     0,    19,     0,     0,     0,
01504        0,     0,     0,    46,     0,     0,    46,     0,     0,     0,
01505        0,     0,     0,     0,     0,     0,     0,    20,    21,    22,
01506       20,    21,    22,     0,    86,     0,    23,    20,    21,    23,
01507       20,    21,    90,     0,     0,     0,    23,     0,     0,    23,
01508       24,     0,     0,    24,    57,     0,   137,     0,     0,     0,
01509       24,     0,     0,    24
01510 };
01511 
01512 static const yytype_int16 yycheck[] =
01513 {
01514        4,    20,    53,    23,   138,    53,    31,    75,    36,   153,
01515      145,    23,    53,    23,   324,    53,   348,   349,    15,   350,
01516      351,   354,   297,    20,    21,   358,   355,    24,   357,     0,
01517      361,    55,    56,    57,   178,    40,    41,   369,   370,    49,
01518      350,   176,    63,    64,    65,    66,   353,   324,    69,    70,
01519       58,    59,    60,    61,    62,   357,    84,   108,   324,   355,
01520      108,   357,   354,   207,   208,    71,    72,   108,   212,   213,
01521       80,    73,    74,    75,    76,   337,    77,    78,    79,   358,
01522      324,   357,   324,   324,   358,   354,   358,   138,   324,   357,
01523      357,   273,   273,   210,   170,   358,    11,   358,   129,   139,
01524      146,    36,    91,    82,    42,    -1,    -1,    -1,    -1,    -1,
01525       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   129,
01526       -1,    -1,    -1,    -1,    -1,    -1,    -1,   271,   272,    -1,
01527       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01528       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01529       -1,    -1,    -1,    -1,    -1,   206,    -1,    -1,   206,   210,
01530       -1,    -1,   210,    -1,    -1,   206,    -1,    -1,   206,   210,
01531       -1,    -1,   210,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01532       -1,   206,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01533       -1,    -1,    -1,    -1,    -1,    -1,    -1,   265,    -1,    -1,
01534       -1,    -1,    -1,   337,    -1,   224,    -1,    -1,    -1,    -1,
01535       -1,    -1,    -1,    -1,   239,    -1,    -1,    -1,    -1,    -1,
01536      354,    -1,   273,   274,    -1,   273,   274,   362,   363,   364,
01537       -1,    -1,   273,   274,    -1,   273,   274,    -1,    -1,    -1,
01538       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01539       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01540       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
01541       -1,    -1,    -1,   324,    -1,    -1,   324,    -1,    -1,    -1,
01542       -1,    -1,    -1,   324,    -1,    -1,   324,    -1,    -1,    -1,
01543       -1,    -1,    -1,    -1,    -1,    -1,    -1,   348,   349,   350,
01544      348,   349,   350,    -1,   324,    -1,   357,   348,   349,   357,
01545      348,   349,   324,    -1,    -1,    -1,   357,    -1,    -1,   357,
01546      371,    -1,    -1,   371,   343,    -1,   330,    -1,    -1,    -1,
01547      371,    -1,    -1,   371
01548 };
01549 
01550 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
01551    symbol of state STATE-NUM.  */
01552 static const yytype_uint16 yystos[] =
01553 {
01554        0,    75,   265,   373,   374,   375,   376,   383,   384,   297,
01555        0,   353,    53,   108,   138,   206,   210,   273,   274,   324,
01556      348,   349,   350,   357,   371,   386,   387,   388,   389,   390,
01557      391,   392,   393,   394,   395,   398,   401,   402,   403,   404,
01558      324,   374,   357,   324,   399,   400,   324,   394,   355,   357,
01559      396,   394,   394,   386,   394,    20,   224,   343,   145,   176,
01560      362,   363,   364,   153,   178,   207,   208,   212,   213,   271,
01561      272,    40,    41,   348,   349,   369,   370,   350,   351,   361,
01562      337,   385,   354,   385,   398,    23,   324,   377,   403,    23,
01563      324,   354,   355,   324,   350,   386,   397,   358,   387,   387,
01564      387,   388,   388,   388,   388,   388,   389,   389,   389,   389,
01565      389,   389,   391,   391,   392,   392,   392,   392,   393,   393,
01566      393,   386,   402,   385,   324,   357,   358,   324,   400,   354,
01567      358,   324,   378,   379,   386,   397,     4,   330,   382,   354,
01568      358,   357,   357,    31,   206,   239,   380,   381,   379,   273,
01569      273,   210,   170,   381,   358,   358
01570 };
01571 
01572 #define yyerrok     (yyerrstatus = 0)
01573 #define yyclearin   (yychar = YYEMPTY)
01574 #define YYEMPTY     (-2)
01575 #define YYEOF       0
01576 
01577 #define YYACCEPT    goto yyacceptlab
01578 #define YYABORT     goto yyabortlab
01579 #define YYERROR     goto yyerrorlab
01580 
01581 
01582 /* Like YYERROR except do call yyerror.  This remains here temporarily
01583    to ease the transition to the new meaning of YYERROR, for GCC.
01584    Once GCC version 2 has supplanted version 1, this can go.  */
01585 
01586 #define YYFAIL      goto yyerrlab
01587 
01588 #define YYRECOVERING()  (!!yyerrstatus)
01589 
01590 #define YYBACKUP(Token, Value)                  \
01591 do                              \
01592   if (yychar == YYEMPTY && yylen == 1)              \
01593     {                               \
01594       yychar = (Token);                     \
01595       yylval = (Value);                     \
01596       yytoken = YYTRANSLATE (yychar);               \
01597       YYPOPSTACK (1);                       \
01598       goto yybackup;                        \
01599     }                               \
01600   else                              \
01601     {                               \
01602       yyerror (YY_("syntax error: cannot back up")); \
01603       YYERROR;                          \
01604     }                               \
01605 while (YYID (0))
01606 
01607 
01608 #define YYTERROR    1
01609 #define YYERRCODE   256
01610 
01611 
01612 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
01613    If N is 0, then set CURRENT to the empty location which ends
01614    the previous symbol: RHS[0] (always defined).  */
01615 
01616 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
01617 #ifndef YYLLOC_DEFAULT
01618 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
01619     do                                  \
01620       if (YYID (N))                                                    \
01621     {                               \
01622       (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;    \
01623       (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
01624       (Current).last_line    = YYRHSLOC (Rhs, N).last_line;     \
01625       (Current).last_column  = YYRHSLOC (Rhs, N).last_column;   \
01626     }                               \
01627       else                              \
01628     {                               \
01629       (Current).first_line   = (Current).last_line   =      \
01630         YYRHSLOC (Rhs, 0).last_line;                \
01631       (Current).first_column = (Current).last_column =      \
01632         YYRHSLOC (Rhs, 0).last_column;              \
01633     }                               \
01634     while (YYID (0))
01635 #endif
01636 
01637 
01638 /* YY_LOCATION_PRINT -- Print the location on the stream.
01639    This macro was not mandated originally: define only if we know
01640    we won't break user code: when these are the locations we know.  */
01641 
01642 #ifndef YY_LOCATION_PRINT
01643 # if YYLTYPE_IS_TRIVIAL
01644 #  define YY_LOCATION_PRINT(File, Loc)          \
01645      fprintf (File, "%d.%d-%d.%d",          \
01646           (Loc).first_line, (Loc).first_column, \
01647           (Loc).last_line,  (Loc).last_column)
01648 # else
01649 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
01650 # endif
01651 #endif
01652 
01653 
01654 /* YYLEX -- calling `yylex' with the right arguments.  */
01655 
01656 #ifdef YYLEX_PARAM
01657 # define YYLEX yylex (YYLEX_PARAM)
01658 #else
01659 # define YYLEX yylex ()
01660 #endif
01661 
01662 /* Enable debugging if requested.  */
01663 #if YYDEBUG
01664 
01665 # ifndef YYFPRINTF
01666 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
01667 #  define YYFPRINTF fprintf
01668 # endif
01669 
01670 # define YYDPRINTF(Args)            \
01671 do {                        \
01672   if (yydebug)                  \
01673     YYFPRINTF Args;             \
01674 } while (YYID (0))
01675 
01676 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)            \
01677 do {                                      \
01678   if (yydebug)                                \
01679     {                                     \
01680       YYFPRINTF (stderr, "%s ", Title);                   \
01681       yy_symbol_print (stderr,                        \
01682           Type, Value); \
01683       YYFPRINTF (stderr, "\n");                       \
01684     }                                     \
01685 } while (YYID (0))
01686 
01687 
01688 /*--------------------------------.
01689 | Print this symbol on YYOUTPUT.  |
01690 `--------------------------------*/
01691 
01692 /*ARGSUSED*/
01693 #if (defined __STDC__ || defined __C99__FUNC__ \
01694      || defined __cplusplus || defined _MSC_VER)
01695 static void
01696 yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
01697 #else
01698 static void
01699 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
01700     FILE *yyoutput;
01701     int yytype;
01702     const YYSTYPE * const yyvaluep;
01703 #endif
01704 {
01705   if (!yyvaluep)
01706     return;
01707 # ifdef YYPRINT
01708   if (yytype < YYNTOKENS)
01709     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01710 # else
01711   YYUSE (yyoutput);
01712 # endif
01713   switch (yytype)
01714     {
01715       default:
01716     break;
01717     }
01718 }
01719 
01720 
01721 /*--------------------------------.
01722 | Print this symbol on YYOUTPUT.  |
01723 `--------------------------------*/
01724 
01725 #if (defined __STDC__ || defined __C99__FUNC__ \
01726      || defined __cplusplus || defined _MSC_VER)
01727 static void
01728 yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
01729 #else
01730 static void
01731 yy_symbol_print (yyoutput, yytype, yyvaluep)
01732     FILE *yyoutput;
01733     int yytype;
01734     const YYSTYPE * const yyvaluep;
01735 #endif
01736 {
01737   if (yytype < YYNTOKENS)
01738     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01739   else
01740     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01741 
01742   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01743   YYFPRINTF (yyoutput, ")");
01744 }
01745 
01746 /*------------------------------------------------------------------.
01747 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01748 | TOP (included).                                                   |
01749 `------------------------------------------------------------------*/
01750 
01751 #if (defined __STDC__ || defined __C99__FUNC__ \
01752      || defined __cplusplus || defined _MSC_VER)
01753 static void
01754 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
01755 #else
01756 static void
01757 yy_stack_print (bottom, top)
01758     yytype_int16 *bottom;
01759     yytype_int16 *top;
01760 #endif
01761 {
01762   YYFPRINTF (stderr, "Stack now");
01763   for (; bottom <= top; ++bottom)
01764     YYFPRINTF (stderr, " %d", *bottom);
01765   YYFPRINTF (stderr, "\n");
01766 }
01767 
01768 # define YY_STACK_PRINT(Bottom, Top)                \
01769 do {                                \
01770   if (yydebug)                          \
01771     yy_stack_print ((Bottom), (Top));               \
01772 } while (YYID (0))
01773 
01774 
01775 /*------------------------------------------------.
01776 | Report that the YYRULE is going to be reduced.  |
01777 `------------------------------------------------*/
01778 
01779 #if (defined __STDC__ || defined __C99__FUNC__ \
01780      || defined __cplusplus || defined _MSC_VER)
01781 static void
01782 yy_reduce_print (YYSTYPE *yyvsp, 
01783            int yyrule)
01784 #else
01785 static void
01786 yy_reduce_print (yyvsp, yyrule
01787            )
01788     YYSTYPE *yyvsp;
01789     
01790            int yyrule;
01791 #endif
01792 {
01793   int yynrhs = yyr2[yyrule];
01794   int yyi;
01795   unsigned long int yylno = yyrline[yyrule];
01796   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01797          yyrule - 1, yylno);
01798   /* The symbols being reduced.  */
01799   for (yyi = 0; yyi < yynrhs; yyi++)
01800     {
01801       fprintf (stderr, "   $%d = ", yyi + 1);
01802       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01803                &(yyvsp[(yyi + 1) - (yynrhs)])
01804                            );
01805       fprintf (stderr, "\n");
01806     }
01807 }
01808 
01809 # define YY_REDUCE_PRINT(Rule)      \
01810 do {                    \
01811   if (yydebug)              \
01812     yy_reduce_print (yyvsp, Rule); \
01813 } while (YYID (0))
01814 
01815 /* Nonzero means print parse trace.  It is left uninitialized so that
01816    multiple parsers can coexist.  */
01817 int yydebug;
01818 #else /* !YYDEBUG */
01819 # define YYDPRINTF(Args)
01820 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01821 # define YY_STACK_PRINT(Bottom, Top)
01822 # define YY_REDUCE_PRINT(Rule)
01823 #endif /* !YYDEBUG */
01824 
01825 
01826 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01827 #ifndef YYINITDEPTH
01828 # define YYINITDEPTH 200
01829 #endif
01830 
01831 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01832    if the built-in stack extension method is used).
01833 
01834    Do not make this value too large; the results are undefined if
01835    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
01836    evaluated with infinite-precision integer arithmetic.  */
01837 
01838 #ifndef YYMAXDEPTH
01839 # define YYMAXDEPTH 10000
01840 #endif
01841 
01842 
01843 
01844 #if YYERROR_VERBOSE
01845 
01846 # ifndef yystrlen
01847 #  if defined __GLIBC__ && defined _STRING_H
01848 #   define yystrlen strlen
01849 #  else
01850 /* Return the length of YYSTR.  */
01851 #if (defined __STDC__ || defined __C99__FUNC__ \
01852      || defined __cplusplus || defined _MSC_VER)
01853 static YYSIZE_T
01854 yystrlen (const char *yystr)
01855 #else
01856 static YYSIZE_T
01857 yystrlen (yystr)
01858     const char *yystr;
01859 #endif
01860 {
01861   YYSIZE_T yylen;
01862   for (yylen = 0; yystr[yylen]; yylen++)
01863     continue;
01864   return yylen;
01865 }
01866 #  endif
01867 # endif
01868 
01869 # ifndef yystpcpy
01870 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01871 #   define yystpcpy stpcpy
01872 #  else
01873 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01874    YYDEST.  */
01875 #if (defined __STDC__ || defined __C99__FUNC__ \
01876      || defined __cplusplus || defined _MSC_VER)
01877 static char *
01878 yystpcpy (char *yydest, const char *yysrc)
01879 #else
01880 static char *
01881 yystpcpy (yydest, yysrc)
01882     char *yydest;
01883     const char *yysrc;
01884 #endif
01885 {
01886   char *yyd = yydest;
01887   const char *yys = yysrc;
01888 
01889   while ((*yyd++ = *yys++) != '\0')
01890     continue;
01891 
01892   return yyd - 1;
01893 }
01894 #  endif
01895 # endif
01896 
01897 # ifndef yytnamerr
01898 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
01899    quotes and backslashes, so that it's suitable for yyerror.  The
01900    heuristic is that double-quoting is unnecessary unless the string
01901    contains an apostrophe, a comma, or backslash (other than
01902    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01903    null, do not copy; instead, return the length of what the result
01904    would have been.  */
01905 static YYSIZE_T
01906 yytnamerr (char *yyres, const char *yystr)
01907 {
01908   if (*yystr == '"')
01909     {
01910       YYSIZE_T yyn = 0;
01911       char const *yyp = yystr;
01912 
01913       for (;;)
01914     switch (*++yyp)
01915       {
01916       case '\'':
01917       case ',':
01918         goto do_not_strip_quotes;
01919 
01920       case '\\':
01921         if (*++yyp != '\\')
01922           goto do_not_strip_quotes;
01923         /* Fall through.  */
01924       default:
01925         if (yyres)
01926           yyres[yyn] = *yyp;
01927         yyn++;
01928         break;
01929 
01930       case '"':
01931         if (yyres)
01932           yyres[yyn] = '\0';
01933         return yyn;
01934       }
01935     do_not_strip_quotes: ;
01936     }
01937 
01938   if (! yyres)
01939     return yystrlen (yystr);
01940 
01941   return yystpcpy (yyres, yystr) - yyres;
01942 }
01943 # endif
01944 
01945 /* Copy into YYRESULT an error message about the unexpected token
01946    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01947    including the terminating null byte.  If YYRESULT is null, do not
01948    copy anything; just return the number of bytes that would be
01949    copied.  As a special case, return 0 if an ordinary "syntax error"
01950    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01951    size calculation.  */
01952 static YYSIZE_T
01953 yysyntax_error (char *yyresult, int yystate, int yychar)
01954 {
01955   int yyn = yypact[yystate];
01956 
01957   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01958     return 0;
01959   else
01960     {
01961       int yytype = YYTRANSLATE (yychar);
01962       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01963       YYSIZE_T yysize = yysize0;
01964       YYSIZE_T yysize1;
01965       int yysize_overflow = 0;
01966       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01967       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01968       int yyx;
01969 
01970 # if 0
01971       /* This is so xgettext sees the translatable formats that are
01972      constructed on the fly.  */
01973       YY_("syntax error, unexpected %s");
01974       YY_("syntax error, unexpected %s, expecting %s");
01975       YY_("syntax error, unexpected %s, expecting %s or %s");
01976       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01977       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01978 # endif
01979       char *yyfmt;
01980       char const *yyf;
01981       static char const yyunexpected[] = "syntax error, unexpected %s";
01982       static char const yyexpecting[] = ", expecting %s";
01983       static char const yyor[] = " or %s";
01984       char yyformat[sizeof yyunexpected
01985             + sizeof yyexpecting - 1
01986             + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01987                * (sizeof yyor - 1))];
01988       char const *yyprefix = yyexpecting;
01989 
01990       /* Start YYX at -YYN if negative to avoid negative indexes in
01991      YYCHECK.  */
01992       int yyxbegin = yyn < 0 ? -yyn : 0;
01993 
01994       /* Stay within bounds of both yycheck and yytname.  */
01995       int yychecklim = YYLAST - yyn + 1;
01996       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01997       int yycount = 1;
01998 
01999       yyarg[0] = yytname[yytype];
02000       yyfmt = yystpcpy (yyformat, yyunexpected);
02001 
02002       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
02003     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
02004       {
02005         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
02006           {
02007         yycount = 1;
02008         yysize = yysize0;
02009         yyformat[sizeof yyunexpected - 1] = '\0';
02010         break;
02011           }
02012         yyarg[yycount++] = yytname[yyx];
02013         yysize1 = yysize + yytnamerr (0, yytname[yyx]);
02014         yysize_overflow |= (yysize1 < yysize);
02015         yysize = yysize1;
02016         yyfmt = yystpcpy (yyfmt, yyprefix);
02017         yyprefix = yyor;
02018       }
02019 
02020       yyf = YY_(yyformat);
02021       yysize1 = yysize + yystrlen (yyf);
02022       yysize_overflow |= (yysize1 < yysize);
02023       yysize = yysize1;
02024 
02025       if (yysize_overflow)
02026     return YYSIZE_MAXIMUM;
02027 
02028       if (yyresult)
02029     {
02030       /* Avoid sprintf, as that infringes on the user's name space.
02031          Don't have undefined behavior even if the translation
02032          produced a string with the wrong number of "%s"s.  */
02033       char *yyp = yyresult;
02034       int yyi = 0;
02035       while ((*yyp = *yyf) != '\0')
02036         {
02037           if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
02038         {
02039           yyp += yytnamerr (yyp, yyarg[yyi++]);
02040           yyf += 2;
02041         }
02042           else
02043         {
02044           yyp++;
02045           yyf++;
02046         }
02047         }
02048     }
02049       return yysize;
02050     }
02051 }
02052 #endif /* YYERROR_VERBOSE */
02053 
02054 
02055 /*-----------------------------------------------.
02056 | Release the memory associated to this symbol.  |
02057 `-----------------------------------------------*/
02058 
02059 /*ARGSUSED*/
02060 #if (defined __STDC__ || defined __C99__FUNC__ \
02061      || defined __cplusplus || defined _MSC_VER)
02062 static void
02063 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
02064 #else
02065 static void
02066 yydestruct (yymsg, yytype, yyvaluep)
02067     const char *yymsg;
02068     int yytype;
02069     YYSTYPE *yyvaluep;
02070 #endif
02071 {
02072   YYUSE (yyvaluep);
02073 
02074   if (!yymsg)
02075     yymsg = "Deleting";
02076   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
02077 
02078   switch (yytype)
02079     {
02080 
02081       default:
02082     break;
02083     }
02084 }
02085 
02086 
02087 /* Prevent warnings from -Wmissing-prototypes.  */
02088 
02089 #ifdef YYPARSE_PARAM
02090 #if defined __STDC__ || defined __cplusplus
02091 int yyparse (void *YYPARSE_PARAM);
02092 #else
02093 int yyparse ();
02094 #endif
02095 #else /* ! YYPARSE_PARAM */
02096 #if defined __STDC__ || defined __cplusplus
02097 int yyparse (void);
02098 #else
02099 int yyparse ();
02100 #endif
02101 #endif /* ! YYPARSE_PARAM */
02102 
02103 
02104 
02105 /* The look-ahead symbol.  */
02106 int yychar;
02107 
02108 /* The semantic value of the look-ahead symbol.  */
02109 YYSTYPE yylval;
02110 
02111 /* Number of syntax errors so far.  */
02112 int yynerrs;
02113 
02114 
02115 
02116 /*----------.
02117 | yyparse.  |
02118 `----------*/
02119 
02120 #ifdef YYPARSE_PARAM
02121 #if (defined __STDC__ || defined __C99__FUNC__ \
02122      || defined __cplusplus || defined _MSC_VER)
02123 int
02124 yyparse (void *YYPARSE_PARAM)
02125 #else
02126 int
02127 yyparse (YYPARSE_PARAM)
02128     void *YYPARSE_PARAM;
02129 #endif
02130 #else /* ! YYPARSE_PARAM */
02131 #if (defined __STDC__ || defined __C99__FUNC__ \
02132      || defined __cplusplus || defined _MSC_VER)
02133 int
02134 yyparse (void)
02135 #else
02136 int
02137 yyparse ()
02138 
02139 #endif
02140 #endif
02141 {
02142   
02143   int yystate;
02144   int yyn;
02145   int yyresult;
02146   /* Number of tokens to shift before error messages enabled.  */
02147   int yyerrstatus;
02148   /* Look-ahead token as an internal (translated) token number.  */
02149   int yytoken = 0;
02150 #if YYERROR_VERBOSE
02151   /* Buffer for error messages, and its allocated size.  */
02152   char yymsgbuf[128];
02153   char *yymsg = yymsgbuf;
02154   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
02155 #endif
02156 
02157   /* Three stacks and their tools:
02158      `yyss': related to states,
02159      `yyvs': related to semantic values,
02160      `yyls': related to locations.
02161 
02162      Refer to the stacks thru separate pointers, to allow yyoverflow
02163      to reallocate them elsewhere.  */
02164 
02165   /* The state stack.  */
02166   yytype_int16 yyssa[YYINITDEPTH];
02167   yytype_int16 *yyss = yyssa;
02168   yytype_int16 *yyssp;
02169 
02170   /* The semantic value stack.  */
02171   YYSTYPE yyvsa[YYINITDEPTH];
02172   YYSTYPE *yyvs = yyvsa;
02173   YYSTYPE *yyvsp;
02174 
02175 
02176 
02177 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
02178 
02179   YYSIZE_T yystacksize = YYINITDEPTH;
02180 
02181   /* The variables used to return semantic value and location from the
02182      action routines.  */
02183   YYSTYPE yyval;
02184 
02185 
02186   /* The number of symbols on the RHS of the reduced rule.
02187      Keep to zero when no symbol should be popped.  */
02188   int yylen = 0;
02189 
02190   YYDPRINTF ((stderr, "Starting parse\n"));
02191 
02192   yystate = 0;
02193   yyerrstatus = 0;
02194   yynerrs = 0;
02195   yychar = YYEMPTY;     /* Cause a token to be read.  */
02196 
02197   /* Initialize stack pointers.
02198      Waste one element of value and location stack
02199      so that they stay on the same level as the state stack.
02200      The wasted elements are never initialized.  */
02201 
02202   yyssp = yyss;
02203   yyvsp = yyvs;
02204 
02205   goto yysetstate;
02206 
02207 /*------------------------------------------------------------.
02208 | yynewstate -- Push a new state, which is found in yystate.  |
02209 `------------------------------------------------------------*/
02210  yynewstate:
02211   /* In all cases, when you get here, the value and location stacks
02212      have just been pushed.  So pushing a state here evens the stacks.  */
02213   yyssp++;
02214 
02215  yysetstate:
02216   *yyssp = yystate;
02217 
02218   if (yyss + yystacksize - 1 <= yyssp)
02219     {
02220       /* Get the current used size of the three stacks, in elements.  */
02221       YYSIZE_T yysize = yyssp - yyss + 1;
02222 
02223 #ifdef yyoverflow
02224       {
02225     /* Give user a chance to reallocate the stack.  Use copies of
02226        these so that the &'s don't force the real ones into
02227        memory.  */
02228     YYSTYPE *yyvs1 = yyvs;
02229     yytype_int16 *yyss1 = yyss;
02230 
02231 
02232     /* Each stack pointer address is followed by the size of the
02233        data in use in that stack, in bytes.  This used to be a
02234        conditional around just the two extra args, but that might
02235        be undefined if yyoverflow is a macro.  */
02236     yyoverflow (YY_("memory exhausted"),
02237             &yyss1, yysize * sizeof (*yyssp),
02238             &yyvs1, yysize * sizeof (*yyvsp),
02239 
02240             &yystacksize);
02241 
02242     yyss = yyss1;
02243     yyvs = yyvs1;
02244       }
02245 #else /* no yyoverflow */
02246 # ifndef YYSTACK_RELOCATE
02247       goto yyexhaustedlab;
02248 # else
02249       /* Extend the stack our own way.  */
02250       if (YYMAXDEPTH <= yystacksize)
02251     goto yyexhaustedlab;
02252       yystacksize *= 2;
02253       if (YYMAXDEPTH < yystacksize)
02254     yystacksize = YYMAXDEPTH;
02255 
02256       {
02257     yytype_int16 *yyss1 = yyss;
02258     union yyalloc *yyptr =
02259       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
02260     if (! yyptr)
02261       goto yyexhaustedlab;
02262     YYSTACK_RELOCATE (yyss);
02263     YYSTACK_RELOCATE (yyvs);
02264 
02265 #  undef YYSTACK_RELOCATE
02266     if (yyss1 != yyssa)
02267       YYSTACK_FREE (yyss1);
02268       }
02269 # endif
02270 #endif /* no yyoverflow */
02271 
02272       yyssp = yyss + yysize - 1;
02273       yyvsp = yyvs + yysize - 1;
02274 
02275 
02276       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
02277           (unsigned long int) yystacksize));
02278 
02279       if (yyss + yystacksize - 1 <= yyssp)
02280     YYABORT;
02281     }
02282 
02283   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
02284 
02285   goto yybackup;
02286 
02287 /*-----------.
02288 | yybackup.  |
02289 `-----------*/
02290 yybackup:
02291 
02292   /* Do appropriate processing given the current state.  Read a
02293      look-ahead token if we need one and don't already have one.  */
02294 
02295   /* First try to decide what to do without reference to look-ahead token.  */
02296   yyn = yypact[yystate];
02297   if (yyn == YYPACT_NINF)
02298     goto yydefault;
02299 
02300   /* Not known => get a look-ahead token if don't already have one.  */
02301 
02302   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
02303   if (yychar == YYEMPTY)
02304     {
02305       YYDPRINTF ((stderr, "Reading a token: "));
02306       yychar = YYLEX;
02307     }
02308 
02309   if (yychar <= YYEOF)
02310     {
02311       yychar = yytoken = YYEOF;
02312       YYDPRINTF ((stderr, "Now at end of input.\n"));
02313     }
02314   else
02315     {
02316       yytoken = YYTRANSLATE (yychar);
02317       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
02318     }
02319 
02320   /* If the proper action on seeing token YYTOKEN is to reduce or to
02321      detect an error, take that action.  */
02322   yyn += yytoken;
02323   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
02324     goto yydefault;
02325   yyn = yytable[yyn];
02326   if (yyn <= 0)
02327     {
02328       if (yyn == 0 || yyn == YYTABLE_NINF)
02329     goto yyerrlab;
02330       yyn = -yyn;
02331       goto yyreduce;
02332     }
02333 
02334   if (yyn == YYFINAL)
02335     YYACCEPT;
02336 
02337   /* Count tokens shifted since error; after three, turn off error
02338      status.  */
02339   if (yyerrstatus)
02340     yyerrstatus--;
02341 
02342   /* Shift the look-ahead token.  */
02343   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
02344 
02345   /* Discard the shifted token unless it is eof.  */
02346   if (yychar != YYEOF)
02347     yychar = YYEMPTY;
02348 
02349   yystate = yyn;
02350   *++yyvsp = yylval;
02351 
02352   goto yynewstate;
02353 
02354 
02355 /*-----------------------------------------------------------.
02356 | yydefault -- do the default action for the current state.  |
02357 `-----------------------------------------------------------*/
02358 yydefault:
02359   yyn = yydefact[yystate];
02360   if (yyn == 0)
02361     goto yyerrlab;
02362   goto yyreduce;
02363 
02364 
02365 /*-----------------------------.
02366 | yyreduce -- Do a reduction.  |
02367 `-----------------------------*/
02368 yyreduce:
02369   /* yyn is the number of a rule to reduce with.  */
02370   yylen = yyr2[yyn];
02371 
02372   /* If YYLEN is nonzero, implement the default value of the action:
02373      `$$ = $1'.
02374 
02375      Otherwise, the following line sets YYVAL to garbage.
02376      This behavior is undocumented and Bison
02377      users should not rely upon it.  Assigning to YYVAL
02378      unconditionally makes the parser a bit smaller, and it avoids a
02379      GCC warning that YYVAL may be used uninitialized.  */
02380   yyval = yyvsp[1-yylen];
02381 
02382 
02383   YY_REDUCE_PRINT (yyn);
02384   switch (yyn)
02385     {
02386         case 2:
02387 #line 569 "sqlparser.y"
02388     {
02389 //todo: multiple statements
02390 //todo: not only "select" statements
02391     parser->setOperation(Parser::OP_Select);
02392     parser->setQuerySchema((yyvsp[(1) - (1)].querySchema));
02393 ;}
02394     break;
02395 
02396   case 3:
02397 #line 579 "sqlparser.y"
02398     {
02399 //todo: multiple statements
02400 ;}
02401     break;
02402 
02403   case 5:
02404 #line 584 "sqlparser.y"
02405     {
02406     (yyval.querySchema) = (yyvsp[(1) - (2)].querySchema);
02407 ;}
02408     break;
02409 
02410   case 6:
02411 #line 594 "sqlparser.y"
02412     {
02413 YYACCEPT;
02414 ;}
02415     break;
02416 
02417   case 7:
02418 #line 598 "sqlparser.y"
02419     {
02420     (yyval.querySchema) = (yyvsp[(1) - (1)].querySchema);
02421 ;}
02422     break;
02423 
02424   case 8:
02425 #line 605 "sqlparser.y"
02426     {
02427     parser->setOperation(Parser::OP_CreateTable);
02428     parser->createTable((yyvsp[(3) - (3)].stringValue));
02429 ;}
02430     break;
02431 
02432   case 11:
02433 #line 614 "sqlparser.y"
02434     {
02435 ;}
02436     break;
02437 
02438   case 12:
02439 #line 620 "sqlparser.y"
02440     {
02441     kdDebug() << "adding field " << (yyvsp[(1) - (2)].stringValue) << endl;
02442     field->setName((yyvsp[(1) - (2)].stringValue));
02443     parser->table()->addField(field);
02444 
02445 //  delete field;
02446     field = 0;
02447 ;}
02448     break;
02449 
02450   case 13:
02451 #line 629 "sqlparser.y"
02452     {
02453     kdDebug() << "adding field " << (yyvsp[(1) - (3)].stringValue) << endl;
02454     field->setName((yyvsp[(1) - (3)].stringValue));
02455     parser->table()->addField(field);
02456 
02457 //  if(field->isPrimaryKey())
02458 //      parser->table()->addPrimaryKey(field->name());
02459 
02460 //  delete field;
02461 //  field = 0;
02462 ;}
02463     break;
02464 
02465   case 15:
02466 #line 644 "sqlparser.y"
02467     {
02468 ;}
02469     break;
02470 
02471   case 16:
02472 #line 650 "sqlparser.y"
02473     {
02474     field->setPrimaryKey(true);
02475     kdDebug() << "primary" << endl;
02476 ;}
02477     break;
02478 
02479   case 17:
02480 #line 655 "sqlparser.y"
02481     {
02482     field->setNotNull(true);
02483     kdDebug() << "not_null" << endl;
02484 ;}
02485     break;
02486 
02487   case 18:
02488 #line 660 "sqlparser.y"
02489     {
02490     field->setAutoIncrement(true);
02491     kdDebug() << "ainc" << endl;
02492 ;}
02493     break;
02494 
02495   case 19:
02496 #line 668 "sqlparser.y"
02497     {
02498     field = new Field();
02499     field->setType((yyvsp[(1) - (1)].colType));
02500 ;}
02501     break;
02502 
02503   case 20:
02504 #line 673 "sqlparser.y"
02505     {
02506     kdDebug() << "sql + length" << endl;
02507     field = new Field();
02508     field->setPrecision((yyvsp[(3) - (4)].integerValue));
02509     field->setType((yyvsp[(1) - (4)].colType));
02510 ;}
02511     break;
02512 
02513   case 21:
02514 #line 680 "sqlparser.y"
02515     {
02516     field = new Field();
02517     field->setPrecision((yyvsp[(3) - (4)].integerValue));
02518     field->setType(Field::Text);
02519 ;}
02520     break;
02521 
02522   case 22:
02523 #line 686 "sqlparser.y"
02524     {
02525     // SQLITE compatibillity
02526     field = new Field();
02527     field->setType(Field::InvalidType);
02528 ;}
02529     break;
02530 
02531   case 23:
02532 #line 695 "sqlparser.y"
02533     {
02534     kdDebug() << "Select ColViews=" << (yyvsp[(2) - (2)].exprList)->debugString() << endl;
02535 
02536     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (2)].querySchema), (yyvsp[(2) - (2)].exprList) )))
02537         return 0;
02538 ;}
02539     break;
02540 
02541   case 24:
02542 #line 702 "sqlparser.y"
02543     {
02544     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), (yyvsp[(3) - (3)].exprList) )))
02545         return 0;
02546 ;}
02547     break;
02548 
02549   case 25:
02550 #line 707 "sqlparser.y"
02551     {
02552     kdDebug() << "Select ColViews Tables" << endl;
02553     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (2)].querySchema), 0, (yyvsp[(2) - (2)].exprList) )))
02554         return 0;
02555 ;}
02556     break;
02557 
02558   case 26:
02559 #line 713 "sqlparser.y"
02560     {
02561     kdDebug() << "Select ColViews Conditions" << endl;
02562     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), 0, (yyvsp[(3) - (3)].expr) )))
02563         return 0;
02564 ;}
02565     break;
02566 
02567   case 27:
02568 #line 719 "sqlparser.y"
02569     {
02570     kdDebug() << "Select ColViews Tables Conditions" << endl;
02571     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (4)].querySchema), (yyvsp[(2) - (4)].exprList), (yyvsp[(3) - (4)].exprList), (yyvsp[(4) - (4)].expr) )))
02572         return 0;
02573 ;}
02574     break;
02575 
02576   case 28:
02577 #line 725 "sqlparser.y"
02578     {
02579     kdDebug() << "Select Tables Conditions" << endl;
02580     if (!((yyval.querySchema) = parseSelect( (yyvsp[(1) - (3)].querySchema), 0, (yyvsp[(2) - (3)].exprList), (yyvsp[(3) - (3)].expr) )))
02581         return 0;
02582 ;}
02583     break;
02584 
02585   case 29:
02586 #line 734 "sqlparser.y"
02587     {
02588     kdDebug() << "SELECT" << endl;
02589 //  parser->createSelect();
02590 //  parser->setOperation(Parser::OP_Select);
02591     (yyval.querySchema) = new QuerySchema();
02592 ;}
02593     break;
02594 
02595   case 30:
02596 #line 744 "sqlparser.y"
02597     {
02598     (yyval.expr) = (yyvsp[(2) - (2)].expr);
02599 ;}
02600     break;
02601 
02602   case 32:
02603 #line 756 "sqlparser.y"
02604     {
02605 //  kdDebug() << "AND " << $3.debugString() << endl;
02606     (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), AND, (yyvsp[(3) - (3)].expr) );
02607 ;}
02608     break;
02609 
02610   case 33:
02611 #line 761 "sqlparser.y"
02612     {
02613     (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), OR, (yyvsp[(3) - (3)].expr) );
02614 ;}
02615     break;
02616 
02617   case 34:
02618 #line 765 "sqlparser.y"
02619     {
02620     (yyval.expr) = new BinaryExpr( KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), XOR, (yyvsp[(3) - (3)].expr) );
02621 ;}
02622     break;
02623 
02624   case 36:
02625 #line 775 "sqlparser.y"
02626     {
02627     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '>', (yyvsp[(3) - (3)].expr));
02628 ;}
02629     break;
02630 
02631   case 37:
02632 #line 779 "sqlparser.y"
02633     {
02634     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), GREATER_OR_EQUAL, (yyvsp[(3) - (3)].expr));
02635 ;}
02636     break;
02637 
02638   case 38:
02639 #line 783 "sqlparser.y"
02640     {
02641     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '<', (yyvsp[(3) - (3)].expr));
02642 ;}
02643     break;
02644 
02645   case 39:
02646 #line 787 "sqlparser.y"
02647     {
02648     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LESS_OR_EQUAL, (yyvsp[(3) - (3)].expr));
02649 ;}
02650     break;
02651 
02652   case 40:
02653 #line 791 "sqlparser.y"
02654     {
02655     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '=', (yyvsp[(3) - (3)].expr));
02656 ;}
02657     break;
02658 
02659   case 42:
02660 #line 801 "sqlparser.y"
02661     {
02662     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL, (yyvsp[(3) - (3)].expr));
02663 ;}
02664     break;
02665 
02666   case 43:
02667 #line 806 "sqlparser.y"
02668     {
02669     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL2, (yyvsp[(3) - (3)].expr));
02670 ;}
02671     break;
02672 
02673   case 44:
02674 #line 810 "sqlparser.y"
02675     {
02676     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LIKE, (yyvsp[(3) - (3)].expr));
02677 ;}
02678     break;
02679 
02680   case 45:
02681 #line 814 "sqlparser.y"
02682     {
02683     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SQL_IN, (yyvsp[(3) - (3)].expr));
02684 ;}
02685     break;
02686 
02687   case 46:
02688 #line 818 "sqlparser.y"
02689     {
02690     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SIMILAR_TO, (yyvsp[(3) - (3)].expr));
02691 ;}
02692     break;
02693 
02694   case 47:
02695 #line 822 "sqlparser.y"
02696     {
02697     (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_SIMILAR_TO, (yyvsp[(3) - (3)].expr));
02698 ;}
02699     break;
02700 
02701   case 49:
02702 #line 832 "sqlparser.y"
02703     {
02704     (yyval.expr) = new UnaryExpr( SQL_IS_NULL, (yyvsp[(1) - (2)].expr) );
02705 ;}
02706     break;
02707 
02708   case 50:
02709 #line 836 "sqlparser.y"
02710     {
02711     (yyval.expr) = new UnaryExpr( SQL_IS_NOT_NULL, (yyvsp[(1) - (2)].expr) );
02712 ;}
02713     break;
02714 
02715   case 52:
02716 #line 846 "sqlparser.y"
02717     {
02718     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_LEFT, (yyvsp[(3) - (3)].expr));
02719 ;}
02720     break;
02721 
02722   case 53:
02723 #line 850 "sqlparser.y"
02724     {
02725     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_RIGHT, (yyvsp[(3) - (3)].expr));
02726 ;}
02727     break;
02728 
02729   case 55:
02730 #line 860 "sqlparser.y"
02731     {
02732     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '+', (yyvsp[(3) - (3)].expr));
02733     (yyval.expr)->debug();
02734 ;}
02735     break;
02736 
02737   case 56:
02738 #line 865 "sqlparser.y"
02739     {
02740     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '-', (yyvsp[(3) - (3)].expr));
02741 ;}
02742     break;
02743 
02744   case 57:
02745 #line 869 "sqlparser.y"
02746     {
02747     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '&', (yyvsp[(3) - (3)].expr));
02748 ;}
02749     break;
02750 
02751   case 58:
02752 #line 873 "sqlparser.y"
02753     {
02754     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '|', (yyvsp[(3) - (3)].expr));
02755 ;}
02756     break;
02757 
02758   case 60:
02759 #line 883 "sqlparser.y"
02760     {
02761     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '/', (yyvsp[(3) - (3)].expr));
02762 ;}
02763     break;
02764 
02765   case 61:
02766 #line 887 "sqlparser.y"
02767     {
02768     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '*', (yyvsp[(3) - (3)].expr));
02769 ;}
02770     break;
02771 
02772   case 62:
02773 #line 891 "sqlparser.y"
02774     {
02775     (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '%', (yyvsp[(3) - (3)].expr));
02776 ;}
02777     break;
02778 
02779   case 64:
02780 #line 902 "sqlparser.y"
02781     {
02782     (yyval.expr) = new UnaryExpr( '-', (yyvsp[(2) - (2)].expr) );
02783 ;}
02784     break;
02785 
02786   case 65:
02787 #line 906 "sqlparser.y"
02788     {
02789     (yyval.expr) = new UnaryExpr( '+', (yyvsp[(2) - (2)].expr) );
02790 ;}
02791     break;
02792 
02793   case 66:
02794 #line 910 "sqlparser.y"
02795     {
02796     (yyval.expr) = new UnaryExpr( '~', (yyvsp[(2) - (2)].expr) );
02797 ;}
02798     break;
02799 
02800   case 67:
02801 #line 914 "sqlparser.y"
02802     {
02803     (yyval.expr) = new UnaryExpr( NOT, (yyvsp[(2) - (2)].expr) );
02804 ;}
02805     break;
02806 
02807   case 68:
02808 #line 918 "sqlparser.y"
02809     {
02810     (yyval.expr) = new VariableExpr( QString::fromUtf8((yyvsp[(1) - (1)].stringValue)) );
02811     
02812 //TODO: simplify this later if that's 'only one field name' expression
02813     kdDebug() << "  + identifier: " << (yyvsp[(1) - (1)].stringValue) << endl;
02814 //  $$ = new Field();
02815 //  $$->setName($1);
02816 //  $$->setTable(dummy);
02817 
02818 //  parser->select()->addField(field);
02819 //  requiresTable = true;
02820 ;}
02821     break;
02822 
02823   case 69:
02824 #line 931 "sqlparser.y"
02825     {
02826     kdDebug() << "  + function: " << (yyvsp[(1) - (2)].stringValue) << "(" << (yyvsp[(2) - (2)].exprList)->debugString() << ")" << endl;
02827     (yyval.expr) = new FunctionExpr((yyvsp[(1) - (2)].stringValue), (yyvsp[(2) - (2)].exprList));
02828 ;}
02829     break;
02830 
02831   case 70:
02832 #line 937 "sqlparser.y"
02833     {
02834     (yyval.expr) = new VariableExpr( QString::fromUtf8((yyvsp[(1) - (3)].stringValue)) + "." + QString::fromUtf8((yyvsp[(3) - (3)].stringValue)) );
02835     kdDebug() << "  + identifier.identifier: " << (yyvsp[(3) - (3)].stringValue) << "." << (yyvsp[(1) - (3)].stringValue) << endl;
02836 //  $$ = new Field();
02837 //  s->setTable($1);
02838 //  $$->setName($3);
02839     //$$->setTable(parser->db()->tableSchema($1));
02840 //  parser->select()->addField(field);
02841 //??    requiresTable = true;
02842 ;}
02843     break;
02844 
02845   case 71:
02846 #line 948 "sqlparser.y"
02847     {
02848     (yyval.expr) = new ConstExpr( SQL_NULL, QVariant() );
02849     kdDebug() << "  + NULL" << endl;
02850 //  $$ = new Field();
02851     //$$->setName(QString::null);
02852 ;}
02853     break;
02854 
02855   case 72:
02856 #line 955 "sqlparser.y"
02857     {
02858     QString s( QString::fromUtf8((yyvsp[(1) - (1)].stringValue)) );
02859     (yyval.expr) = new ConstExpr( CHARACTER_STRING_LITERAL, s.mid(1,s.length()-2) );
02860     kdDebug() << "  + constant " << s << endl;
02861 ;}
02862     break;
02863 
02864   case 73:
02865 #line 961 "sqlparser.y"
02866     {
02867     QVariant val;
02868     if ((yyvsp[(1) - (1)].integerValue) <= INT_MAX && (yyvsp[(1) - (1)].integerValue) >= INT_MIN)
02869         val = (int)(yyvsp[(1) - (1)].integerValue);
02870     else if ((yyvsp[(1) - (1)].integerValue) <= UINT_MAX && (yyvsp[(1) - (1)].integerValue) >= 0)
02871         val = (uint)(yyvsp[(1) - (1)].integerValue);
02872     else if ((yyvsp[(1) - (1)].integerValue) <= LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= LLONG_MIN)
02873         val = (Q_LLONG)(yyvsp[(1) - (1)].integerValue);
02874 
02875 //  if ($1 < ULLONG_MAX)
02876 //      val = (Q_ULLONG)$1;
02877 //TODO ok?
02878 
02879     (yyval.expr) = new ConstExpr( INTEGER_CONST, val );
02880     kdDebug() << "  + int constant: " << val.toString() << endl;
02881 ;}
02882     break;
02883 
02884   case 74:
02885 #line 978 "sqlparser.y"
02886     {
02887     (yyval.expr) = new ConstExpr( REAL_CONST, QPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) );
02888     kdDebug() << "  + real constant: " << (yyvsp[(1) - (1)].realValue).integer << "." << (yyvsp[(1) - (1)].realValue).fractional << endl;
02889 ;}
02890     break;
02891 
02892   case 76:
02893 #line 989 "sqlparser.y"
02894     {
02895     kdDebug() << "(expr)" << endl;
02896     (yyval.expr) = new UnaryExpr('(', (yyvsp[(2) - (3)].expr));
02897 ;}
02898     break;
02899 
02900   case 77:
02901 #line 997 "sqlparser.y"
02902     {
02903 //  $$ = new NArgExpr(0, 0);
02904 //  $$->add( $1 );
02905 //  $$->add( $3 );
02906     (yyval.exprList) = (yyvsp[(2) - (3)].exprList);
02907 ;}
02908     break;
02909 
02910   case 78:
02911 #line 1007 "sqlparser.y"
02912     {
02913     (yyval.exprList) = (yyvsp[(3) - (3)].exprList);
02914     (yyval.exprList)->prepend( (yyvsp[(1) - (3)].expr) );
02915 ;}
02916     break;
02917 
02918   case 79:
02919 #line 1012 "sqlparser.y"
02920     {
02921     (yyval.exprList) = new NArgExpr(0, 0);
02922     (yyval.exprList)->add( (yyvsp[(1) - (3)].expr) );
02923     (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
02924 ;}
02925     break;
02926 
02927   case 80:
02928 #line 1021 "sqlparser.y"
02929     {
02930     (yyval.exprList) = (yyvsp[(2) - (2)].exprList);
02931 ;}
02932     break;
02933 
02934   case 81:
02935 #line 1062 "sqlparser.y"
02936     {
02937     (yyval.exprList) = (yyvsp[(1) - (3)].exprList);
02938     (yyval.exprList)->add((yyvsp[(3) - (3)].expr));
02939 ;}
02940     break;
02941 
02942   case 82:
02943 #line 1067 "sqlparser.y"
02944     {
02945     (yyval.exprList) = new NArgExpr(KexiDBExpr_TableList, IDENTIFIER); //ok?
02946     (yyval.exprList)->add((yyvsp[(1) - (1)].expr));
02947 ;}
02948     break;
02949 
02950   case 83:
02951 #line 1075 "sqlparser.y"
02952     {
02953     kdDebug() << "FROM: '" << (yyvsp[(1) - (1)].stringValue) << "'" << endl;
02954 
02955 //  TableSchema *schema = parser->db()->tableSchema($1);
02956 //  parser->select()->setParentTable(schema);
02957 //  parser->select()->addTable(schema);
02958 //  requiresTable = false;
02959     
02960 //addTable($1);
02961 
02962     (yyval.expr) = new VariableExpr(QString::fromUtf8((yyvsp[(1) - (1)].stringValue)));
02963 
02964     /*
02965 //TODO: this isn't ok for more tables:
02966     Field::ListIterator it = parser->select()->fieldsIterator();
02967     for(Field *item; (item = it.current()); ++it)
02968     {
02969         if(item->table() == dummy)
02970         {
02971             item->setTable(schema);
02972         }
02973 
02974         if(item->table() && !item->isQueryAsterisk())
02975         {
02976             Field *f = item->table()->field(item->name());
02977             if(!f)
02978             {
02979                 ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current);
02980                 parser->setError(err);
02981                 yyerror("fieldlisterror");
02982             }   
02983         }
02984     }*/
02985 ;}
02986     break;
02987 
02988   case 84:
02989 #line 1110 "sqlparser.y"
02990     {
02991     //table + alias
02992     (yyval.expr) = new BinaryExpr(
02993         KexiDBExpr_SpecialBinary, 
02994         new VariableExpr(QString::fromUtf8((yyvsp[(1) - (2)].stringValue))), 0,
02995         new VariableExpr(QString::fromUtf8((yyvsp[(2) - (2)].stringValue)))
02996     );
02997 ;}
02998     break;
02999 
03000   case 85:
03001 #line 1119 "sqlparser.y"
03002     {
03003     //table + alias
03004     (yyval.expr) = new BinaryExpr(
03005         KexiDBExpr_SpecialBinary,
03006         new VariableExpr(QString::fromUtf8((yyvsp[(1) - (3)].stringValue))), AS,
03007         new VariableExpr(QString::fromUtf8((yyvsp[(3) - (3)].stringValue)))
03008     );
03009 ;}
03010     break;
03011 
03012   case 86:
03013 #line 1133 "sqlparser.y"
03014     {
03015     (yyval.exprList) = (yyvsp[(1) - (3)].exprList);
03016     (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
03017     kdDebug() << "ColViews: ColViews , ColItem" << endl;
03018 ;}
03019     break;
03020 
03021   case 87:
03022 #line 1139 "sqlparser.y"
03023     {
03024     (yyval.exprList) = new NArgExpr(0,0);
03025     (yyval.exprList)->add( (yyvsp[(1) - (1)].expr) );
03026     kdDebug() << "ColViews: ColItem" << endl;
03027 ;}
03028     break;
03029 
03030   case 88:
03031 #line 1148 "sqlparser.y"
03032     {
03033 //  $$ = new Field();
03034 //  dummy->addField($$);
03035 //  $$->setExpression( $1 );
03036 //  parser->select()->addField($$);
03037     (yyval.expr) = (yyvsp[(1) - (1)].expr);
03038     kdDebug() << " added column expr: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'" << endl;
03039 ;}
03040     break;
03041 
03042   case 89:
03043 #line 1157 "sqlparser.y"
03044     {
03045     (yyval.expr) = (yyvsp[(1) - (1)].expr);
03046     kdDebug() << " added column wildcard: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'" << endl;
03047 ;}
03048     break;
03049 
03050   case 90:
03051 #line 1162 "sqlparser.y"
03052     {
03053 //  $$ = new Field();
03054 //  $$->setExpression( $1 );
03055 //  parser->select()->addField($$);
03056     (yyval.expr) = new BinaryExpr(
03057         KexiDBExpr_SpecialBinary, (yyvsp[(1) - (3)].expr), AS,
03058         new VariableExpr(QString::fromUtf8((yyvsp[(3) - (3)].stringValue)))
03059 //      new ConstExpr(IDENTIFIER, QString::fromLocal8Bit($3))
03060     );
03061     kdDebug() << " added column expr: " << (yyval.expr)->debugString() << endl;
03062 ;}
03063     break;
03064 
03065   case 91:
03066 #line 1174 "sqlparser.y"
03067     {
03068 //  $$ = new Field();
03069 //  $$->setExpression( $1 );
03070 //  parser->select()->addField($$);
03071     (yyval.expr) = new BinaryExpr(
03072         KexiDBExpr_SpecialBinary, (yyvsp[(1) - (2)].expr), 0, 
03073         new VariableExpr(QString::fromUtf8((yyvsp[(2) - (2)].stringValue)))
03074 //      new ConstExpr(IDENTIFIER, QString::fromLocal8Bit($2))
03075     );
03076     kdDebug() << " added column expr: " << (yyval.expr)->debugString() << endl;
03077 ;}
03078     break;
03079 
03080   case 92:
03081 #line 1189 "sqlparser.y"
03082     {
03083     (yyval.expr) = (yyvsp[(1) - (1)].expr);
03084 ;}
03085     break;
03086 
03087   case 93:
03088 #line 1233 "sqlparser.y"
03089     {
03090     (yyval.expr) = (yyvsp[(3) - (4)].expr);
03091 //TODO
03092 //  $$->setName("DISTINCT(" + $3->name() + ")");
03093 ;}
03094     break;
03095 
03096   case 94:
03097 #line 1242 "sqlparser.y"
03098     {
03099     (yyval.expr) = new VariableExpr("*");
03100     kdDebug() << "all columns" << endl;
03101 
03102 //  QueryAsterisk *ast = new QueryAsterisk(parser->select(), dummy);
03103 //  parser->select()->addAsterisk(ast);
03104 //  requiresTable = true;
03105 ;}
03106     break;
03107 
03108   case 95:
03109 #line 1251 "sqlparser.y"
03110     {
03111     QString s = QString::fromUtf8((yyvsp[(1) - (3)].stringValue));
03112     s+=".*";
03113     (yyval.expr) = new VariableExpr(s);
03114     kdDebug() << "  + all columns from " << s << endl;
03115 ;}
03116     break;
03117 
03118 
03119 /* Line 1267 of yacc.c.  */
03120 #line 3121 "sqlparser.tab.c"
03121       default: break;
03122     }
03123   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
03124 
03125   YYPOPSTACK (yylen);
03126   yylen = 0;
03127   YY_STACK_PRINT (yyss, yyssp);
03128 
03129   *++yyvsp = yyval;
03130 
03131 
03132   /* Now `shift' the result of the reduction.  Determine what state
03133      that goes to, based on the state we popped back to and the rule
03134      number reduced by.  */
03135 
03136   yyn = yyr1[yyn];
03137 
03138   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
03139   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
03140     yystate = yytable[yystate];
03141   else
03142     yystate = yydefgoto[yyn - YYNTOKENS];
03143 
03144   goto yynewstate;
03145 
03146 
03147 /*------------------------------------.
03148 | yyerrlab -- here on detecting error |
03149 `------------------------------------*/
03150 yyerrlab:
03151   /* If not already recovering from an error, report this error.  */
03152   if (!yyerrstatus)
03153     {
03154       ++yynerrs;
03155 #if ! YYERROR_VERBOSE
03156       yyerror (YY_("syntax error"));
03157 #else
03158       {
03159     YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
03160     if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
03161       {
03162         YYSIZE_T yyalloc = 2 * yysize;
03163         if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
03164           yyalloc = YYSTACK_ALLOC_MAXIMUM;
03165         if (yymsg != yymsgbuf)
03166           YYSTACK_FREE (yymsg);
03167         yymsg = (char *) YYSTACK_ALLOC (yyalloc);
03168         if (yymsg)
03169           yymsg_alloc = yyalloc;
03170         else
03171           {
03172         yymsg = yymsgbuf;
03173         yymsg_alloc = sizeof yymsgbuf;
03174           }
03175       }
03176 
03177     if (0 < yysize && yysize <= yymsg_alloc)
03178       {
03179         (void) yysyntax_error (yymsg, yystate, yychar);
03180         yyerror (yymsg);
03181       }
03182     else
03183       {
03184         yyerror (YY_("syntax error"));
03185         if (yysize != 0)
03186           goto yyexhaustedlab;
03187       }
03188       }
03189 #endif
03190     }
03191 
03192 
03193 
03194   if (yyerrstatus == 3)
03195     {
03196       /* If just tried and failed to reuse look-ahead token after an
03197      error, discard it.  */
03198 
03199       if (yychar <= YYEOF)
03200     {
03201       /* Return failure if at end of input.  */
03202       if (yychar == YYEOF)
03203         YYABORT;
03204     }
03205       else
03206     {
03207       yydestruct ("Error: discarding",
03208               yytoken, &yylval);
03209       yychar = YYEMPTY;
03210     }
03211     }
03212 
03213   /* Else will try to reuse look-ahead token after shifting the error
03214      token.  */
03215   goto yyerrlab1;
03216 
03217 
03218 /*---------------------------------------------------.
03219 | yyerrorlab -- error raised explicitly by YYERROR.  |
03220 `---------------------------------------------------*/
03221 yyerrorlab:
03222 
03223   /* Pacify compilers like GCC when the user code never invokes
03224      YYERROR and the label yyerrorlab therefore never appears in user
03225      code.  */
03226   if (/*CONSTCOND*/ 0)
03227      goto yyerrorlab;
03228 
03229   /* Do not reclaim the symbols of the rule which action triggered
03230      this YYERROR.  */
03231   YYPOPSTACK (yylen);
03232   yylen = 0;
03233   YY_STACK_PRINT (yyss, yyssp);
03234   yystate = *yyssp;
03235   goto yyerrlab1;
03236 
03237 
03238 /*-------------------------------------------------------------.
03239 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
03240 `-------------------------------------------------------------*/
03241 yyerrlab1:
03242   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
03243 
03244   for (;;)
03245     {
03246       yyn = yypact[yystate];
03247       if (yyn != YYPACT_NINF)
03248     {
03249       yyn += YYTERROR;
03250       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
03251         {
03252           yyn = yytable[yyn];
03253           if (0 < yyn)
03254         break;
03255         }
03256     }
03257 
03258       /* Pop the current state because it cannot handle the error token.  */
03259       if (yyssp == yyss)
03260     YYABORT;
03261 
03262 
03263       yydestruct ("Error: popping",
03264           yystos[yystate], yyvsp);
03265       YYPOPSTACK (1);
03266       yystate = *yyssp;
03267       YY_STACK_PRINT (yyss, yyssp);
03268     }
03269 
03270   if (yyn == YYFINAL)
03271     YYACCEPT;
03272 
03273   *++yyvsp = yylval;
03274 
03275 
03276   /* Shift the error token.  */
03277   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
03278 
03279   yystate = yyn;
03280   goto yynewstate;
03281 
03282 
03283 /*-------------------------------------.
03284 | yyacceptlab -- YYACCEPT comes here.  |
03285 `-------------------------------------*/
03286 yyacceptlab:
03287   yyresult = 0;
03288   goto yyreturn;
03289 
03290 /*-----------------------------------.
03291 | yyabortlab -- YYABORT comes here.  |
03292 `-----------------------------------*/
03293 yyabortlab:
03294   yyresult = 1;
03295   goto yyreturn;
03296 
03297 #ifndef yyoverflow
03298 /*-------------------------------------------------.
03299 | yyexhaustedlab -- memory exhaustion comes here.  |
03300 `-------------------------------------------------*/
03301 yyexhaustedlab:
03302   yyerror (YY_("memory exhausted"));
03303   yyresult = 2;
03304   /* Fall through.  */
03305 #endif
03306 
03307 yyreturn:
03308   if (yychar != YYEOF && yychar != YYEMPTY)
03309      yydestruct ("Cleanup: discarding lookahead",
03310          yytoken, &yylval);
03311   /* Do not reclaim the symbols of the rule which action triggered
03312      this YYABORT or YYACCEPT.  */
03313   YYPOPSTACK (yylen);
03314   YY_STACK_PRINT (yyss, yyssp);
03315   while (yyssp != yyss)
03316     {
03317       yydestruct ("Cleanup: popping",
03318           yystos[*yyssp], yyvsp);
03319       YYPOPSTACK (1);
03320     }
03321 #ifndef yyoverflow
03322   if (yyss != yyssa)
03323     YYSTACK_FREE (yyss);
03324 #endif
03325 #if YYERROR_VERBOSE
03326   if (yymsg != yymsgbuf)
03327     YYSTACK_FREE (yymsg);
03328 #endif
03329   return yyresult;
03330 }
03331 
03332 
03333 #line 1265 "sqlparser.y"
03334 
03335 
03336 
03337 const char * const tname(int offset) { return yytname[offset]; }
KDE Home | KDE Accessibility Home | Description of Access Keys