00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #define YYBISON 1
00048
00049
00050 #define YYBISON_VERSION "2.2"
00051
00052
00053 #define YYSKELETON_NAME "yacc.c"
00054
00055
00056 #define YYPURE 0
00057
00058
00059 #define YYLSP_NEEDED 0
00060
00061
00062
00063
00064 #ifndef YYTOKENTYPE
00065 # define YYTOKENTYPE
00066
00067
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 QUERY_PARAMETER = 581,
00393 USING = 582,
00394 VALUE = 583,
00395 VALUES = 584,
00396 VARBINARY = 585,
00397 VARCHAR = 586,
00398 VARYING = 587,
00399 VENDOR = 588,
00400 VIEW = 589,
00401 WEEK = 590,
00402 WHEN = 591,
00403 WHENEVER = 592,
00404 WHERE = 593,
00405 WHERE_CURRENT_OF = 594,
00406 WITH = 595,
00407 WORD_WRAPPED = 596,
00408 WORK = 597,
00409 WRAPPED = 598,
00410 XOR = 599,
00411 YEAR = 600,
00412 YEARS_BETWEEN = 601,
00413 SCAN_ERROR = 602,
00414 __LAST_TOKEN = 603,
00415 ILIKE = 604
00416 };
00417 #endif
00418
00419 #define UMINUS 258
00420 #define SQL_TYPE 259
00421 #define SQL_ABS 260
00422 #define ACOS 261
00423 #define AMPERSAND 262
00424 #define SQL_ABSOLUTE 263
00425 #define ADA 264
00426 #define ADD 265
00427 #define ADD_DAYS 266
00428 #define ADD_HOURS 267
00429 #define ADD_MINUTES 268
00430 #define ADD_MONTHS 269
00431 #define ADD_SECONDS 270
00432 #define ADD_YEARS 271
00433 #define ALL 272
00434 #define ALLOCATE 273
00435 #define ALTER 274
00436 #define AND 275
00437 #define ANY 276
00438 #define ARE 277
00439 #define AS 278
00440 #define ASIN 279
00441 #define ASC 280
00442 #define ASCII 281
00443 #define ASSERTION 282
00444 #define ATAN 283
00445 #define ATAN2 284
00446 #define AUTHORIZATION 285
00447 #define AUTO_INCREMENT 286
00448 #define AVG 287
00449 #define BEFORE 288
00450 #define SQL_BEGIN 289
00451 #define BETWEEN 290
00452 #define BIGINT 291
00453 #define BINARY 292
00454 #define BIT 293
00455 #define BIT_LENGTH 294
00456 #define BITWISE_SHIFT_LEFT 295
00457 #define BITWISE_SHIFT_RIGHT 296
00458 #define BREAK 297
00459 #define BY 298
00460 #define CASCADE 299
00461 #define CASCADED 300
00462 #define CASE 301
00463 #define CAST 302
00464 #define CATALOG 303
00465 #define CEILING 304
00466 #define CENTER 305
00467 #define SQL_CHAR 306
00468 #define CHAR_LENGTH 307
00469 #define CHARACTER_STRING_LITERAL 308
00470 #define CHECK 309
00471 #define CLOSE 310
00472 #define COALESCE 311
00473 #define COBOL 312
00474 #define COLLATE 313
00475 #define COLLATION 314
00476 #define COLUMN 315
00477 #define COMMIT 316
00478 #define COMPUTE 317
00479 #define CONCAT 318
00480 #define CONCATENATION 319
00481 #define CONNECT 320
00482 #define CONNECTION 321
00483 #define CONSTRAINT 322
00484 #define CONSTRAINTS 323
00485 #define CONTINUE 324
00486 #define CONVERT 325
00487 #define CORRESPONDING 326
00488 #define COS 327
00489 #define COT 328
00490 #define COUNT 329
00491 #define CREATE 330
00492 #define CURDATE 331
00493 #define CURRENT 332
00494 #define CURRENT_DATE 333
00495 #define CURRENT_TIME 334
00496 #define CURRENT_TIMESTAMP 335
00497 #define CURTIME 336
00498 #define CURSOR 337
00499 #define DATABASE 338
00500 #define SQL_DATE 339
00501 #define DATE_FORMAT 340
00502 #define DATE_REMAINDER 341
00503 #define DATE_VALUE 342
00504 #define DAY 343
00505 #define DAYOFMONTH 344
00506 #define DAYOFWEEK 345
00507 #define DAYOFYEAR 346
00508 #define DAYS_BETWEEN 347
00509 #define DEALLOCATE 348
00510 #define DEC 349
00511 #define DECLARE 350
00512 #define DEFAULT 351
00513 #define DEFERRABLE 352
00514 #define DEFERRED 353
00515 #define SQL_DELETE 354
00516 #define DESC 355
00517 #define DESCRIBE 356
00518 #define DESCRIPTOR 357
00519 #define DIAGNOSTICS 358
00520 #define DICTIONARY 359
00521 #define DIRECTORY 360
00522 #define DISCONNECT 361
00523 #define DISPLACEMENT 362
00524 #define DISTINCT 363
00525 #define DOMAIN_TOKEN 364
00526 #define SQL_DOUBLE 365
00527 #define DOUBLE_QUOTED_STRING 366
00528 #define DROP 367
00529 #define ELSE 368
00530 #define END 369
00531 #define END_EXEC 370
00532 #define EQUAL 371
00533 #define ESCAPE 372
00534 #define EXCEPT 373
00535 #define SQL_EXCEPTION 374
00536 #define EXEC 375
00537 #define EXECUTE 376
00538 #define EXISTS 377
00539 #define EXP 378
00540 #define EXPONENT 379
00541 #define EXTERNAL 380
00542 #define EXTRACT 381
00543 #define SQL_FALSE 382
00544 #define FETCH 383
00545 #define FIRST 384
00546 #define SQL_FLOAT 385
00547 #define FLOOR 386
00548 #define FN 387
00549 #define FOR 388
00550 #define FOREIGN 389
00551 #define FORTRAN 390
00552 #define FOUND 391
00553 #define FOUR_DIGITS 392
00554 #define FROM 393
00555 #define FULL 394
00556 #define GET 395
00557 #define GLOBAL 396
00558 #define GO 397
00559 #define GOTO 398
00560 #define GRANT 399
00561 #define GREATER_OR_EQUAL 400
00562 #define HAVING 401
00563 #define HOUR 402
00564 #define HOURS_BETWEEN 403
00565 #define IDENTITY 404
00566 #define IFNULL 405
00567 #define SQL_IGNORE 406
00568 #define IMMEDIATE 407
00569 #define SQL_IN 408
00570 #define INCLUDE 409
00571 #define INDEX 410
00572 #define INDICATOR 411
00573 #define INITIALLY 412
00574 #define INNER 413
00575 #define INPUT 414
00576 #define INSENSITIVE 415
00577 #define INSERT 416
00578 #define INTEGER 417
00579 #define INTERSECT 418
00580 #define INTERVAL 419
00581 #define INTO 420
00582 #define IS 421
00583 #define ISOLATION 422
00584 #define JOIN 423
00585 #define JUSTIFY 424
00586 #define KEY 425
00587 #define LANGUAGE 426
00588 #define LAST 427
00589 #define LCASE 428
00590 #define LEFT 429
00591 #define LENGTH 430
00592 #define LESS_OR_EQUAL 431
00593 #define LEVEL 432
00594 #define LIKE 433
00595 #define LINE_WIDTH 434
00596 #define LOCAL 435
00597 #define LOCATE 436
00598 #define LOG 437
00599 #define SQL_LONG 438
00600 #define LOWER 439
00601 #define LTRIM 440
00602 #define LTRIP 441
00603 #define MATCH 442
00604 #define SQL_MAX 443
00605 #define MICROSOFT 444
00606 #define SQL_MIN 445
00607 #define MINUS 446
00608 #define MINUTE 447
00609 #define MINUTES_BETWEEN 448
00610 #define MOD 449
00611 #define MODIFY 450
00612 #define MODULE 451
00613 #define MONTH 452
00614 #define MONTHS_BETWEEN 453
00615 #define MUMPS 454
00616 #define NAMES 455
00617 #define NATIONAL 456
00618 #define NCHAR 457
00619 #define NEXT 458
00620 #define NODUP 459
00621 #define NONE 460
00622 #define NOT 461
00623 #define NOT_EQUAL 462
00624 #define NOT_EQUAL2 463
00625 #define NOW 464
00626 #define SQL_NULL 465
00627 #define SQL_IS 466
00628 #define SQL_IS_NULL 467
00629 #define SQL_IS_NOT_NULL 468
00630 #define NULLIF 469
00631 #define NUMERIC 470
00632 #define OCTET_LENGTH 471
00633 #define ODBC 472
00634 #define OF 473
00635 #define SQL_OFF 474
00636 #define SQL_ON 475
00637 #define ONLY 476
00638 #define OPEN 477
00639 #define OPTION 478
00640 #define OR 479
00641 #define ORDER 480
00642 #define OUTER 481
00643 #define OUTPUT 482
00644 #define OVERLAPS 483
00645 #define PAGE 484
00646 #define PARTIAL 485
00647 #define SQL_PASCAL 486
00648 #define PERSISTENT 487
00649 #define CQL_PI 488
00650 #define PLI 489
00651 #define POSITION 490
00652 #define PRECISION 491
00653 #define PREPARE 492
00654 #define PRESERVE 493
00655 #define PRIMARY 494
00656 #define PRIOR 495
00657 #define PRIVILEGES 496
00658 #define PROCEDURE 497
00659 #define PRODUCT 498
00660 #define PUBLIC 499
00661 #define QUARTER 500
00662 #define QUIT 501
00663 #define RAND 502
00664 #define READ_ONLY 503
00665 #define REAL 504
00666 #define REFERENCES 505
00667 #define REPEAT 506
00668 #define REPLACE 507
00669 #define RESTRICT 508
00670 #define REVOKE 509
00671 #define RIGHT 510
00672 #define ROLLBACK 511
00673 #define ROWS 512
00674 #define RPAD 513
00675 #define RTRIM 514
00676 #define SCHEMA 515
00677 #define SCREEN_WIDTH 516
00678 #define SCROLL 517
00679 #define SECOND 518
00680 #define SECONDS_BETWEEN 519
00681 #define SELECT 520
00682 #define SEQUENCE 521
00683 #define SETOPT 522
00684 #define SET 523
00685 #define SHOWOPT 524
00686 #define SIGN 525
00687 #define SIMILAR_TO 526
00688 #define NOT_SIMILAR_TO 527
00689 #define INTEGER_CONST 528
00690 #define REAL_CONST 529
00691 #define DATE_CONST 530
00692 #define DATETIME_CONST 531
00693 #define TIME_CONST 532
00694 #define SIN 533
00695 #define SQL_SIZE 534
00696 #define SMALLINT 535
00697 #define SOME 536
00698 #define SPACE 537
00699 #define SQL 538
00700 #define SQL_TRUE 539
00701 #define SQLCA 540
00702 #define SQLCODE 541
00703 #define SQLERROR 542
00704 #define SQLSTATE 543
00705 #define SQLWARNING 544
00706 #define SQRT 545
00707 #define STDEV 546
00708 #define SUBSTRING 547
00709 #define SUM 548
00710 #define SYSDATE 549
00711 #define SYSDATE_FORMAT 550
00712 #define SYSTEM 551
00713 #define TABLE 552
00714 #define TAN 553
00715 #define TEMPORARY 554
00716 #define THEN 555
00717 #define THREE_DIGITS 556
00718 #define TIME 557
00719 #define TIMESTAMP 558
00720 #define TIMEZONE_HOUR 559
00721 #define TIMEZONE_MINUTE 560
00722 #define TINYINT 561
00723 #define TO 562
00724 #define TO_CHAR 563
00725 #define TO_DATE 564
00726 #define TRANSACTION 565
00727 #define TRANSLATE 566
00728 #define TRANSLATION 567
00729 #define TRUNCATE 568
00730 #define GENERAL_TITLE 569
00731 #define TWO_DIGITS 570
00732 #define UCASE 571
00733 #define UNION 572
00734 #define UNIQUE 573
00735 #define SQL_UNKNOWN 574
00736 #define UPDATE 575
00737 #define UPPER 576
00738 #define USAGE 577
00739 #define USER 578
00740 #define IDENTIFIER 579
00741 #define IDENTIFIER_DOT_ASTERISK 580
00742 #define QUERY_PARAMETER 581
00743 #define USING 582
00744 #define VALUE 583
00745 #define VALUES 584
00746 #define VARBINARY 585
00747 #define VARCHAR 586
00748 #define VARYING 587
00749 #define VENDOR 588
00750 #define VIEW 589
00751 #define WEEK 590
00752 #define WHEN 591
00753 #define WHENEVER 592
00754 #define WHERE 593
00755 #define WHERE_CURRENT_OF 594
00756 #define WITH 595
00757 #define WORD_WRAPPED 596
00758 #define WORK 597
00759 #define WRAPPED 598
00760 #define XOR 599
00761 #define YEAR 600
00762 #define YEARS_BETWEEN 601
00763 #define SCAN_ERROR 602
00764 #define __LAST_TOKEN 603
00765 #define ILIKE 604
00766
00767
00768
00769
00770
00771 #line 438 "sqlparser.y"
00772
00773 #ifndef YYDEBUG
00774 # define YYDEBUG 0
00775 #endif
00776 #include <stdio.h>
00777 #include <string.h>
00778 #include <string>
00779 #include <iostream>
00780 #include <assert.h>
00781 #include <limits.h>
00782
00783 #ifdef Q_WS_WIN
00784
00785 # undef LLONG_MIN
00786 #endif
00787 #ifndef LLONG_MAX
00788 # define LLONG_MAX 0x7fffffffffffffffLL
00789 #endif
00790 #ifndef LLONG_MIN
00791 # define LLONG_MIN 0x8000000000000000LL
00792 #endif
00793 #ifndef LLONG_MAX
00794 # define ULLONG_MAX 0xffffffffffffffffLL
00795 #endif
00796
00797 #ifdef _WIN32
00798 # include <malloc.h>
00799 #endif
00800
00801 #include <qobject.h>
00802 #include <kdebug.h>
00803 #include <klocale.h>
00804 #include <qptrlist.h>
00805 #include <qcstring.h>
00806 #include <qvariant.h>
00807
00808 #include <connection.h>
00809 #include <queryschema.h>
00810 #include <field.h>
00811 #include <tableschema.h>
00812
00813 #include "parser.h"
00814 #include "parser_p.h"
00815 #include "sqltypes.h"
00816
00817 int yylex();
00818
00819
00820 using namespace KexiDB;
00821
00822 #define YY_NO_UNPUT
00823 #define YYSTACK_USE_ALLOCA 1
00824 #define YYMAXDEPTH 255
00825
00826 extern "C"
00827 {
00828 int yywrap()
00829 {
00830 return 1;
00831 }
00832 }
00833
00834 #if 0
00835 struct yyval
00836 {
00837 QString parserUserName;
00838 int integerValue;
00839 KexiDBField::ColumnType coltype;
00840 }
00841 #endif
00842
00843
00844
00845
00846 #ifndef YYDEBUG
00847 # define YYDEBUG 0
00848 #endif
00849
00850
00851 #ifdef YYERROR_VERBOSE
00852 # undef YYERROR_VERBOSE
00853 # define YYERROR_VERBOSE 1
00854 #else
00855 # define YYERROR_VERBOSE 0
00856 #endif
00857
00858
00859 #ifndef YYTOKEN_TABLE
00860 # define YYTOKEN_TABLE 0
00861 #endif
00862
00863 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00864 typedef union YYSTYPE
00865 #line 511 "sqlparser.y"
00866 {
00867 QString* stringValue;
00868 Q_LLONG integerValue;
00869 bool booleanValue;
00870 struct realType realValue;
00871 KexiDB::Field::Type colType;
00872 KexiDB::Field *field;
00873 KexiDB::BaseExpr *expr;
00874 KexiDB::NArgExpr *exprList;
00875 KexiDB::ConstExpr *constExpr;
00876 KexiDB::QuerySchema *querySchema;
00877 SelectOptionsInternal *selectOptions;
00878 OrderByColumnInternal::List *orderByColumns;
00879 QVariant *variantValue;
00880 }
00881
00882 #line 883 "sqlparser.tab.c"
00883 YYSTYPE;
00884 # define yystype YYSTYPE
00885 # define YYSTYPE_IS_DECLARED 1
00886 # define YYSTYPE_IS_TRIVIAL 1
00887 #endif
00888
00889
00890
00891
00892
00893
00894
00895 #line 896 "sqlparser.tab.c"
00896
00897 #ifdef short
00898 # undef short
00899 #endif
00900
00901 #ifdef YYTYPE_UINT8
00902 typedef YYTYPE_UINT8 yytype_uint8;
00903 #else
00904 typedef unsigned char yytype_uint8;
00905 #endif
00906
00907 #ifdef YYTYPE_INT8
00908 typedef YYTYPE_INT8 yytype_int8;
00909 #elif (defined __STDC__ || defined __C99__FUNC__ \
00910 || defined __cplusplus || defined _MSC_VER)
00911 typedef signed char yytype_int8;
00912 #else
00913 typedef short int yytype_int8;
00914 #endif
00915
00916 #ifdef YYTYPE_UINT16
00917 typedef YYTYPE_UINT16 yytype_uint16;
00918 #else
00919 typedef unsigned short int yytype_uint16;
00920 #endif
00921
00922 #ifdef YYTYPE_INT16
00923 typedef YYTYPE_INT16 yytype_int16;
00924 #else
00925 typedef short int yytype_int16;
00926 #endif
00927
00928 #ifndef YYSIZE_T
00929 # ifdef __SIZE_TYPE__
00930 # define YYSIZE_T __SIZE_TYPE__
00931 # elif defined size_t
00932 # define YYSIZE_T size_t
00933 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00934 || defined __cplusplus || defined _MSC_VER)
00935 # include <stddef.h>
00936 # define YYSIZE_T size_t
00937 # else
00938 # define YYSIZE_T unsigned int
00939 # endif
00940 #endif
00941
00942 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00943
00944 #ifndef YY_
00945 # if YYENABLE_NLS
00946 # if ENABLE_NLS
00947 # include <libintl.h>
00948 # define YY_(msgid) dgettext ("bison-runtime", msgid)
00949 # endif
00950 # endif
00951 # ifndef YY_
00952 # define YY_(msgid) msgid
00953 # endif
00954 #endif
00955
00956
00957 #if ! defined lint || defined __GNUC__
00958 # define YYUSE(e) ((void) (e))
00959 #else
00960 # define YYUSE(e)
00961 #endif
00962
00963
00964 #ifndef lint
00965 # define YYID(n) (n)
00966 #else
00967 #if (defined __STDC__ || defined __C99__FUNC__ \
00968 || defined __cplusplus || defined _MSC_VER)
00969 static int
00970 YYID (int i)
00971 #else
00972 static int
00973 YYID (i)
00974 int i;
00975 #endif
00976 {
00977 return i;
00978 }
00979 #endif
00980
00981 #if ! defined yyoverflow || YYERROR_VERBOSE
00982
00983
00984
00985 # ifdef YYSTACK_USE_ALLOCA
00986 # if YYSTACK_USE_ALLOCA
00987 # ifdef __GNUC__
00988 # define YYSTACK_ALLOC __builtin_alloca
00989 # elif defined __BUILTIN_VA_ARG_INCR
00990 # include <alloca.h>
00991 # elif defined _AIX
00992 # define YYSTACK_ALLOC __alloca
00993 # elif defined _MSC_VER
00994 # include <malloc.h>
00995 # define alloca _alloca
00996 # else
00997 # define YYSTACK_ALLOC alloca
00998 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00999 || defined __cplusplus || defined _MSC_VER)
01000 # include <stdlib.h>
01001 # ifndef _STDLIB_H
01002 # define _STDLIB_H 1
01003 # endif
01004 # endif
01005 # endif
01006 # endif
01007 # endif
01008
01009 # ifdef YYSTACK_ALLOC
01010
01011 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
01012 # ifndef YYSTACK_ALLOC_MAXIMUM
01013
01014
01015
01016
01017 # define YYSTACK_ALLOC_MAXIMUM 4032
01018 # endif
01019 # else
01020 # define YYSTACK_ALLOC YYMALLOC
01021 # define YYSTACK_FREE YYFREE
01022 # ifndef YYSTACK_ALLOC_MAXIMUM
01023 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
01024 # endif
01025 # if (defined __cplusplus && ! defined _STDLIB_H \
01026 && ! ((defined YYMALLOC || defined malloc) \
01027 && (defined YYFREE || defined free)))
01028 # include <stdlib.h>
01029 # ifndef _STDLIB_H
01030 # define _STDLIB_H 1
01031 # endif
01032 # endif
01033 # ifndef YYMALLOC
01034 # define YYMALLOC malloc
01035 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
01036 || defined __cplusplus || defined _MSC_VER)
01037 void *malloc (YYSIZE_T);
01038 # endif
01039 # endif
01040 # ifndef YYFREE
01041 # define YYFREE free
01042 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
01043 || defined __cplusplus || defined _MSC_VER)
01044 void free (void *);
01045 # endif
01046 # endif
01047 # endif
01048 #endif
01049
01050
01051 #if (! defined yyoverflow \
01052 && (! defined __cplusplus \
01053 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
01054
01055
01056 union yyalloc
01057 {
01058 yytype_int16 yyss;
01059 YYSTYPE yyvs;
01060 };
01061
01062
01063 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
01064
01065
01066
01067 # define YYSTACK_BYTES(N) \
01068 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
01069 + YYSTACK_GAP_MAXIMUM)
01070
01071
01072
01073 # ifndef YYCOPY
01074 # if defined __GNUC__ && 1 < __GNUC__
01075 # define YYCOPY(To, From, Count) \
01076 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
01077 # else
01078 # define YYCOPY(To, From, Count) \
01079 do \
01080 { \
01081 YYSIZE_T yyi; \
01082 for (yyi = 0; yyi < (Count); yyi++) \
01083 (To)[yyi] = (From)[yyi]; \
01084 } \
01085 while (YYID (0))
01086 # endif
01087 # endif
01088
01089
01090
01091
01092
01093
01094 # define YYSTACK_RELOCATE(Stack) \
01095 do \
01096 { \
01097 YYSIZE_T yynewbytes; \
01098 YYCOPY (&yyptr->Stack, Stack, yysize); \
01099 Stack = &yyptr->Stack; \
01100 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
01101 yyptr += yynewbytes / sizeof (*yyptr); \
01102 } \
01103 while (YYID (0))
01104
01105 #endif
01106
01107
01108 #define YYFINAL 10
01109
01110 #define YYLAST 335
01111
01112
01113 #define YYNTOKENS 373
01114
01115 #define YYNNTS 37
01116
01117 #define YYNRULES 108
01118
01119 #define YYNSTATES 176
01120
01121
01122 #define YYUNDEFTOK 2
01123 #define YYMAXUTOK 604
01124
01125 #define YYTRANSLATE(YYX) \
01126 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
01127
01128
01129 static const yytype_uint16 yytranslate[] =
01130 {
01131 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01134 2, 2, 2, 2, 2, 2, 357, 352, 370, 361,
01135 358, 359, 351, 350, 355, 349, 356, 362, 2, 2,
01136 2, 2, 2, 2, 2, 2, 2, 2, 2, 354,
01137 364, 363, 365, 360, 353, 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, 368, 2, 369, 367, 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, 371, 2, 372, 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, 2, 2, 2, 2,
01149 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01150 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01151 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01152 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01153 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01154 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01155 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01156 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
01157 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
01158 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
01159 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
01160 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
01161 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
01162 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
01163 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
01164 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
01165 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
01166 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
01167 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
01168 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
01169 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
01170 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
01171 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
01172 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
01173 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
01174 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
01175 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
01176 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
01177 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
01178 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
01179 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
01180 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
01181 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
01182 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
01183 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
01184 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
01185 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
01186 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
01187 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
01188 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
01189 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
01190 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
01191 345, 346, 347, 348, 366
01192 };
01193
01194 #if YYDEBUG
01195
01196
01197 static const yytype_uint16 yyprhs[] =
01198 {
01199 0, 0, 3, 5, 9, 11, 14, 16, 18, 19,
01200 27, 31, 33, 36, 40, 43, 45, 48, 51, 53,
01201 55, 60, 65, 66, 69, 73, 76, 80, 85, 87,
01202 89, 93, 98, 103, 106, 108, 111, 115, 120, 122,
01203 126, 128, 130, 132, 134, 138, 142, 146, 148, 152,
01204 156, 160, 164, 168, 170, 174, 178, 182, 186, 190,
01205 194, 196, 199, 202, 204, 208, 212, 214, 218, 222,
01206 226, 230, 232, 236, 240, 244, 246, 249, 252, 255,
01207 258, 260, 262, 265, 269, 271, 273, 275, 277, 279,
01208 283, 287, 291, 295, 298, 302, 304, 306, 309, 313,
01209 317, 319, 321, 323, 327, 330, 332, 337, 339
01210 };
01211
01212
01213 static const yytype_int16 yyrhs[] =
01214 {
01215 374, 0, -1, 375, -1, 376, 354, 375, -1, 376,
01216 -1, 376, 354, -1, 377, -1, 384, -1, -1, 75,
01217 297, 324, 378, 358, 379, 359, -1, 379, 355, 380,
01218 -1, 380, -1, 324, 383, -1, 324, 383, 381, -1,
01219 381, 382, -1, 382, -1, 239, 170, -1, 206, 210,
01220 -1, 31, -1, 4, -1, 4, 358, 273, 359, -1,
01221 331, 358, 273, 359, -1, -1, 385, 406, -1, 385,
01222 406, 403, -1, 385, 403, -1, 385, 406, 386, -1,
01223 385, 406, 403, 386, -1, 265, -1, 387, -1, 225,
01224 43, 388, -1, 387, 225, 43, 388, -1, 225, 43,
01225 388, 387, -1, 338, 391, -1, 389, -1, 389, 390,
01226 -1, 389, 355, 388, -1, 389, 390, 355, 388, -1,
01227 324, -1, 324, 356, 324, -1, 273, -1, 25, -1,
01228 100, -1, 392, -1, 393, 20, 392, -1, 393, 224,
01229 392, -1, 393, 344, 392, -1, 393, -1, 394, 365,
01230 393, -1, 394, 145, 393, -1, 394, 364, 393, -1,
01231 394, 176, 393, -1, 394, 363, 393, -1, 394, -1,
01232 395, 207, 394, -1, 395, 208, 394, -1, 395, 178,
01233 394, -1, 395, 153, 394, -1, 395, 271, 394, -1,
01234 395, 272, 394, -1, 395, -1, 395, 212, -1, 395,
01235 213, -1, 396, -1, 397, 40, 396, -1, 397, 41,
01236 396, -1, 397, -1, 398, 350, 397, -1, 398, 349,
01237 397, -1, 398, 370, 397, -1, 398, 371, 397, -1,
01238 398, -1, 399, 362, 398, -1, 399, 351, 398, -1,
01239 399, 352, 398, -1, 399, -1, 349, 399, -1, 350,
01240 399, -1, 372, 399, -1, 206, 399, -1, 324, -1,
01241 326, -1, 324, 401, -1, 324, 356, 324, -1, 210,
01242 -1, 53, -1, 273, -1, 274, -1, 400, -1, 358,
01243 391, 359, -1, 358, 402, 359, -1, 391, 355, 402,
01244 -1, 391, 355, 391, -1, 138, 404, -1, 404, 355,
01245 405, -1, 405, -1, 324, -1, 324, 324, -1, 324,
01246 23, 324, -1, 406, 355, 407, -1, 407, -1, 408,
01247 -1, 409, -1, 408, 23, 324, -1, 408, 324, -1,
01248 391, -1, 108, 358, 408, 359, -1, 351, -1, 324,
01249 356, 351, -1
01250 };
01251
01252
01253 static const yytype_uint16 yyrline[] =
01254 {
01255 0, 580, 580, 590, 594, 595, 605, 609, 617, 616,
01256 626, 626, 632, 640, 656, 656, 662, 667, 672, 680,
01257 685, 692, 699, 707, 714, 719, 725, 731, 740, 750,
01258 756, 762, 769, 779, 788, 797, 807, 815, 827, 833,
01259 840, 847, 851, 858, 863, 868, 872, 877, 882, 886,
01260 890, 894, 898, 903, 908, 913, 917, 921, 925, 929,
01261 934, 939, 943, 948, 953, 957, 962, 967, 972, 976,
01262 980, 985, 990, 994, 998, 1003, 1009, 1013, 1017, 1021,
01263 1025, 1033, 1039, 1046, 1053, 1060, 1066, 1083, 1089, 1094,
01264 1102, 1112, 1117, 1126, 1171, 1176, 1184, 1212, 1223, 1239,
01265 1245, 1254, 1263, 1268, 1277, 1289, 1333, 1342, 1351
01266 };
01267 #endif
01268
01269 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
01270
01271
01272 static const char *const yytname[] =
01273 {
01274 "$end", "error", "$undefined", "UMINUS", "SQL_TYPE", "SQL_ABS", "ACOS",
01275 "AMPERSAND", "SQL_ABSOLUTE", "ADA", "ADD", "ADD_DAYS", "ADD_HOURS",
01276 "ADD_MINUTES", "ADD_MONTHS", "ADD_SECONDS", "ADD_YEARS", "ALL",
01277 "ALLOCATE", "ALTER", "AND", "ANY", "ARE", "AS", "ASIN", "ASC", "ASCII",
01278 "ASSERTION", "ATAN", "ATAN2", "AUTHORIZATION", "AUTO_INCREMENT", "AVG",
01279 "BEFORE", "SQL_BEGIN", "BETWEEN", "BIGINT", "BINARY", "BIT",
01280 "BIT_LENGTH", "BITWISE_SHIFT_LEFT", "BITWISE_SHIFT_RIGHT", "BREAK", "BY",
01281 "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CEILING", "CENTER",
01282 "SQL_CHAR", "CHAR_LENGTH", "CHARACTER_STRING_LITERAL", "CHECK", "CLOSE",
01283 "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLUMN", "COMMIT",
01284 "COMPUTE", "CONCAT", "CONCATENATION", "CONNECT", "CONNECTION",
01285 "CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", "CORRESPONDING",
01286 "COS", "COT", "COUNT", "CREATE", "CURDATE", "CURRENT", "CURRENT_DATE",
01287 "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURTIME", "CURSOR", "DATABASE",
01288 "SQL_DATE", "DATE_FORMAT", "DATE_REMAINDER", "DATE_VALUE", "DAY",
01289 "DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DAYS_BETWEEN", "DEALLOCATE",
01290 "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
01291 "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
01292 "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
01293 "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
01294 "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
01295 "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
01296 "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
01297 "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
01298 "GRANT", "GREATER_OR_EQUAL", "HAVING", "HOUR", "HOURS_BETWEEN",
01299 "IDENTITY", "IFNULL", "SQL_IGNORE", "IMMEDIATE", "SQL_IN", "INCLUDE",
01300 "INDEX", "INDICATOR", "INITIALLY", "INNER", "INPUT", "INSENSITIVE",
01301 "INSERT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ISOLATION",
01302 "JOIN", "JUSTIFY", "KEY", "LANGUAGE", "LAST", "LCASE", "LEFT", "LENGTH",
01303 "LESS_OR_EQUAL", "LEVEL", "LIKE", "LINE_WIDTH", "LOCAL", "LOCATE", "LOG",
01304 "SQL_LONG", "LOWER", "LTRIM", "LTRIP", "MATCH", "SQL_MAX", "MICROSOFT",
01305 "SQL_MIN", "MINUS", "MINUTE", "MINUTES_BETWEEN", "MOD", "MODIFY",
01306 "MODULE", "MONTH", "MONTHS_BETWEEN", "MUMPS", "NAMES", "NATIONAL",
01307 "NCHAR", "NEXT", "NODUP", "NONE", "NOT", "NOT_EQUAL", "NOT_EQUAL2",
01308 "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
01309 "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
01310 "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
01311 "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
01312 "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
01313 "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
01314 "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
01315 "ROLLBACK", "ROWS", "RPAD", "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL",
01316 "SECOND", "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET",
01317 "SHOWOPT", "SIGN", "SIMILAR_TO", "NOT_SIMILAR_TO", "INTEGER_CONST",
01318 "REAL_CONST", "DATE_CONST", "DATETIME_CONST", "TIME_CONST", "SIN",
01319 "SQL_SIZE", "SMALLINT", "SOME", "SPACE", "SQL", "SQL_TRUE", "SQLCA",
01320 "SQLCODE", "SQLERROR", "SQLSTATE", "SQLWARNING", "SQRT", "STDEV",
01321 "SUBSTRING", "SUM", "SYSDATE", "SYSDATE_FORMAT", "SYSTEM", "TABLE",
01322 "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
01323 "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
01324 "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
01325 "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
01326 "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
01327 "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
01328 "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
01329 "WHENEVER", "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", "WORK",
01330 "WRAPPED", "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", "__LAST_TOKEN",
01331 "'-'", "'+'", "'*'", "'%'", "'@'", "';'", "','", "'.'", "'$'", "'('",
01332 "')'", "'?'", "'''", "'/'", "'='", "'<'", "'>'", "ILIKE", "'^'", "'['",
01333 "']'", "'&'", "'|'", "'~'", "$accept", "TopLevelStatement",
01334 "StatementList", "Statement", "CreateTableStatement", "@1", "ColDefs",
01335 "ColDef", "ColKeys", "ColKey", "ColType", "SelectStatement", "Select",
01336 "SelectOptions", "WhereClause", "OrderByClause", "OrderByColumnId",
01337 "OrderByOption", "aExpr", "aExpr2", "aExpr3", "aExpr4", "aExpr5",
01338 "aExpr6", "aExpr7", "aExpr8", "aExpr9", "aExpr10", "aExprList",
01339 "aExprList2", "Tables", "FlatTableList", "FlatTable", "ColViews",
01340 "ColItem", "ColExpression", "ColWildCard", 0
01341 };
01342 #endif
01343
01344 # ifdef YYPRINT
01345
01346
01347 static const yytype_uint16 yytoknum[] =
01348 {
01349 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
01350 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
01351 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
01352 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
01353 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
01354 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
01355 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
01356 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
01357 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
01358 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
01359 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
01360 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
01361 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
01362 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
01363 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
01364 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
01365 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
01366 425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
01367 435, 436, 437, 438, 439, 440, 441, 442, 443, 444,
01368 445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
01369 455, 456, 457, 458, 459, 460, 461, 462, 463, 464,
01370 465, 466, 467, 468, 469, 470, 471, 472, 473, 474,
01371 475, 476, 477, 478, 479, 480, 481, 482, 483, 484,
01372 485, 486, 487, 488, 489, 490, 491, 492, 493, 494,
01373 495, 496, 497, 498, 499, 500, 501, 502, 503, 504,
01374 505, 506, 507, 508, 509, 510, 511, 512, 513, 514,
01375 515, 516, 517, 518, 519, 520, 521, 522, 523, 524,
01376 525, 526, 527, 528, 529, 530, 531, 532, 533, 534,
01377 535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
01378 545, 546, 547, 548, 549, 550, 551, 552, 553, 554,
01379 555, 556, 557, 558, 559, 560, 561, 562, 563, 564,
01380 565, 566, 567, 568, 569, 570, 571, 572, 573, 574,
01381 575, 576, 577, 578, 579, 580, 581, 582, 583, 584,
01382 585, 586, 587, 588, 589, 590, 591, 592, 593, 594,
01383 595, 596, 597, 598, 599, 600, 601, 602, 603, 45,
01384 43, 42, 37, 64, 59, 44, 46, 36, 40, 41,
01385 63, 39, 47, 61, 60, 62, 604, 94, 91, 93,
01386 38, 124, 126
01387 };
01388 # endif
01389
01390
01391 static const yytype_uint16 yyr1[] =
01392 {
01393 0, 373, 374, 375, 375, 375, 376, 376, 378, 377,
01394 379, 379, 380, 380, 381, 381, 382, 382, 382, 383,
01395 383, 383, 383, 384, 384, 384, 384, 384, 385, 386,
01396 386, 386, 386, 387, 388, 388, 388, 388, 389, 389,
01397 389, 390, 390, 391, 392, 392, 392, 392, 393, 393,
01398 393, 393, 393, 393, 394, 394, 394, 394, 394, 394,
01399 394, 395, 395, 395, 396, 396, 396, 397, 397, 397,
01400 397, 397, 398, 398, 398, 398, 399, 399, 399, 399,
01401 399, 399, 399, 399, 399, 399, 399, 399, 399, 400,
01402 401, 402, 402, 403, 404, 404, 405, 405, 405, 406,
01403 406, 407, 407, 407, 407, 408, 408, 409, 409
01404 };
01405
01406
01407 static const yytype_uint8 yyr2[] =
01408 {
01409 0, 2, 1, 3, 1, 2, 1, 1, 0, 7,
01410 3, 1, 2, 3, 2, 1, 2, 2, 1, 1,
01411 4, 4, 0, 2, 3, 2, 3, 4, 1, 1,
01412 3, 4, 4, 2, 1, 2, 3, 4, 1, 3,
01413 1, 1, 1, 1, 3, 3, 3, 1, 3, 3,
01414 3, 3, 3, 1, 3, 3, 3, 3, 3, 3,
01415 1, 2, 2, 1, 3, 3, 1, 3, 3, 3,
01416 3, 1, 3, 3, 3, 1, 2, 2, 2, 2,
01417 1, 1, 2, 3, 1, 1, 1, 1, 1, 3,
01418 3, 3, 3, 2, 3, 1, 1, 2, 3, 3,
01419 1, 1, 1, 3, 2, 1, 4, 1, 3
01420 };
01421
01422
01423
01424
01425 static const yytype_uint8 yydefact[] =
01426 {
01427 0, 0, 28, 0, 2, 4, 6, 7, 0, 0,
01428 1, 5, 85, 0, 0, 0, 84, 86, 87, 80,
01429 81, 0, 0, 107, 0, 0, 105, 43, 47, 53,
01430 60, 63, 66, 71, 75, 88, 25, 23, 100, 101,
01431 102, 8, 3, 0, 96, 93, 95, 80, 79, 0,
01432 0, 82, 76, 77, 0, 78, 0, 0, 0, 0,
01433 0, 0, 0, 0, 0, 0, 0, 0, 61, 62,
01434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01435 0, 0, 0, 0, 26, 29, 24, 0, 104, 0,
01436 0, 0, 97, 0, 0, 83, 108, 0, 0, 89,
01437 44, 45, 46, 49, 51, 52, 50, 48, 57, 56,
01438 54, 55, 58, 59, 64, 65, 68, 67, 69, 70,
01439 73, 74, 72, 0, 33, 99, 0, 27, 103, 0,
01440 106, 98, 94, 0, 90, 40, 38, 30, 34, 0,
01441 22, 0, 11, 92, 91, 0, 32, 41, 42, 0,
01442 35, 31, 19, 0, 12, 0, 9, 39, 36, 0,
01443 0, 0, 18, 0, 0, 13, 15, 10, 37, 0,
01444 0, 17, 16, 14, 20, 21
01445 };
01446
01447
01448 static const yytype_int16 yydefgoto[] =
01449 {
01450 -1, 3, 4, 5, 6, 89, 141, 142, 165, 166,
01451 154, 7, 8, 84, 85, 137, 138, 150, 26, 27,
01452 28, 29, 30, 31, 32, 33, 34, 35, 51, 98,
01453 36, 45, 46, 37, 38, 39, 40
01454 };
01455
01456
01457
01458 #define YYPACT_NINF -336
01459 static const yytype_int16 yypact[] =
01460 {
01461 -67, -271, -336, 39, -336, -311, -336, -336, -50, -265,
01462 -336, -67, -336, -298, -262, -37, -336, -336, -336, -335,
01463 -336, -37, -37, -336, -37, -37, -336, -336, -18, -135,
01464 -142, -336, -7, -325, -332, -336, -336, -133, -336, -19,
01465 -336, -336, -336, -40, -9, -291, -336, -318, -336, -309,
01466 -37, -336, -336, -336, -292, -336, -37, -37, -37, -37,
01467 -37, -37, -37, -37, -37, -37, -37, -37, -336, -336,
01468 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
01469 -37, 26, -37, -47, -336, -153, -216, -251, -336, -284,
01470 -273, -237, -336, -262, -231, -336, -336, -260, -263, -336,
01471 -336, -336, -336, -336, -336, -336, -336, -336, -336, -336,
01472 -336, -336, -336, -336, -336, -336, -336, -336, -336, -336,
01473 -336, -336, -336, -261, -336, -336, 51, -336, -336, -227,
01474 -336, -336, -336, -37, -336, -336, -258, -239, -25, -261,
01475 -3, -324, -336, -260, -336, -224, -336, -336, -336, -261,
01476 -254, -336, -256, -255, -24, -227, -336, -336, -336, -261,
01477 -169, -168, -336, -104, -63, -24, -336, -336, -336, -250,
01478 -249, -336, -336, -336, -336, -336
01479 };
01480
01481
01482 static const yytype_int16 yypgoto[] =
01483 {
01484 -336, -336, 97, -336, -336, -336, -336, -44, -336, -53,
01485 -336, -336, -336, 27, -23, -122, -336, -336, -6, -1,
01486 18, -17, -336, -21, 8, 11, 7, -336, -336, -16,
01487 78, -336, 23, -336, 35, 76, -336
01488 };
01489
01490
01491
01492
01493
01494 #define YYTABLE_NINF -1
01495 static const yytype_uint8 yytable[] =
01496 {
01497 147, 152, 56, 12, 87, 14, 12, 162, 1, 81,
01498 59, 64, 135, 12, 91, 95, 12, 151, 54, 78,
01499 79, 49, 48, 50, 74, 75, 9, 158, 52, 53,
01500 80, 155, 55, 72, 73, 156, 65, 168, 94, 10,
01501 50, 60, 96, 11, 97, 76, 77, 108, 109, 110,
01502 111, 114, 115, 112, 113, 100, 101, 102, 13, 41,
01503 43, 13, 44, 136, 93, 66, 67, 99, 13, 123,
01504 68, 69, 126, 128, 129, 148, 124, 103, 104, 105,
01505 106, 107, 116, 117, 118, 119, 130, 131, 14, 120,
01506 121, 122, 81, 95, 139, 133, 134, 140, 145, 82,
01507 157, 159, 160, 161, 169, 170, 171, 172, 42, 174,
01508 175, 167, 173, 127, 146, 86, 132, 144, 125, 90,
01509 0, 0, 82, 0, 0, 0, 0, 143, 0, 70,
01510 71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01511 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01512 0, 0, 0, 0, 0, 0, 15, 0, 0, 15,
01513 16, 0, 0, 16, 0, 0, 15, 0, 0, 15,
01514 16, 0, 0, 16, 0, 0, 0, 0, 0, 0,
01515 0, 0, 163, 0, 0, 0, 0, 0, 0, 0,
01516 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
01517 0, 0, 0, 0, 0, 82, 57, 0, 0, 0,
01518 0, 0, 0, 0, 0, 164, 0, 0, 0, 0,
01519 0, 0, 83, 17, 18, 0, 17, 18, 61, 62,
01520 63, 0, 0, 17, 18, 0, 17, 18, 0, 0,
01521 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01522 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01524 0, 0, 0, 0, 19, 0, 20, 19, 0, 20,
01525 0, 0, 0, 0, 47, 0, 20, 47, 0, 20,
01526 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
01527 22, 23, 21, 22, 23, 88, 0, 0, 24, 21,
01528 22, 24, 21, 22, 0, 92, 0, 0, 24, 0,
01529 0, 24, 25, 0, 0, 25, 58, 0, 153, 0,
01530 149, 0, 25, 0, 0, 25
01531 };
01532
01533 static const yytype_int16 yycheck[] =
01534 {
01535 25, 4, 20, 53, 23, 138, 53, 31, 75, 225,
01536 145, 153, 273, 53, 23, 324, 53, 139, 24, 351,
01537 352, 356, 15, 358, 349, 350, 297, 149, 21, 22,
01538 362, 355, 25, 40, 41, 359, 178, 159, 356, 0,
01539 358, 176, 351, 354, 50, 370, 371, 64, 65, 66,
01540 67, 72, 73, 70, 71, 56, 57, 58, 108, 324,
01541 358, 108, 324, 324, 355, 207, 208, 359, 108, 43,
01542 212, 213, 225, 324, 358, 100, 82, 59, 60, 61,
01543 62, 63, 74, 75, 76, 77, 359, 324, 138, 78,
01544 79, 80, 225, 324, 43, 355, 359, 324, 356, 338,
01545 324, 355, 358, 358, 273, 273, 210, 170, 11, 359,
01546 359, 155, 165, 86, 137, 37, 93, 133, 83, 43,
01547 -1, -1, 338, -1, -1, -1, -1, 133, -1, 271,
01548 272, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01550 -1, -1, -1, -1, -1, -1, 206, -1, -1, 206,
01551 210, -1, -1, 210, -1, -1, 206, -1, -1, 206,
01552 210, -1, -1, 210, -1, -1, -1, -1, -1, -1,
01553 -1, -1, 206, -1, -1, -1, -1, -1, -1, -1,
01554 -1, -1, -1, -1, -1, -1, -1, -1, 265, -1,
01555 -1, -1, -1, -1, -1, 338, 224, -1, -1, -1,
01556 -1, -1, -1, -1, -1, 239, -1, -1, -1, -1,
01557 -1, -1, 355, 273, 274, -1, 273, 274, 363, 364,
01558 365, -1, -1, 273, 274, -1, 273, 274, -1, -1,
01559 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01560 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01561 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01562 -1, -1, -1, -1, 324, -1, 326, 324, -1, 326,
01563 -1, -1, -1, -1, 324, -1, 326, 324, -1, 326,
01564 -1, -1, -1, -1, -1, -1, -1, -1, -1, 349,
01565 350, 351, 349, 350, 351, 324, -1, -1, 358, 349,
01566 350, 358, 349, 350, -1, 324, -1, -1, 358, -1,
01567 -1, 358, 372, -1, -1, 372, 344, -1, 331, -1,
01568 355, -1, 372, -1, -1, 372
01569 };
01570
01571
01572
01573 static const yytype_uint16 yystos[] =
01574 {
01575 0, 75, 265, 374, 375, 376, 377, 384, 385, 297,
01576 0, 354, 53, 108, 138, 206, 210, 273, 274, 324,
01577 326, 349, 350, 351, 358, 372, 391, 392, 393, 394,
01578 395, 396, 397, 398, 399, 400, 403, 406, 407, 408,
01579 409, 324, 375, 358, 324, 404, 405, 324, 399, 356,
01580 358, 401, 399, 399, 391, 399, 20, 224, 344, 145,
01581 176, 363, 364, 365, 153, 178, 207, 208, 212, 213,
01582 271, 272, 40, 41, 349, 350, 370, 371, 351, 352,
01583 362, 225, 338, 355, 386, 387, 403, 23, 324, 378,
01584 408, 23, 324, 355, 356, 324, 351, 391, 402, 359,
01585 392, 392, 392, 393, 393, 393, 393, 393, 394, 394,
01586 394, 394, 394, 394, 396, 396, 397, 397, 397, 397,
01587 398, 398, 398, 43, 391, 407, 225, 386, 324, 358,
01588 359, 324, 405, 355, 359, 273, 324, 388, 389, 43,
01589 324, 379, 380, 391, 402, 356, 387, 25, 100, 355,
01590 390, 388, 4, 331, 383, 355, 359, 324, 388, 355,
01591 358, 358, 31, 206, 239, 381, 382, 380, 388, 273,
01592 273, 210, 170, 382, 359, 359
01593 };
01594
01595 #define yyerrok (yyerrstatus = 0)
01596 #define yyclearin (yychar = YYEMPTY)
01597 #define YYEMPTY (-2)
01598 #define YYEOF 0
01599
01600 #define YYACCEPT goto yyacceptlab
01601 #define YYABORT goto yyabortlab
01602 #define YYERROR goto yyerrorlab
01603
01604
01605
01606
01607
01608
01609 #define YYFAIL goto yyerrlab
01610
01611 #define YYRECOVERING() (!!yyerrstatus)
01612
01613 #define YYBACKUP(Token, Value) \
01614 do \
01615 if (yychar == YYEMPTY && yylen == 1) \
01616 { \
01617 yychar = (Token); \
01618 yylval = (Value); \
01619 yytoken = YYTRANSLATE (yychar); \
01620 YYPOPSTACK (1); \
01621 goto yybackup; \
01622 } \
01623 else \
01624 { \
01625 yyerror (YY_("syntax error: cannot back up")); \
01626 YYERROR; \
01627 } \
01628 while (YYID (0))
01629
01630
01631 #define YYTERROR 1
01632 #define YYERRCODE 256
01633
01634
01635
01636
01637
01638
01639 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
01640 #ifndef YYLLOC_DEFAULT
01641 # define YYLLOC_DEFAULT(Current, Rhs, N) \
01642 do \
01643 if (YYID (N)) \
01644 { \
01645 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
01646 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
01647 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
01648 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
01649 } \
01650 else \
01651 { \
01652 (Current).first_line = (Current).last_line = \
01653 YYRHSLOC (Rhs, 0).last_line; \
01654 (Current).first_column = (Current).last_column = \
01655 YYRHSLOC (Rhs, 0).last_column; \
01656 } \
01657 while (YYID (0))
01658 #endif
01659
01660
01661
01662
01663
01664
01665 #ifndef YY_LOCATION_PRINT
01666 # if YYLTYPE_IS_TRIVIAL
01667 # define YY_LOCATION_PRINT(File, Loc) \
01668 fprintf (File, "%d.%d-%d.%d", \
01669 (Loc).first_line, (Loc).first_column, \
01670 (Loc).last_line, (Loc).last_column)
01671 # else
01672 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
01673 # endif
01674 #endif
01675
01676
01677
01678
01679 #ifdef YYLEX_PARAM
01680 # define YYLEX yylex (YYLEX_PARAM)
01681 #else
01682 # define YYLEX yylex ()
01683 #endif
01684
01685
01686 #if YYDEBUG
01687
01688 # ifndef YYFPRINTF
01689 # include <stdio.h>
01690 # define YYFPRINTF fprintf
01691 # endif
01692
01693 # define YYDPRINTF(Args) \
01694 do { \
01695 if (yydebug) \
01696 YYFPRINTF Args; \
01697 } while (YYID (0))
01698
01699 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
01700 do { \
01701 if (yydebug) \
01702 { \
01703 YYFPRINTF (stderr, "%s ", Title); \
01704 yy_symbol_print (stderr, \
01705 Type, Value); \
01706 YYFPRINTF (stderr, "\n"); \
01707 } \
01708 } while (YYID (0))
01709
01710
01711
01712
01713
01714
01715
01716 #if (defined __STDC__ || defined __C99__FUNC__ \
01717 || defined __cplusplus || defined _MSC_VER)
01718 static void
01719 yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
01720 #else
01721 static void
01722 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
01723 FILE *yyoutput;
01724 int yytype;
01725 const YYSTYPE * const yyvaluep;
01726 #endif
01727 {
01728 if (!yyvaluep)
01729 return;
01730 # ifdef YYPRINT
01731 if (yytype < YYNTOKENS)
01732 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01733 # else
01734 YYUSE (yyoutput);
01735 # endif
01736 switch (yytype)
01737 {
01738 default:
01739 break;
01740 }
01741 }
01742
01743
01744
01745
01746
01747
01748 #if (defined __STDC__ || defined __C99__FUNC__ \
01749 || defined __cplusplus || defined _MSC_VER)
01750 static void
01751 yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
01752 #else
01753 static void
01754 yy_symbol_print (yyoutput, yytype, yyvaluep)
01755 FILE *yyoutput;
01756 int yytype;
01757 const YYSTYPE * const yyvaluep;
01758 #endif
01759 {
01760 if (yytype < YYNTOKENS)
01761 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01762 else
01763 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01764
01765 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01766 YYFPRINTF (yyoutput, ")");
01767 }
01768
01769
01770
01771
01772
01773
01774 #if (defined __STDC__ || defined __C99__FUNC__ \
01775 || defined __cplusplus || defined _MSC_VER)
01776 static void
01777 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
01778 #else
01779 static void
01780 yy_stack_print (bottom, top)
01781 yytype_int16 *bottom;
01782 yytype_int16 *top;
01783 #endif
01784 {
01785 YYFPRINTF (stderr, "Stack now");
01786 for (; bottom <= top; ++bottom)
01787 YYFPRINTF (stderr, " %d", *bottom);
01788 YYFPRINTF (stderr, "\n");
01789 }
01790
01791 # define YY_STACK_PRINT(Bottom, Top) \
01792 do { \
01793 if (yydebug) \
01794 yy_stack_print ((Bottom), (Top)); \
01795 } while (YYID (0))
01796
01797
01798
01799
01800
01801
01802 #if (defined __STDC__ || defined __C99__FUNC__ \
01803 || defined __cplusplus || defined _MSC_VER)
01804 static void
01805 yy_reduce_print (YYSTYPE *yyvsp,
01806 int yyrule)
01807 #else
01808 static void
01809 yy_reduce_print (yyvsp, yyrule
01810 )
01811 YYSTYPE *yyvsp;
01812
01813 int yyrule;
01814 #endif
01815 {
01816 int yynrhs = yyr2[yyrule];
01817 int yyi;
01818 unsigned long int yylno = yyrline[yyrule];
01819 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01820 yyrule - 1, yylno);
01821
01822 for (yyi = 0; yyi < yynrhs; yyi++)
01823 {
01824 fprintf (stderr, " $%d = ", yyi + 1);
01825 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01826 &(yyvsp[(yyi + 1) - (yynrhs)])
01827 );
01828 fprintf (stderr, "\n");
01829 }
01830 }
01831
01832 # define YY_REDUCE_PRINT(Rule) \
01833 do { \
01834 if (yydebug) \
01835 yy_reduce_print (yyvsp, Rule); \
01836 } while (YYID (0))
01837
01838
01839
01840 int yydebug;
01841 #else
01842 # define YYDPRINTF(Args)
01843 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01844 # define YY_STACK_PRINT(Bottom, Top)
01845 # define YY_REDUCE_PRINT(Rule)
01846 #endif
01847
01848
01849
01850 #ifndef YYINITDEPTH
01851 # define YYINITDEPTH 200
01852 #endif
01853
01854
01855
01856
01857
01858
01859
01860
01861 #ifndef YYMAXDEPTH
01862 # define YYMAXDEPTH 10000
01863 #endif
01864
01865
01866
01867 #if YYERROR_VERBOSE
01868
01869 # ifndef yystrlen
01870 # if defined __GLIBC__ && defined _STRING_H
01871 # define yystrlen strlen
01872 # else
01873
01874 #if (defined __STDC__ || defined __C99__FUNC__ \
01875 || defined __cplusplus || defined _MSC_VER)
01876 static YYSIZE_T
01877 yystrlen (const char *yystr)
01878 #else
01879 static YYSIZE_T
01880 yystrlen (yystr)
01881 const char *yystr;
01882 #endif
01883 {
01884 YYSIZE_T yylen;
01885 for (yylen = 0; yystr[yylen]; yylen++)
01886 continue;
01887 return yylen;
01888 }
01889 # endif
01890 # endif
01891
01892 # ifndef yystpcpy
01893 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01894 # define yystpcpy stpcpy
01895 # else
01896
01897
01898 #if (defined __STDC__ || defined __C99__FUNC__ \
01899 || defined __cplusplus || defined _MSC_VER)
01900 static char *
01901 yystpcpy (char *yydest, const char *yysrc)
01902 #else
01903 static char *
01904 yystpcpy (yydest, yysrc)
01905 char *yydest;
01906 const char *yysrc;
01907 #endif
01908 {
01909 char *yyd = yydest;
01910 const char *yys = yysrc;
01911
01912 while ((*yyd++ = *yys++) != '\0')
01913 continue;
01914
01915 return yyd - 1;
01916 }
01917 # endif
01918 # endif
01919
01920 # ifndef yytnamerr
01921
01922
01923
01924
01925
01926
01927
01928 static YYSIZE_T
01929 yytnamerr (char *yyres, const char *yystr)
01930 {
01931 if (*yystr == '"')
01932 {
01933 YYSIZE_T yyn = 0;
01934 char const *yyp = yystr;
01935
01936 for (;;)
01937 switch (*++yyp)
01938 {
01939 case '\'':
01940 case ',':
01941 goto do_not_strip_quotes;
01942
01943 case '\\':
01944 if (*++yyp != '\\')
01945 goto do_not_strip_quotes;
01946
01947 default:
01948 if (yyres)
01949 yyres[yyn] = *yyp;
01950 yyn++;
01951 break;
01952
01953 case '"':
01954 if (yyres)
01955 yyres[yyn] = '\0';
01956 return yyn;
01957 }
01958 do_not_strip_quotes: ;
01959 }
01960
01961 if (! yyres)
01962 return yystrlen (yystr);
01963
01964 return yystpcpy (yyres, yystr) - yyres;
01965 }
01966 # endif
01967
01968
01969
01970
01971
01972
01973
01974
01975 static YYSIZE_T
01976 yysyntax_error (char *yyresult, int yystate, int yychar)
01977 {
01978 int yyn = yypact[yystate];
01979
01980 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01981 return 0;
01982 else
01983 {
01984 int yytype = YYTRANSLATE (yychar);
01985 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01986 YYSIZE_T yysize = yysize0;
01987 YYSIZE_T yysize1;
01988 int yysize_overflow = 0;
01989 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01990 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01991 int yyx;
01992
01993 # if 0
01994
01995
01996 YY_("syntax error, unexpected %s");
01997 YY_("syntax error, unexpected %s, expecting %s");
01998 YY_("syntax error, unexpected %s, expecting %s or %s");
01999 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
02000 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
02001 # endif
02002 char *yyfmt;
02003 char const *yyf;
02004 static char const yyunexpected[] = "syntax error, unexpected %s";
02005 static char const yyexpecting[] = ", expecting %s";
02006 static char const yyor[] = " or %s";
02007 char yyformat[sizeof yyunexpected
02008 + sizeof yyexpecting - 1
02009 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
02010 * (sizeof yyor - 1))];
02011 char const *yyprefix = yyexpecting;
02012
02013
02014
02015 int yyxbegin = yyn < 0 ? -yyn : 0;
02016
02017
02018 int yychecklim = YYLAST - yyn + 1;
02019 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
02020 int yycount = 1;
02021
02022 yyarg[0] = yytname[yytype];
02023 yyfmt = yystpcpy (yyformat, yyunexpected);
02024
02025 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
02026 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
02027 {
02028 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
02029 {
02030 yycount = 1;
02031 yysize = yysize0;
02032 yyformat[sizeof yyunexpected - 1] = '\0';
02033 break;
02034 }
02035 yyarg[yycount++] = yytname[yyx];
02036 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
02037 yysize_overflow |= (yysize1 < yysize);
02038 yysize = yysize1;
02039 yyfmt = yystpcpy (yyfmt, yyprefix);
02040 yyprefix = yyor;
02041 }
02042
02043 yyf = YY_(yyformat);
02044 yysize1 = yysize + yystrlen (yyf);
02045 yysize_overflow |= (yysize1 < yysize);
02046 yysize = yysize1;
02047
02048 if (yysize_overflow)
02049 return YYSIZE_MAXIMUM;
02050
02051 if (yyresult)
02052 {
02053
02054
02055
02056 char *yyp = yyresult;
02057 int yyi = 0;
02058 while ((*yyp = *yyf) != '\0')
02059 {
02060 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
02061 {
02062 yyp += yytnamerr (yyp, yyarg[yyi++]);
02063 yyf += 2;
02064 }
02065 else
02066 {
02067 yyp++;
02068 yyf++;
02069 }
02070 }
02071 }
02072 return yysize;
02073 }
02074 }
02075 #endif
02076
02077
02078
02079
02080
02081
02082
02083 #if (defined __STDC__ || defined __C99__FUNC__ \
02084 || defined __cplusplus || defined _MSC_VER)
02085 static void
02086 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
02087 #else
02088 static void
02089 yydestruct (yymsg, yytype, yyvaluep)
02090 const char *yymsg;
02091 int yytype;
02092 YYSTYPE *yyvaluep;
02093 #endif
02094 {
02095 YYUSE (yyvaluep);
02096
02097 if (!yymsg)
02098 yymsg = "Deleting";
02099 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
02100
02101 switch (yytype)
02102 {
02103
02104 default:
02105 break;
02106 }
02107 }
02108
02109
02110
02111
02112 #ifdef YYPARSE_PARAM
02113 #if defined __STDC__ || defined __cplusplus
02114 int yyparse (void *YYPARSE_PARAM);
02115 #else
02116 int yyparse ();
02117 #endif
02118 #else
02119 #if defined __STDC__ || defined __cplusplus
02120 int yyparse (void);
02121 #else
02122 int yyparse ();
02123 #endif
02124 #endif
02125
02126
02127
02128
02129 int yychar;
02130
02131
02132 YYSTYPE yylval;
02133
02134
02135 int yynerrs;
02136
02137
02138
02139
02140
02141
02142
02143 #ifdef YYPARSE_PARAM
02144 #if (defined __STDC__ || defined __C99__FUNC__ \
02145 || defined __cplusplus || defined _MSC_VER)
02146 int
02147 yyparse (void *YYPARSE_PARAM)
02148 #else
02149 int
02150 yyparse (YYPARSE_PARAM)
02151 void *YYPARSE_PARAM;
02152 #endif
02153 #else
02154 #if (defined __STDC__ || defined __C99__FUNC__ \
02155 || defined __cplusplus || defined _MSC_VER)
02156 int
02157 yyparse (void)
02158 #else
02159 int
02160 yyparse ()
02161
02162 #endif
02163 #endif
02164 {
02165
02166 int yystate;
02167 int yyn;
02168 int yyresult;
02169
02170 int yyerrstatus;
02171
02172 int yytoken = 0;
02173 #if YYERROR_VERBOSE
02174
02175 char yymsgbuf[128];
02176 char *yymsg = yymsgbuf;
02177 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
02178 #endif
02179
02180
02181
02182
02183
02184
02185
02186
02187
02188
02189 yytype_int16 yyssa[YYINITDEPTH];
02190 yytype_int16 *yyss = yyssa;
02191 yytype_int16 *yyssp;
02192
02193
02194 YYSTYPE yyvsa[YYINITDEPTH];
02195 YYSTYPE *yyvs = yyvsa;
02196 YYSTYPE *yyvsp;
02197
02198
02199
02200 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
02201
02202 YYSIZE_T yystacksize = YYINITDEPTH;
02203
02204
02205
02206 YYSTYPE yyval;
02207
02208
02209
02210
02211 int yylen = 0;
02212
02213 YYDPRINTF ((stderr, "Starting parse\n"));
02214
02215 yystate = 0;
02216 yyerrstatus = 0;
02217 yynerrs = 0;
02218 yychar = YYEMPTY;
02219
02220
02221
02222
02223
02224
02225 yyssp = yyss;
02226 yyvsp = yyvs;
02227
02228 goto yysetstate;
02229
02230
02231
02232
02233 yynewstate:
02234
02235
02236 yyssp++;
02237
02238 yysetstate:
02239 *yyssp = yystate;
02240
02241 if (yyss + yystacksize - 1 <= yyssp)
02242 {
02243
02244 YYSIZE_T yysize = yyssp - yyss + 1;
02245
02246 #ifdef yyoverflow
02247 {
02248
02249
02250
02251 YYSTYPE *yyvs1 = yyvs;
02252 yytype_int16 *yyss1 = yyss;
02253
02254
02255
02256
02257
02258
02259 yyoverflow (YY_("memory exhausted"),
02260 &yyss1, yysize * sizeof (*yyssp),
02261 &yyvs1, yysize * sizeof (*yyvsp),
02262
02263 &yystacksize);
02264
02265 yyss = yyss1;
02266 yyvs = yyvs1;
02267 }
02268 #else
02269 # ifndef YYSTACK_RELOCATE
02270 goto yyexhaustedlab;
02271 # else
02272
02273 if (YYMAXDEPTH <= yystacksize)
02274 goto yyexhaustedlab;
02275 yystacksize *= 2;
02276 if (YYMAXDEPTH < yystacksize)
02277 yystacksize = YYMAXDEPTH;
02278
02279 {
02280 yytype_int16 *yyss1 = yyss;
02281 union yyalloc *yyptr =
02282 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
02283 if (! yyptr)
02284 goto yyexhaustedlab;
02285 YYSTACK_RELOCATE (yyss);
02286 YYSTACK_RELOCATE (yyvs);
02287
02288 # undef YYSTACK_RELOCATE
02289 if (yyss1 != yyssa)
02290 YYSTACK_FREE (yyss1);
02291 }
02292 # endif
02293 #endif
02294
02295 yyssp = yyss + yysize - 1;
02296 yyvsp = yyvs + yysize - 1;
02297
02298
02299 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
02300 (unsigned long int) yystacksize));
02301
02302 if (yyss + yystacksize - 1 <= yyssp)
02303 YYABORT;
02304 }
02305
02306 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
02307
02308 goto yybackup;
02309
02310
02311
02312
02313 yybackup:
02314
02315
02316
02317
02318
02319 yyn = yypact[yystate];
02320 if (yyn == YYPACT_NINF)
02321 goto yydefault;
02322
02323
02324
02325
02326 if (yychar == YYEMPTY)
02327 {
02328 YYDPRINTF ((stderr, "Reading a token: "));
02329 yychar = YYLEX;
02330 }
02331
02332 if (yychar <= YYEOF)
02333 {
02334 yychar = yytoken = YYEOF;
02335 YYDPRINTF ((stderr, "Now at end of input.\n"));
02336 }
02337 else
02338 {
02339 yytoken = YYTRANSLATE (yychar);
02340 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
02341 }
02342
02343
02344
02345 yyn += yytoken;
02346 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
02347 goto yydefault;
02348 yyn = yytable[yyn];
02349 if (yyn <= 0)
02350 {
02351 if (yyn == 0 || yyn == YYTABLE_NINF)
02352 goto yyerrlab;
02353 yyn = -yyn;
02354 goto yyreduce;
02355 }
02356
02357 if (yyn == YYFINAL)
02358 YYACCEPT;
02359
02360
02361
02362 if (yyerrstatus)
02363 yyerrstatus--;
02364
02365
02366 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
02367
02368
02369 if (yychar != YYEOF)
02370 yychar = YYEMPTY;
02371
02372 yystate = yyn;
02373 *++yyvsp = yylval;
02374
02375 goto yynewstate;
02376
02377
02378
02379
02380
02381 yydefault:
02382 yyn = yydefact[yystate];
02383 if (yyn == 0)
02384 goto yyerrlab;
02385 goto yyreduce;
02386
02387
02388
02389
02390
02391 yyreduce:
02392
02393 yylen = yyr2[yyn];
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403 yyval = yyvsp[1-yylen];
02404
02405
02406 YY_REDUCE_PRINT (yyn);
02407 switch (yyn)
02408 {
02409 case 2:
02410 #line 581 "sqlparser.y"
02411 {
02412
02413
02414 parser->setOperation(Parser::OP_Select);
02415 parser->setQuerySchema((yyvsp[(1) - (1)].querySchema));
02416 ;}
02417 break;
02418
02419 case 3:
02420 #line 591 "sqlparser.y"
02421 {
02422
02423 ;}
02424 break;
02425
02426 case 5:
02427 #line 596 "sqlparser.y"
02428 {
02429 (yyval.querySchema) = (yyvsp[(1) - (2)].querySchema);
02430 ;}
02431 break;
02432
02433 case 6:
02434 #line 606 "sqlparser.y"
02435 {
02436 YYACCEPT;
02437 ;}
02438 break;
02439
02440 case 7:
02441 #line 610 "sqlparser.y"
02442 {
02443 (yyval.querySchema) = (yyvsp[(1) - (1)].querySchema);
02444 ;}
02445 break;
02446
02447 case 8:
02448 #line 617 "sqlparser.y"
02449 {
02450 parser->setOperation(Parser::OP_CreateTable);
02451 parser->createTable((yyvsp[(3) - (3)].stringValue)->latin1());
02452 delete (yyvsp[(3) - (3)].stringValue);
02453 ;}
02454 break;
02455
02456 case 11:
02457 #line 627 "sqlparser.y"
02458 {
02459 ;}
02460 break;
02461
02462 case 12:
02463 #line 633 "sqlparser.y"
02464 {
02465 KexiDBDbg << "adding field " << *(yyvsp[(1) - (2)].stringValue) << endl;
02466 field->setName((yyvsp[(1) - (2)].stringValue)->latin1());
02467 parser->table()->addField(field);
02468 field = 0;
02469 delete (yyvsp[(1) - (2)].stringValue);
02470 ;}
02471 break;
02472
02473 case 13:
02474 #line 641 "sqlparser.y"
02475 {
02476 KexiDBDbg << "adding field " << *(yyvsp[(1) - (3)].stringValue) << endl;
02477 field->setName(*(yyvsp[(1) - (3)].stringValue));
02478 delete (yyvsp[(1) - (3)].stringValue);
02479 parser->table()->addField(field);
02480
02481
02482
02483
02484
02485
02486 ;}
02487 break;
02488
02489 case 15:
02490 #line 657 "sqlparser.y"
02491 {
02492 ;}
02493 break;
02494
02495 case 16:
02496 #line 663 "sqlparser.y"
02497 {
02498 field->setPrimaryKey(true);
02499 KexiDBDbg << "primary" << endl;
02500 ;}
02501 break;
02502
02503 case 17:
02504 #line 668 "sqlparser.y"
02505 {
02506 field->setNotNull(true);
02507 KexiDBDbg << "not_null" << endl;
02508 ;}
02509 break;
02510
02511 case 18:
02512 #line 673 "sqlparser.y"
02513 {
02514 field->setAutoIncrement(true);
02515 KexiDBDbg << "ainc" << endl;
02516 ;}
02517 break;
02518
02519 case 19:
02520 #line 681 "sqlparser.y"
02521 {
02522 field = new Field();
02523 field->setType((yyvsp[(1) - (1)].colType));
02524 ;}
02525 break;
02526
02527 case 20:
02528 #line 686 "sqlparser.y"
02529 {
02530 KexiDBDbg << "sql + length" << endl;
02531 field = new Field();
02532 field->setPrecision((yyvsp[(3) - (4)].integerValue));
02533 field->setType((yyvsp[(1) - (4)].colType));
02534 ;}
02535 break;
02536
02537 case 21:
02538 #line 693 "sqlparser.y"
02539 {
02540 field = new Field();
02541 field->setPrecision((yyvsp[(3) - (4)].integerValue));
02542 field->setType(Field::Text);
02543 ;}
02544 break;
02545
02546 case 22:
02547 #line 699 "sqlparser.y"
02548 {
02549
02550 field = new Field();
02551 field->setType(Field::InvalidType);
02552 ;}
02553 break;
02554
02555 case 23:
02556 #line 708 "sqlparser.y"
02557 {
02558 KexiDBDbg << "Select ColViews=" << (yyvsp[(2) - (2)].exprList)->debugString() << endl;
02559
02560 if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), (yyvsp[(2) - (2)].exprList) )))
02561 return 0;
02562 ;}
02563 break;
02564
02565 case 24:
02566 #line 715 "sqlparser.y"
02567 {
02568 if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), (yyvsp[(3) - (3)].exprList) )))
02569 return 0;
02570 ;}
02571 break;
02572
02573 case 25:
02574 #line 720 "sqlparser.y"
02575 {
02576 KexiDBDbg << "Select ColViews Tables" << endl;
02577 if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), 0, (yyvsp[(2) - (2)].exprList) )))
02578 return 0;
02579 ;}
02580 break;
02581
02582 case 26:
02583 #line 726 "sqlparser.y"
02584 {
02585 KexiDBDbg << "Select ColViews Conditions" << endl;
02586 if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), 0, (yyvsp[(3) - (3)].selectOptions) )))
02587 return 0;
02588 ;}
02589 break;
02590
02591 case 27:
02592 #line 732 "sqlparser.y"
02593 {
02594 KexiDBDbg << "Select ColViews Tables SelectOptions" << endl;
02595 if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (4)].querySchema), (yyvsp[(2) - (4)].exprList), (yyvsp[(3) - (4)].exprList), (yyvsp[(4) - (4)].selectOptions) )))
02596 return 0;
02597 ;}
02598 break;
02599
02600 case 28:
02601 #line 741 "sqlparser.y"
02602 {
02603 KexiDBDbg << "SELECT" << endl;
02604
02605
02606 (yyval.querySchema) = new QuerySchema();
02607 ;}
02608 break;
02609
02610 case 29:
02611 #line 751 "sqlparser.y"
02612 {
02613 KexiDBDbg << "WhereClause" << endl;
02614 (yyval.selectOptions) = new SelectOptionsInternal;
02615 (yyval.selectOptions)->whereExpr = (yyvsp[(1) - (1)].expr);
02616 ;}
02617 break;
02618
02619 case 30:
02620 #line 757 "sqlparser.y"
02621 {
02622 KexiDBDbg << "OrderByClause" << endl;
02623 (yyval.selectOptions) = new SelectOptionsInternal;
02624 (yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (3)].orderByColumns);
02625 ;}
02626 break;
02627
02628 case 31:
02629 #line 763 "sqlparser.y"
02630 {
02631 KexiDBDbg << "WhereClause ORDER BY OrderByClause" << endl;
02632 (yyval.selectOptions) = new SelectOptionsInternal;
02633 (yyval.selectOptions)->whereExpr = (yyvsp[(1) - (4)].expr);
02634 (yyval.selectOptions)->orderByColumns = (yyvsp[(4) - (4)].orderByColumns);
02635 ;}
02636 break;
02637
02638 case 32:
02639 #line 770 "sqlparser.y"
02640 {
02641 KexiDBDbg << "OrderByClause WhereClause" << endl;
02642 (yyval.selectOptions) = new SelectOptionsInternal;
02643 (yyval.selectOptions)->whereExpr = (yyvsp[(4) - (4)].expr);
02644 (yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (4)].orderByColumns);
02645 ;}
02646 break;
02647
02648 case 33:
02649 #line 780 "sqlparser.y"
02650 {
02651 (yyval.expr) = (yyvsp[(2) - (2)].expr);
02652 ;}
02653 break;
02654
02655 case 34:
02656 #line 789 "sqlparser.y"
02657 {
02658 KexiDBDbg << "ORDER BY IDENTIFIER" << endl;
02659 (yyval.orderByColumns) = new OrderByColumnInternal::List;
02660 OrderByColumnInternal orderByColumn;
02661 orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (1)].variantValue) );
02662 (yyval.orderByColumns)->append( orderByColumn );
02663 delete (yyvsp[(1) - (1)].variantValue);
02664 ;}
02665 break;
02666
02667 case 35:
02668 #line 798 "sqlparser.y"
02669 {
02670 KexiDBDbg << "ORDER BY IDENTIFIER OrderByOption" << endl;
02671 (yyval.orderByColumns) = new OrderByColumnInternal::List;
02672 OrderByColumnInternal orderByColumn;
02673 orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (2)].variantValue) );
02674 orderByColumn.ascending = (yyvsp[(2) - (2)].booleanValue);
02675 (yyval.orderByColumns)->append( orderByColumn );
02676 delete (yyvsp[(1) - (2)].variantValue);
02677 ;}
02678 break;
02679
02680 case 36:
02681 #line 808 "sqlparser.y"
02682 {
02683 (yyval.orderByColumns) = (yyvsp[(3) - (3)].orderByColumns);
02684 OrderByColumnInternal orderByColumn;
02685 orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (3)].variantValue) );
02686 (yyval.orderByColumns)->append( orderByColumn );
02687 delete (yyvsp[(1) - (3)].variantValue);
02688 ;}
02689 break;
02690
02691 case 37:
02692 #line 816 "sqlparser.y"
02693 {
02694 (yyval.orderByColumns) = (yyvsp[(4) - (4)].orderByColumns);
02695 OrderByColumnInternal orderByColumn;
02696 orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (4)].variantValue) );
02697 orderByColumn.ascending = (yyvsp[(2) - (4)].booleanValue);
02698 (yyval.orderByColumns)->append( orderByColumn );
02699 delete (yyvsp[(1) - (4)].variantValue);
02700 ;}
02701 break;
02702
02703 case 38:
02704 #line 828 "sqlparser.y"
02705 {
02706 (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (1)].stringValue) );
02707 KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
02708 delete (yyvsp[(1) - (1)].stringValue);
02709 ;}
02710 break;
02711
02712 case 39:
02713 #line 834 "sqlparser.y"
02714 {
02715 (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
02716 KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
02717 delete (yyvsp[(1) - (3)].stringValue);
02718 delete (yyvsp[(3) - (3)].stringValue);
02719 ;}
02720 break;
02721
02722 case 40:
02723 #line 841 "sqlparser.y"
02724 {
02725 (yyval.variantValue) = new QVariant((yyvsp[(1) - (1)].integerValue));
02726 KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
02727 ;}
02728 break;
02729
02730 case 41:
02731 #line 848 "sqlparser.y"
02732 {
02733 (yyval.booleanValue) = true;
02734 ;}
02735 break;
02736
02737 case 42:
02738 #line 852 "sqlparser.y"
02739 {
02740 (yyval.booleanValue) = false;
02741 ;}
02742 break;
02743
02744 case 44:
02745 #line 864 "sqlparser.y"
02746 {
02747
02748 (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), AND, (yyvsp[(3) - (3)].expr) );
02749 ;}
02750 break;
02751
02752 case 45:
02753 #line 869 "sqlparser.y"
02754 {
02755 (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), OR, (yyvsp[(3) - (3)].expr) );
02756 ;}
02757 break;
02758
02759 case 46:
02760 #line 873 "sqlparser.y"
02761 {
02762 (yyval.expr) = new BinaryExpr( KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), XOR, (yyvsp[(3) - (3)].expr) );
02763 ;}
02764 break;
02765
02766 case 48:
02767 #line 883 "sqlparser.y"
02768 {
02769 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '>', (yyvsp[(3) - (3)].expr));
02770 ;}
02771 break;
02772
02773 case 49:
02774 #line 887 "sqlparser.y"
02775 {
02776 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), GREATER_OR_EQUAL, (yyvsp[(3) - (3)].expr));
02777 ;}
02778 break;
02779
02780 case 50:
02781 #line 891 "sqlparser.y"
02782 {
02783 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '<', (yyvsp[(3) - (3)].expr));
02784 ;}
02785 break;
02786
02787 case 51:
02788 #line 895 "sqlparser.y"
02789 {
02790 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LESS_OR_EQUAL, (yyvsp[(3) - (3)].expr));
02791 ;}
02792 break;
02793
02794 case 52:
02795 #line 899 "sqlparser.y"
02796 {
02797 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '=', (yyvsp[(3) - (3)].expr));
02798 ;}
02799 break;
02800
02801 case 54:
02802 #line 909 "sqlparser.y"
02803 {
02804 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL, (yyvsp[(3) - (3)].expr));
02805 ;}
02806 break;
02807
02808 case 55:
02809 #line 914 "sqlparser.y"
02810 {
02811 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL2, (yyvsp[(3) - (3)].expr));
02812 ;}
02813 break;
02814
02815 case 56:
02816 #line 918 "sqlparser.y"
02817 {
02818 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LIKE, (yyvsp[(3) - (3)].expr));
02819 ;}
02820 break;
02821
02822 case 57:
02823 #line 922 "sqlparser.y"
02824 {
02825 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SQL_IN, (yyvsp[(3) - (3)].expr));
02826 ;}
02827 break;
02828
02829 case 58:
02830 #line 926 "sqlparser.y"
02831 {
02832 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SIMILAR_TO, (yyvsp[(3) - (3)].expr));
02833 ;}
02834 break;
02835
02836 case 59:
02837 #line 930 "sqlparser.y"
02838 {
02839 (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_SIMILAR_TO, (yyvsp[(3) - (3)].expr));
02840 ;}
02841 break;
02842
02843 case 61:
02844 #line 940 "sqlparser.y"
02845 {
02846 (yyval.expr) = new UnaryExpr( SQL_IS_NULL, (yyvsp[(1) - (2)].expr) );
02847 ;}
02848 break;
02849
02850 case 62:
02851 #line 944 "sqlparser.y"
02852 {
02853 (yyval.expr) = new UnaryExpr( SQL_IS_NOT_NULL, (yyvsp[(1) - (2)].expr) );
02854 ;}
02855 break;
02856
02857 case 64:
02858 #line 954 "sqlparser.y"
02859 {
02860 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_LEFT, (yyvsp[(3) - (3)].expr));
02861 ;}
02862 break;
02863
02864 case 65:
02865 #line 958 "sqlparser.y"
02866 {
02867 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_RIGHT, (yyvsp[(3) - (3)].expr));
02868 ;}
02869 break;
02870
02871 case 67:
02872 #line 968 "sqlparser.y"
02873 {
02874 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '+', (yyvsp[(3) - (3)].expr));
02875 (yyval.expr)->debug();
02876 ;}
02877 break;
02878
02879 case 68:
02880 #line 973 "sqlparser.y"
02881 {
02882 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '-', (yyvsp[(3) - (3)].expr));
02883 ;}
02884 break;
02885
02886 case 69:
02887 #line 977 "sqlparser.y"
02888 {
02889 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '&', (yyvsp[(3) - (3)].expr));
02890 ;}
02891 break;
02892
02893 case 70:
02894 #line 981 "sqlparser.y"
02895 {
02896 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '|', (yyvsp[(3) - (3)].expr));
02897 ;}
02898 break;
02899
02900 case 72:
02901 #line 991 "sqlparser.y"
02902 {
02903 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '/', (yyvsp[(3) - (3)].expr));
02904 ;}
02905 break;
02906
02907 case 73:
02908 #line 995 "sqlparser.y"
02909 {
02910 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '*', (yyvsp[(3) - (3)].expr));
02911 ;}
02912 break;
02913
02914 case 74:
02915 #line 999 "sqlparser.y"
02916 {
02917 (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '%', (yyvsp[(3) - (3)].expr));
02918 ;}
02919 break;
02920
02921 case 76:
02922 #line 1010 "sqlparser.y"
02923 {
02924 (yyval.expr) = new UnaryExpr( '-', (yyvsp[(2) - (2)].expr) );
02925 ;}
02926 break;
02927
02928 case 77:
02929 #line 1014 "sqlparser.y"
02930 {
02931 (yyval.expr) = new UnaryExpr( '+', (yyvsp[(2) - (2)].expr) );
02932 ;}
02933 break;
02934
02935 case 78:
02936 #line 1018 "sqlparser.y"
02937 {
02938 (yyval.expr) = new UnaryExpr( '~', (yyvsp[(2) - (2)].expr) );
02939 ;}
02940 break;
02941
02942 case 79:
02943 #line 1022 "sqlparser.y"
02944 {
02945 (yyval.expr) = new UnaryExpr( NOT, (yyvsp[(2) - (2)].expr) );
02946 ;}
02947 break;
02948
02949 case 80:
02950 #line 1026 "sqlparser.y"
02951 {
02952 (yyval.expr) = new VariableExpr( *(yyvsp[(1) - (1)].stringValue) );
02953
02954
02955 KexiDBDbg << " + identifier: " << *(yyvsp[(1) - (1)].stringValue) << endl;
02956 delete (yyvsp[(1) - (1)].stringValue);
02957 ;}
02958 break;
02959
02960 case 81:
02961 #line 1034 "sqlparser.y"
02962 {
02963 (yyval.expr) = new QueryParameterExpr( *(yyvsp[(1) - (1)].stringValue) );
02964 KexiDBDbg << " + query parameter: " << (yyval.expr)->debugString() << endl;
02965 delete (yyvsp[(1) - (1)].stringValue);
02966 ;}
02967 break;
02968
02969 case 82:
02970 #line 1040 "sqlparser.y"
02971 {
02972 KexiDBDbg << " + function: " << *(yyvsp[(1) - (2)].stringValue) << "(" << (yyvsp[(2) - (2)].exprList)->debugString() << ")" << endl;
02973 (yyval.expr) = new FunctionExpr(*(yyvsp[(1) - (2)].stringValue), (yyvsp[(2) - (2)].exprList));
02974 delete (yyvsp[(1) - (2)].stringValue);
02975 ;}
02976 break;
02977
02978 case 83:
02979 #line 1047 "sqlparser.y"
02980 {
02981 (yyval.expr) = new VariableExpr( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
02982 KexiDBDbg << " + identifier.identifier: " << *(yyvsp[(1) - (3)].stringValue) << "." << *(yyvsp[(3) - (3)].stringValue) << endl;
02983 delete (yyvsp[(1) - (3)].stringValue);
02984 delete (yyvsp[(3) - (3)].stringValue);
02985 ;}
02986 break;
02987
02988 case 84:
02989 #line 1054 "sqlparser.y"
02990 {
02991 (yyval.expr) = new ConstExpr( SQL_NULL, QVariant() );
02992 KexiDBDbg << " + NULL" << endl;
02993
02994
02995 ;}
02996 break;
02997
02998 case 85:
02999 #line 1061 "sqlparser.y"
03000 {
03001 (yyval.expr) = new ConstExpr( CHARACTER_STRING_LITERAL, *(yyvsp[(1) - (1)].stringValue) );
03002 KexiDBDbg << " + constant " << (yyvsp[(1) - (1)].stringValue) << endl;
03003 delete (yyvsp[(1) - (1)].stringValue);
03004 ;}
03005 break;
03006
03007 case 86:
03008 #line 1067 "sqlparser.y"
03009 {
03010 QVariant val;
03011 if ((yyvsp[(1) - (1)].integerValue) <= INT_MAX && (yyvsp[(1) - (1)].integerValue) >= INT_MIN)
03012 val = (int)(yyvsp[(1) - (1)].integerValue);
03013 else if ((yyvsp[(1) - (1)].integerValue) <= UINT_MAX && (yyvsp[(1) - (1)].integerValue) >= 0)
03014 val = (uint)(yyvsp[(1) - (1)].integerValue);
03015 else if ((yyvsp[(1) - (1)].integerValue) <= (Q_LLONG)LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= (Q_LLONG)LLONG_MIN)
03016 val = (Q_LLONG)(yyvsp[(1) - (1)].integerValue);
03017
03018
03019
03020
03021
03022 (yyval.expr) = new ConstExpr( INTEGER_CONST, val );
03023 KexiDBDbg << " + int constant: " << val.toString() << endl;
03024 ;}
03025 break;
03026
03027 case 87:
03028 #line 1084 "sqlparser.y"
03029 {
03030 (yyval.expr) = new ConstExpr( REAL_CONST, QPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) );
03031 KexiDBDbg << " + real constant: " << (yyvsp[(1) - (1)].realValue).integer << "." << (yyvsp[(1) - (1)].realValue).fractional << endl;
03032 ;}
03033 break;
03034
03035 case 89:
03036 #line 1095 "sqlparser.y"
03037 {
03038 KexiDBDbg << "(expr)" << endl;
03039 (yyval.expr) = new UnaryExpr('(', (yyvsp[(2) - (3)].expr));
03040 ;}
03041 break;
03042
03043 case 90:
03044 #line 1103 "sqlparser.y"
03045 {
03046
03047
03048
03049 (yyval.exprList) = (yyvsp[(2) - (3)].exprList);
03050 ;}
03051 break;
03052
03053 case 91:
03054 #line 1113 "sqlparser.y"
03055 {
03056 (yyval.exprList) = (yyvsp[(3) - (3)].exprList);
03057 (yyval.exprList)->prepend( (yyvsp[(1) - (3)].expr) );
03058 ;}
03059 break;
03060
03061 case 92:
03062 #line 1118 "sqlparser.y"
03063 {
03064 (yyval.exprList) = new NArgExpr(0, 0);
03065 (yyval.exprList)->add( (yyvsp[(1) - (3)].expr) );
03066 (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
03067 ;}
03068 break;
03069
03070 case 93:
03071 #line 1127 "sqlparser.y"
03072 {
03073 (yyval.exprList) = (yyvsp[(2) - (2)].exprList);
03074 ;}
03075 break;
03076
03077 case 94:
03078 #line 1172 "sqlparser.y"
03079 {
03080 (yyval.exprList) = (yyvsp[(1) - (3)].exprList);
03081 (yyval.exprList)->add((yyvsp[(3) - (3)].expr));
03082 ;}
03083 break;
03084
03085 case 95:
03086 #line 1177 "sqlparser.y"
03087 {
03088 (yyval.exprList) = new NArgExpr(KexiDBExpr_TableList, IDENTIFIER);
03089 (yyval.exprList)->add((yyvsp[(1) - (1)].expr));
03090 ;}
03091 break;
03092
03093 case 96:
03094 #line 1185 "sqlparser.y"
03095 {
03096 KexiDBDbg << "FROM: '" << *(yyvsp[(1) - (1)].stringValue) << "'" << endl;
03097 (yyval.expr) = new VariableExpr(*(yyvsp[(1) - (1)].stringValue));
03098
03099
03100
03101
03102
03103
03104
03105
03106
03107
03108
03109
03110
03111
03112
03113
03114
03115
03116
03117
03118
03119
03120 delete (yyvsp[(1) - (1)].stringValue);
03121 ;}
03122 break;
03123
03124 case 97:
03125 #line 1213 "sqlparser.y"
03126 {
03127
03128 (yyval.expr) = new BinaryExpr(
03129 KexiDBExpr_SpecialBinary,
03130 new VariableExpr(*(yyvsp[(1) - (2)].stringValue)), 0,
03131 new VariableExpr(*(yyvsp[(2) - (2)].stringValue))
03132 );
03133 delete (yyvsp[(1) - (2)].stringValue);
03134 delete (yyvsp[(2) - (2)].stringValue);
03135 ;}
03136 break;
03137
03138 case 98:
03139 #line 1224 "sqlparser.y"
03140 {
03141
03142 (yyval.expr) = new BinaryExpr(
03143 KexiDBExpr_SpecialBinary,
03144 new VariableExpr(*(yyvsp[(1) - (3)].stringValue)), AS,
03145 new VariableExpr(*(yyvsp[(3) - (3)].stringValue))
03146 );
03147 delete (yyvsp[(1) - (3)].stringValue);
03148 delete (yyvsp[(3) - (3)].stringValue);
03149 ;}
03150 break;
03151
03152 case 99:
03153 #line 1240 "sqlparser.y"
03154 {
03155 (yyval.exprList) = (yyvsp[(1) - (3)].exprList);
03156 (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
03157 KexiDBDbg << "ColViews: ColViews , ColItem" << endl;
03158 ;}
03159 break;
03160
03161 case 100:
03162 #line 1246 "sqlparser.y"
03163 {
03164 (yyval.exprList) = new NArgExpr(0,0);
03165 (yyval.exprList)->add( (yyvsp[(1) - (1)].expr) );
03166 KexiDBDbg << "ColViews: ColItem" << endl;
03167 ;}
03168 break;
03169
03170 case 101:
03171 #line 1255 "sqlparser.y"
03172 {
03173
03174
03175
03176
03177 (yyval.expr) = (yyvsp[(1) - (1)].expr);
03178 KexiDBDbg << " added column expr: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'" << endl;
03179 ;}
03180 break;
03181
03182 case 102:
03183 #line 1264 "sqlparser.y"
03184 {
03185 (yyval.expr) = (yyvsp[(1) - (1)].expr);
03186 KexiDBDbg << " added column wildcard: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'" << endl;
03187 ;}
03188 break;
03189
03190 case 103:
03191 #line 1269 "sqlparser.y"
03192 {
03193 (yyval.expr) = new BinaryExpr(
03194 KexiDBExpr_SpecialBinary, (yyvsp[(1) - (3)].expr), AS,
03195 new VariableExpr(*(yyvsp[(3) - (3)].stringValue))
03196 );
03197 KexiDBDbg << " added column expr: " << (yyval.expr)->debugString() << endl;
03198 delete (yyvsp[(3) - (3)].stringValue);
03199 ;}
03200 break;
03201
03202 case 104:
03203 #line 1278 "sqlparser.y"
03204 {
03205 (yyval.expr) = new BinaryExpr(
03206 KexiDBExpr_SpecialBinary, (yyvsp[(1) - (2)].expr), 0,
03207 new VariableExpr(*(yyvsp[(2) - (2)].stringValue))
03208 );
03209 KexiDBDbg << " added column expr: " << (yyval.expr)->debugString() << endl;
03210 delete (yyvsp[(2) - (2)].stringValue);
03211 ;}
03212 break;
03213
03214 case 105:
03215 #line 1290 "sqlparser.y"
03216 {
03217 (yyval.expr) = (yyvsp[(1) - (1)].expr);
03218 ;}
03219 break;
03220
03221 case 106:
03222 #line 1334 "sqlparser.y"
03223 {
03224 (yyval.expr) = (yyvsp[(3) - (4)].expr);
03225
03226
03227 ;}
03228 break;
03229
03230 case 107:
03231 #line 1343 "sqlparser.y"
03232 {
03233 (yyval.expr) = new VariableExpr("*");
03234 KexiDBDbg << "all columns" << endl;
03235
03236
03237
03238
03239 ;}
03240 break;
03241
03242 case 108:
03243 #line 1352 "sqlparser.y"
03244 {
03245 QString s( *(yyvsp[(1) - (3)].stringValue) );
03246 s += ".*";
03247 (yyval.expr) = new VariableExpr(s);
03248 KexiDBDbg << " + all columns from " << s << endl;
03249 delete (yyvsp[(1) - (3)].stringValue);
03250 ;}
03251 break;
03252
03253
03254
03255 #line 3256 "sqlparser.tab.c"
03256 default: break;
03257 }
03258 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
03259
03260 YYPOPSTACK (yylen);
03261 yylen = 0;
03262 YY_STACK_PRINT (yyss, yyssp);
03263
03264 *++yyvsp = yyval;
03265
03266
03267
03268
03269
03270
03271 yyn = yyr1[yyn];
03272
03273 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
03274 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
03275 yystate = yytable[yystate];
03276 else
03277 yystate = yydefgoto[yyn - YYNTOKENS];
03278
03279 goto yynewstate;
03280
03281
03282
03283
03284
03285 yyerrlab:
03286
03287 if (!yyerrstatus)
03288 {
03289 ++yynerrs;
03290 #if ! YYERROR_VERBOSE
03291 yyerror (YY_("syntax error"));
03292 #else
03293 {
03294 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
03295 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
03296 {
03297 YYSIZE_T yyalloc = 2 * yysize;
03298 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
03299 yyalloc = YYSTACK_ALLOC_MAXIMUM;
03300 if (yymsg != yymsgbuf)
03301 YYSTACK_FREE (yymsg);
03302 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
03303 if (yymsg)
03304 yymsg_alloc = yyalloc;
03305 else
03306 {
03307 yymsg = yymsgbuf;
03308 yymsg_alloc = sizeof yymsgbuf;
03309 }
03310 }
03311
03312 if (0 < yysize && yysize <= yymsg_alloc)
03313 {
03314 (void) yysyntax_error (yymsg, yystate, yychar);
03315 yyerror (yymsg);
03316 }
03317 else
03318 {
03319 yyerror (YY_("syntax error"));
03320 if (yysize != 0)
03321 goto yyexhaustedlab;
03322 }
03323 }
03324 #endif
03325 }
03326
03327
03328
03329 if (yyerrstatus == 3)
03330 {
03331
03332
03333
03334 if (yychar <= YYEOF)
03335 {
03336
03337 if (yychar == YYEOF)
03338 YYABORT;
03339 }
03340 else
03341 {
03342 yydestruct ("Error: discarding",
03343 yytoken, &yylval);
03344 yychar = YYEMPTY;
03345 }
03346 }
03347
03348
03349
03350 goto yyerrlab1;
03351
03352
03353
03354
03355
03356 yyerrorlab:
03357
03358
03359
03360
03361 if ( 0)
03362 goto yyerrorlab;
03363
03364
03365
03366 YYPOPSTACK (yylen);
03367 yylen = 0;
03368 YY_STACK_PRINT (yyss, yyssp);
03369 yystate = *yyssp;
03370 goto yyerrlab1;
03371
03372
03373
03374
03375
03376 yyerrlab1:
03377 yyerrstatus = 3;
03378
03379 for (;;)
03380 {
03381 yyn = yypact[yystate];
03382 if (yyn != YYPACT_NINF)
03383 {
03384 yyn += YYTERROR;
03385 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
03386 {
03387 yyn = yytable[yyn];
03388 if (0 < yyn)
03389 break;
03390 }
03391 }
03392
03393
03394 if (yyssp == yyss)
03395 YYABORT;
03396
03397
03398 yydestruct ("Error: popping",
03399 yystos[yystate], yyvsp);
03400 YYPOPSTACK (1);
03401 yystate = *yyssp;
03402 YY_STACK_PRINT (yyss, yyssp);
03403 }
03404
03405 if (yyn == YYFINAL)
03406 YYACCEPT;
03407
03408 *++yyvsp = yylval;
03409
03410
03411
03412 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
03413
03414 yystate = yyn;
03415 goto yynewstate;
03416
03417
03418
03419
03420
03421 yyacceptlab:
03422 yyresult = 0;
03423 goto yyreturn;
03424
03425
03426
03427
03428 yyabortlab:
03429 yyresult = 1;
03430 goto yyreturn;
03431
03432 #ifndef yyoverflow
03433
03434
03435
03436 yyexhaustedlab:
03437 yyerror (YY_("memory exhausted"));
03438 yyresult = 2;
03439
03440 #endif
03441
03442 yyreturn:
03443 if (yychar != YYEOF && yychar != YYEMPTY)
03444 yydestruct ("Cleanup: discarding lookahead",
03445 yytoken, &yylval);
03446
03447
03448 YYPOPSTACK (yylen);
03449 YY_STACK_PRINT (yyss, yyssp);
03450 while (yyssp != yyss)
03451 {
03452 yydestruct ("Cleanup: popping",
03453 yystos[*yyssp], yyvsp);
03454 YYPOPSTACK (1);
03455 }
03456 #ifndef yyoverflow
03457 if (yyss != yyssa)
03458 YYSTACK_FREE (yyss);
03459 #endif
03460 #if YYERROR_VERBOSE
03461 if (yymsg != yymsgbuf)
03462 YYSTACK_FREE (yymsg);
03463 #endif
03464 return yyresult;
03465 }
03466
03467
03468 #line 1367 "sqlparser.y"
03469
03470
03471
03472 const char * const tname(int offset) { return yytname[offset]; }