diff --git a/libs/db/parser/generate_parser_code.sh b/libs/db/parser/generate_parser_code.sh index 8e82425193e0d2d2312e76ed735a5b072ee562ae..343e66e7fcb4e51790db12b8b18662d99af7a239 100755 --- a/libs/db/parser/generate_parser_code.sh +++ b/libs/db/parser/generate_parser_code.sh @@ -7,7 +7,7 @@ flex -osqlscanner.cpp sqlscanner.l bison -dv sqlparser.y echo '#ifndef _SQLPARSER_H_ #define _SQLPARSER_H_ -#include +#include #include "parser.h" #include "sqltypes.h" diff --git a/libs/db/parser/sqlparser.cpp b/libs/db/parser/sqlparser.cpp index a921030f7e01c31792ba9ff0e7187e8e76121ac3..8588b53a755870d13ffb836869640ba7a11e09b8 100644 --- a/libs/db/parser/sqlparser.cpp +++ b/libs/db/parser/sqlparser.cpp @@ -1,30 +1,37 @@ -/* A Bison parser, made by GNU Bison 1.875b. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,724 +43,29 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.5" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 -/* Using locations. */ -#define YYLSP_NEEDED 0 - - +/* Push parsers. */ +#define YYPUSH 0 -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype { - UMINUS = 258, - SQL_TYPE = 259, - SQL_ABS = 260, - ACOS = 261, - AMPERSAND = 262, - SQL_ABSOLUTE = 263, - ADA = 264, - ADD = 265, - ADD_DAYS = 266, - ADD_HOURS = 267, - ADD_MINUTES = 268, - ADD_MONTHS = 269, - ADD_SECONDS = 270, - ADD_YEARS = 271, - ALL = 272, - ALLOCATE = 273, - ALTER = 274, - AND = 275, - ANY = 276, - ARE = 277, - AS = 278, - ASIN = 279, - ASC = 280, - ASCII = 281, - ASSERTION = 282, - ATAN = 283, - ATAN2 = 284, - AUTHORIZATION = 285, - AUTO_INCREMENT = 286, - AVG = 287, - BEFORE = 288, - SQL_BEGIN = 289, - BETWEEN = 290, - BIGINT = 291, - BINARY = 292, - BIT = 293, - BIT_LENGTH = 294, - BITWISE_SHIFT_LEFT = 295, - BITWISE_SHIFT_RIGHT = 296, - BREAK = 297, - BY = 298, - CASCADE = 299, - CASCADED = 300, - CASE = 301, - CAST = 302, - CATALOG = 303, - CEILING = 304, - CENTER = 305, - SQL_CHAR = 306, - CHAR_LENGTH = 307, - CHARACTER_STRING_LITERAL = 308, - CHECK = 309, - CLOSE = 310, - COALESCE = 311, - COBOL = 312, - COLLATE = 313, - COLLATION = 314, - COLUMN = 315, - COMMIT = 316, - COMPUTE = 317, - CONCAT = 318, - CONCATENATION = 319, - CONNECT = 320, - CONNECTION = 321, - CONSTRAINT = 322, - CONSTRAINTS = 323, - CONTINUE = 324, - CONVERT = 325, - CORRESPONDING = 326, - COS = 327, - COT = 328, - COUNT = 329, - CREATE = 330, - CURDATE = 331, - CURRENT = 332, - CURRENT_DATE = 333, - CURRENT_TIME = 334, - CURRENT_TIMESTAMP = 335, - CURTIME = 336, - CURSOR = 337, - DATABASE = 338, - SQL_DATE = 339, - DATE_FORMAT = 340, - DATE_REMAINDER = 341, - DATE_VALUE = 342, - DAY = 343, - DAYOFMONTH = 344, - DAYOFWEEK = 345, - DAYOFYEAR = 346, - DAYS_BETWEEN = 347, - DEALLOCATE = 348, - DEC = 349, - DECLARE = 350, - DEFAULT = 351, - DEFERRABLE = 352, - DEFERRED = 353, - SQL_DELETE = 354, - DESC = 355, - DESCRIBE = 356, - DESCRIPTOR = 357, - DIAGNOSTICS = 358, - DICTIONARY = 359, - DIRECTORY = 360, - DISCONNECT = 361, - DISPLACEMENT = 362, - DISTINCT = 363, - DOMAIN_TOKEN = 364, - SQL_DOUBLE = 365, - DOUBLE_QUOTED_STRING = 366, - DROP = 367, - ELSE = 368, - END = 369, - END_EXEC = 370, - EQUAL = 371, - ESCAPE = 372, - EXCEPT = 373, - SQL_EXCEPTION = 374, - EXEC = 375, - EXECUTE = 376, - EXISTS = 377, - EXP = 378, - EXPONENT = 379, - EXTERNAL = 380, - EXTRACT = 381, - SQL_FALSE = 382, - FETCH = 383, - FIRST = 384, - SQL_FLOAT = 385, - FLOOR = 386, - FN = 387, - FOR = 388, - FOREIGN = 389, - FORTRAN = 390, - FOUND = 391, - FOUR_DIGITS = 392, - FROM = 393, - FULL = 394, - GET = 395, - GLOBAL = 396, - GO = 397, - GOTO = 398, - GRANT = 399, - GREATER_OR_EQUAL = 400, - HAVING = 401, - HOUR = 402, - HOURS_BETWEEN = 403, - IDENTITY = 404, - IFNULL = 405, - SQL_IGNORE = 406, - IMMEDIATE = 407, - SQL_IN = 408, - INCLUDE = 409, - INDEX = 410, - INDICATOR = 411, - INITIALLY = 412, - INNER = 413, - SQL_INPUT = 414, - INSENSITIVE = 415, - INSERT = 416, - INTEGER = 417, - INTERSECT = 418, - INTERVAL = 419, - INTO = 420, - IS = 421, - ISOLATION = 422, - JOIN = 423, - JUSTIFY = 424, - KEY = 425, - LANGUAGE = 426, - LAST = 427, - LCASE = 428, - LEFT = 429, - LENGTH = 430, - LESS_OR_EQUAL = 431, - LEVEL = 432, - LIKE = 433, - LINE_WIDTH = 434, - LOCAL = 435, - LOCATE = 436, - LOG = 437, - SQL_LONG = 438, - LOWER = 439, - LTRIM = 440, - LTRIP = 441, - MATCH = 442, - SQL_MAX = 443, - MICROSOFT = 444, - SQL_MIN = 445, - MINUS = 446, - MINUTE = 447, - MINUTES_BETWEEN = 448, - MOD = 449, - MODIFY = 450, - MODULE = 451, - MONTH = 452, - MONTHS_BETWEEN = 453, - MUMPS = 454, - NAMES = 455, - NATIONAL = 456, - NCHAR = 457, - NEXT = 458, - NODUP = 459, - NONE = 460, - NOT = 461, - NOT_EQUAL = 462, - NOT_EQUAL2 = 463, - NOW = 464, - SQL_NULL = 465, - SQL_IS = 466, - SQL_IS_NULL = 467, - SQL_IS_NOT_NULL = 468, - NULLIF = 469, - NUMERIC = 470, - OCTET_LENGTH = 471, - ODBC = 472, - OF = 473, - SQL_OFF = 474, - SQL_ON = 475, - ONLY = 476, - OPEN = 477, - OPTION = 478, - OR = 479, - ORDER = 480, - OUTER = 481, - OUTPUT = 482, - OVERLAPS = 483, - PAGE = 484, - PARTIAL = 485, - SQL_PASCAL = 486, - PERSISTENT = 487, - CQL_PI = 488, - PLI = 489, - POSITION = 490, - PRECISION = 491, - PREPARE = 492, - PRESERVE = 493, - PRIMARY = 494, - PRIOR = 495, - PRIVILEGES = 496, - PROCEDURE = 497, - PRODUCT = 498, - PUBLIC = 499, - QUARTER = 500, - QUIT = 501, - RAND = 502, - READ_ONLY = 503, - REAL = 504, - REFERENCES = 505, - REPEAT = 506, - REPLACE = 507, - RESTRICT = 508, - REVOKE = 509, - RIGHT = 510, - ROLLBACK = 511, - ROWS = 512, - RPAD = 513, - RTRIM = 514, - SCHEMA = 515, - SCREEN_WIDTH = 516, - SCROLL = 517, - SECOND = 518, - SECONDS_BETWEEN = 519, - SELECT = 520, - SEQUENCE = 521, - SETOPT = 522, - SET = 523, - SHOWOPT = 524, - SIGN = 525, - SIMILAR_TO = 526, - NOT_SIMILAR_TO = 527, - INTEGER_CONST = 528, - REAL_CONST = 529, - DATE_CONST = 530, - DATETIME_CONST = 531, - TIME_CONST = 532, - SIN = 533, - SQL_SIZE = 534, - SMALLINT = 535, - SOME = 536, - SPACE = 537, - SQL = 538, - SQL_TRUE = 539, - SQLCA = 540, - SQLCODE = 541, - SQLERROR = 542, - SQLSTATE = 543, - SQLWARNING = 544, - SQRT = 545, - STDEV = 546, - SUBSTRING = 547, - SUM = 548, - SYSDATE = 549, - SYSDATE_FORMAT = 550, - SYSTEM = 551, - TABLE = 552, - TAN = 553, - TEMPORARY = 554, - THEN = 555, - THREE_DIGITS = 556, - TIME = 557, - TIMESTAMP = 558, - TIMEZONE_HOUR = 559, - TIMEZONE_MINUTE = 560, - TINYINT = 561, - TO = 562, - TO_CHAR = 563, - TO_DATE = 564, - TRANSACTION = 565, - TRANSLATE = 566, - TRANSLATION = 567, - TRUNCATE = 568, - GENERAL_TITLE = 569, - TWO_DIGITS = 570, - UCASE = 571, - UNION = 572, - UNIQUE = 573, - SQL_UNKNOWN = 574, - UPDATE = 575, - UPPER = 576, - USAGE = 577, - USER = 578, - IDENTIFIER = 579, - IDENTIFIER_DOT_ASTERISK = 580, - QUERY_PARAMETER = 581, - USING = 582, - VALUE = 583, - VALUES = 584, - VARBINARY = 585, - VARCHAR = 586, - VARYING = 587, - VENDOR = 588, - VIEW = 589, - WEEK = 590, - WHEN = 591, - WHENEVER = 592, - WHERE = 593, - WHERE_CURRENT_OF = 594, - WITH = 595, - WORD_WRAPPED = 596, - WORK = 597, - WRAPPED = 598, - XOR = 599, - YEAR = 600, - YEARS_BETWEEN = 601, - SCAN_ERROR = 602, - __LAST_TOKEN = 603, - ILIKE = 604 -}; -#endif -#define UMINUS 258 -#define SQL_TYPE 259 -#define SQL_ABS 260 -#define ACOS 261 -#define AMPERSAND 262 -#define SQL_ABSOLUTE 263 -#define ADA 264 -#define ADD 265 -#define ADD_DAYS 266 -#define ADD_HOURS 267 -#define ADD_MINUTES 268 -#define ADD_MONTHS 269 -#define ADD_SECONDS 270 -#define ADD_YEARS 271 -#define ALL 272 -#define ALLOCATE 273 -#define ALTER 274 -#define AND 275 -#define ANY 276 -#define ARE 277 -#define AS 278 -#define ASIN 279 -#define ASC 280 -#define ASCII 281 -#define ASSERTION 282 -#define ATAN 283 -#define ATAN2 284 -#define AUTHORIZATION 285 -#define AUTO_INCREMENT 286 -#define AVG 287 -#define BEFORE 288 -#define SQL_BEGIN 289 -#define BETWEEN 290 -#define BIGINT 291 -#define BINARY 292 -#define BIT 293 -#define BIT_LENGTH 294 -#define BITWISE_SHIFT_LEFT 295 -#define BITWISE_SHIFT_RIGHT 296 -#define BREAK 297 -#define BY 298 -#define CASCADE 299 -#define CASCADED 300 -#define CASE 301 -#define CAST 302 -#define CATALOG 303 -#define CEILING 304 -#define CENTER 305 -#define SQL_CHAR 306 -#define CHAR_LENGTH 307 -#define CHARACTER_STRING_LITERAL 308 -#define CHECK 309 -#define CLOSE 310 -#define COALESCE 311 -#define COBOL 312 -#define COLLATE 313 -#define COLLATION 314 -#define COLUMN 315 -#define COMMIT 316 -#define COMPUTE 317 -#define CONCAT 318 -#define CONCATENATION 319 -#define CONNECT 320 -#define CONNECTION 321 -#define CONSTRAINT 322 -#define CONSTRAINTS 323 -#define CONTINUE 324 -#define CONVERT 325 -#define CORRESPONDING 326 -#define COS 327 -#define COT 328 -#define COUNT 329 -#define CREATE 330 -#define CURDATE 331 -#define CURRENT 332 -#define CURRENT_DATE 333 -#define CURRENT_TIME 334 -#define CURRENT_TIMESTAMP 335 -#define CURTIME 336 -#define CURSOR 337 -#define DATABASE 338 -#define SQL_DATE 339 -#define DATE_FORMAT 340 -#define DATE_REMAINDER 341 -#define DATE_VALUE 342 -#define DAY 343 -#define DAYOFMONTH 344 -#define DAYOFWEEK 345 -#define DAYOFYEAR 346 -#define DAYS_BETWEEN 347 -#define DEALLOCATE 348 -#define DEC 349 -#define DECLARE 350 -#define DEFAULT 351 -#define DEFERRABLE 352 -#define DEFERRED 353 -#define SQL_DELETE 354 -#define DESC 355 -#define DESCRIBE 356 -#define DESCRIPTOR 357 -#define DIAGNOSTICS 358 -#define DICTIONARY 359 -#define DIRECTORY 360 -#define DISCONNECT 361 -#define DISPLACEMENT 362 -#define DISTINCT 363 -#define DOMAIN_TOKEN 364 -#define SQL_DOUBLE 365 -#define DOUBLE_QUOTED_STRING 366 -#define DROP 367 -#define ELSE 368 -#define END 369 -#define END_EXEC 370 -#define EQUAL 371 -#define ESCAPE 372 -#define EXCEPT 373 -#define SQL_EXCEPTION 374 -#define EXEC 375 -#define EXECUTE 376 -#define EXISTS 377 -#define EXP 378 -#define EXPONENT 379 -#define EXTERNAL 380 -#define EXTRACT 381 -#define SQL_FALSE 382 -#define FETCH 383 -#define FIRST 384 -#define SQL_FLOAT 385 -#define FLOOR 386 -#define FN 387 -#define FOR 388 -#define FOREIGN 389 -#define FORTRAN 390 -#define FOUND 391 -#define FOUR_DIGITS 392 -#define FROM 393 -#define FULL 394 -#define GET 395 -#define GLOBAL 396 -#define GO 397 -#define GOTO 398 -#define GRANT 399 -#define GREATER_OR_EQUAL 400 -#define HAVING 401 -#define HOUR 402 -#define HOURS_BETWEEN 403 -#define IDENTITY 404 -#define IFNULL 405 -#define SQL_IGNORE 406 -#define IMMEDIATE 407 -#define SQL_IN 408 -#define INCLUDE 409 -#define INDEX 410 -#define INDICATOR 411 -#define INITIALLY 412 -#define INNER 413 -#define SQL_INPUT 414 -#define INSENSITIVE 415 -#define INSERT 416 -#define INTEGER 417 -#define INTERSECT 418 -#define INTERVAL 419 -#define INTO 420 -#define IS 421 -#define ISOLATION 422 -#define JOIN 423 -#define JUSTIFY 424 -#define KEY 425 -#define LANGUAGE 426 -#define LAST 427 -#define LCASE 428 -#define LEFT 429 -#define LENGTH 430 -#define LESS_OR_EQUAL 431 -#define LEVEL 432 -#define LIKE 433 -#define LINE_WIDTH 434 -#define LOCAL 435 -#define LOCATE 436 -#define LOG 437 -#define SQL_LONG 438 -#define LOWER 439 -#define LTRIM 440 -#define LTRIP 441 -#define MATCH 442 -#define SQL_MAX 443 -#define MICROSOFT 444 -#define SQL_MIN 445 -#define MINUS 446 -#define MINUTE 447 -#define MINUTES_BETWEEN 448 -#define MOD 449 -#define MODIFY 450 -#define MODULE 451 -#define MONTH 452 -#define MONTHS_BETWEEN 453 -#define MUMPS 454 -#define NAMES 455 -#define NATIONAL 456 -#define NCHAR 457 -#define NEXT 458 -#define NODUP 459 -#define NONE 460 -#define NOT 461 -#define NOT_EQUAL 462 -#define NOT_EQUAL2 463 -#define NOW 464 -#define SQL_NULL 465 -#define SQL_IS 466 -#define SQL_IS_NULL 467 -#define SQL_IS_NOT_NULL 468 -#define NULLIF 469 -#define NUMERIC 470 -#define OCTET_LENGTH 471 -#define ODBC 472 -#define OF 473 -#define SQL_OFF 474 -#define SQL_ON 475 -#define ONLY 476 -#define OPEN 477 -#define OPTION 478 -#define OR 479 -#define ORDER 480 -#define OUTER 481 -#define OUTPUT 482 -#define OVERLAPS 483 -#define PAGE 484 -#define PARTIAL 485 -#define SQL_PASCAL 486 -#define PERSISTENT 487 -#define CQL_PI 488 -#define PLI 489 -#define POSITION 490 -#define PRECISION 491 -#define PREPARE 492 -#define PRESERVE 493 -#define PRIMARY 494 -#define PRIOR 495 -#define PRIVILEGES 496 -#define PROCEDURE 497 -#define PRODUCT 498 -#define PUBLIC 499 -#define QUARTER 500 -#define QUIT 501 -#define RAND 502 -#define READ_ONLY 503 -#define REAL 504 -#define REFERENCES 505 -#define REPEAT 506 -#define REPLACE 507 -#define RESTRICT 508 -#define REVOKE 509 -#define RIGHT 510 -#define ROLLBACK 511 -#define ROWS 512 -#define RPAD 513 -#define RTRIM 514 -#define SCHEMA 515 -#define SCREEN_WIDTH 516 -#define SCROLL 517 -#define SECOND 518 -#define SECONDS_BETWEEN 519 -#define SELECT 520 -#define SEQUENCE 521 -#define SETOPT 522 -#define SET 523 -#define SHOWOPT 524 -#define SIGN 525 -#define SIMILAR_TO 526 -#define NOT_SIMILAR_TO 527 -#define INTEGER_CONST 528 -#define REAL_CONST 529 -#define DATE_CONST 530 -#define DATETIME_CONST 531 -#define TIME_CONST 532 -#define SIN 533 -#define SQL_SIZE 534 -#define SMALLINT 535 -#define SOME 536 -#define SPACE 537 -#define SQL 538 -#define SQL_TRUE 539 -#define SQLCA 540 -#define SQLCODE 541 -#define SQLERROR 542 -#define SQLSTATE 543 -#define SQLWARNING 544 -#define SQRT 545 -#define STDEV 546 -#define SUBSTRING 547 -#define SUM 548 -#define SYSDATE 549 -#define SYSDATE_FORMAT 550 -#define SYSTEM 551 -#define TABLE 552 -#define TAN 553 -#define TEMPORARY 554 -#define THEN 555 -#define THREE_DIGITS 556 -#define TIME 557 -#define TIMESTAMP 558 -#define TIMEZONE_HOUR 559 -#define TIMEZONE_MINUTE 560 -#define TINYINT 561 -#define TO 562 -#define TO_CHAR 563 -#define TO_DATE 564 -#define TRANSACTION 565 -#define TRANSLATE 566 -#define TRANSLATION 567 -#define TRUNCATE 568 -#define GENERAL_TITLE 569 -#define TWO_DIGITS 570 -#define UCASE 571 -#define UNION 572 -#define UNIQUE 573 -#define SQL_UNKNOWN 574 -#define UPDATE 575 -#define UPPER 576 -#define USAGE 577 -#define USER 578 -#define IDENTIFIER 579 -#define IDENTIFIER_DOT_ASTERISK 580 -#define QUERY_PARAMETER 581 -#define USING 582 -#define VALUE 583 -#define VALUES 584 -#define VARBINARY 585 -#define VARCHAR 586 -#define VARYING 587 -#define VENDOR 588 -#define VIEW 589 -#define WEEK 590 -#define WHEN 591 -#define WHENEVER 592 -#define WHERE 593 -#define WHERE_CURRENT_OF 594 -#define WITH 595 -#define WORD_WRAPPED 596 -#define WORK 597 -#define WRAPPED 598 -#define XOR 599 -#define YEAR 600 -#define YEARS_BETWEEN 601 -#define SCAN_ERROR 602 -#define __LAST_TOKEN 603 -#define ILIKE 604 +/* Pull parsers. */ +#define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ + +/* Line 268 of yacc.c */ #line 438 "sqlparser.y" #ifndef YYDEBUG /* compat. */ @@ -805,30 +117,35 @@ enum yytokentype { int yylex(); -// using namespace std; +// using namespace std; using namespace KexiDB; #define YY_NO_UNPUT #define YYSTACK_USE_ALLOCA 1 #define YYMAXDEPTH 255 -extern "C" -{ - int yywrap() { - return 1; - } -} + extern "C" + { + int yywrap() + { + return 1; + } + } #if 0 -struct yyval { - QString parserUserName; - int integerValue; - KexiDBField::ColumnType coltype; -} + struct yyval + { + QString parserUserName; + int integerValue; + KexiDBField::ColumnType coltype; + } #endif +/* Line 268 of yacc.c */ +#line 148 "sqlparser.cpp" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -842,78 +159,571 @@ struct yyval { # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 511 "sqlparser.y" -typedef union YYSTYPE { - QString* stringValue; - qint64 integerValue; - bool booleanValue; - struct realType realValue; - KexiDB::Field::Type colType; - KexiDB::Field *field; - KexiDB::BaseExpr *expr; - KexiDB::NArgExpr *exprList; - KexiDB::ConstExpr *constExpr; - KexiDB::QuerySchema *querySchema; - SelectOptionsInternal *selectOptions; - OrderByColumnInternal::List *orderByColumns; - QVariant *variantValue; +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + UMINUS = 258, + SQL_TYPE = 259, + SQL_ABS = 260, + ACOS = 261, + AMPERSAND = 262, + SQL_ABSOLUTE = 263, + ADA = 264, + ADD = 265, + ADD_DAYS = 266, + ADD_HOURS = 267, + ADD_MINUTES = 268, + ADD_MONTHS = 269, + ADD_SECONDS = 270, + ADD_YEARS = 271, + ALL = 272, + ALLOCATE = 273, + ALTER = 274, + AND = 275, + ANY = 276, + ARE = 277, + AS = 278, + ASIN = 279, + ASC = 280, + ASCII = 281, + ASSERTION = 282, + ATAN = 283, + ATAN2 = 284, + AUTHORIZATION = 285, + AUTO_INCREMENT = 286, + AVG = 287, + BEFORE = 288, + SQL_BEGIN = 289, + BETWEEN = 290, + BIGINT = 291, + BINARY = 292, + BIT = 293, + BIT_LENGTH = 294, + BITWISE_SHIFT_LEFT = 295, + BITWISE_SHIFT_RIGHT = 296, + BREAK = 297, + BY = 298, + CASCADE = 299, + CASCADED = 300, + CASE = 301, + CAST = 302, + CATALOG = 303, + CEILING = 304, + CENTER = 305, + SQL_CHAR = 306, + CHAR_LENGTH = 307, + CHARACTER_STRING_LITERAL = 308, + CHECK = 309, + CLOSE = 310, + COALESCE = 311, + COBOL = 312, + COLLATE = 313, + COLLATION = 314, + COLUMN = 315, + COMMIT = 316, + COMPUTE = 317, + CONCAT = 318, + CONCATENATION = 319, + CONNECT = 320, + CONNECTION = 321, + CONSTRAINT = 322, + CONSTRAINTS = 323, + CONTINUE = 324, + CONVERT = 325, + CORRESPONDING = 326, + COS = 327, + COT = 328, + COUNT = 329, + CREATE = 330, + CURDATE = 331, + CURRENT = 332, + CURRENT_DATE = 333, + CURRENT_TIME = 334, + CURRENT_TIMESTAMP = 335, + CURTIME = 336, + CURSOR = 337, + DATABASE = 338, + SQL_DATE = 339, + DATE_FORMAT = 340, + DATE_REMAINDER = 341, + DATE_VALUE = 342, + DAY = 343, + DAYOFMONTH = 344, + DAYOFWEEK = 345, + DAYOFYEAR = 346, + DAYS_BETWEEN = 347, + DEALLOCATE = 348, + DEC = 349, + DECLARE = 350, + DEFAULT = 351, + DEFERRABLE = 352, + DEFERRED = 353, + SQL_DELETE = 354, + DESC = 355, + DESCRIBE = 356, + DESCRIPTOR = 357, + DIAGNOSTICS = 358, + DICTIONARY = 359, + DIRECTORY = 360, + DISCONNECT = 361, + DISPLACEMENT = 362, + DISTINCT = 363, + DOMAIN_TOKEN = 364, + SQL_DOUBLE = 365, + DOUBLE_QUOTED_STRING = 366, + DROP = 367, + ELSE = 368, + END = 369, + END_EXEC = 370, + EQUAL = 371, + ESCAPE = 372, + EXCEPT = 373, + SQL_EXCEPTION = 374, + EXEC = 375, + EXECUTE = 376, + EXISTS = 377, + EXP = 378, + EXPONENT = 379, + EXTERNAL = 380, + EXTRACT = 381, + SQL_FALSE = 382, + FETCH = 383, + FIRST = 384, + SQL_FLOAT = 385, + FLOOR = 386, + FN = 387, + FOR = 388, + FOREIGN = 389, + FORTRAN = 390, + FOUND = 391, + FOUR_DIGITS = 392, + FROM = 393, + FULL = 394, + GET = 395, + GLOBAL = 396, + GO = 397, + GOTO = 398, + GRANT = 399, + GREATER_OR_EQUAL = 400, + HAVING = 401, + HOUR = 402, + HOURS_BETWEEN = 403, + IDENTITY = 404, + IFNULL = 405, + SQL_IGNORE = 406, + IMMEDIATE = 407, + SQL_IN = 408, + INCLUDE = 409, + INDEX = 410, + INDICATOR = 411, + INITIALLY = 412, + INNER = 413, + SQL_INPUT = 414, + INSENSITIVE = 415, + INSERT = 416, + INTEGER = 417, + INTERSECT = 418, + INTERVAL = 419, + INTO = 420, + IS = 421, + ISOLATION = 422, + JOIN = 423, + JUSTIFY = 424, + KEY = 425, + LANGUAGE = 426, + LAST = 427, + LCASE = 428, + LEFT = 429, + LENGTH = 430, + LESS_OR_EQUAL = 431, + LEVEL = 432, + LIKE = 433, + LINE_WIDTH = 434, + LOCAL = 435, + LOCATE = 436, + LOG = 437, + SQL_LONG = 438, + LOWER = 439, + LTRIM = 440, + LTRIP = 441, + MATCH = 442, + SQL_MAX = 443, + MICROSOFT = 444, + SQL_MIN = 445, + MINUS = 446, + MINUTE = 447, + MINUTES_BETWEEN = 448, + MOD = 449, + MODIFY = 450, + MODULE = 451, + MONTH = 452, + MONTHS_BETWEEN = 453, + MUMPS = 454, + NAMES = 455, + NATIONAL = 456, + NCHAR = 457, + NEXT = 458, + NODUP = 459, + NONE = 460, + NOT = 461, + NOT_EQUAL = 462, + NOT_EQUAL2 = 463, + NOW = 464, + SQL_NULL = 465, + SQL_IS = 466, + SQL_IS_NULL = 467, + SQL_IS_NOT_NULL = 468, + NULLIF = 469, + NUMERIC = 470, + OCTET_LENGTH = 471, + ODBC = 472, + OF = 473, + SQL_OFF = 474, + SQL_ON = 475, + ONLY = 476, + OPEN = 477, + OPTION = 478, + OR = 479, + ORDER = 480, + OUTER = 481, + OUTPUT = 482, + OVERLAPS = 483, + PAGE = 484, + PARTIAL = 485, + SQL_PASCAL = 486, + PERSISTENT = 487, + CQL_PI = 488, + PLI = 489, + POSITION = 490, + PRECISION = 491, + PREPARE = 492, + PRESERVE = 493, + PRIMARY = 494, + PRIOR = 495, + PRIVILEGES = 496, + PROCEDURE = 497, + PRODUCT = 498, + PUBLIC = 499, + QUARTER = 500, + QUIT = 501, + RAND = 502, + READ_ONLY = 503, + REAL = 504, + REFERENCES = 505, + REPEAT = 506, + REPLACE = 507, + RESTRICT = 508, + REVOKE = 509, + RIGHT = 510, + ROLLBACK = 511, + ROWS = 512, + RPAD = 513, + RTRIM = 514, + SCHEMA = 515, + SCREEN_WIDTH = 516, + SCROLL = 517, + SECOND = 518, + SECONDS_BETWEEN = 519, + SELECT = 520, + SEQUENCE = 521, + SETOPT = 522, + SET = 523, + SHOWOPT = 524, + SIGN = 525, + SIMILAR_TO = 526, + NOT_SIMILAR_TO = 527, + INTEGER_CONST = 528, + REAL_CONST = 529, + DATE_CONST = 530, + DATETIME_CONST = 531, + TIME_CONST = 532, + SIN = 533, + SQL_SIZE = 534, + SMALLINT = 535, + SOME = 536, + SPACE = 537, + SQL = 538, + SQL_TRUE = 539, + SQLCA = 540, + SQLCODE = 541, + SQLERROR = 542, + SQLSTATE = 543, + SQLWARNING = 544, + SQRT = 545, + STDEV = 546, + SUBSTRING = 547, + SUM = 548, + SYSDATE = 549, + SYSDATE_FORMAT = 550, + SYSTEM = 551, + TABLE = 552, + TAN = 553, + TEMPORARY = 554, + THEN = 555, + THREE_DIGITS = 556, + TIME = 557, + TIMESTAMP = 558, + TIMEZONE_HOUR = 559, + TIMEZONE_MINUTE = 560, + TINYINT = 561, + TO = 562, + TO_CHAR = 563, + TO_DATE = 564, + TRANSACTION = 565, + TRANSLATE = 566, + TRANSLATION = 567, + TRUNCATE = 568, + GENERAL_TITLE = 569, + TWO_DIGITS = 570, + UCASE = 571, + UNION = 572, + UNIQUE = 573, + SQL_UNKNOWN = 574, + UPDATE = 575, + UPPER = 576, + USAGE = 577, + USER = 578, + IDENTIFIER = 579, + IDENTIFIER_DOT_ASTERISK = 580, + QUERY_PARAMETER = 581, + USING = 582, + VALUE = 583, + VALUES = 584, + VARBINARY = 585, + VARCHAR = 586, + VARYING = 587, + VENDOR = 588, + VIEW = 589, + WEEK = 590, + WHEN = 591, + WHENEVER = 592, + WHERE = 593, + WHERE_CURRENT_OF = 594, + WITH = 595, + WORD_WRAPPED = 596, + WORK = 597, + WRAPPED = 598, + XOR = 599, + YEAR = 600, + YEARS_BETWEEN = 601, + SCAN_ERROR = 602, + __LAST_TOKEN = 603, + ILIKE = 604 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 293 of yacc.c */ +#line 514 "sqlparser.y" + + QString* stringValue; + qint64 integerValue; + bool booleanValue; + struct realType realValue; + KexiDB::Field::Type colType; + KexiDB::Field *field; + KexiDB::BaseExpr *expr; + KexiDB::NArgExpr *exprList; + KexiDB::ConstExpr *constExpr; + KexiDB::QuerySchema *querySchema; + SelectOptionsInternal *selectOptions; + OrderByColumnInternal::List *orderByColumns; + QVariant *variantValue; + + + +/* Line 293 of yacc.c */ +#line 551 "sqlparser.cpp" } YYSTYPE; -/* Line 191 of yacc.c. */ -#line 863 "sqlparser.cpp" +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 875 "sqlparser.cpp" +/* Line 343 of yacc.c */ +#line 563 "sqlparser.cpp" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -/* The parser invokes alloca or malloc; define the necessary symbols. */ +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC -/* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ -union yyalloc { - short yyss; - YYSTYPE yyvs; +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ @@ -922,590 +732,623 @@ union yyalloc { /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) -typedef signed char yysigned_char; -#else -typedef short yysigned_char; -#endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 10 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 335 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 373 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 37 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 108 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 176 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 604 -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned short yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 357, 352, 370, 361, - 358, 359, 351, 350, 355, 349, 356, 362, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 354, - 364, 363, 365, 360, 353, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 368, 2, 369, 367, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 371, 2, 372, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 366 +static const yytype_uint16 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 357, 352, 370, 361, + 358, 359, 351, 350, 355, 349, 356, 362, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 354, + 364, 363, 365, 360, 353, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 368, 2, 369, 367, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 371, 2, 372, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 366 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = { - 0, 0, 3, 5, 9, 11, 14, 16, 18, 19, - 27, 31, 33, 36, 40, 43, 45, 48, 51, 53, - 55, 60, 65, 66, 69, 73, 76, 80, 85, 87, - 89, 93, 98, 103, 106, 108, 111, 115, 120, 122, - 126, 128, 130, 132, 134, 138, 142, 146, 148, 152, - 156, 160, 164, 168, 170, 174, 178, 182, 186, 190, - 194, 196, 199, 202, 204, 208, 212, 214, 218, 222, - 226, 230, 232, 236, 240, 244, 246, 249, 252, 255, - 258, 260, 262, 265, 269, 271, 273, 275, 277, 279, - 283, 287, 291, 295, 298, 302, 304, 306, 309, 313, - 317, 319, 321, 323, 327, 330, 332, 337, 339 +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 9, 11, 14, 16, 18, 19, + 27, 31, 33, 36, 40, 43, 45, 48, 51, 53, + 55, 60, 65, 66, 69, 73, 76, 80, 85, 87, + 89, 93, 98, 103, 106, 108, 111, 115, 120, 122, + 126, 128, 130, 132, 134, 138, 142, 146, 148, 152, + 156, 160, 164, 168, 170, 174, 178, 182, 186, 190, + 194, 196, 199, 202, 204, 208, 212, 214, 218, 222, + 226, 230, 232, 236, 240, 244, 246, 249, 252, 255, + 258, 260, 262, 265, 269, 271, 273, 275, 277, 279, + 283, 287, 291, 295, 298, 302, 304, 306, 309, 313, + 317, 319, 321, 323, 327, 330, 332, 337, 339 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = { - 374, 0, -1, 375, -1, 376, 354, 375, -1, 376, - -1, 376, 354, -1, 377, -1, 384, -1, -1, 75, - 297, 324, 378, 358, 379, 359, -1, 379, 355, 380, - -1, 380, -1, 324, 383, -1, 324, 383, 381, -1, - 381, 382, -1, 382, -1, 239, 170, -1, 206, 210, - -1, 31, -1, 4, -1, 4, 358, 273, 359, -1, - 331, 358, 273, 359, -1, -1, 385, 406, -1, 385, - 406, 403, -1, 385, 403, -1, 385, 406, 386, -1, - 385, 406, 403, 386, -1, 265, -1, 387, -1, 225, - 43, 388, -1, 387, 225, 43, 388, -1, 225, 43, - 388, 387, -1, 338, 391, -1, 389, -1, 389, 390, - -1, 389, 355, 388, -1, 389, 390, 355, 388, -1, - 324, -1, 324, 356, 324, -1, 273, -1, 25, -1, - 100, -1, 392, -1, 393, 20, 392, -1, 393, 224, - 392, -1, 393, 344, 392, -1, 393, -1, 394, 365, - 393, -1, 394, 145, 393, -1, 394, 364, 393, -1, - 394, 176, 393, -1, 394, 363, 393, -1, 394, -1, - 395, 207, 394, -1, 395, 208, 394, -1, 395, 178, - 394, -1, 395, 153, 394, -1, 395, 271, 394, -1, - 395, 272, 394, -1, 395, -1, 395, 212, -1, 395, - 213, -1, 396, -1, 397, 40, 396, -1, 397, 41, - 396, -1, 397, -1, 398, 350, 397, -1, 398, 349, - 397, -1, 398, 370, 397, -1, 398, 371, 397, -1, - 398, -1, 399, 362, 398, -1, 399, 351, 398, -1, - 399, 352, 398, -1, 399, -1, 349, 399, -1, 350, - 399, -1, 372, 399, -1, 206, 399, -1, 324, -1, - 326, -1, 324, 401, -1, 324, 356, 324, -1, 210, - -1, 53, -1, 273, -1, 274, -1, 400, -1, 358, - 391, 359, -1, 358, 402, 359, -1, 391, 355, 402, - -1, 391, 355, 391, -1, 138, 404, -1, 404, 355, - 405, -1, 405, -1, 324, -1, 324, 324, -1, 324, - 23, 324, -1, 406, 355, 407, -1, 407, -1, 408, - -1, 409, -1, 408, 23, 324, -1, 408, 324, -1, - 391, -1, 108, 358, 408, 359, -1, 351, -1, 324, - 356, 351, -1 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 374, 0, -1, 375, -1, 376, 354, 375, -1, 376, + -1, 376, 354, -1, 377, -1, 384, -1, -1, 75, + 297, 324, 378, 358, 379, 359, -1, 379, 355, 380, + -1, 380, -1, 324, 383, -1, 324, 383, 381, -1, + 381, 382, -1, 382, -1, 239, 170, -1, 206, 210, + -1, 31, -1, 4, -1, 4, 358, 273, 359, -1, + 331, 358, 273, 359, -1, -1, 385, 406, -1, 385, + 406, 403, -1, 385, 403, -1, 385, 406, 386, -1, + 385, 406, 403, 386, -1, 265, -1, 387, -1, 225, + 43, 388, -1, 387, 225, 43, 388, -1, 225, 43, + 388, 387, -1, 338, 391, -1, 389, -1, 389, 390, + -1, 389, 355, 388, -1, 389, 390, 355, 388, -1, + 324, -1, 324, 356, 324, -1, 273, -1, 25, -1, + 100, -1, 392, -1, 393, 20, 392, -1, 393, 224, + 392, -1, 393, 344, 392, -1, 393, -1, 394, 365, + 393, -1, 394, 145, 393, -1, 394, 364, 393, -1, + 394, 176, 393, -1, 394, 363, 393, -1, 394, -1, + 395, 207, 394, -1, 395, 208, 394, -1, 395, 178, + 394, -1, 395, 153, 394, -1, 395, 271, 394, -1, + 395, 272, 394, -1, 395, -1, 395, 212, -1, 395, + 213, -1, 396, -1, 397, 40, 396, -1, 397, 41, + 396, -1, 397, -1, 398, 350, 397, -1, 398, 349, + 397, -1, 398, 370, 397, -1, 398, 371, 397, -1, + 398, -1, 399, 362, 398, -1, 399, 351, 398, -1, + 399, 352, 398, -1, 399, -1, 349, 399, -1, 350, + 399, -1, 372, 399, -1, 206, 399, -1, 324, -1, + 326, -1, 324, 401, -1, 324, 356, 324, -1, 210, + -1, 53, -1, 273, -1, 274, -1, 400, -1, 358, + 391, 359, -1, 358, 402, 359, -1, 391, 355, 402, + -1, 391, 355, 391, -1, 138, 404, -1, 404, 355, + 405, -1, 405, -1, 324, -1, 324, 324, -1, 324, + 23, 324, -1, 406, 355, 407, -1, 407, -1, 408, + -1, 409, -1, 408, 23, 324, -1, 408, 324, -1, + 391, -1, 108, 358, 408, 359, -1, 351, -1, 324, + 356, 351, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = { - 0, 580, 580, 590, 594, 595, 605, 609, 617, 616, - 626, 626, 632, 640, 656, 656, 662, 667, 672, 680, - 685, 692, 699, 707, 714, 719, 725, 731, 740, 750, - 756, 762, 769, 779, 788, 797, 807, 815, 827, 833, - 840, 847, 851, 858, 863, 868, 872, 877, 882, 886, - 890, 894, 898, 903, 908, 913, 917, 921, 925, 929, - 934, 939, 943, 948, 953, 957, 962, 967, 972, 976, - 980, 985, 990, 994, 998, 1003, 1009, 1013, 1017, 1021, - 1025, 1033, 1039, 1046, 1053, 1060, 1066, 1083, 1089, 1094, - 1102, 1112, 1117, 1126, 1171, 1176, 1184, 1212, 1223, 1239, - 1245, 1254, 1263, 1268, 1277, 1289, 1333, 1342, 1351 +static const yytype_uint16 yyrline[] = +{ + 0, 583, 583, 593, 597, 598, 608, 612, 620, 619, + 629, 629, 635, 643, 659, 659, 665, 670, 675, 683, + 688, 695, 702, 710, 717, 722, 728, 734, 743, 753, + 759, 765, 772, 782, 791, 800, 810, 818, 830, 836, + 843, 850, 854, 861, 866, 871, 875, 880, 885, 889, + 893, 897, 901, 906, 911, 916, 920, 924, 928, 932, + 937, 942, 946, 951, 956, 960, 965, 970, 975, 979, + 983, 988, 993, 997, 1001, 1006, 1012, 1016, 1020, 1024, + 1028, 1036, 1042, 1049, 1056, 1063, 1069, 1086, 1092, 1097, + 1105, 1115, 1120, 1129, 1174, 1179, 1187, 1215, 1226, 1242, + 1248, 1257, 1266, 1271, 1280, 1292, 1336, 1345, 1354 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = { - "$end", "error", "$undefined", "UMINUS", "SQL_TYPE", "SQL_ABS", "ACOS", - "AMPERSAND", "SQL_ABSOLUTE", "ADA", "ADD", "ADD_DAYS", "ADD_HOURS", - "ADD_MINUTES", "ADD_MONTHS", "ADD_SECONDS", "ADD_YEARS", "ALL", - "ALLOCATE", "ALTER", "AND", "ANY", "ARE", "AS", "ASIN", "ASC", "ASCII", - "ASSERTION", "ATAN", "ATAN2", "AUTHORIZATION", "AUTO_INCREMENT", "AVG", - "BEFORE", "SQL_BEGIN", "BETWEEN", "BIGINT", "BINARY", "BIT", - "BIT_LENGTH", "BITWISE_SHIFT_LEFT", "BITWISE_SHIFT_RIGHT", "BREAK", - "BY", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CEILING", - "CENTER", "SQL_CHAR", "CHAR_LENGTH", "CHARACTER_STRING_LITERAL", - "CHECK", "CLOSE", "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLUMN", - "COMMIT", "COMPUTE", "CONCAT", "CONCATENATION", "CONNECT", "CONNECTION", - "CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", "CORRESPONDING", - "COS", "COT", "COUNT", "CREATE", "CURDATE", "CURRENT", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURTIME", "CURSOR", "DATABASE", - "SQL_DATE", "DATE_FORMAT", "DATE_REMAINDER", "DATE_VALUE", "DAY", - "DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DAYS_BETWEEN", "DEALLOCATE", - "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE", - "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY", - "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN", - "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC", - "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE", - "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", - "FETCH", "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", - "FORTRAN", "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", - "GO", "GOTO", "GRANT", "GREATER_OR_EQUAL", "HAVING", "HOUR", - "HOURS_BETWEEN", "IDENTITY", "IFNULL", "SQL_IGNORE", "IMMEDIATE", - "SQL_IN", "INCLUDE", "INDEX", "INDICATOR", "INITIALLY", "INNER", - "SQL_INPUT", "INSENSITIVE", "INSERT", "INTEGER", "INTERSECT", "INTERVAL", - "INTO", "IS", "ISOLATION", "JOIN", "JUSTIFY", "KEY", "LANGUAGE", "LAST", - "LCASE", "LEFT", "LENGTH", "LESS_OR_EQUAL", "LEVEL", "LIKE", - "LINE_WIDTH", "LOCAL", "LOCATE", "LOG", "SQL_LONG", "LOWER", "LTRIM", - "LTRIP", "MATCH", "SQL_MAX", "MICROSOFT", "SQL_MIN", "MINUS", "MINUTE", - "MINUTES_BETWEEN", "MOD", "MODIFY", "MODULE", "MONTH", "MONTHS_BETWEEN", - "MUMPS", "NAMES", "NATIONAL", "NCHAR", "NEXT", "NODUP", "NONE", "NOT", - "NOT_EQUAL", "NOT_EQUAL2", "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", - "SQL_IS_NOT_NULL", "NULLIF", "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", - "SQL_OFF", "SQL_ON", "ONLY", "OPEN", "OPTION", "OR", "ORDER", "OUTER", - "OUTPUT", "OVERLAPS", "PAGE", "PARTIAL", "SQL_PASCAL", "PERSISTENT", - "CQL_PI", "PLI", "POSITION", "PRECISION", "PREPARE", "PRESERVE", - "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURE", "PRODUCT", "PUBLIC", - "QUARTER", "QUIT", "RAND", "READ_ONLY", "REAL", "REFERENCES", "REPEAT", - "REPLACE", "RESTRICT", "REVOKE", "RIGHT", "ROLLBACK", "ROWS", "RPAD", - "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL", "SECOND", - "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET", "SHOWOPT", - "SIGN", "SIMILAR_TO", "NOT_SIMILAR_TO", "INTEGER_CONST", "REAL_CONST", - "DATE_CONST", "DATETIME_CONST", "TIME_CONST", "SIN", "SQL_SIZE", - "SMALLINT", "SOME", "SPACE", "SQL", "SQL_TRUE", "SQLCA", "SQLCODE", - "SQLERROR", "SQLSTATE", "SQLWARNING", "SQRT", "STDEV", "SUBSTRING", - "SUM", "SYSDATE", "SYSDATE_FORMAT", "SYSTEM", "TABLE", "TAN", - "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP", - "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR", - "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE", - "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", - "SQL_UNKNOWN", "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER", - "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", - "VALUES", "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", - "WHEN", "WHENEVER", "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", - "WORK", "WRAPPED", "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", - "__LAST_TOKEN", "'-'", "'+'", "'*'", "'%'", "'@'", "';'", "','", "'.'", - "'$'", "'('", "')'", "'?'", "'''", "'/'", "'='", "'<'", "'>'", "ILIKE", - "'^'", "'['", "']'", "'&'", "'|'", "'~'", "$accept", - "TopLevelStatement", "StatementList", "Statement", - "CreateTableStatement", "@1", "ColDefs", "ColDef", "ColKeys", "ColKey", - "ColType", "SelectStatement", "Select", "SelectOptions", "WhereClause", - "OrderByClause", "OrderByColumnId", "OrderByOption", "aExpr", "aExpr2", - "aExpr3", "aExpr4", "aExpr5", "aExpr6", "aExpr7", "aExpr8", "aExpr9", - "aExpr10", "aExprList", "aExprList2", "Tables", "FlatTableList", - "FlatTable", "ColViews", "ColItem", "ColExpression", "ColWildCard", 0 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "UMINUS", "SQL_TYPE", "SQL_ABS", "ACOS", + "AMPERSAND", "SQL_ABSOLUTE", "ADA", "ADD", "ADD_DAYS", "ADD_HOURS", + "ADD_MINUTES", "ADD_MONTHS", "ADD_SECONDS", "ADD_YEARS", "ALL", + "ALLOCATE", "ALTER", "AND", "ANY", "ARE", "AS", "ASIN", "ASC", "ASCII", + "ASSERTION", "ATAN", "ATAN2", "AUTHORIZATION", "AUTO_INCREMENT", "AVG", + "BEFORE", "SQL_BEGIN", "BETWEEN", "BIGINT", "BINARY", "BIT", + "BIT_LENGTH", "BITWISE_SHIFT_LEFT", "BITWISE_SHIFT_RIGHT", "BREAK", "BY", + "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CEILING", "CENTER", + "SQL_CHAR", "CHAR_LENGTH", "CHARACTER_STRING_LITERAL", "CHECK", "CLOSE", + "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLUMN", "COMMIT", + "COMPUTE", "CONCAT", "CONCATENATION", "CONNECT", "CONNECTION", + "CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", "CORRESPONDING", + "COS", "COT", "COUNT", "CREATE", "CURDATE", "CURRENT", "CURRENT_DATE", + "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURTIME", "CURSOR", "DATABASE", + "SQL_DATE", "DATE_FORMAT", "DATE_REMAINDER", "DATE_VALUE", "DAY", + "DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DAYS_BETWEEN", "DEALLOCATE", + "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE", + "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY", + "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN", + "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC", + "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE", + "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH", + "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN", + "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO", + "GRANT", "GREATER_OR_EQUAL", "HAVING", "HOUR", "HOURS_BETWEEN", + "IDENTITY", "IFNULL", "SQL_IGNORE", "IMMEDIATE", "SQL_IN", "INCLUDE", + "INDEX", "INDICATOR", "INITIALLY", "INNER", "SQL_INPUT", "INSENSITIVE", + "INSERT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ISOLATION", + "JOIN", "JUSTIFY", "KEY", "LANGUAGE", "LAST", "LCASE", "LEFT", "LENGTH", + "LESS_OR_EQUAL", "LEVEL", "LIKE", "LINE_WIDTH", "LOCAL", "LOCATE", "LOG", + "SQL_LONG", "LOWER", "LTRIM", "LTRIP", "MATCH", "SQL_MAX", "MICROSOFT", + "SQL_MIN", "MINUS", "MINUTE", "MINUTES_BETWEEN", "MOD", "MODIFY", + "MODULE", "MONTH", "MONTHS_BETWEEN", "MUMPS", "NAMES", "NATIONAL", + "NCHAR", "NEXT", "NODUP", "NONE", "NOT", "NOT_EQUAL", "NOT_EQUAL2", + "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF", + "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY", + "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE", + "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION", + "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES", + "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY", + "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT", + "ROLLBACK", "ROWS", "RPAD", "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL", + "SECOND", "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET", + "SHOWOPT", "SIGN", "SIMILAR_TO", "NOT_SIMILAR_TO", "INTEGER_CONST", + "REAL_CONST", "DATE_CONST", "DATETIME_CONST", "TIME_CONST", "SIN", + "SQL_SIZE", "SMALLINT", "SOME", "SPACE", "SQL", "SQL_TRUE", "SQLCA", + "SQLCODE", "SQLERROR", "SQLSTATE", "SQLWARNING", "SQRT", "STDEV", + "SUBSTRING", "SUM", "SYSDATE", "SYSDATE_FORMAT", "SYSTEM", "TABLE", + "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP", + "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR", + "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE", + "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN", + "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER", + "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES", + "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN", + "WHENEVER", "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", "WORK", + "WRAPPED", "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", "__LAST_TOKEN", + "'-'", "'+'", "'*'", "'%'", "'@'", "';'", "','", "'.'", "'$'", "'('", + "')'", "'?'", "'\\''", "'/'", "'='", "'<'", "'>'", "ILIKE", "'^'", "'['", + "']'", "'&'", "'|'", "'~'", "$accept", "TopLevelStatement", + "StatementList", "Statement", "CreateTableStatement", "$@1", "ColDefs", + "ColDef", "ColKeys", "ColKey", "ColType", "SelectStatement", "Select", + "SelectOptions", "WhereClause", "OrderByClause", "OrderByColumnId", + "OrderByOption", "aExpr", "aExpr2", "aExpr3", "aExpr4", "aExpr5", + "aExpr6", "aExpr7", "aExpr8", "aExpr9", "aExpr10", "aExprList", + "aExprList2", "Tables", "FlatTableList", "FlatTable", "ColViews", + "ColItem", "ColExpression", "ColWildCard", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, - 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, - 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 45, - 43, 42, 37, 64, 59, 44, 46, 36, 40, 41, - 63, 39, 47, 61, 60, 62, 604, 94, 91, 93, - 38, 124, 126 +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 45, + 43, 42, 37, 64, 59, 44, 46, 36, 40, 41, + 63, 39, 47, 61, 60, 62, 604, 94, 91, 93, + 38, 124, 126 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned short yyr1[] = { - 0, 373, 374, 375, 375, 375, 376, 376, 378, 377, - 379, 379, 380, 380, 381, 381, 382, 382, 382, 383, - 383, 383, 383, 384, 384, 384, 384, 384, 385, 386, - 386, 386, 386, 387, 388, 388, 388, 388, 389, 389, - 389, 390, 390, 391, 392, 392, 392, 392, 393, 393, - 393, 393, 393, 393, 394, 394, 394, 394, 394, 394, - 394, 395, 395, 395, 396, 396, 396, 397, 397, 397, - 397, 397, 398, 398, 398, 398, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 400, - 401, 402, 402, 403, 404, 404, 405, 405, 405, 406, - 406, 407, 407, 407, 407, 408, 408, 409, 409 +static const yytype_uint16 yyr1[] = +{ + 0, 373, 374, 375, 375, 375, 376, 376, 378, 377, + 379, 379, 380, 380, 381, 381, 382, 382, 382, 383, + 383, 383, 383, 384, 384, 384, 384, 384, 385, 386, + 386, 386, 386, 387, 388, 388, 388, 388, 389, 389, + 389, 390, 390, 391, 392, 392, 392, 392, 393, 393, + 393, 393, 393, 393, 394, 394, 394, 394, 394, 394, + 394, 395, 395, 395, 396, 396, 396, 397, 397, 397, + 397, 397, 398, 398, 398, 398, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, 399, 400, + 401, 402, 402, 403, 404, 404, 405, 405, 405, 406, + 406, 407, 407, 407, 407, 408, 408, 409, 409 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = { - 0, 2, 1, 3, 1, 2, 1, 1, 0, 7, - 3, 1, 2, 3, 2, 1, 2, 2, 1, 1, - 4, 4, 0, 2, 3, 2, 3, 4, 1, 1, - 3, 4, 4, 2, 1, 2, 3, 4, 1, 3, - 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, - 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 1, 2, 2, 1, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 3, 3, 1, 2, 2, 2, 2, - 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, - 3, 3, 3, 2, 3, 1, 1, 2, 3, 3, - 1, 1, 1, 3, 2, 1, 4, 1, 3 +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 3, 1, 2, 1, 1, 0, 7, + 3, 1, 2, 3, 2, 1, 2, 2, 1, 1, + 4, 4, 0, 2, 3, 2, 3, 4, 1, 1, + 3, 4, 4, 2, 1, 2, 3, 4, 1, 3, + 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, + 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, + 1, 2, 2, 1, 3, 3, 1, 3, 3, 3, + 3, 1, 3, 3, 3, 1, 2, 2, 2, 2, + 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, + 3, 3, 3, 2, 3, 1, 1, 2, 3, 3, + 1, 1, 1, 3, 2, 1, 4, 1, 3 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = { - 0, 0, 28, 0, 2, 4, 6, 7, 0, 0, - 1, 5, 85, 0, 0, 0, 84, 86, 87, 80, - 81, 0, 0, 107, 0, 0, 105, 43, 47, 53, - 60, 63, 66, 71, 75, 88, 25, 23, 100, 101, - 102, 8, 3, 0, 96, 93, 95, 80, 79, 0, - 0, 82, 76, 77, 0, 78, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 29, 24, 0, 104, 0, - 0, 0, 97, 0, 0, 83, 108, 0, 0, 89, - 44, 45, 46, 49, 51, 52, 50, 48, 57, 56, - 54, 55, 58, 59, 64, 65, 68, 67, 69, 70, - 73, 74, 72, 0, 33, 99, 0, 27, 103, 0, - 106, 98, 94, 0, 90, 40, 38, 30, 34, 0, - 22, 0, 11, 92, 91, 0, 32, 41, 42, 0, - 35, 31, 19, 0, 12, 0, 9, 39, 36, 0, - 0, 0, 18, 0, 0, 13, 15, 10, 37, 0, - 0, 17, 16, 14, 20, 21 +static const yytype_uint8 yydefact[] = +{ + 0, 0, 28, 0, 2, 4, 6, 7, 0, 0, + 1, 5, 85, 0, 0, 0, 84, 86, 87, 80, + 81, 0, 0, 107, 0, 0, 105, 43, 47, 53, + 60, 63, 66, 71, 75, 88, 25, 23, 100, 101, + 102, 8, 3, 0, 96, 93, 95, 80, 79, 0, + 0, 82, 76, 77, 0, 78, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 61, 62, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 26, 29, 24, 0, 104, 0, + 0, 0, 97, 0, 0, 83, 108, 0, 0, 89, + 44, 45, 46, 49, 51, 52, 50, 48, 57, 56, + 54, 55, 58, 59, 64, 65, 68, 67, 69, 70, + 73, 74, 72, 0, 33, 99, 0, 27, 103, 0, + 106, 98, 94, 0, 90, 40, 38, 30, 34, 0, + 22, 0, 11, 92, 91, 0, 32, 41, 42, 0, + 35, 31, 19, 0, 12, 0, 9, 39, 36, 0, + 0, 0, 18, 0, 0, 13, 15, 10, 37, 0, + 0, 17, 16, 14, 20, 21 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = { - -1, 3, 4, 5, 6, 89, 141, 142, 165, 166, - 154, 7, 8, 84, 85, 137, 138, 150, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 51, 98, - 36, 45, 46, 37, 38, 39, 40 +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 6, 89, 141, 142, 165, 166, + 154, 7, 8, 84, 85, 137, 138, 150, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 51, 98, + 36, 45, 46, 37, 38, 39, 40 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -336 -static const short yypact[] = { - -67, -271, -336, 39, -336, -311, -336, -336, -50, -265, +static const yytype_int16 yypact[] = +{ + -67, -271, -336, 39, -336, -311, -336, -336, -50, -265, -336, -67, -336, -298, -262, -37, -336, -336, -336, -335, -336, -37, -37, -336, -37, -37, -336, -336, -18, -135, -142, -336, -7, -325, -332, -336, -336, -133, -336, -19, -336, -336, -336, -40, -9, -291, -336, -318, -336, -309, - -37, -336, -336, -336, -292, -336, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -336, -336, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, 26, -37, -47, -336, -153, -216, -251, -336, -284, + -37, -336, -336, -336, -292, -336, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -336, -336, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, 26, -37, -47, -336, -153, -216, -251, -336, -284, -273, -237, -336, -262, -231, -336, -336, -260, -263, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, -261, -336, -336, 51, -336, -336, -227, -336, -336, -336, -37, -336, -336, -258, -239, -25, -261, - -3, -324, -336, -260, -336, -224, -336, -336, -336, -261, + -3, -324, -336, -260, -336, -224, -336, -336, -336, -261, -254, -336, -256, -255, -24, -227, -336, -336, -336, -261, -169, -168, -336, -104, -63, -24, -336, -336, -336, -250, -249, -336, -336, -336, -336, -336 }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = { +static const yytype_int16 yypgoto[] = +{ -336, -336, 97, -336, -336, -336, -336, -44, -336, -53, -336, -336, -336, 27, -23, -122, -336, -336, -6, -1, - 18, -17, -336, -21, 8, 11, 7, -336, -336, -16, - 78, -336, 23, -336, 35, 76, -336 + 18, -17, -336, -21, 8, 11, 7, -336, -336, -16, + 78, -336, 23, -336, 35, 76, -336 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = { - 147, 152, 56, 12, 87, 14, 12, 162, 1, 81, - 59, 64, 135, 12, 91, 95, 12, 151, 54, 78, - 79, 49, 48, 50, 74, 75, 9, 158, 52, 53, - 80, 155, 55, 72, 73, 156, 65, 168, 94, 10, - 50, 60, 96, 11, 97, 76, 77, 108, 109, 110, - 111, 114, 115, 112, 113, 100, 101, 102, 13, 41, - 43, 13, 44, 136, 93, 66, 67, 99, 13, 123, - 68, 69, 126, 128, 129, 148, 124, 103, 104, 105, - 106, 107, 116, 117, 118, 119, 130, 131, 14, 120, - 121, 122, 81, 95, 139, 133, 134, 140, 145, 82, - 157, 159, 160, 161, 169, 170, 171, 172, 42, 174, - 175, 167, 173, 127, 146, 86, 132, 144, 125, 90, - 0, 0, 82, 0, 0, 0, 0, 143, 0, 70, - 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 15, - 16, 0, 0, 16, 0, 0, 15, 0, 0, 15, - 16, 0, 0, 16, 0, 0, 0, 0, 0, 0, - 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 82, 57, 0, 0, 0, - 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, - 0, 0, 83, 17, 18, 0, 17, 18, 61, 62, - 63, 0, 0, 17, 18, 0, 17, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 19, 0, 20, 19, 0, 20, - 0, 0, 0, 0, 47, 0, 20, 47, 0, 20, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 22, 23, 21, 22, 23, 88, 0, 0, 24, 21, - 22, 24, 21, 22, 0, 92, 0, 0, 24, 0, - 0, 24, 25, 0, 0, 25, 58, 0, 153, 0, - 149, 0, 25, 0, 0, 25 +static const yytype_uint8 yytable[] = +{ + 147, 152, 56, 12, 87, 14, 12, 162, 1, 81, + 59, 64, 135, 12, 91, 95, 12, 151, 54, 78, + 79, 49, 48, 50, 74, 75, 9, 158, 52, 53, + 80, 155, 55, 72, 73, 156, 65, 168, 94, 10, + 50, 60, 96, 11, 97, 76, 77, 108, 109, 110, + 111, 114, 115, 112, 113, 100, 101, 102, 13, 41, + 43, 13, 44, 136, 93, 66, 67, 99, 13, 123, + 68, 69, 126, 128, 129, 148, 124, 103, 104, 105, + 106, 107, 116, 117, 118, 119, 130, 131, 14, 120, + 121, 122, 81, 95, 139, 133, 134, 140, 145, 82, + 157, 159, 160, 161, 169, 170, 171, 172, 42, 174, + 175, 167, 173, 127, 146, 86, 132, 144, 125, 90, + 0, 0, 82, 0, 0, 0, 0, 143, 0, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 15, + 16, 0, 0, 16, 0, 0, 15, 0, 0, 15, + 16, 0, 0, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 82, 57, 0, 0, 0, + 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, + 0, 0, 83, 17, 18, 0, 17, 18, 61, 62, + 63, 0, 0, 17, 18, 0, 17, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 0, 20, 19, 0, 20, + 0, 0, 0, 0, 47, 0, 20, 47, 0, 20, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 22, 23, 21, 22, 23, 88, 0, 0, 24, 21, + 22, 24, 21, 22, 0, 92, 0, 0, 24, 0, + 0, 24, 25, 0, 0, 25, 58, 0, 153, 0, + 149, 0, 25, 0, 0, 25 }; -static const short yycheck[] = { - 25, 4, 20, 53, 23, 138, 53, 31, 75, 225, - 145, 153, 273, 53, 23, 324, 53, 139, 24, 351, - 352, 356, 15, 358, 349, 350, 297, 149, 21, 22, - 362, 355, 25, 40, 41, 359, 178, 159, 356, 0, - 358, 176, 351, 354, 50, 370, 371, 64, 65, 66, - 67, 72, 73, 70, 71, 56, 57, 58, 108, 324, - 358, 108, 324, 324, 355, 207, 208, 359, 108, 43, - 212, 213, 225, 324, 358, 100, 82, 59, 60, 61, - 62, 63, 74, 75, 76, 77, 359, 324, 138, 78, - 79, 80, 225, 324, 43, 355, 359, 324, 356, 338, - 324, 355, 358, 358, 273, 273, 210, 170, 11, 359, - 359, 155, 165, 86, 137, 37, 93, 133, 83, 43, - -1, -1, 338, -1, -1, -1, -1, 133, -1, 271, - 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 206, -1, -1, 206, - 210, -1, -1, 210, -1, -1, 206, -1, -1, 206, - 210, -1, -1, 210, -1, -1, -1, -1, -1, -1, - -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, - -1, -1, -1, -1, -1, 338, 224, -1, -1, -1, - -1, -1, -1, -1, -1, 239, -1, -1, -1, -1, - -1, -1, 355, 273, 274, -1, 273, 274, 363, 364, - 365, -1, -1, 273, 274, -1, 273, 274, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 324, -1, 326, 324, -1, 326, - -1, -1, -1, -1, 324, -1, 326, 324, -1, 326, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, - 350, 351, 349, 350, 351, 324, -1, -1, 358, 349, - 350, 358, 349, 350, -1, 324, -1, -1, 358, -1, - -1, 358, 372, -1, -1, 372, 344, -1, 331, -1, - 355, -1, 372, -1, -1, 372 +#define yypact_value_is_default(yystate) \ + ((yystate) == (-336)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + +static const yytype_int16 yycheck[] = +{ + 25, 4, 20, 53, 23, 138, 53, 31, 75, 225, + 145, 153, 273, 53, 23, 324, 53, 139, 24, 351, + 352, 356, 15, 358, 349, 350, 297, 149, 21, 22, + 362, 355, 25, 40, 41, 359, 178, 159, 356, 0, + 358, 176, 351, 354, 50, 370, 371, 64, 65, 66, + 67, 72, 73, 70, 71, 56, 57, 58, 108, 324, + 358, 108, 324, 324, 355, 207, 208, 359, 108, 43, + 212, 213, 225, 324, 358, 100, 82, 59, 60, 61, + 62, 63, 74, 75, 76, 77, 359, 324, 138, 78, + 79, 80, 225, 324, 43, 355, 359, 324, 356, 338, + 324, 355, 358, 358, 273, 273, 210, 170, 11, 359, + 359, 155, 165, 86, 137, 37, 93, 133, 83, 43, + -1, -1, 338, -1, -1, -1, -1, 133, -1, 271, + 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 206, -1, -1, 206, + 210, -1, -1, 210, -1, -1, 206, -1, -1, 206, + 210, -1, -1, 210, -1, -1, -1, -1, -1, -1, + -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, + -1, -1, -1, -1, -1, 338, 224, -1, -1, -1, + -1, -1, -1, -1, -1, 239, -1, -1, -1, -1, + -1, -1, 355, 273, 274, -1, 273, 274, 363, 364, + 365, -1, -1, 273, 274, -1, 273, 274, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 324, -1, 326, 324, -1, 326, + -1, -1, -1, -1, 324, -1, 326, 324, -1, 326, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, + 350, 351, 349, 350, 351, 324, -1, -1, 358, 349, + 350, 358, 349, 350, -1, 324, -1, -1, 358, -1, + -1, 358, 372, -1, -1, 372, 344, -1, 331, -1, + 355, -1, 372, -1, -1, 372 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned short yystos[] = { - 0, 75, 265, 374, 375, 376, 377, 384, 385, 297, - 0, 354, 53, 108, 138, 206, 210, 273, 274, 324, - 326, 349, 350, 351, 358, 372, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 403, 406, 407, 408, - 409, 324, 375, 358, 324, 404, 405, 324, 399, 356, - 358, 401, 399, 399, 391, 399, 20, 224, 344, 145, - 176, 363, 364, 365, 153, 178, 207, 208, 212, 213, - 271, 272, 40, 41, 349, 350, 370, 371, 351, 352, - 362, 225, 338, 355, 386, 387, 403, 23, 324, 378, - 408, 23, 324, 355, 356, 324, 351, 391, 402, 359, - 392, 392, 392, 393, 393, 393, 393, 393, 394, 394, - 394, 394, 394, 394, 396, 396, 397, 397, 397, 397, - 398, 398, 398, 43, 391, 407, 225, 386, 324, 358, - 359, 324, 405, 355, 359, 273, 324, 388, 389, 43, - 324, 379, 380, 391, 402, 356, 387, 25, 100, 355, - 390, 388, 4, 331, 383, 355, 359, 324, 388, 355, - 358, 358, 31, 206, 239, 381, 382, 380, 388, 273, - 273, 210, 170, 382, 359, 359 +static const yytype_uint16 yystos[] = +{ + 0, 75, 265, 374, 375, 376, 377, 384, 385, 297, + 0, 354, 53, 108, 138, 206, 210, 273, 274, 324, + 326, 349, 350, 351, 358, 372, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 403, 406, 407, 408, + 409, 324, 375, 358, 324, 404, 405, 324, 399, 356, + 358, 401, 399, 399, 391, 399, 20, 224, 344, 145, + 176, 363, 364, 365, 153, 178, 207, 208, 212, 213, + 271, 272, 40, 41, 349, 350, 370, 371, 351, 352, + 362, 225, 338, 355, 386, 387, 403, 23, 324, 378, + 408, 23, 324, 355, 356, 324, 351, 391, 402, 359, + 392, 392, 392, 393, 393, 393, 393, 393, 394, 394, + 394, 394, 394, 394, 396, 396, 397, 397, 397, 397, + 398, 398, 398, 43, 391, 407, 225, 386, 324, 358, + 359, 324, 405, 355, 359, 273, 324, 388, 389, 43, + 324, 379, 380, 391, 402, 356, 387, 25, 100, 355, + 390, 388, 4, 331, 383, 355, 359, 324, 388, 355, + 358, 358, 31, 206, 239, 381, 382, 380, 388, 273, + 273, 210, 170, 382, 359, 359 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ - while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* This macro is provided for backward compatibility. */ + +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -1522,100 +1365,164 @@ static const unsigned short yystos[] = { # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ - do { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (0) - -# define YYDSYMPRINT(Args) \ - do { \ - if (yydebug) \ - yysymprint Args; \ - } while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ - do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ - } while (0) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print(short *bottom, short *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print(bottom, top) -short *bottom; -short *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { - YYFPRINTF(stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF(stderr, " %d", *bottom); - YYFPRINTF(stderr, "\n"); + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ - do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ - } while (0) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print(int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print(yyrule) -int yyrule; +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; #endif { - int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF(stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF(stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF(stderr, "-> %s\n", yytname [yyr1[yyrule]]); + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } } -# define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ - } while (0) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1623,152 +1530,300 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen(const char *yystr) -# else -yystrlen(yystr) -const char *yystr; -# endif +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy(char *yydest, const char *yysrc) -# else -yystpcpy(yydest, yysrc) -char *yydest; -const char *yysrc; -# endif +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; + while ((*yyd++ = *yys++) != '\0') + continue; - return yyd - 1; + return yyd - 1; } # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint(FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint(yyoutput, yytype, yyvaluep) -FILE *yyoutput; -int yytype; -YYSTYPE *yyvaluep; -#endif +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } - if (yytype < YYNTOKENS) { - YYFPRINTF(yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } else - YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]); + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - switch (yytype) { - default: - break; + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; } - YYFPRINTF(yyoutput, ")"); + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } +#endif /* YYERROR_VERBOSE */ -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct(int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct(yytype, yyvaluep) -int yytype; -YYSTYPE *yyvaluep; +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) { + switch (yytype) + { - default: - break; + default: + break; } } - -/* Prevent warnings from -Wmissing-prototypes. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse(void *YYPARSE_PARAM); -# else -int yyparse(); -# endif +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse(void); +#if defined __STDC__ || defined __cplusplus +int yyparse (void); #else -int yyparse(); +int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ - /* The lookahead symbol. */ int yychar; @@ -1779,1402 +1834,1539 @@ YYSTYPE yylval; int yynerrs; - /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse(void *YYPARSE_PARAM) -# else -int yyparse(YYPARSE_PARAM) -void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int -yyparse(void) +yyparse (void) #else int -yyparse() +yyparse () #endif #endif { - - register int yystate; - register int yyn; - int yyresult; + int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + YYSIZE_T yystacksize; -#define YYPOPSTACK (yyvsp--, yyssp--) + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - YYDPRINTF((stderr, "Starting parse\n")); + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + YYDPRINTF ((stderr, "Starting parse\n")); - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ - yyssp = yyss; - yyvsp = yyvs; + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; - goto yysetstate; + goto yysetstate; - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; -yysetstate: - *yyssp = yystate; + yysetstate: + *yyssp = yystate; - if (yyss + yystacksize - 1 <= yyssp) { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, yysize * sizeof(*yyssp), - &yyvs1, yysize * sizeof(*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE(yyss); - YYSTACK_RELOCATE(yyvs); - + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } # endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; - YYDPRINTF((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } - YYDPRINTF((stderr, "Entering state %d\n", yystate)); + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - goto yybackup; + if (yystate == YYFINAL) + YYACCEPT; - /*-----------. - | yybackup. | - `-----------*/ -yybackup: + goto yybackup; - /* Do appropriate processing given the current state. */ - /* Read a lookahead token if we need one and don't already have one. */ - /* yyresume: */ +/*-----------. +| yybackup. | +`-----------*/ +yybackup: - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = YYLEX; + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; } - if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } else { - yytoken = YYTRANSLATE(yychar); - YYDSYMPRINTF("Next token is", yytoken, &yylval, &yylloc); + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF((stderr, "Shifting token %s, ", yytname[yytoken])); + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; - *++yyvsp = yylval; + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Discard the shifted token. */ + yychar = YYEMPTY; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + yystate = yyn; + *++yyvsp = yylval; - yystate = yyn; - goto yynewstate; + goto yynewstate; - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; - YY_REDUCE_PRINT(yyn); - switch (yyn) { - case 2: -#line 581 "sqlparser.y" - { + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: + +/* Line 1806 of yacc.c */ +#line 584 "sqlparser.y" + { //todo: multiple statements //todo: not only "select" statements - parser->setOperation(Parser::OP_Select); - parser->setQuerySchema(yyvsp[0].querySchema); - ; - } - break; + parser->setOperation(Parser::OP_Select); + parser->setQuerySchema((yyvsp[(1) - (1)].querySchema)); +} + break; - case 3: -#line 591 "sqlparser.y" - { + case 3: + +/* Line 1806 of yacc.c */ +#line 594 "sqlparser.y" + { //todo: multiple statements - ; - } - break; +} + break; - case 5: -#line 596 "sqlparser.y" - { - yyval.querySchema = yyvsp[-1].querySchema; - ; - } - break; + case 5: - case 6: -#line 606 "sqlparser.y" - { - YYACCEPT; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 599 "sqlparser.y" + { + (yyval.querySchema) = (yyvsp[(1) - (2)].querySchema); +} + break; - case 7: -#line 610 "sqlparser.y" - { - yyval.querySchema = yyvsp[0].querySchema; - ; - } - break; + case 6: - case 8: -#line 617 "sqlparser.y" - { - parser->setOperation(Parser::OP_CreateTable); - parser->createTable(yyvsp[0].stringValue->toLatin1()); - delete yyvsp[0].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 609 "sqlparser.y" + { +YYACCEPT; +} + break; - case 11: -#line 627 "sqlparser.y" - { - ; - } - break; + case 7: - case 12: -#line 633 "sqlparser.y" - { - KexiDBDbg << "adding field " << *yyvsp[-1].stringValue; - field->setName(yyvsp[-1].stringValue->toLatin1()); - parser->table()->addField(field); - field = 0; - delete yyvsp[-1].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 613 "sqlparser.y" + { + (yyval.querySchema) = (yyvsp[(1) - (1)].querySchema); +} + break; - case 13: -#line 641 "sqlparser.y" - { - KexiDBDbg << "adding field " << *yyvsp[-2].stringValue; - field->setName(*yyvsp[-2].stringValue); - delete yyvsp[-2].stringValue; - parser->table()->addField(field); + case 8: -// if(field->isPrimaryKey()) -// parser->table()->addPrimaryKey(field->name()); +/* Line 1806 of yacc.c */ +#line 620 "sqlparser.y" + { + parser->setOperation(Parser::OP_CreateTable); + parser->createTable((yyvsp[(3) - (3)].stringValue)->toLatin1()); + delete (yyvsp[(3) - (3)].stringValue); +} + break; -// delete field; -// field = 0; - ; - } - break; + case 11: - case 15: -#line 657 "sqlparser.y" - { - ; - } - break; +/* Line 1806 of yacc.c */ +#line 630 "sqlparser.y" + { +} + break; + + case 12: + +/* Line 1806 of yacc.c */ +#line 636 "sqlparser.y" + { + KexiDBDbg << "adding field " << *(yyvsp[(1) - (2)].stringValue); + field->setName((yyvsp[(1) - (2)].stringValue)->toLatin1()); + parser->table()->addField(field); + field = 0; + delete (yyvsp[(1) - (2)].stringValue); +} + break; - case 16: -#line 663 "sqlparser.y" - { - field->setPrimaryKey(true); - KexiDBDbg << "primary"; - ; - } - break; + case 13: - case 17: -#line 668 "sqlparser.y" - { - field->setNotNull(true); - KexiDBDbg << "not_null"; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 644 "sqlparser.y" + { + KexiDBDbg << "adding field " << *(yyvsp[(1) - (3)].stringValue); + field->setName(*(yyvsp[(1) - (3)].stringValue)); + delete (yyvsp[(1) - (3)].stringValue); + parser->table()->addField(field); - case 18: -#line 673 "sqlparser.y" - { - field->setAutoIncrement(true); - KexiDBDbg << "ainc"; - ; - } - break; +// if(field->isPrimaryKey()) +// parser->table()->addPrimaryKey(field->name()); - case 19: -#line 681 "sqlparser.y" - { - field = new Field(); - field->setType(yyvsp[0].colType); - ; - } - break; +// delete field; +// field = 0; +} + break; - case 20: -#line 686 "sqlparser.y" - { - KexiDBDbg << "sql + length"; - field = new Field(); - field->setPrecision(yyvsp[-1].integerValue); - field->setType(yyvsp[-3].colType); - ; - } - break; + case 15: - case 21: -#line 693 "sqlparser.y" - { - field = new Field(); - field->setPrecision(yyvsp[-1].integerValue); - field->setType(Field::Text); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 660 "sqlparser.y" + { +} + break; - case 22: -#line 699 "sqlparser.y" - { - // SQLITE compatibillity - field = new Field(); - field->setType(Field::InvalidType); - ; - } - break; + case 16: - case 23: -#line 708 "sqlparser.y" - { - KexiDBDbg << "Select ColViews=" << yyvsp[0].exprList->debugString(); +/* Line 1806 of yacc.c */ +#line 666 "sqlparser.y" + { + field->setPrimaryKey(true); + KexiDBDbg << "primary"; +} + break; - if (!(yyval.querySchema = buildSelectQuery(yyvsp[-1].querySchema, yyvsp[0].exprList))) - return 0; - ; - } - break; + case 17: - case 24: -#line 715 "sqlparser.y" - { - if (!(yyval.querySchema = buildSelectQuery(yyvsp[-2].querySchema, yyvsp[-1].exprList, yyvsp[0].exprList))) - return 0; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 671 "sqlparser.y" + { + field->setNotNull(true); + KexiDBDbg << "not_null"; +} + break; - case 25: -#line 720 "sqlparser.y" - { - KexiDBDbg << "Select ColViews Tables"; - if (!(yyval.querySchema = buildSelectQuery(yyvsp[-1].querySchema, 0, yyvsp[0].exprList))) - return 0; - ; - } - break; + case 18: - case 26: -#line 726 "sqlparser.y" - { - KexiDBDbg << "Select ColViews Conditions"; - if (!(yyval.querySchema = buildSelectQuery(yyvsp[-2].querySchema, yyvsp[-1].exprList, 0, yyvsp[0].selectOptions))) - return 0; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 676 "sqlparser.y" + { + field->setAutoIncrement(true); + KexiDBDbg << "ainc"; +} + break; - case 27: -#line 732 "sqlparser.y" - { - KexiDBDbg << "Select ColViews Tables SelectOptions"; - if (!(yyval.querySchema = buildSelectQuery(yyvsp[-3].querySchema, yyvsp[-2].exprList, yyvsp[-1].exprList, yyvsp[0].selectOptions))) - return 0; - ; - } - break; + case 19: - case 28: -#line 741 "sqlparser.y" - { - KexiDBDbg << "SELECT"; -// parser->createSelect(); -// parser->setOperation(Parser::OP_Select); - yyval.querySchema = new QuerySchema(); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 684 "sqlparser.y" + { + field = new Field(); + field->setType((yyvsp[(1) - (1)].colType)); +} + break; - case 29: -#line 751 "sqlparser.y" - { - KexiDBDbg << "WhereClause"; - yyval.selectOptions = new SelectOptionsInternal; - yyval.selectOptions->whereExpr = yyvsp[0].expr; - ; - } - break; + case 20: - case 30: -#line 757 "sqlparser.y" - { - KexiDBDbg << "OrderByClause"; - yyval.selectOptions = new SelectOptionsInternal; - yyval.selectOptions->orderByColumns = yyvsp[0].orderByColumns; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 689 "sqlparser.y" + { + KexiDBDbg << "sql + length"; + field = new Field(); + field->setPrecision((yyvsp[(3) - (4)].integerValue)); + field->setType((yyvsp[(1) - (4)].colType)); +} + break; - case 31: -#line 763 "sqlparser.y" - { - KexiDBDbg << "WhereClause ORDER BY OrderByClause"; - yyval.selectOptions = new SelectOptionsInternal; - yyval.selectOptions->whereExpr = yyvsp[-3].expr; - yyval.selectOptions->orderByColumns = yyvsp[0].orderByColumns; - ; - } - break; + case 21: - case 32: -#line 770 "sqlparser.y" - { - KexiDBDbg << "OrderByClause WhereClause"; - yyval.selectOptions = new SelectOptionsInternal; - yyval.selectOptions->whereExpr = yyvsp[0].expr; - yyval.selectOptions->orderByColumns = yyvsp[-1].orderByColumns; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 696 "sqlparser.y" + { + field = new Field(); + field->setPrecision((yyvsp[(3) - (4)].integerValue)); + field->setType(Field::Text); +} + break; - case 33: -#line 780 "sqlparser.y" - { - yyval.expr = yyvsp[0].expr; - ; - } - break; + case 22: - case 34: -#line 789 "sqlparser.y" - { - KexiDBDbg << "ORDER BY IDENTIFIER"; - yyval.orderByColumns = new OrderByColumnInternal::List; - OrderByColumnInternal orderByColumn; - orderByColumn.setColumnByNameOrNumber(*yyvsp[0].variantValue); - yyval.orderByColumns->append(orderByColumn); - delete yyvsp[0].variantValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 702 "sqlparser.y" + { + // SQLITE compatibillity + field = new Field(); + field->setType(Field::InvalidType); +} + break; - case 35: -#line 798 "sqlparser.y" - { - KexiDBDbg << "ORDER BY IDENTIFIER OrderByOption"; - yyval.orderByColumns = new OrderByColumnInternal::List; - OrderByColumnInternal orderByColumn; - orderByColumn.setColumnByNameOrNumber(*yyvsp[-1].variantValue); - orderByColumn.ascending = yyvsp[0].booleanValue; - yyval.orderByColumns->append(orderByColumn); - delete yyvsp[-1].variantValue; - ; - } - break; + case 23: - case 36: -#line 808 "sqlparser.y" - { - yyval.orderByColumns = yyvsp[0].orderByColumns; - OrderByColumnInternal orderByColumn; - orderByColumn.setColumnByNameOrNumber(*yyvsp[-2].variantValue); - yyval.orderByColumns->append(orderByColumn); - delete yyvsp[-2].variantValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 711 "sqlparser.y" + { + KexiDBDbg << "Select ColViews=" << (yyvsp[(2) - (2)].exprList)->debugString(); - case 37: -#line 816 "sqlparser.y" - { - yyval.orderByColumns = yyvsp[0].orderByColumns; - OrderByColumnInternal orderByColumn; - orderByColumn.setColumnByNameOrNumber(*yyvsp[-3].variantValue); - orderByColumn.ascending = yyvsp[-2].booleanValue; - yyval.orderByColumns->append(orderByColumn); - delete yyvsp[-3].variantValue; - ; - } - break; + if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), (yyvsp[(2) - (2)].exprList) ))) + return 0; +} + break; - case 38: -#line 828 "sqlparser.y" - { - yyval.variantValue = new QVariant(*yyvsp[0].stringValue); - KexiDBDbg << "OrderByColumnId: " << *yyval.variantValue; - delete yyvsp[0].stringValue; - ; - } - break; + case 24: - case 39: -#line 834 "sqlparser.y" - { - yyval.variantValue = new QVariant(*yyvsp[-2].stringValue + "." + *yyvsp[0].stringValue); - KexiDBDbg << "OrderByColumnId: " << *yyval.variantValue; - delete yyvsp[-2].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 718 "sqlparser.y" + { + if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), (yyvsp[(3) - (3)].exprList) ))) + return 0; +} + break; - case 40: -#line 841 "sqlparser.y" - { - yyval.variantValue = new QVariant(yyvsp[0].integerValue); - KexiDBDbg << "OrderByColumnId: " << *yyval.variantValue; - ; - } - break; + case 25: - case 41: -#line 848 "sqlparser.y" - { - yyval.booleanValue = true; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 723 "sqlparser.y" + { + KexiDBDbg << "Select ColViews Tables"; + if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), 0, (yyvsp[(2) - (2)].exprList) ))) + return 0; +} + break; - case 42: -#line 852 "sqlparser.y" - { - yyval.booleanValue = false; - ; - } - break; + case 26: - case 44: -#line 864 "sqlparser.y" - { -// KexiDBDbg << "AND " << $3.debugString(); - yyval.expr = new BinaryExpr(KexiDBExpr_Logical, yyvsp[-2].expr, AND, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 729 "sqlparser.y" + { + KexiDBDbg << "Select ColViews Conditions"; + if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), 0, (yyvsp[(3) - (3)].selectOptions) ))) + return 0; +} + break; - case 45: -#line 869 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Logical, yyvsp[-2].expr, OR, yyvsp[0].expr); - ; - } - break; + case 27: - case 46: -#line 873 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, XOR, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 735 "sqlparser.y" + { + KexiDBDbg << "Select ColViews Tables SelectOptions"; + if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (4)].querySchema), (yyvsp[(2) - (4)].exprList), (yyvsp[(3) - (4)].exprList), (yyvsp[(4) - (4)].selectOptions) ))) + return 0; +} + break; - case 48: -#line 883 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, '>', yyvsp[0].expr); - ; - } - break; + case 28: - case 49: -#line 887 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, GREATER_OR_EQUAL, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 744 "sqlparser.y" + { + KexiDBDbg << "SELECT"; +// parser->createSelect(); +// parser->setOperation(Parser::OP_Select); + (yyval.querySchema) = new QuerySchema(); +} + break; - case 50: -#line 891 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, '<', yyvsp[0].expr); - ; - } - break; + case 29: - case 51: -#line 895 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, LESS_OR_EQUAL, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 754 "sqlparser.y" + { + KexiDBDbg << "WhereClause"; + (yyval.selectOptions) = new SelectOptionsInternal; + (yyval.selectOptions)->whereExpr = (yyvsp[(1) - (1)].expr); +} + break; - case 52: -#line 899 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, '=', yyvsp[0].expr); - ; - } - break; + case 30: - case 54: -#line 909 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, NOT_EQUAL, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 760 "sqlparser.y" + { + KexiDBDbg << "OrderByClause"; + (yyval.selectOptions) = new SelectOptionsInternal; + (yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (3)].orderByColumns); +} + break; - case 55: -#line 914 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, NOT_EQUAL2, yyvsp[0].expr); - ; - } - break; + case 31: - case 56: -#line 918 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, LIKE, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 766 "sqlparser.y" + { + KexiDBDbg << "WhereClause ORDER BY OrderByClause"; + (yyval.selectOptions) = new SelectOptionsInternal; + (yyval.selectOptions)->whereExpr = (yyvsp[(1) - (4)].expr); + (yyval.selectOptions)->orderByColumns = (yyvsp[(4) - (4)].orderByColumns); +} + break; - case 57: -#line 922 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, SQL_IN, yyvsp[0].expr); - ; - } - break; + case 32: - case 58: -#line 926 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, SIMILAR_TO, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 773 "sqlparser.y" + { + KexiDBDbg << "OrderByClause WhereClause"; + (yyval.selectOptions) = new SelectOptionsInternal; + (yyval.selectOptions)->whereExpr = (yyvsp[(4) - (4)].expr); + (yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (4)].orderByColumns); +} + break; - case 59: -#line 930 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Relational, yyvsp[-2].expr, NOT_SIMILAR_TO, yyvsp[0].expr); - ; - } - break; + case 33: - case 61: -#line 940 "sqlparser.y" - { - yyval.expr = new UnaryExpr(SQL_IS_NULL, yyvsp[-1].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 783 "sqlparser.y" + { + (yyval.expr) = (yyvsp[(2) - (2)].expr); +} + break; + + case 34: + +/* Line 1806 of yacc.c */ +#line 792 "sqlparser.y" + { + KexiDBDbg << "ORDER BY IDENTIFIER"; + (yyval.orderByColumns) = new OrderByColumnInternal::List; + OrderByColumnInternal orderByColumn; + orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (1)].variantValue) ); + (yyval.orderByColumns)->append( orderByColumn ); + delete (yyvsp[(1) - (1)].variantValue); +} + break; + + case 35: + +/* Line 1806 of yacc.c */ +#line 801 "sqlparser.y" + { + KexiDBDbg << "ORDER BY IDENTIFIER OrderByOption"; + (yyval.orderByColumns) = new OrderByColumnInternal::List; + OrderByColumnInternal orderByColumn; + orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (2)].variantValue) ); + orderByColumn.ascending = (yyvsp[(2) - (2)].booleanValue); + (yyval.orderByColumns)->append( orderByColumn ); + delete (yyvsp[(1) - (2)].variantValue); +} + break; + + case 36: + +/* Line 1806 of yacc.c */ +#line 811 "sqlparser.y" + { + (yyval.orderByColumns) = (yyvsp[(3) - (3)].orderByColumns); + OrderByColumnInternal orderByColumn; + orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (3)].variantValue) ); + (yyval.orderByColumns)->append( orderByColumn ); + delete (yyvsp[(1) - (3)].variantValue); +} + break; + + case 37: + +/* Line 1806 of yacc.c */ +#line 819 "sqlparser.y" + { + (yyval.orderByColumns) = (yyvsp[(4) - (4)].orderByColumns); + OrderByColumnInternal orderByColumn; + orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (4)].variantValue) ); + orderByColumn.ascending = (yyvsp[(2) - (4)].booleanValue); + (yyval.orderByColumns)->append( orderByColumn ); + delete (yyvsp[(1) - (4)].variantValue); +} + break; - case 62: -#line 944 "sqlparser.y" - { - yyval.expr = new UnaryExpr(SQL_IS_NOT_NULL, yyvsp[-1].expr); - ; - } - break; + case 38: - case 64: -#line 954 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, BITWISE_SHIFT_LEFT, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 831 "sqlparser.y" + { + (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (1)].stringValue) ); + KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue); + delete (yyvsp[(1) - (1)].stringValue); +} + break; - case 65: -#line 958 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, BITWISE_SHIFT_RIGHT, yyvsp[0].expr); - ; - } - break; + case 39: - case 67: -#line 968 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '+', yyvsp[0].expr); - yyval.expr->debug(); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 837 "sqlparser.y" + { + (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) ); + KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue); + delete (yyvsp[(1) - (3)].stringValue); + delete (yyvsp[(3) - (3)].stringValue); +} + break; - case 68: -#line 973 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '-', yyvsp[0].expr); - ; - } - break; + case 40: - case 69: -#line 977 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '&', yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 844 "sqlparser.y" + { + (yyval.variantValue) = new QVariant((yyvsp[(1) - (1)].integerValue)); + KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue); +} + break; - case 70: -#line 981 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '|', yyvsp[0].expr); - ; - } - break; + case 41: - case 72: -#line 991 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '/', yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 851 "sqlparser.y" + { + (yyval.booleanValue) = true; +} + break; - case 73: -#line 995 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '*', yyvsp[0].expr); - ; - } - break; + case 42: - case 74: -#line 999 "sqlparser.y" - { - yyval.expr = new BinaryExpr(KexiDBExpr_Arithm, yyvsp[-2].expr, '%', yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 855 "sqlparser.y" + { + (yyval.booleanValue) = false; +} + break; - case 76: -#line 1010 "sqlparser.y" - { - yyval.expr = new UnaryExpr('-', yyvsp[0].expr); - ; - } - break; + case 44: - case 77: -#line 1014 "sqlparser.y" - { - yyval.expr = new UnaryExpr('+', yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 867 "sqlparser.y" + { +// KexiDBDbg << "AND " << $3.debugString(); + (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), AND, (yyvsp[(3) - (3)].expr) ); +} + break; - case 78: -#line 1018 "sqlparser.y" - { - yyval.expr = new UnaryExpr('~', yyvsp[0].expr); - ; - } - break; + case 45: - case 79: -#line 1022 "sqlparser.y" - { - yyval.expr = new UnaryExpr(NOT, yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 872 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), OR, (yyvsp[(3) - (3)].expr) ); +} + break; - case 80: -#line 1026 "sqlparser.y" - { - yyval.expr = new VariableExpr(*yyvsp[0].stringValue); + case 46: -//TODO: simplify this later if that's 'only one field name' expression - KexiDBDbg << " + identifier: " << *yyvsp[0].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 876 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr( KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), XOR, (yyvsp[(3) - (3)].expr) ); +} + break; - case 81: -#line 1034 "sqlparser.y" - { - yyval.expr = new QueryParameterExpr(*yyvsp[0].stringValue); - KexiDBDbg << " + query parameter: " << yyval.expr->debugString(); - delete yyvsp[0].stringValue; - ; - } - break; + case 48: - case 82: -#line 1040 "sqlparser.y" - { - KexiDBDbg << " + function: " << *yyvsp[-1].stringValue << "(" << yyvsp[0].exprList->debugString() << ")"; - yyval.expr = new FunctionExpr(*yyvsp[-1].stringValue, yyvsp[0].exprList); - delete yyvsp[-1].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 886 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '>', (yyvsp[(3) - (3)].expr)); +} + break; - case 83: -#line 1047 "sqlparser.y" - { - yyval.expr = new VariableExpr(*yyvsp[-2].stringValue + "." + *yyvsp[0].stringValue); - KexiDBDbg << " + identifier.identifier: " << *yyvsp[-2].stringValue << "." << *yyvsp[0].stringValue; - delete yyvsp[-2].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; + case 49: - case 84: -#line 1054 "sqlparser.y" - { - yyval.expr = new ConstExpr(SQL_NULL, QVariant()); - KexiDBDbg << " + NULL"; -// $$ = new Field(); - //$$->setName(QString::null); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 890 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), GREATER_OR_EQUAL, (yyvsp[(3) - (3)].expr)); +} + break; - case 85: -#line 1061 "sqlparser.y" - { - yyval.expr = new ConstExpr(CHARACTER_STRING_LITERAL, *yyvsp[0].stringValue); - KexiDBDbg << " + constant " << yyvsp[0].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; + case 50: - case 86: -#line 1067 "sqlparser.y" - { - QVariant val; - if (yyvsp[0].integerValue <= INT_MAX && yyvsp[0].integerValue >= INT_MIN) - val = (int)yyvsp[0].integerValue; - else if (yyvsp[0].integerValue <= UINT_MAX && yyvsp[0].integerValue >= 0) - val = (uint)yyvsp[0].integerValue; - else if (yyvsp[0].integerValue <= LLONG_MAX && yyvsp[0].integerValue >= LLONG_MIN) - val = (qint64)yyvsp[0].integerValue; - -// if ($1 < ULLONG_MAX) -// val = (quint64)$1; -//TODO ok? +/* Line 1806 of yacc.c */ +#line 894 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '<', (yyvsp[(3) - (3)].expr)); +} + break; - yyval.expr = new ConstExpr(INTEGER_CONST, val); - KexiDBDbg << " + int constant: " << val.toString(); - ; - } - break; + case 51: - case 87: -#line 1084 "sqlparser.y" - { - yyval.expr = new ConstExpr(REAL_CONST, QPoint(yyvsp[0].realValue.integer, yyvsp[0].realValue.fractional)); - KexiDBDbg << " + real constant: " << yyvsp[0].realValue.integer << "." << yyvsp[0].realValue.fractional; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 898 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LESS_OR_EQUAL, (yyvsp[(3) - (3)].expr)); +} + break; - case 89: -#line 1095 "sqlparser.y" - { - KexiDBDbg << "(expr)"; - yyval.expr = new UnaryExpr('(', yyvsp[-1].expr); - ; - } - break; + case 52: - case 90: -#line 1103 "sqlparser.y" - { -// $$ = new NArgExpr(0, 0); -// $$->add( $1 ); -// $$->add( $3 ); - yyval.exprList = yyvsp[-1].exprList; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 902 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '=', (yyvsp[(3) - (3)].expr)); +} + break; - case 91: -#line 1113 "sqlparser.y" - { - yyval.exprList = yyvsp[0].exprList; - yyval.exprList->prepend(yyvsp[-2].expr); - ; - } - break; + case 54: - case 92: -#line 1118 "sqlparser.y" - { - yyval.exprList = new NArgExpr(0, 0); - yyval.exprList->add(yyvsp[-2].expr); - yyval.exprList->add(yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 912 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL, (yyvsp[(3) - (3)].expr)); +} + break; - case 93: -#line 1127 "sqlparser.y" - { - yyval.exprList = yyvsp[0].exprList; - ; - } - break; + case 55: - case 94: -#line 1172 "sqlparser.y" - { - yyval.exprList = yyvsp[-2].exprList; - yyval.exprList->add(yyvsp[0].expr); - ; - } - break; +/* Line 1806 of yacc.c */ +#line 917 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL2, (yyvsp[(3) - (3)].expr)); +} + break; - case 95: -#line 1177 "sqlparser.y" - { - yyval.exprList = new NArgExpr(KexiDBExpr_TableList, IDENTIFIER); //ok? - yyval.exprList->add(yyvsp[0].expr); - ; - } - break; + case 56: - case 96: -#line 1185 "sqlparser.y" - { - KexiDBDbg << "FROM: '" << *yyvsp[0].stringValue << "'"; - yyval.expr = new VariableExpr(*yyvsp[0].stringValue); - - /* - //TODO: this isn't ok for more tables: - Field::ListIterator it = parser->select()->fieldsIterator(); - for(Field *item; (item = it.current()); ++it) - { - if(item->table() == dummy) - { - item->setTable(schema); - } +/* Line 1806 of yacc.c */ +#line 921 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LIKE, (yyvsp[(3) - (3)].expr)); +} + break; - if(item->table() && !item->isQueryAsterisk()) - { - Field *f = item->table()->field(item->name()); - if(!f) - { - ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current); - parser->setError(err); - yyerror("fieldlisterror"); - } - } - }*/ - delete yyvsp[0].stringValue; - ; - } - break; + case 57: - case 97: -#line 1213 "sqlparser.y" - { - //table + alias - yyval.expr = new BinaryExpr( - KexiDBExpr_SpecialBinary, - new VariableExpr(*yyvsp[-1].stringValue), 0, - new VariableExpr(*yyvsp[0].stringValue) - ); - delete yyvsp[-1].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 925 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SQL_IN, (yyvsp[(3) - (3)].expr)); +} + break; - case 98: -#line 1224 "sqlparser.y" - { - //table + alias - yyval.expr = new BinaryExpr( - KexiDBExpr_SpecialBinary, - new VariableExpr(*yyvsp[-2].stringValue), AS, - new VariableExpr(*yyvsp[0].stringValue) - ); - delete yyvsp[-2].stringValue; - delete yyvsp[0].stringValue; - ; - } - break; + case 58: - case 99: -#line 1240 "sqlparser.y" - { - yyval.exprList = yyvsp[-2].exprList; - yyval.exprList->add(yyvsp[0].expr); - KexiDBDbg << "ColViews: ColViews , ColItem"; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 929 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SIMILAR_TO, (yyvsp[(3) - (3)].expr)); +} + break; - case 100: -#line 1246 "sqlparser.y" - { - yyval.exprList = new NArgExpr(0, 0); - yyval.exprList->add(yyvsp[0].expr); - KexiDBDbg << "ColViews: ColItem"; - ; - } - break; + case 59: - case 101: -#line 1255 "sqlparser.y" - { -// $$ = new Field(); -// dummy->addField($$); -// $$->setExpression( $1 ); -// parser->select()->addField($$); - yyval.expr = yyvsp[0].expr; - KexiDBDbg << " added column expr: '" << yyvsp[0].expr->debugString() << "'"; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 933 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_SIMILAR_TO, (yyvsp[(3) - (3)].expr)); +} + break; - case 102: -#line 1264 "sqlparser.y" - { - yyval.expr = yyvsp[0].expr; - KexiDBDbg << " added column wildcard: '" << yyvsp[0].expr->debugString() << "'"; - ; - } - break; + case 61: - case 103: -#line 1269 "sqlparser.y" - { - yyval.expr = new BinaryExpr( - KexiDBExpr_SpecialBinary, yyvsp[-2].expr, AS, - new VariableExpr(*yyvsp[0].stringValue) - ); - KexiDBDbg << " added column expr: " << yyval.expr->debugString(); - delete yyvsp[0].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 943 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( SQL_IS_NULL, (yyvsp[(1) - (2)].expr) ); +} + break; - case 104: -#line 1278 "sqlparser.y" - { - yyval.expr = new BinaryExpr( - KexiDBExpr_SpecialBinary, yyvsp[-1].expr, 0, - new VariableExpr(*yyvsp[0].stringValue) - ); - KexiDBDbg << " added column expr: " << yyval.expr->debugString(); - delete yyvsp[0].stringValue; - ; - } - break; + case 62: - case 105: -#line 1290 "sqlparser.y" - { - yyval.expr = yyvsp[0].expr; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 947 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( SQL_IS_NOT_NULL, (yyvsp[(1) - (2)].expr) ); +} + break; - case 106: -#line 1334 "sqlparser.y" - { - yyval.expr = yyvsp[-1].expr; -//TODO -// $$->setName("DISTINCT(" + $3->name() + ")"); - ; - } - break; + case 64: - case 107: -#line 1343 "sqlparser.y" - { - yyval.expr = new VariableExpr("*"); - KexiDBDbg << "all columns"; +/* Line 1806 of yacc.c */ +#line 957 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_LEFT, (yyvsp[(3) - (3)].expr)); +} + break; -// QueryAsterisk *ast = new QueryAsterisk(parser->select(), dummy); -// parser->select()->addAsterisk(ast); -// requiresTable = true; - ; - } - break; + case 65: - case 108: -#line 1352 "sqlparser.y" - { - QString s(*yyvsp[-2].stringValue); - s += ".*"; - yyval.expr = new VariableExpr(s); - KexiDBDbg << " + all columns from " << s; - delete yyvsp[-2].stringValue; - ; - } - break; +/* Line 1806 of yacc.c */ +#line 961 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_RIGHT, (yyvsp[(3) - (3)].expr)); +} + break; + case 67: - } +/* Line 1806 of yacc.c */ +#line 971 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '+', (yyvsp[(3) - (3)].expr)); + (yyval.expr)->debug(); +} + break; - /* Line 999 of yacc.c. */ -#line 2915 "sqlparser.cpp" - - yyvsp -= yylen; - yyssp -= yylen; + case 68: +/* Line 1806 of yacc.c */ +#line 976 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '-', (yyvsp[(3) - (3)].expr)); +} + break; - YY_STACK_PRINT(yyss, yyssp); + case 69: - *++yyvsp = yyval; +/* Line 1806 of yacc.c */ +#line 980 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '&', (yyvsp[(3) - (3)].expr)); +} + break; + case 70: - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ +/* Line 1806 of yacc.c */ +#line 984 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '|', (yyvsp[(3) - (3)].expr)); +} + break; - yyn = yyr1[yyn]; + case 72: - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; +/* Line 1806 of yacc.c */ +#line 994 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '/', (yyvsp[(3) - (3)].expr)); +} + break; - goto yynewstate; + case 73: +/* Line 1806 of yacc.c */ +#line 998 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '*', (yyvsp[(3) - (3)].expr)); +} + break; - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE(yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yysize += yystrlen(yyprefix) + yystrlen(yytname [yyx]); - yycount += 1; - if (yycount == 5) { - yysize = 0; - break; - } - } - yysize += (sizeof("syntax error, unexpected ") - + yystrlen(yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC(yysize); - if (yymsg != 0) { - char *yyp = yystpcpy(yymsg, "syntax error, unexpected "); - yyp = yystpcpy(yyp, yytname[yytype]); - - if (yycount < 5) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yyp = yystpcpy(yyp, yyprefix); - yyp = yystpcpy(yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror(yymsg); - YYSTACK_FREE(yymsg); - } else - yyerror("syntax error; also virtual memory exhausted"); - } else -#endif /* YYERROR_VERBOSE */ - yyerror("syntax error"); - } + case 74: +/* Line 1806 of yacc.c */ +#line 1002 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '%', (yyvsp[(3) - (3)].expr)); +} + break; + case 76: - if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ +/* Line 1806 of yacc.c */ +#line 1013 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( '-', (yyvsp[(2) - (2)].expr) ); +} + break; - /* Return failure if at end of input. */ - if (yychar == YYEOF) { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) { - YYDSYMPRINTF("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct(yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } + case 77: - YYDSYMPRINTF("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct(yytoken, &yylval); - yychar = YYEMPTY; +/* Line 1806 of yacc.c */ +#line 1017 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( '+', (yyvsp[(2) - (2)].expr) ); +} + break; - } + case 78: - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; +/* Line 1806 of yacc.c */ +#line 1021 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( '~', (yyvsp[(2) - (2)].expr) ); +} + break; + case 79: - /*----------------------------------------------------. - | yyerrlab1 -- error raised explicitly by an action. | - `----------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } +/* Line 1806 of yacc.c */ +#line 1025 "sqlparser.y" + { + (yyval.expr) = new UnaryExpr( NOT, (yyvsp[(2) - (2)].expr) ); +} + break; + + case 80: + +/* Line 1806 of yacc.c */ +#line 1029 "sqlparser.y" + { + (yyval.expr) = new VariableExpr( *(yyvsp[(1) - (1)].stringValue) ); + +//TODO: simplify this later if that's 'only one field name' expression + KexiDBDbg << " + identifier: " << *(yyvsp[(1) - (1)].stringValue); + delete (yyvsp[(1) - (1)].stringValue); +} + break; - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + case 81: + +/* Line 1806 of yacc.c */ +#line 1037 "sqlparser.y" + { + (yyval.expr) = new QueryParameterExpr( *(yyvsp[(1) - (1)].stringValue) ); + KexiDBDbg << " + query parameter: " << (yyval.expr)->debugString(); + delete (yyvsp[(1) - (1)].stringValue); +} + break; + + case 82: + +/* Line 1806 of yacc.c */ +#line 1043 "sqlparser.y" + { + KexiDBDbg << " + function: " << *(yyvsp[(1) - (2)].stringValue) << "(" << (yyvsp[(2) - (2)].exprList)->debugString() << ")"; + (yyval.expr) = new FunctionExpr(*(yyvsp[(1) - (2)].stringValue), (yyvsp[(2) - (2)].exprList)); + delete (yyvsp[(1) - (2)].stringValue); +} + break; - YYDSYMPRINTF("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct(yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; + case 83: - YY_STACK_PRINT(yyss, yyssp); +/* Line 1806 of yacc.c */ +#line 1050 "sqlparser.y" + { + (yyval.expr) = new VariableExpr( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) ); + KexiDBDbg << " + identifier.identifier: " << *(yyvsp[(1) - (3)].stringValue) << "." << *(yyvsp[(3) - (3)].stringValue); + delete (yyvsp[(1) - (3)].stringValue); + delete (yyvsp[(3) - (3)].stringValue); +} + break; + + case 84: + +/* Line 1806 of yacc.c */ +#line 1057 "sqlparser.y" + { + (yyval.expr) = new ConstExpr( SQL_NULL, QVariant() ); + KexiDBDbg << " + NULL"; +// $$ = new Field(); + //$$->setName(QString::null); +} + break; + + case 85: + +/* Line 1806 of yacc.c */ +#line 1064 "sqlparser.y" + { + (yyval.expr) = new ConstExpr( CHARACTER_STRING_LITERAL, *(yyvsp[(1) - (1)].stringValue) ); + KexiDBDbg << " + constant " << (yyvsp[(1) - (1)].stringValue); + delete (yyvsp[(1) - (1)].stringValue); +} + break; + + case 86: + +/* Line 1806 of yacc.c */ +#line 1070 "sqlparser.y" + { + QVariant val; + if ((yyvsp[(1) - (1)].integerValue) <= INT_MAX && (yyvsp[(1) - (1)].integerValue) >= INT_MIN) + val = (int)(yyvsp[(1) - (1)].integerValue); + else if ((yyvsp[(1) - (1)].integerValue) <= UINT_MAX && (yyvsp[(1) - (1)].integerValue) >= 0) + val = (uint)(yyvsp[(1) - (1)].integerValue); + else if ((yyvsp[(1) - (1)].integerValue) <= LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= LLONG_MIN) + val = (qint64)(yyvsp[(1) - (1)].integerValue); + +// if ($1 < ULLONG_MAX) +// val = (quint64)$1; +//TODO ok? + + (yyval.expr) = new ConstExpr( INTEGER_CONST, val ); + KexiDBDbg << " + int constant: " << val.toString(); +} + break; + + case 87: + +/* Line 1806 of yacc.c */ +#line 1087 "sqlparser.y" + { + (yyval.expr) = new ConstExpr( REAL_CONST, QPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) ); + KexiDBDbg << " + real constant: " << (yyvsp[(1) - (1)].realValue).integer << "." << (yyvsp[(1) - (1)].realValue).fractional; +} + break; + + case 89: + +/* Line 1806 of yacc.c */ +#line 1098 "sqlparser.y" + { + KexiDBDbg << "(expr)"; + (yyval.expr) = new UnaryExpr('(', (yyvsp[(2) - (3)].expr)); +} + break; + + case 90: + +/* Line 1806 of yacc.c */ +#line 1106 "sqlparser.y" + { +// $$ = new NArgExpr(0, 0); +// $$->add( $1 ); +// $$->add( $3 ); + (yyval.exprList) = (yyvsp[(2) - (3)].exprList); +} + break; + + case 91: + +/* Line 1806 of yacc.c */ +#line 1116 "sqlparser.y" + { + (yyval.exprList) = (yyvsp[(3) - (3)].exprList); + (yyval.exprList)->prepend( (yyvsp[(1) - (3)].expr) ); +} + break; + + case 92: + +/* Line 1806 of yacc.c */ +#line 1121 "sqlparser.y" + { + (yyval.exprList) = new NArgExpr(0, 0); + (yyval.exprList)->add( (yyvsp[(1) - (3)].expr) ); + (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) ); +} + break; + + case 93: + +/* Line 1806 of yacc.c */ +#line 1130 "sqlparser.y" + { + (yyval.exprList) = (yyvsp[(2) - (2)].exprList); +} + break; + + case 94: + +/* Line 1806 of yacc.c */ +#line 1175 "sqlparser.y" + { + (yyval.exprList) = (yyvsp[(1) - (3)].exprList); + (yyval.exprList)->add((yyvsp[(3) - (3)].expr)); +} + break; + + case 95: + +/* Line 1806 of yacc.c */ +#line 1180 "sqlparser.y" + { + (yyval.exprList) = new NArgExpr(KexiDBExpr_TableList, IDENTIFIER); //ok? + (yyval.exprList)->add((yyvsp[(1) - (1)].expr)); +} + break; + + case 96: + +/* Line 1806 of yacc.c */ +#line 1188 "sqlparser.y" + { + KexiDBDbg << "FROM: '" << *(yyvsp[(1) - (1)].stringValue) << "'"; + (yyval.expr) = new VariableExpr(*(yyvsp[(1) - (1)].stringValue)); + + /* +//TODO: this isn't ok for more tables: + Field::ListIterator it = parser->select()->fieldsIterator(); + for(Field *item; (item = it.current()); ++it) + { + if(item->table() == dummy) + { + item->setTable(schema); + } + + if(item->table() && !item->isQueryAsterisk()) + { + Field *f = item->table()->field(item->name()); + if(!f) + { + ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'",item->name(),schema->name()), ctoken, current); + parser->setError(err); + yyerror("fieldlisterror"); + } + } + }*/ + delete (yyvsp[(1) - (1)].stringValue); +} + break; + + case 97: + +/* Line 1806 of yacc.c */ +#line 1216 "sqlparser.y" + { + //table + alias + (yyval.expr) = new BinaryExpr( + KexiDBExpr_SpecialBinary, + new VariableExpr(*(yyvsp[(1) - (2)].stringValue)), 0, + new VariableExpr(*(yyvsp[(2) - (2)].stringValue)) + ); + delete (yyvsp[(1) - (2)].stringValue); + delete (yyvsp[(2) - (2)].stringValue); +} + break; + + case 98: + +/* Line 1806 of yacc.c */ +#line 1227 "sqlparser.y" + { + //table + alias + (yyval.expr) = new BinaryExpr( + KexiDBExpr_SpecialBinary, + new VariableExpr(*(yyvsp[(1) - (3)].stringValue)), AS, + new VariableExpr(*(yyvsp[(3) - (3)].stringValue)) + ); + delete (yyvsp[(1) - (3)].stringValue); + delete (yyvsp[(3) - (3)].stringValue); +} + break; + + case 99: + +/* Line 1806 of yacc.c */ +#line 1243 "sqlparser.y" + { + (yyval.exprList) = (yyvsp[(1) - (3)].exprList); + (yyval.exprList)->add( (yyvsp[(3) - (3)].expr) ); + KexiDBDbg << "ColViews: ColViews , ColItem"; +} + break; + + case 100: + +/* Line 1806 of yacc.c */ +#line 1249 "sqlparser.y" + { + (yyval.exprList) = new NArgExpr(0,0); + (yyval.exprList)->add( (yyvsp[(1) - (1)].expr) ); + KexiDBDbg << "ColViews: ColItem"; +} + break; + + case 101: + +/* Line 1806 of yacc.c */ +#line 1258 "sqlparser.y" + { +// $$ = new Field(); +// dummy->addField($$); +// $$->setExpression( $1 ); +// parser->select()->addField($$); + (yyval.expr) = (yyvsp[(1) - (1)].expr); + KexiDBDbg << " added column expr: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'"; +} + break; + + case 102: + +/* Line 1806 of yacc.c */ +#line 1267 "sqlparser.y" + { + (yyval.expr) = (yyvsp[(1) - (1)].expr); + KexiDBDbg << " added column wildcard: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'"; +} + break; + + case 103: + +/* Line 1806 of yacc.c */ +#line 1272 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr( + KexiDBExpr_SpecialBinary, (yyvsp[(1) - (3)].expr), AS, + new VariableExpr(*(yyvsp[(3) - (3)].stringValue)) + ); + KexiDBDbg << " added column expr: " << (yyval.expr)->debugString(); + delete (yyvsp[(3) - (3)].stringValue); +} + break; + + case 104: + +/* Line 1806 of yacc.c */ +#line 1281 "sqlparser.y" + { + (yyval.expr) = new BinaryExpr( + KexiDBExpr_SpecialBinary, (yyvsp[(1) - (2)].expr), 0, + new VariableExpr(*(yyvsp[(2) - (2)].stringValue)) + ); + KexiDBDbg << " added column expr: " << (yyval.expr)->debugString(); + delete (yyvsp[(2) - (2)].stringValue); +} + break; + + case 105: + +/* Line 1806 of yacc.c */ +#line 1293 "sqlparser.y" + { + (yyval.expr) = (yyvsp[(1) - (1)].expr); +} + break; + + case 106: + +/* Line 1806 of yacc.c */ +#line 1337 "sqlparser.y" + { + (yyval.expr) = (yyvsp[(3) - (4)].expr); +//TODO +// $$->setName("DISTINCT(" + $3->name() + ")"); +} + break; + + case 107: + +/* Line 1806 of yacc.c */ +#line 1346 "sqlparser.y" + { + (yyval.expr) = new VariableExpr("*"); + KexiDBDbg << "all columns"; + +// QueryAsterisk *ast = new QueryAsterisk(parser->select(), dummy); +// parser->select()->addAsterisk(ast); +// requiresTable = true; +} + break; + + case 108: + +/* Line 1806 of yacc.c */ +#line 1355 "sqlparser.y" + { + QString s( *(yyvsp[(1) - (3)].stringValue) ); + s += ".*"; + (yyval.expr) = new VariableExpr(s); + KexiDBDbg << " + all columns from " << s; + delete (yyvsp[(1) - (3)].stringValue); +} + break; + + + +/* Line 1806 of yacc.c */ +#line 3138 "sqlparser.cpp" + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - if (yyn == YYFINAL) - YYACCEPT; + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; - YYDPRINTF((stderr, "Shifting error token, ")); - *++yyvsp = yylval; +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + *++yyvsp = yylval; - yystate = yyn; - goto yynewstate; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ yyacceptlab: - yyresult = 0; - goto yyreturn; + yyresult = 0; + goto yyreturn; - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow - /*----------------------------------------------. - | yyoverflowlab -- parser overflow comes here. | - `----------------------------------------------*/ -yyoverflowlab: - yyerror("parser stack overflow"); - yyresult = 2; - /* Fall through. */ + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ #endif yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE(yyss); + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 1367 "sqlparser.y" +/* Line 2067 of yacc.c */ +#line 1370 "sqlparser.y" -const char* tname(int offset) -{ - return yytname[offset]; -} + +const char* tname(int offset) { return yytname[offset]; } diff --git a/libs/db/parser/sqlparser.h b/libs/db/parser/sqlparser.h index bf233aa5c4d7035f4bdff8264123fc29de91662f..d5a2c02b7b56876498c435d7a82220c08f888940 100644 --- a/libs/db/parser/sqlparser.h +++ b/libs/db/parser/sqlparser.h @@ -5,763 +5,429 @@ #include "sqltypes.h" bool parseData(KexiDB::Parser *p, const char *data); -/* A Bison parser, made by GNU Bison 1.875b. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype { - UMINUS = 258, - SQL_TYPE = 259, - SQL_ABS = 260, - ACOS = 261, - AMPERSAND = 262, - SQL_ABSOLUTE = 263, - ADA = 264, - ADD = 265, - ADD_DAYS = 266, - ADD_HOURS = 267, - ADD_MINUTES = 268, - ADD_MONTHS = 269, - ADD_SECONDS = 270, - ADD_YEARS = 271, - ALL = 272, - ALLOCATE = 273, - ALTER = 274, - AND = 275, - ANY = 276, - ARE = 277, - AS = 278, - ASIN = 279, - ASC = 280, - ASCII = 281, - ASSERTION = 282, - ATAN = 283, - ATAN2 = 284, - AUTHORIZATION = 285, - AUTO_INCREMENT = 286, - AVG = 287, - BEFORE = 288, - SQL_BEGIN = 289, - BETWEEN = 290, - BIGINT = 291, - BINARY = 292, - BIT = 293, - BIT_LENGTH = 294, - BITWISE_SHIFT_LEFT = 295, - BITWISE_SHIFT_RIGHT = 296, - BREAK = 297, - BY = 298, - CASCADE = 299, - CASCADED = 300, - CASE = 301, - CAST = 302, - CATALOG = 303, - CEILING = 304, - CENTER = 305, - SQL_CHAR = 306, - CHAR_LENGTH = 307, - CHARACTER_STRING_LITERAL = 308, - CHECK = 309, - CLOSE = 310, - COALESCE = 311, - COBOL = 312, - COLLATE = 313, - COLLATION = 314, - COLUMN = 315, - COMMIT = 316, - COMPUTE = 317, - CONCAT = 318, - CONCATENATION = 319, - CONNECT = 320, - CONNECTION = 321, - CONSTRAINT = 322, - CONSTRAINTS = 323, - CONTINUE = 324, - CONVERT = 325, - CORRESPONDING = 326, - COS = 327, - COT = 328, - COUNT = 329, - CREATE = 330, - CURDATE = 331, - CURRENT = 332, - CURRENT_DATE = 333, - CURRENT_TIME = 334, - CURRENT_TIMESTAMP = 335, - CURTIME = 336, - CURSOR = 337, - DATABASE = 338, - SQL_DATE = 339, - DATE_FORMAT = 340, - DATE_REMAINDER = 341, - DATE_VALUE = 342, - DAY = 343, - DAYOFMONTH = 344, - DAYOFWEEK = 345, - DAYOFYEAR = 346, - DAYS_BETWEEN = 347, - DEALLOCATE = 348, - DEC = 349, - DECLARE = 350, - DEFAULT = 351, - DEFERRABLE = 352, - DEFERRED = 353, - SQL_DELETE = 354, - DESC = 355, - DESCRIBE = 356, - DESCRIPTOR = 357, - DIAGNOSTICS = 358, - DICTIONARY = 359, - DIRECTORY = 360, - DISCONNECT = 361, - DISPLACEMENT = 362, - DISTINCT = 363, - DOMAIN_TOKEN = 364, - SQL_DOUBLE = 365, - DOUBLE_QUOTED_STRING = 366, - DROP = 367, - ELSE = 368, - END = 369, - END_EXEC = 370, - EQUAL = 371, - ESCAPE = 372, - EXCEPT = 373, - SQL_EXCEPTION = 374, - EXEC = 375, - EXECUTE = 376, - EXISTS = 377, - EXP = 378, - EXPONENT = 379, - EXTERNAL = 380, - EXTRACT = 381, - SQL_FALSE = 382, - FETCH = 383, - FIRST = 384, - SQL_FLOAT = 385, - FLOOR = 386, - FN = 387, - FOR = 388, - FOREIGN = 389, - FORTRAN = 390, - FOUND = 391, - FOUR_DIGITS = 392, - FROM = 393, - FULL = 394, - GET = 395, - GLOBAL = 396, - GO = 397, - GOTO = 398, - GRANT = 399, - GREATER_OR_EQUAL = 400, - HAVING = 401, - HOUR = 402, - HOURS_BETWEEN = 403, - IDENTITY = 404, - IFNULL = 405, - SQL_IGNORE = 406, - IMMEDIATE = 407, - SQL_IN = 408, - INCLUDE = 409, - INDEX = 410, - INDICATOR = 411, - INITIALLY = 412, - INNER = 413, - SQL_INPUT = 414, - INSENSITIVE = 415, - INSERT = 416, - INTEGER = 417, - INTERSECT = 418, - INTERVAL = 419, - INTO = 420, - IS = 421, - ISOLATION = 422, - JOIN = 423, - JUSTIFY = 424, - KEY = 425, - LANGUAGE = 426, - LAST = 427, - LCASE = 428, - LEFT = 429, - LENGTH = 430, - LESS_OR_EQUAL = 431, - LEVEL = 432, - LIKE = 433, - LINE_WIDTH = 434, - LOCAL = 435, - LOCATE = 436, - LOG = 437, - SQL_LONG = 438, - LOWER = 439, - LTRIM = 440, - LTRIP = 441, - MATCH = 442, - SQL_MAX = 443, - MICROSOFT = 444, - SQL_MIN = 445, - MINUS = 446, - MINUTE = 447, - MINUTES_BETWEEN = 448, - MOD = 449, - MODIFY = 450, - MODULE = 451, - MONTH = 452, - MONTHS_BETWEEN = 453, - MUMPS = 454, - NAMES = 455, - NATIONAL = 456, - NCHAR = 457, - NEXT = 458, - NODUP = 459, - NONE = 460, - NOT = 461, - NOT_EQUAL = 462, - NOT_EQUAL2 = 463, - NOW = 464, - SQL_NULL = 465, - SQL_IS = 466, - SQL_IS_NULL = 467, - SQL_IS_NOT_NULL = 468, - NULLIF = 469, - NUMERIC = 470, - OCTET_LENGTH = 471, - ODBC = 472, - OF = 473, - SQL_OFF = 474, - SQL_ON = 475, - ONLY = 476, - OPEN = 477, - OPTION = 478, - OR = 479, - ORDER = 480, - OUTER = 481, - OUTPUT = 482, - OVERLAPS = 483, - PAGE = 484, - PARTIAL = 485, - SQL_PASCAL = 486, - PERSISTENT = 487, - CQL_PI = 488, - PLI = 489, - POSITION = 490, - PRECISION = 491, - PREPARE = 492, - PRESERVE = 493, - PRIMARY = 494, - PRIOR = 495, - PRIVILEGES = 496, - PROCEDURE = 497, - PRODUCT = 498, - PUBLIC = 499, - QUARTER = 500, - QUIT = 501, - RAND = 502, - READ_ONLY = 503, - REAL = 504, - REFERENCES = 505, - REPEAT = 506, - REPLACE = 507, - RESTRICT = 508, - REVOKE = 509, - RIGHT = 510, - ROLLBACK = 511, - ROWS = 512, - RPAD = 513, - RTRIM = 514, - SCHEMA = 515, - SCREEN_WIDTH = 516, - SCROLL = 517, - SECOND = 518, - SECONDS_BETWEEN = 519, - SELECT = 520, - SEQUENCE = 521, - SETOPT = 522, - SET = 523, - SHOWOPT = 524, - SIGN = 525, - SIMILAR_TO = 526, - NOT_SIMILAR_TO = 527, - INTEGER_CONST = 528, - REAL_CONST = 529, - DATE_CONST = 530, - DATETIME_CONST = 531, - TIME_CONST = 532, - SIN = 533, - SQL_SIZE = 534, - SMALLINT = 535, - SOME = 536, - SPACE = 537, - SQL = 538, - SQL_TRUE = 539, - SQLCA = 540, - SQLCODE = 541, - SQLERROR = 542, - SQLSTATE = 543, - SQLWARNING = 544, - SQRT = 545, - STDEV = 546, - SUBSTRING = 547, - SUM = 548, - SYSDATE = 549, - SYSDATE_FORMAT = 550, - SYSTEM = 551, - TABLE = 552, - TAN = 553, - TEMPORARY = 554, - THEN = 555, - THREE_DIGITS = 556, - TIME = 557, - TIMESTAMP = 558, - TIMEZONE_HOUR = 559, - TIMEZONE_MINUTE = 560, - TINYINT = 561, - TO = 562, - TO_CHAR = 563, - TO_DATE = 564, - TRANSACTION = 565, - TRANSLATE = 566, - TRANSLATION = 567, - TRUNCATE = 568, - GENERAL_TITLE = 569, - TWO_DIGITS = 570, - UCASE = 571, - UNION = 572, - UNIQUE = 573, - SQL_UNKNOWN = 574, - UPDATE = 575, - UPPER = 576, - USAGE = 577, - USER = 578, - IDENTIFIER = 579, - IDENTIFIER_DOT_ASTERISK = 580, - QUERY_PARAMETER = 581, - USING = 582, - VALUE = 583, - VALUES = 584, - VARBINARY = 585, - VARCHAR = 586, - VARYING = 587, - VENDOR = 588, - VIEW = 589, - WEEK = 590, - WHEN = 591, - WHENEVER = 592, - WHERE = 593, - WHERE_CURRENT_OF = 594, - WITH = 595, - WORD_WRAPPED = 596, - WORK = 597, - WRAPPED = 598, - XOR = 599, - YEAR = 600, - YEARS_BETWEEN = 601, - SCAN_ERROR = 602, - __LAST_TOKEN = 603, - ILIKE = 604 -}; + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + UMINUS = 258, + SQL_TYPE = 259, + SQL_ABS = 260, + ACOS = 261, + AMPERSAND = 262, + SQL_ABSOLUTE = 263, + ADA = 264, + ADD = 265, + ADD_DAYS = 266, + ADD_HOURS = 267, + ADD_MINUTES = 268, + ADD_MONTHS = 269, + ADD_SECONDS = 270, + ADD_YEARS = 271, + ALL = 272, + ALLOCATE = 273, + ALTER = 274, + AND = 275, + ANY = 276, + ARE = 277, + AS = 278, + ASIN = 279, + ASC = 280, + ASCII = 281, + ASSERTION = 282, + ATAN = 283, + ATAN2 = 284, + AUTHORIZATION = 285, + AUTO_INCREMENT = 286, + AVG = 287, + BEFORE = 288, + SQL_BEGIN = 289, + BETWEEN = 290, + BIGINT = 291, + BINARY = 292, + BIT = 293, + BIT_LENGTH = 294, + BITWISE_SHIFT_LEFT = 295, + BITWISE_SHIFT_RIGHT = 296, + BREAK = 297, + BY = 298, + CASCADE = 299, + CASCADED = 300, + CASE = 301, + CAST = 302, + CATALOG = 303, + CEILING = 304, + CENTER = 305, + SQL_CHAR = 306, + CHAR_LENGTH = 307, + CHARACTER_STRING_LITERAL = 308, + CHECK = 309, + CLOSE = 310, + COALESCE = 311, + COBOL = 312, + COLLATE = 313, + COLLATION = 314, + COLUMN = 315, + COMMIT = 316, + COMPUTE = 317, + CONCAT = 318, + CONCATENATION = 319, + CONNECT = 320, + CONNECTION = 321, + CONSTRAINT = 322, + CONSTRAINTS = 323, + CONTINUE = 324, + CONVERT = 325, + CORRESPONDING = 326, + COS = 327, + COT = 328, + COUNT = 329, + CREATE = 330, + CURDATE = 331, + CURRENT = 332, + CURRENT_DATE = 333, + CURRENT_TIME = 334, + CURRENT_TIMESTAMP = 335, + CURTIME = 336, + CURSOR = 337, + DATABASE = 338, + SQL_DATE = 339, + DATE_FORMAT = 340, + DATE_REMAINDER = 341, + DATE_VALUE = 342, + DAY = 343, + DAYOFMONTH = 344, + DAYOFWEEK = 345, + DAYOFYEAR = 346, + DAYS_BETWEEN = 347, + DEALLOCATE = 348, + DEC = 349, + DECLARE = 350, + DEFAULT = 351, + DEFERRABLE = 352, + DEFERRED = 353, + SQL_DELETE = 354, + DESC = 355, + DESCRIBE = 356, + DESCRIPTOR = 357, + DIAGNOSTICS = 358, + DICTIONARY = 359, + DIRECTORY = 360, + DISCONNECT = 361, + DISPLACEMENT = 362, + DISTINCT = 363, + DOMAIN_TOKEN = 364, + SQL_DOUBLE = 365, + DOUBLE_QUOTED_STRING = 366, + DROP = 367, + ELSE = 368, + END = 369, + END_EXEC = 370, + EQUAL = 371, + ESCAPE = 372, + EXCEPT = 373, + SQL_EXCEPTION = 374, + EXEC = 375, + EXECUTE = 376, + EXISTS = 377, + EXP = 378, + EXPONENT = 379, + EXTERNAL = 380, + EXTRACT = 381, + SQL_FALSE = 382, + FETCH = 383, + FIRST = 384, + SQL_FLOAT = 385, + FLOOR = 386, + FN = 387, + FOR = 388, + FOREIGN = 389, + FORTRAN = 390, + FOUND = 391, + FOUR_DIGITS = 392, + FROM = 393, + FULL = 394, + GET = 395, + GLOBAL = 396, + GO = 397, + GOTO = 398, + GRANT = 399, + GREATER_OR_EQUAL = 400, + HAVING = 401, + HOUR = 402, + HOURS_BETWEEN = 403, + IDENTITY = 404, + IFNULL = 405, + SQL_IGNORE = 406, + IMMEDIATE = 407, + SQL_IN = 408, + INCLUDE = 409, + INDEX = 410, + INDICATOR = 411, + INITIALLY = 412, + INNER = 413, + SQL_INPUT = 414, + INSENSITIVE = 415, + INSERT = 416, + INTEGER = 417, + INTERSECT = 418, + INTERVAL = 419, + INTO = 420, + IS = 421, + ISOLATION = 422, + JOIN = 423, + JUSTIFY = 424, + KEY = 425, + LANGUAGE = 426, + LAST = 427, + LCASE = 428, + LEFT = 429, + LENGTH = 430, + LESS_OR_EQUAL = 431, + LEVEL = 432, + LIKE = 433, + LINE_WIDTH = 434, + LOCAL = 435, + LOCATE = 436, + LOG = 437, + SQL_LONG = 438, + LOWER = 439, + LTRIM = 440, + LTRIP = 441, + MATCH = 442, + SQL_MAX = 443, + MICROSOFT = 444, + SQL_MIN = 445, + MINUS = 446, + MINUTE = 447, + MINUTES_BETWEEN = 448, + MOD = 449, + MODIFY = 450, + MODULE = 451, + MONTH = 452, + MONTHS_BETWEEN = 453, + MUMPS = 454, + NAMES = 455, + NATIONAL = 456, + NCHAR = 457, + NEXT = 458, + NODUP = 459, + NONE = 460, + NOT = 461, + NOT_EQUAL = 462, + NOT_EQUAL2 = 463, + NOW = 464, + SQL_NULL = 465, + SQL_IS = 466, + SQL_IS_NULL = 467, + SQL_IS_NOT_NULL = 468, + NULLIF = 469, + NUMERIC = 470, + OCTET_LENGTH = 471, + ODBC = 472, + OF = 473, + SQL_OFF = 474, + SQL_ON = 475, + ONLY = 476, + OPEN = 477, + OPTION = 478, + OR = 479, + ORDER = 480, + OUTER = 481, + OUTPUT = 482, + OVERLAPS = 483, + PAGE = 484, + PARTIAL = 485, + SQL_PASCAL = 486, + PERSISTENT = 487, + CQL_PI = 488, + PLI = 489, + POSITION = 490, + PRECISION = 491, + PREPARE = 492, + PRESERVE = 493, + PRIMARY = 494, + PRIOR = 495, + PRIVILEGES = 496, + PROCEDURE = 497, + PRODUCT = 498, + PUBLIC = 499, + QUARTER = 500, + QUIT = 501, + RAND = 502, + READ_ONLY = 503, + REAL = 504, + REFERENCES = 505, + REPEAT = 506, + REPLACE = 507, + RESTRICT = 508, + REVOKE = 509, + RIGHT = 510, + ROLLBACK = 511, + ROWS = 512, + RPAD = 513, + RTRIM = 514, + SCHEMA = 515, + SCREEN_WIDTH = 516, + SCROLL = 517, + SECOND = 518, + SECONDS_BETWEEN = 519, + SELECT = 520, + SEQUENCE = 521, + SETOPT = 522, + SET = 523, + SHOWOPT = 524, + SIGN = 525, + SIMILAR_TO = 526, + NOT_SIMILAR_TO = 527, + INTEGER_CONST = 528, + REAL_CONST = 529, + DATE_CONST = 530, + DATETIME_CONST = 531, + TIME_CONST = 532, + SIN = 533, + SQL_SIZE = 534, + SMALLINT = 535, + SOME = 536, + SPACE = 537, + SQL = 538, + SQL_TRUE = 539, + SQLCA = 540, + SQLCODE = 541, + SQLERROR = 542, + SQLSTATE = 543, + SQLWARNING = 544, + SQRT = 545, + STDEV = 546, + SUBSTRING = 547, + SUM = 548, + SYSDATE = 549, + SYSDATE_FORMAT = 550, + SYSTEM = 551, + TABLE = 552, + TAN = 553, + TEMPORARY = 554, + THEN = 555, + THREE_DIGITS = 556, + TIME = 557, + TIMESTAMP = 558, + TIMEZONE_HOUR = 559, + TIMEZONE_MINUTE = 560, + TINYINT = 561, + TO = 562, + TO_CHAR = 563, + TO_DATE = 564, + TRANSACTION = 565, + TRANSLATE = 566, + TRANSLATION = 567, + TRUNCATE = 568, + GENERAL_TITLE = 569, + TWO_DIGITS = 570, + UCASE = 571, + UNION = 572, + UNIQUE = 573, + SQL_UNKNOWN = 574, + UPDATE = 575, + UPPER = 576, + USAGE = 577, + USER = 578, + IDENTIFIER = 579, + IDENTIFIER_DOT_ASTERISK = 580, + QUERY_PARAMETER = 581, + USING = 582, + VALUE = 583, + VALUES = 584, + VARBINARY = 585, + VARCHAR = 586, + VARYING = 587, + VENDOR = 588, + VIEW = 589, + WEEK = 590, + WHEN = 591, + WHENEVER = 592, + WHERE = 593, + WHERE_CURRENT_OF = 594, + WITH = 595, + WORD_WRAPPED = 596, + WORK = 597, + WRAPPED = 598, + XOR = 599, + YEAR = 600, + YEARS_BETWEEN = 601, + SCAN_ERROR = 602, + __LAST_TOKEN = 603, + ILIKE = 604 + }; #endif -#define UMINUS 258 -#define SQL_TYPE 259 -#define SQL_ABS 260 -#define ACOS 261 -#define AMPERSAND 262 -#define SQL_ABSOLUTE 263 -#define ADA 264 -#define ADD 265 -#define ADD_DAYS 266 -#define ADD_HOURS 267 -#define ADD_MINUTES 268 -#define ADD_MONTHS 269 -#define ADD_SECONDS 270 -#define ADD_YEARS 271 -#define ALL 272 -#define ALLOCATE 273 -#define ALTER 274 -#define AND 275 -#define ANY 276 -#define ARE 277 -#define AS 278 -#define ASIN 279 -#define ASC 280 -#define ASCII 281 -#define ASSERTION 282 -#define ATAN 283 -#define ATAN2 284 -#define AUTHORIZATION 285 -#define AUTO_INCREMENT 286 -#define AVG 287 -#define BEFORE 288 -#define SQL_BEGIN 289 -#define BETWEEN 290 -#define BIGINT 291 -#define BINARY 292 -#define BIT 293 -#define BIT_LENGTH 294 -#define BITWISE_SHIFT_LEFT 295 -#define BITWISE_SHIFT_RIGHT 296 -#define BREAK 297 -#define BY 298 -#define CASCADE 299 -#define CASCADED 300 -#define CASE 301 -#define CAST 302 -#define CATALOG 303 -#define CEILING 304 -#define CENTER 305 -#define SQL_CHAR 306 -#define CHAR_LENGTH 307 -#define CHARACTER_STRING_LITERAL 308 -#define CHECK 309 -#define CLOSE 310 -#define COALESCE 311 -#define COBOL 312 -#define COLLATE 313 -#define COLLATION 314 -#define COLUMN 315 -#define COMMIT 316 -#define COMPUTE 317 -#define CONCAT 318 -#define CONCATENATION 319 -#define CONNECT 320 -#define CONNECTION 321 -#define CONSTRAINT 322 -#define CONSTRAINTS 323 -#define CONTINUE 324 -#define CONVERT 325 -#define CORRESPONDING 326 -#define COS 327 -#define COT 328 -#define COUNT 329 -#define CREATE 330 -#define CURDATE 331 -#define CURRENT 332 -#define CURRENT_DATE 333 -#define CURRENT_TIME 334 -#define CURRENT_TIMESTAMP 335 -#define CURTIME 336 -#define CURSOR 337 -#define DATABASE 338 -#define SQL_DATE 339 -#define DATE_FORMAT 340 -#define DATE_REMAINDER 341 -#define DATE_VALUE 342 -#define DAY 343 -#define DAYOFMONTH 344 -#define DAYOFWEEK 345 -#define DAYOFYEAR 346 -#define DAYS_BETWEEN 347 -#define DEALLOCATE 348 -#define DEC 349 -#define DECLARE 350 -#define DEFAULT 351 -#define DEFERRABLE 352 -#define DEFERRED 353 -#define SQL_DELETE 354 -#define DESC 355 -#define DESCRIBE 356 -#define DESCRIPTOR 357 -#define DIAGNOSTICS 358 -#define DICTIONARY 359 -#define DIRECTORY 360 -#define DISCONNECT 361 -#define DISPLACEMENT 362 -#define DISTINCT 363 -#define DOMAIN_TOKEN 364 -#define SQL_DOUBLE 365 -#define DOUBLE_QUOTED_STRING 366 -#define DROP 367 -#define ELSE 368 -#define END 369 -#define END_EXEC 370 -#define EQUAL 371 -#define ESCAPE 372 -#define EXCEPT 373 -#define SQL_EXCEPTION 374 -#define EXEC 375 -#define EXECUTE 376 -#define EXISTS 377 -#define EXP 378 -#define EXPONENT 379 -#define EXTERNAL 380 -#define EXTRACT 381 -#define SQL_FALSE 382 -#define FETCH 383 -#define FIRST 384 -#define SQL_FLOAT 385 -#define FLOOR 386 -#define FN 387 -#define FOR 388 -#define FOREIGN 389 -#define FORTRAN 390 -#define FOUND 391 -#define FOUR_DIGITS 392 -#define FROM 393 -#define FULL 394 -#define GET 395 -#define GLOBAL 396 -#define GO 397 -#define GOTO 398 -#define GRANT 399 -#define GREATER_OR_EQUAL 400 -#define HAVING 401 -#define HOUR 402 -#define HOURS_BETWEEN 403 -#define IDENTITY 404 -#define IFNULL 405 -#define SQL_IGNORE 406 -#define IMMEDIATE 407 -#define SQL_IN 408 -#define INCLUDE 409 -#define INDEX 410 -#define INDICATOR 411 -#define INITIALLY 412 -#define INNER 413 -#define SQL_INPUT 414 -#define INSENSITIVE 415 -#define INSERT 416 -#define INTEGER 417 -#define INTERSECT 418 -#define INTERVAL 419 -#define INTO 420 -#define IS 421 -#define ISOLATION 422 -#define JOIN 423 -#define JUSTIFY 424 -#define KEY 425 -#define LANGUAGE 426 -#define LAST 427 -#define LCASE 428 -#define LEFT 429 -#define LENGTH 430 -#define LESS_OR_EQUAL 431 -#define LEVEL 432 -#define LIKE 433 -#define LINE_WIDTH 434 -#define LOCAL 435 -#define LOCATE 436 -#define LOG 437 -#define SQL_LONG 438 -#define LOWER 439 -#define LTRIM 440 -#define LTRIP 441 -#define MATCH 442 -#define SQL_MAX 443 -#define MICROSOFT 444 -#define SQL_MIN 445 -#define MINUS 446 -#define MINUTE 447 -#define MINUTES_BETWEEN 448 -#define MOD 449 -#define MODIFY 450 -#define MODULE 451 -#define MONTH 452 -#define MONTHS_BETWEEN 453 -#define MUMPS 454 -#define NAMES 455 -#define NATIONAL 456 -#define NCHAR 457 -#define NEXT 458 -#define NODUP 459 -#define NONE 460 -#define NOT 461 -#define NOT_EQUAL 462 -#define NOT_EQUAL2 463 -#define NOW 464 -#define SQL_NULL 465 -#define SQL_IS 466 -#define SQL_IS_NULL 467 -#define SQL_IS_NOT_NULL 468 -#define NULLIF 469 -#define NUMERIC 470 -#define OCTET_LENGTH 471 -#define ODBC 472 -#define OF 473 -#define SQL_OFF 474 -#define SQL_ON 475 -#define ONLY 476 -#define OPEN 477 -#define OPTION 478 -#define OR 479 -#define ORDER 480 -#define OUTER 481 -#define OUTPUT 482 -#define OVERLAPS 483 -#define PAGE 484 -#define PARTIAL 485 -#define SQL_PASCAL 486 -#define PERSISTENT 487 -#define CQL_PI 488 -#define PLI 489 -#define POSITION 490 -#define PRECISION 491 -#define PREPARE 492 -#define PRESERVE 493 -#define PRIMARY 494 -#define PRIOR 495 -#define PRIVILEGES 496 -#define PROCEDURE 497 -#define PRODUCT 498 -#define PUBLIC 499 -#define QUARTER 500 -#define QUIT 501 -#define RAND 502 -#define READ_ONLY 503 -#define REAL 504 -#define REFERENCES 505 -#define REPEAT 506 -#define REPLACE 507 -#define RESTRICT 508 -#define REVOKE 509 -#define RIGHT 510 -#define ROLLBACK 511 -#define ROWS 512 -#define RPAD 513 -#define RTRIM 514 -#define SCHEMA 515 -#define SCREEN_WIDTH 516 -#define SCROLL 517 -#define SECOND 518 -#define SECONDS_BETWEEN 519 -#define SELECT 520 -#define SEQUENCE 521 -#define SETOPT 522 -#define SET 523 -#define SHOWOPT 524 -#define SIGN 525 -#define SIMILAR_TO 526 -#define NOT_SIMILAR_TO 527 -#define INTEGER_CONST 528 -#define REAL_CONST 529 -#define DATE_CONST 530 -#define DATETIME_CONST 531 -#define TIME_CONST 532 -#define SIN 533 -#define SQL_SIZE 534 -#define SMALLINT 535 -#define SOME 536 -#define SPACE 537 -#define SQL 538 -#define SQL_TRUE 539 -#define SQLCA 540 -#define SQLCODE 541 -#define SQLERROR 542 -#define SQLSTATE 543 -#define SQLWARNING 544 -#define SQRT 545 -#define STDEV 546 -#define SUBSTRING 547 -#define SUM 548 -#define SYSDATE 549 -#define SYSDATE_FORMAT 550 -#define SYSTEM 551 -#define TABLE 552 -#define TAN 553 -#define TEMPORARY 554 -#define THEN 555 -#define THREE_DIGITS 556 -#define TIME 557 -#define TIMESTAMP 558 -#define TIMEZONE_HOUR 559 -#define TIMEZONE_MINUTE 560 -#define TINYINT 561 -#define TO 562 -#define TO_CHAR 563 -#define TO_DATE 564 -#define TRANSACTION 565 -#define TRANSLATE 566 -#define TRANSLATION 567 -#define TRUNCATE 568 -#define GENERAL_TITLE 569 -#define TWO_DIGITS 570 -#define UCASE 571 -#define UNION 572 -#define UNIQUE 573 -#define SQL_UNKNOWN 574 -#define UPDATE 575 -#define UPPER 576 -#define USAGE 577 -#define USER 578 -#define IDENTIFIER 579 -#define IDENTIFIER_DOT_ASTERISK 580 -#define QUERY_PARAMETER 581 -#define USING 582 -#define VALUE 583 -#define VALUES 584 -#define VARBINARY 585 -#define VARCHAR 586 -#define VARYING 587 -#define VENDOR 588 -#define VIEW 589 -#define WEEK 590 -#define WHEN 591 -#define WHENEVER 592 -#define WHERE 593 -#define WHERE_CURRENT_OF 594 -#define WITH 595 -#define WORD_WRAPPED 596 -#define WORK 597 -#define WRAPPED 598 -#define XOR 599 -#define YEAR 600 -#define YEARS_BETWEEN 601 -#define SCAN_ERROR 602 -#define __LAST_TOKEN 603 -#define ILIKE 604 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 2068 of yacc.c */ +#line 514 "sqlparser.y" + + QString* stringValue; + qint64 integerValue; + bool booleanValue; + struct realType realValue; + KexiDB::Field::Type colType; + KexiDB::Field *field; + KexiDB::BaseExpr *expr; + KexiDB::NArgExpr *exprList; + KexiDB::ConstExpr *constExpr; + KexiDB::QuerySchema *querySchema; + SelectOptionsInternal *selectOptions; + OrderByColumnInternal::List *orderByColumns; + QVariant *variantValue; -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 511 "sqlparser.y" -typedef union YYSTYPE { - QString* stringValue; - qint64 integerValue; - bool booleanValue; - struct realType realValue; - KexiDB::Field::Type colType; - KexiDB::Field *field; - KexiDB::BaseExpr *expr; - KexiDB::NArgExpr *exprList; - KexiDB::ConstExpr *constExpr; - KexiDB::QuerySchema *querySchema; - SelectOptionsInternal *selectOptions; - OrderByColumnInternal::List *orderByColumns; - QVariant *variantValue; + + +/* Line 2068 of yacc.c */ +#line 417 "sqlparser.tab.h" } YYSTYPE; -/* Line 1252 of yacc.c. */ -#line 751 "sqlparser.tab.h" +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; - #endif diff --git a/libs/db/parser/sqlparser.y b/libs/db/parser/sqlparser.y index cca63aa0dfe81e7968dc8a4603b24214eb0917d2..a33feaaae78dac815fb9b02deacc19ae7c8c8354 100644 --- a/libs/db/parser/sqlparser.y +++ b/libs/db/parser/sqlparser.y @@ -471,10 +471,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "parser.h" #include "parser_p.h" diff --git a/libs/db/parser/sqlscanner.cpp b/libs/db/parser/sqlscanner.cpp index 0755c43bf0ce769623b1b3778336aaff38ed1706..6a8f34f63b6e80f5b42c38f7d05f4d9e5e17b241 100644 --- a/libs/db/parser/sqlscanner.cpp +++ b/libs/db/parser/sqlscanner.cpp @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,10 +31,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -92,14 +92,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -160,96 +161,92 @@ extern FILE *yyin, *yyout; #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -#define YY_LESS_LINENO(n) - + #define YY_LESS_LINENO(n) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 -}; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -264,8 +261,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. @@ -274,62 +271,62 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void yyrestart(FILE *input_file); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer); -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size); -void yy_delete_buffer(YY_BUFFER_STATE b); -void yy_flush_buffer(YY_BUFFER_STATE b); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer); -void yypop_buffer_state(void); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -static void yyensure_buffer_stack(void); -static void yy_load_buffer_state(void); -static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file); +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size); -YY_BUFFER_STATE yy_scan_string(yyconst char *yy_str); -YY_BUFFER_STATE yy_scan_bytes(yyconst char *bytes, int len); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); -void *yyalloc(yy_size_t); -void *yyrealloc(void *, yy_size_t); -void yyfree(void *); +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -351,63 +348,66 @@ int yylineno = 1; extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state(void); -static yy_state_type yy_try_NUL_trans(yy_state_type current_state); -static int yy_get_next_buffer(void); -static void yy_fatal_error(yyconst char msg[]); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 43 #define YY_END_OF_BUFFER 44 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static yyconst flex_int16_t yy_accept[148] = { 0, +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[148] = + { 0, 0, 0, 44, 43, 41, 42, 43, 42, 42, 43, - 42, 7, 42, 42, 42, 42, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 42, 41, 2, 0, 38, 9, 0, 8, - 8, 7, 39, 27, 4, 1, 3, 5, 28, 0, - 39, 10, 35, 39, 39, 39, 6, 22, 39, 39, - 39, 39, 39, 24, 25, 39, 39, 39, 39, 39, - 39, 26, 8, 40, 9, 36, 39, 39, 39, 39, - 0, 39, 39, 39, 21, 39, 39, 39, 39, 39, - 39, 39, 29, 39, 37, 12, 39, 0, 14, 15, - - 16, 0, 23, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 0, 0, 34, 30, 39, 39, 32, 33, - 11, 39, 0, 0, 0, 31, 39, 13, 0, 20, + 42, 7, 42, 42, 42, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 42, 42, 41, 2, 0, 38, 9, 0, 8, + 8, 7, 39, 27, 4, 1, 3, 5, 28, 39, + 10, 35, 39, 39, 39, 6, 22, 39, 39, 39, + 39, 39, 24, 25, 39, 39, 39, 39, 39, 39, + 0, 26, 8, 9, 36, 39, 39, 39, 39, 0, + 39, 39, 39, 21, 39, 39, 39, 39, 39, 39, + 39, 29, 40, 39, 37, 12, 39, 0, 14, 15, + + 16, 0, 23, 39, 39, 39, 39, 39, 39, 39, + 39, 0, 0, 0, 34, 30, 39, 39, 32, 33, + 11, 39, 0, 0, 0, 31, 39, 13, 0, 20, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 19, 0, 0, 0, 17, 0 - } ; + 18, 19, 0, 0, 0, 17, 0 + } ; -static yyconst flex_int32_t yy_ec[256] = { 0, +static yyconst flex_int32_t yy_ec[256] = + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 1, 5, 6, 7, 5, 5, 5, 5, 5, 5, 8, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 10, - 11, 12, 5, 5, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 15, - 15, 31, 32, 33, 34, 15, 35, 36, 37, 15, - 13, 1, 14, 5, 15, 5, 16, 17, 18, 19, - - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 15, 15, 31, 32, 33, 34, 15, 35, 36, - 37, 15, 1, 38, 1, 5, 1, 1, 1, 1, + 11, 12, 5, 5, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 28, 29, 30, 31, 32, 28, 33, 34, 35, 28, + 36, 1, 37, 5, 28, 5, 38, 39, 40, 41, + + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 28, 28, 53, 54, 55, 56, 28, 57, 58, + 59, 28, 1, 60, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -422,126 +422,161 @@ static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - } ; + } ; -static yyconst flex_int32_t yy_meta[39] = { 0, +static yyconst flex_int32_t yy_meta[61] = + { 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, - 1, 1, 3, 3, 2, 2, 2, 2, 2, 2, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1 - } ; - -static yyconst flex_int16_t yy_base[152] = { 0, - 0, 0, 254, 255, 251, 241, 247, 255, 244, 242, - 239, 31, 31, 236, 33, 0, 238, 38, 39, 40, - 41, 42, 43, 44, 45, 47, 49, 55, 74, 46, - 60, 56, 207, 242, 255, 239, 255, 255, 235, 232, - 231, 50, 231, 255, 255, 255, 255, 255, 255, 224, - 76, 48, 229, 77, 79, 80, 81, 88, 83, 84, - 91, 85, 92, 228, 93, 94, 95, 96, 98, 100, - 101, 255, 226, 255, 226, 225, 105, 115, 117, 118, - 125, 120, 122, 121, 129, 126, 127, 128, 132, 134, - 135, 136, 224, 131, 223, 222, 138, 127, 221, 220, - - 219, 146, 218, 142, 148, 151, 155, 157, 160, 163, - 164, 192, 188, 190, 205, 204, 158, 171, 203, 202, - 201, 162, 206, 179, 177, 196, 166, 195, 173, 255, - 177, 184, 166, 172, 174, 171, 180, 165, 167, 159, - 255, 255, 187, 183, 158, 255, 255, 216, 219, 58, - 222 - } ; - -static yyconst flex_int16_t yy_def[152] = { 0, - 147, 1, 147, 147, 147, 147, 148, 147, 147, 149, - 147, 150, 147, 147, 147, 151, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 147, 147, 147, 148, 147, 147, 149, 147, - 147, 150, 150, 147, 147, 147, 147, 147, 147, 151, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 147, 147, 147, 150, 150, 150, 150, 150, 150, - 147, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 147, 150, 150, - - 150, 147, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 147, 147, 147, 150, 150, 150, 150, 150, 150, - 150, 150, 147, 147, 147, 150, 150, 150, 147, 147, - 147, 150, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 0, 147, 147, 147, - 147 - } ; - -static yyconst flex_int16_t yy_nxt[294] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 + } ; + +static yyconst flex_int16_t yy_base[152] = + { 0, + 0, 0, 355, 368, 352, 342, 348, 368, 345, 343, + 340, 53, 53, 337, 55, 60, 61, 62, 63, 339, + 64, 68, 73, 66, 74, 81, 67, 110, 65, 84, + 89, 0, 285, 342, 368, 339, 368, 368, 335, 332, + 331, 76, 331, 368, 368, 368, 368, 368, 368, 120, + 125, 330, 127, 69, 94, 116, 135, 130, 131, 134, + 137, 140, 329, 142, 147, 146, 152, 145, 155, 159, + 299, 368, 325, 325, 323, 165, 171, 173, 177, 173, + 154, 179, 196, 188, 192, 198, 200, 201, 193, 209, + 199, 322, 368, 213, 319, 317, 217, 195, 311, 310, + + 308, 224, 307, 221, 222, 227, 224, 229, 247, 248, + 249, 228, 236, 241, 306, 305, 241, 262, 304, 303, + 301, 255, 229, 245, 251, 185, 273, 101, 277, 368, + 259, 280, 254, 268, 291, 271, 285, 272, 280, 268, + 368, 368, 93, 304, 280, 368, 368, 359, 362, 77, + 365 + } ; + +static yyconst flex_int16_t yy_def[152] = + { 0, + 147, 1, 147, 147, 147, 147, 148, 147, 147, 149, + 147, 150, 147, 147, 147, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 151, 147, 147, 147, 148, 147, 147, 149, 147, + 147, 150, 150, 147, 147, 147, 147, 147, 147, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 151, 147, 147, 150, 150, 150, 150, 150, 150, 147, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 147, 150, 150, 150, 150, 147, 150, 150, + + 150, 147, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 147, 147, 147, 150, 150, 150, 150, 150, 150, + 150, 150, 147, 147, 147, 150, 150, 150, 147, 147, + 147, 150, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 0, 147, 147, 147, + 147 + } ; + +static yyconst flex_int16_t yy_nxt[429] = + { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 8, 17, 18, 19, 20, 21, 17, - 22, 17, 17, 23, 24, 17, 25, 17, 26, 27, - 28, 29, 30, 17, 31, 32, 17, 33, 41, 42, - 44, 45, 46, 48, 49, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 41, 42, 43, - 55, 69, 147, 147, 60, 76, 51, 147, 61, 52, - 54, 57, 56, 59, 58, 53, 62, 64, 66, 65, - 63, 147, 70, 147, 147, 71, 147, 147, 147, 81, - 147, 147, 147, 67, 75, 147, 77, 68, 147, 147, - - 147, 147, 147, 147, 83, 147, 82, 147, 147, 79, - 78, 87, 147, 80, 91, 88, 84, 85, 86, 92, - 94, 89, 147, 90, 147, 147, 81, 147, 147, 147, - 102, 93, 95, 147, 147, 147, 147, 97, 147, 147, - 101, 147, 147, 147, 96, 147, 104, 102, 99, 147, - 105, 106, 103, 98, 100, 147, 112, 107, 147, 111, - 113, 108, 147, 110, 147, 147, 109, 147, 117, 147, - 147, 147, 115, 147, 129, 135, 119, 114, 147, 120, - 116, 118, 121, 122, 144, 135, 127, 146, 144, 143, - 126, 147, 128, 142, 141, 140, 132, 139, 137, 136, - - 134, 133, 147, 147, 131, 130, 138, 129, 147, 147, - 147, 147, 147, 125, 124, 145, 36, 36, 36, 39, - 39, 39, 50, 50, 123, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 73, 147, 147, 74, 147, 73, - 40, 37, 37, 34, 72, 147, 47, 40, 37, 38, - 37, 35, 34, 147, 3, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147 - - } ; - -static yyconst flex_int16_t yy_chk[294] = { 0, + 14, 15, 16, 17, 18, 19, 20, 21, 20, 20, + 22, 23, 20, 24, 20, 25, 26, 20, 27, 28, + 29, 20, 30, 31, 20, 32, 8, 16, 17, 18, + 19, 20, 21, 20, 20, 22, 23, 20, 24, 20, + 25, 26, 27, 28, 29, 20, 30, 31, 20, 33, + 41, 42, 44, 45, 46, 48, 49, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 68, 43, 54, + 147, 147, 59, 41, 42, 50, 60, 65, 147, 51, + 53, 147, 55, 56, 144, 52, 147, 57, 77, 58, + + 61, 147, 68, 69, 54, 62, 63, 59, 147, 64, + 50, 60, 65, 51, 53, 70, 55, 147, 56, 52, + 78, 57, 77, 147, 58, 61, 66, 147, 69, 62, + 67, 63, 147, 64, 147, 74, 80, 147, 147, 75, + 70, 147, 147, 76, 147, 78, 79, 147, 82, 147, + 81, 66, 147, 147, 147, 67, 83, 86, 90, 147, + 74, 147, 147, 85, 75, 87, 147, 84, 76, 88, + 79, 91, 147, 82, 80, 81, 89, 94, 147, 99, + 147, 83, 86, 90, 147, 95, 147, 92, 85, 102, + 87, 84, 147, 97, 88, 147, 91, 96, 98, 147, + + 147, 89, 94, 147, 99, 147, 147, 147, 147, 100, + 95, 92, 101, 107, 104, 103, 147, 106, 97, 105, + 147, 112, 96, 98, 147, 102, 113, 109, 147, 147, + 129, 147, 108, 100, 147, 111, 147, 101, 107, 104, + 103, 117, 106, 110, 105, 119, 112, 118, 147, 115, + 113, 109, 116, 114, 147, 147, 147, 108, 123, 124, + 111, 125, 147, 120, 121, 122, 117, 110, 130, 147, + 119, 126, 118, 115, 127, 131, 116, 114, 129, 134, + 147, 135, 123, 128, 124, 136, 125, 147, 120, 121, + 122, 137, 135, 130, 139, 126, 143, 140, 141, 127, + + 131, 132, 133, 142, 134, 144, 146, 128, 147, 136, + 147, 147, 147, 147, 147, 147, 137, 147, 147, 139, + 143, 138, 140, 141, 147, 132, 147, 133, 142, 147, + 147, 146, 147, 73, 145, 93, 147, 147, 147, 73, + 40, 37, 37, 34, 72, 138, 147, 47, 40, 37, + 38, 37, 35, 34, 147, 147, 147, 147, 145, 36, + 36, 36, 39, 39, 39, 71, 71, 3, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147 + } ; + +static yyconst flex_int16_t yy_chk[429] = + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, - 13, 13, 13, 15, 15, 18, 19, 20, 21, 22, - 23, 24, 25, 30, 26, 52, 27, 42, 42, 150, - 21, 30, 28, 32, 25, 52, 18, 31, 25, 18, - 20, 23, 22, 24, 23, 19, 26, 27, 28, 27, - 26, 29, 31, 51, 54, 32, 55, 56, 57, 58, - 59, 60, 62, 29, 51, 58, 54, 29, 61, 63, - - 65, 66, 67, 68, 60, 69, 59, 70, 71, 56, - 55, 65, 77, 57, 69, 66, 61, 62, 63, 70, - 77, 67, 78, 68, 79, 80, 81, 82, 84, 83, - 85, 71, 78, 86, 87, 88, 85, 80, 94, 89, - 84, 90, 91, 92, 79, 97, 87, 102, 82, 104, - 88, 89, 86, 81, 83, 105, 98, 90, 106, 97, - 98, 91, 107, 94, 108, 117, 92, 109, 106, 122, - 110, 111, 104, 127, 129, 135, 108, 102, 118, 109, - 105, 107, 110, 111, 144, 132, 118, 145, 143, 140, - 117, 132, 122, 139, 138, 137, 127, 136, 134, 133, - - 131, 129, 128, 126, 125, 124, 135, 123, 121, 120, - 119, 116, 115, 114, 113, 144, 148, 148, 148, 149, - 149, 149, 151, 151, 112, 103, 101, 100, 99, 96, - 95, 93, 76, 75, 73, 64, 53, 50, 43, 41, - 40, 39, 36, 34, 33, 17, 14, 11, 10, 9, - 7, 6, 5, 3, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147 - - } ; + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 12, 12, 13, 13, 13, 15, 15, 16, 17, 18, + 19, 21, 29, 24, 27, 22, 54, 29, 150, 19, + 23, 25, 24, 42, 42, 16, 24, 27, 26, 16, + 18, 30, 21, 22, 143, 17, 31, 22, 54, 23, + + 25, 55, 29, 30, 19, 25, 26, 24, 128, 26, + 16, 24, 27, 16, 18, 31, 21, 28, 22, 17, + 55, 22, 54, 56, 23, 25, 28, 50, 30, 25, + 28, 26, 51, 26, 53, 50, 57, 58, 59, 51, + 31, 60, 57, 53, 61, 55, 56, 62, 59, 64, + 58, 28, 68, 66, 65, 28, 60, 64, 68, 67, + 50, 81, 69, 62, 51, 65, 70, 61, 53, 66, + 56, 69, 76, 59, 80, 58, 67, 76, 77, 81, + 78, 60, 64, 68, 79, 77, 82, 70, 62, 84, + 65, 61, 126, 79, 66, 84, 69, 78, 80, 85, + + 89, 67, 76, 83, 81, 86, 91, 87, 88, 82, + 77, 70, 83, 89, 86, 85, 90, 88, 79, 87, + 94, 98, 78, 80, 97, 102, 98, 91, 104, 105, + 123, 107, 90, 82, 106, 97, 108, 83, 89, 86, + 85, 106, 88, 94, 87, 108, 98, 107, 117, 104, + 98, 91, 105, 102, 109, 110, 111, 90, 112, 113, + 97, 114, 122, 109, 110, 111, 106, 94, 124, 118, + 108, 117, 107, 104, 118, 125, 105, 102, 129, 131, + 127, 132, 112, 122, 113, 133, 114, 132, 109, 110, + 111, 134, 135, 124, 136, 117, 140, 137, 138, 118, + + 125, 127, 129, 139, 131, 144, 145, 122, 121, 133, + 120, 119, 116, 115, 103, 101, 134, 100, 99, 136, + 140, 135, 137, 138, 96, 127, 95, 129, 139, 92, + 75, 145, 74, 73, 144, 71, 63, 52, 43, 41, + 40, 39, 36, 34, 33, 135, 20, 14, 11, 10, + 9, 7, 6, 5, 3, 0, 0, 0, 144, 148, + 148, 148, 149, 149, 149, 151, 151, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147 + } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -594,10 +629,10 @@ extern void setError(const QString& errDesc); extern void setError(const QString& errName, const QString& errDesc); /* *** Please reflect changes to this file in ../driver_p.cpp *** */ -/*identifier [a-zA-Z_][a-zA-Z_0-9]* */ +/*identifier [a-zA-Z_][a-zA-Z_0-9]* */ /* quoted_identifier (\"[a-zA-Z_0-9]+\") */ /* todo: support for real numbers */ -#line 610 "sqlscanner.cpp" +#line 636 "sqlscanner.cpp" #define INITIAL 0 @@ -613,7 +648,36 @@ extern void setError(const QString& errName, const QString& errDesc); #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals(void); +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +int yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -621,28 +685,28 @@ static int yy_init_globals(void); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap(void); +extern "C" int yywrap (void ); #else -extern int yywrap(void); +extern int yywrap (void ); #endif #endif -static void yyunput(int c, char *buf_ptr); - + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy(char *, yyconst char *, int); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(yyconst char *); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput(void); +static int yyinput (void ); #else -static int input(void); +static int input (void ); #endif #endif @@ -657,7 +721,7 @@ static int input(void); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -665,35 +729,35 @@ static int input(void); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < (size_t)max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ - \ - + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -722,7 +786,7 @@ static int input(void); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int yylex(void); +extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ @@ -740,1336 +804,1388 @@ extern int yylex(void); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ -YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + #line 58 "sqlscanner.l" -#line 767 "sqlscanner.cpp" +#line 822 "sqlscanner.cpp" - if (!(yy_init)) { - (yy_init) = 1; + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if (!(yy_start)) - (yy_start) = 1; /* first start state */ - - if (! yyin) - yyin = stdin; - - if (! yyout) - yyout = stdout; - - if (! YY_CURRENT_BUFFER) { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_load_buffer_state(); - } - - while (1) { /* loops until end-of-file is reached */ - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_match: - do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int) yy_def[yy_current_state]; - if (yy_current_state >= 148) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } while (yy_current_state != 147); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - - yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - do_action: /* This label is used only to access EOF actions. */ - - switch (yy_act) { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - - case 1: - YY_RULE_SETUP + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 148 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_current_state != 147 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP #line 61 "sqlscanner.l" - { - ECOUNT; - return NOT_EQUAL; - } - YY_BREAK - case 2: - YY_RULE_SETUP +{ + ECOUNT; + return NOT_EQUAL; +} + YY_BREAK +case 2: +YY_RULE_SETUP #line 66 "sqlscanner.l" - { - ECOUNT; - return NOT_EQUAL2; - } - YY_BREAK - case 3: - YY_RULE_SETUP +{ + ECOUNT; + return NOT_EQUAL2; +} + YY_BREAK +case 3: +YY_RULE_SETUP #line 71 "sqlscanner.l" - { - ECOUNT; - return '='; - } - YY_BREAK - case 4: - YY_RULE_SETUP +{ + ECOUNT; + return '='; +} + YY_BREAK +case 4: +YY_RULE_SETUP #line 76 "sqlscanner.l" - { - ECOUNT; - return LESS_OR_EQUAL; - } - YY_BREAK - case 5: - YY_RULE_SETUP +{ + ECOUNT; + return LESS_OR_EQUAL; +} + YY_BREAK +case 5: +YY_RULE_SETUP #line 81 "sqlscanner.l" - { - ECOUNT; - return GREATER_OR_EQUAL; - } - YY_BREAK - case 6: - YY_RULE_SETUP +{ + ECOUNT; + return GREATER_OR_EQUAL; +} + YY_BREAK +case 6: +YY_RULE_SETUP #line 86 "sqlscanner.l" - { - ECOUNT; - return SQL_IN; - } - YY_BREAK - case 7: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_IN; +} + YY_BREAK +case 7: +YY_RULE_SETUP #line 91 "sqlscanner.l" - { +{ //TODO: what about hex or octal values? - //we're using QString:toLongLong() here because atoll() is not so portable: - ECOUNT; - bool ok; - yylval.integerValue = QString(yytext).toLongLong(&ok); - if (!ok) { - setError(i18n("Invalid integer number"), i18n("This integer number may be too large.")); - return SCAN_ERROR; - } -// yylval.integerValue = atol(yytext); - return INTEGER_CONST; - } - YY_BREAK - case 8: - YY_RULE_SETUP + //we're using QString:toLongLong() here because atoll() is not so portable: + ECOUNT; + bool ok; + yylval.integerValue = QString(yytext).toLongLong( &ok ); + if (!ok) { + setError(i18n("Invalid integer number"),i18n("This integer number may be too large.")); + return SCAN_ERROR; + } +// yylval.integerValue = atol(yytext); + return INTEGER_CONST; +} + YY_BREAK +case 8: +YY_RULE_SETUP #line 105 "sqlscanner.l" - { - char *p = yytext; - if (yytext[0] == '.') { /* no integer part */ - yylval.realValue.integer = 0; - } else { - yylval.realValue.integer = atoi(p); - int i = 0; - while (p && i < yyleng && *p != '.') { - i++; - p++; - } - if (i == 0 || !p || *p != '.') { - yylval.realValue.fractional = 0; - return REAL_CONST; - } - } - /* fractional part */ - p++; - yylval.realValue.fractional = atoi(p); - return REAL_CONST; - } - YY_BREAK - case 9: - YY_RULE_SETUP +{ + char *p = yytext; + if (yytext[0]=='.') { /* no integer part */ + yylval.realValue.integer = 0; + } + else { + yylval.realValue.integer = atoi(p); + int i=0; + while (p && i < yyleng && *p != '.') { + i++; + p++; + } + if (i==0 || !p || *p!='.') { + yylval.realValue.fractional = 0; + return REAL_CONST; + } + } + /* fractional part */ + p++; + yylval.realValue.fractional = atoi(p); + return REAL_CONST; +} + YY_BREAK +case 9: +YY_RULE_SETUP #line 128 "sqlscanner.l" - { - ECOUNT; - return AND; - } - YY_BREAK - case 10: - YY_RULE_SETUP +{ + ECOUNT; + return AND; +} + YY_BREAK +case 10: +YY_RULE_SETUP #line 133 "sqlscanner.l" - { - ECOUNT; - return AS; - } - YY_BREAK - case 11: - YY_RULE_SETUP +{ + ECOUNT; + return AS; +} + YY_BREAK +case 11: +YY_RULE_SETUP #line 138 "sqlscanner.l" - { - ECOUNT; - return CREATE; - } - YY_BREAK - case 12: - YY_RULE_SETUP +{ + ECOUNT; + return CREATE; +} + YY_BREAK +case 12: +YY_RULE_SETUP #line 143 "sqlscanner.l" - { - ECOUNT; - return FROM; - } - YY_BREAK - case 13: - YY_RULE_SETUP +{ + ECOUNT; + return FROM; +} + YY_BREAK +case 13: +YY_RULE_SETUP #line 148 "sqlscanner.l" - { - ECOUNT; - return SQL_TYPE; - } - YY_BREAK - case 14: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_TYPE; +} + YY_BREAK +case 14: +YY_RULE_SETUP #line 153 "sqlscanner.l" - { - ECOUNT; - return JOIN; - } - YY_BREAK - case 15: - YY_RULE_SETUP +{ + ECOUNT; + return JOIN; +} + YY_BREAK +case 15: +YY_RULE_SETUP #line 158 "sqlscanner.l" - { - ECOUNT; - return LEFT; - } - YY_BREAK - case 16: - YY_RULE_SETUP +{ + ECOUNT; + return LEFT; +} + YY_BREAK +case 16: +YY_RULE_SETUP #line 163 "sqlscanner.l" - { - ECOUNT; - return LIKE; - } - YY_BREAK - case 17: - /* rule 17 can match eol */ - YY_RULE_SETUP +{ + ECOUNT; + return LIKE; +} + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP #line 168 "sqlscanner.l" - { - ECOUNT; - return NOT_SIMILAR_TO; - } - YY_BREAK - case 18: - /* rule 18 can match eol */ - YY_RULE_SETUP +{ + ECOUNT; + return NOT_SIMILAR_TO; +} + YY_BREAK +case 18: +/* rule 18 can match eol */ +YY_RULE_SETUP #line 173 "sqlscanner.l" - { - ECOUNT; - return SIMILAR_TO; - } - YY_BREAK - case 19: - /* rule 19 can match eol */ - YY_RULE_SETUP +{ + ECOUNT; + return SIMILAR_TO; +} + YY_BREAK +case 19: +/* rule 19 can match eol */ +YY_RULE_SETUP #line 178 "sqlscanner.l" - { - ECOUNT; - return SQL_IS_NOT_NULL; - } - YY_BREAK - case 20: - /* rule 20 can match eol */ - YY_RULE_SETUP +{ + ECOUNT; + return SQL_IS_NOT_NULL; +} + YY_BREAK +case 20: +/* rule 20 can match eol */ +YY_RULE_SETUP #line 183 "sqlscanner.l" - { - ECOUNT; - return SQL_IS_NULL; - } - YY_BREAK - case 21: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_IS_NULL; +} + YY_BREAK +case 21: +YY_RULE_SETUP #line 188 "sqlscanner.l" - { - ECOUNT; - return NOT; - } - YY_BREAK - case 22: - YY_RULE_SETUP +{ + ECOUNT; + return NOT; +} + YY_BREAK +case 22: +YY_RULE_SETUP #line 193 "sqlscanner.l" - { - ECOUNT; - return SQL_IS; - } - YY_BREAK - case 23: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_IS; +} + YY_BREAK +case 23: +YY_RULE_SETUP #line 198 "sqlscanner.l" - { - ECOUNT; - return SQL_NULL; - } - YY_BREAK - case 24: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_NULL; +} + YY_BREAK +case 24: +YY_RULE_SETUP #line 203 "sqlscanner.l" - { - ECOUNT; - return SQL_ON; - } - YY_BREAK - case 25: - YY_RULE_SETUP +{ + ECOUNT; + return SQL_ON; +} + YY_BREAK +case 25: +YY_RULE_SETUP #line 208 "sqlscanner.l" - { - ECOUNT; - return OR; - } - YY_BREAK - case 26: - YY_RULE_SETUP +{ + ECOUNT; + return OR; +} + YY_BREAK +case 26: +YY_RULE_SETUP #line 213 "sqlscanner.l" - { /* also means OR for numbers (mysql) */ - ECOUNT; - return CONCATENATION; - } - YY_BREAK - case 27: - YY_RULE_SETUP +{ /* also means OR for numbers (mysql) */ + ECOUNT; + return CONCATENATION; +} + YY_BREAK +case 27: +YY_RULE_SETUP #line 218 "sqlscanner.l" - { - ECOUNT; - return BITWISE_SHIFT_LEFT; - } - YY_BREAK - case 28: - YY_RULE_SETUP +{ + ECOUNT; + return BITWISE_SHIFT_LEFT; +} + YY_BREAK +case 28: +YY_RULE_SETUP #line 223 "sqlscanner.l" - { - ECOUNT; - return BITWISE_SHIFT_RIGHT; - } - YY_BREAK - case 29: - YY_RULE_SETUP +{ + ECOUNT; + return BITWISE_SHIFT_RIGHT; +} + YY_BREAK +case 29: +YY_RULE_SETUP #line 228 "sqlscanner.l" - { - ECOUNT; - return XOR; - } - YY_BREAK - case 30: - YY_RULE_SETUP +{ + ECOUNT; + return XOR; +} + YY_BREAK +case 30: +YY_RULE_SETUP #line 233 "sqlscanner.l" - { - ECOUNT; - return RIGHT; - } - YY_BREAK - case 31: - YY_RULE_SETUP +{ + ECOUNT; + return RIGHT; +} + YY_BREAK +case 31: +YY_RULE_SETUP #line 238 "sqlscanner.l" - { - ECOUNT; - return SELECT; - } - YY_BREAK - case 32: - YY_RULE_SETUP +{ + ECOUNT; + return SELECT; +} + YY_BREAK +case 32: +YY_RULE_SETUP #line 243 "sqlscanner.l" - { - ECOUNT; - return TABLE; - } - YY_BREAK - case 33: - YY_RULE_SETUP +{ + ECOUNT; + return TABLE; +} + YY_BREAK +case 33: +YY_RULE_SETUP #line 248 "sqlscanner.l" - { - ECOUNT; - return WHERE; - } - YY_BREAK - case 34: - YY_RULE_SETUP +{ + ECOUNT; + return WHERE; +} + YY_BREAK +case 34: +YY_RULE_SETUP #line 253 "sqlscanner.l" - { - ECOUNT; - return ORDER; - } - YY_BREAK - case 35: - YY_RULE_SETUP +{ + ECOUNT; + return ORDER; +} + YY_BREAK +case 35: +YY_RULE_SETUP #line 258 "sqlscanner.l" - { - ECOUNT; - return BY; - } - YY_BREAK - case 36: - YY_RULE_SETUP +{ + ECOUNT; + return BY; +} + YY_BREAK +case 36: +YY_RULE_SETUP #line 263 "sqlscanner.l" - { - ECOUNT; - return ASC; - } - YY_BREAK - case 37: - YY_RULE_SETUP +{ + ECOUNT; + return ASC; +} + YY_BREAK +case 37: +YY_RULE_SETUP #line 268 "sqlscanner.l" - { - ECOUNT; - return DESC; - } - YY_BREAK - case 38: - /* rule 38 can match eol */ - YY_RULE_SETUP +{ + ECOUNT; + return DESC; +} + YY_BREAK +case 38: +/* rule 38 can match eol */ +YY_RULE_SETUP #line 273 "sqlscanner.l" - { - ECOUNT; - yylval.stringValue = new QString(QString::fromUtf8(yytext + 1, yyleng - 2)); - return CHARACTER_STRING_LITERAL; - - /* "ZZZ" sentinel for script */ - } - YY_BREAK - case 39: - YY_RULE_SETUP +{ + ECOUNT; + yylval.stringValue = new QString(QString::fromUtf8(yytext+1, yyleng-2)); + return CHARACTER_STRING_LITERAL; + +/* "ZZZ" sentinel for script */ +} + YY_BREAK +case 39: +YY_RULE_SETUP #line 281 "sqlscanner.l" - { - KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")"; - ECOUNT; - yylval.stringValue = new QString(QString::fromUtf8(yytext, yyleng)); - if (yytext[0] >= '0' && yytext[0] <= '9') { - setError(i18n("Invalid identifier"), - i18n("Identifiers should start with a letter or '_' character")); - return SCAN_ERROR; - } - return IDENTIFIER; - } - YY_BREAK - case 40: - /* rule 40 can match eol */ - YY_RULE_SETUP +{ + KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")"; + ECOUNT; + yylval.stringValue = new QString(QString::fromUtf8(yytext, yyleng)); + if (yytext[0]>='0' && yytext[0]<='9') { + setError(i18n("Invalid identifier"), + i18n("Identifiers should start with a letter or '_' character")); + return SCAN_ERROR; + } + return IDENTIFIER; +} + YY_BREAK +case 40: +/* rule 40 can match eol */ +YY_RULE_SETUP #line 293 "sqlscanner.l" - { - KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")"; - ECOUNT; - yylval.stringValue = new QString(QString::fromUtf8(yytext + 1, yyleng - 2)); - return QUERY_PARAMETER; - } - YY_BREAK - case 41: - /* rule 41 can match eol */ - YY_RULE_SETUP +{ + KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")"; + ECOUNT; + yylval.stringValue = new QString(QString::fromUtf8(yytext+1, yyleng-2)); + return QUERY_PARAMETER; +} + YY_BREAK +case 41: +/* rule 41 can match eol */ +YY_RULE_SETUP #line 300 "sqlscanner.l" - { - ECOUNT; - } - YY_BREAK - case 42: - YY_RULE_SETUP +{ + ECOUNT; +} + YY_BREAK +case 42: +YY_RULE_SETUP #line 304 "sqlscanner.l" - { - KexiDBDbg << "char: '" << yytext[0] << "'"; - ECOUNT; - return yytext[0]; - } - YY_BREAK - case 43: - YY_RULE_SETUP +{ + KexiDBDbg << "char: '" << yytext[0] << "'"; + ECOUNT; + return yytext[0]; +} + YY_BREAK +case 43: +YY_RULE_SETUP #line 310 "sqlscanner.l" - ECHO; - YY_BREAK -#line 1233 "sqlscanner.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if (yy_next_state) { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch (yy_get_next_buffer()) { - case EOB_ACT_END_OF_FILE: { - (yy_did_buffer_switch_on_eof) = 0; - - if (yywrap()) { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else { - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ +ECHO; + YY_BREAK +#line 1288 "sqlscanner.cpp" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer(void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ - if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int)((yy_c_buf_p) - b->yy_ch_buf); - - if (b->yy_is_our_buffer) { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf, b->yy_buf_size + 2); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (! b->yy_ch_buf) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow"); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ((yy_n_chars) == 0) { - if (number_to_move == YY_MORE_ADJ) { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - return ret_val; + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state(void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int) yy_def[yy_current_state]; - if (yy_current_state >= 148) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 148 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int) yy_def[yy_current_state]; - if (yy_current_state >= 148) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 147); - - return yy_is_jam ? 0 : yy_current_state; + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 148 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 147); + + return yy_is_jam ? 0 : yy_current_state; } -static void yyunput(int c, register char * yy_bp) + static void yyunput (int c, register char * yy_bp ) { - register char *yy_cp; - + register char *yy_cp; + yy_cp = (yy_c_buf_p); - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - *--dest = *--source; + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char) c; + *--yy_cp = (char) c; - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput(void) + static int yyinput (void) #else -static int input(void) + static int input (void) #endif { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch (yy_get_next_buffer()) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: { - if (yywrap()) - return EOF; - - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ -void yyrestart(FILE * input_file) + void yyrestart (FILE * input_file ) { - - if (! YY_CURRENT_BUFFER) { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_init_buffer(YY_CURRENT_BUFFER, input_file); - yy_load_buffer_state(); + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack(); - if (YY_CURRENT_BUFFER == new_buffer) - return; - - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - (yy_did_buffer_switch_on_eof) = 1; + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } -static void yy_load_buffer_state(void) +static void yy_load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ -YY_BUFFER_STATE yy_create_buffer(FILE * file, int size) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b = (YY_BUFFER_STATE) yyalloc(sizeof(struct yy_buffer_state)); - if (! b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + b->yy_buf_size = size; - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2); - if (! b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - yy_init_buffer(b, file); + yy_init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ -void yy_delete_buffer(YY_BUFFER_STATE b) + void yy_delete_buffer (YY_BUFFER_STATE b ) { + + if ( ! b ) + return; - if (! b) - return; - - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if (b->yy_is_our_buffer) - yyfree((void *) b->yy_ch_buf); + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); - yyfree((void *) b); + yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ -static void yy_init_buffer(YY_BUFFER_STATE b, FILE * file) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; + int oerrno = errno; + + yy_flush_buffer(b ); - yy_flush_buffer(b); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ - if (b != YY_CURRENT_BUFFER) { + if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } - b->yy_is_interactive = 0; - - errno = oerrno; + b->yy_is_interactive = 0; + + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ -void yy_flush_buffer(YY_BUFFER_STATE b) + void yy_flush_buffer (YY_BUFFER_STATE b ) { - if (! b) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if (b == YY_CURRENT_BUFFER) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void yypush_buffer_state(YY_BUFFER_STATE new_buffer) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void yypop_buffer_state(void) +void yypop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; - } + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void yyensure_buffer_stack(void) +static void yyensure_buffer_stack (void) { - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + int num_to_alloc; + + if (!(yy_buffer_stack)) { - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer(char * base, yy_size_t size) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; - - if (size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof(struct yy_buffer_state)); - if (! b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b); - - return b; + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * + * @param yystr a NUL-terminated string to scan + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string(yyconst char * yystr) +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - - return yy_scan_bytes(yystr, strlen(yystr)); + + return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes(yyconst char * yybytes, int _yybytes_len) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n); - if (! buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < _yybytes_len; ++i) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n); - if (! b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error(yyconst char* msg) +static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int yyget_lineno(void) +int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ -FILE *yyget_in(void) +FILE *yyget_in (void) { - return yyin; + return yyin; } /** Get the output stream. - * + * */ -FILE *yyget_out(void) +FILE *yyget_out (void) { - return yyout; + return yyout; } /** Get the length of the current token. - * + * */ -int yyget_leng(void) +int yyget_leng (void) { - return yyleng; + return yyleng; } /** Get the current token. - * + * */ -char *yyget_text(void) +char *yyget_text (void) { - return yytext; + return yytext; } /** Set the current line number. * @param line_number - * + * */ -void yyset_lineno(int line_number) +void yyset_lineno (int line_number ) { - + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see yy_switch_to_buffer */ -void yyset_in(FILE * in_str) +void yyset_in (FILE * in_str ) { - yyin = in_str ; + yyin = in_str ; } -void yyset_out(FILE * out_str) +void yyset_out (FILE * out_str ) { - yyout = out_str ; + yyout = out_str ; } -int yyget_debug(void) +int yyget_debug (void) { - return yy_flex_debug; + return yy_flex_debug; } -void yyset_debug(int bdebug) +void yyset_debug (int bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = bdebug ; } -static int yy_init_globals(void) +static int yy_init_globals (void) { - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; @@ -2078,7 +2194,7 @@ static int yy_init_globals(void) (yy_init) = 0; (yy_start) = 0; - /* Defined in main.c */ +/* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; @@ -2094,23 +2210,23 @@ static int yy_init_globals(void) } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy(void) +int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ - while (YY_CURRENT_BUFFER) { - yy_delete_buffer(YY_CURRENT_BUFFER); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack)); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ - yy_init_globals(); + yy_init_globals( ); return 0; } @@ -2120,45 +2236,45 @@ int yylex_destroy(void) */ #ifndef yytext_ptr -static void yy_flex_strncpy(char* s1, yyconst char * s2, int n) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(yyconst char * s) +static int yy_flex_strlen (yyconst char * s ) { - register int n; - for (n = 0; s[n]; ++n) - ; + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif -void *yyalloc(yy_size_t size) +void *yyalloc (yy_size_t size ) { - return (void *) malloc(size); + return (void *) malloc( size ); } -void *yyrealloc(void * ptr, yy_size_t size) +void *yyrealloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc((char *) ptr, size); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } -void yyfree(void * ptr) +void yyfree (void * ptr ) { - free((char *) ptr); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -2169,9 +2285,9 @@ void yyfree(void * ptr) void tokenize(const char *data) { - yy_switch_to_buffer(yy_scan_string(data)); - ctoken = ""; - current = 0; + yy_switch_to_buffer(yy_scan_string(data)); + ctoken = ""; + current = 0; }