BadgerDB
/afs/cs.wisc.edu/u/n/w/nwilliam/private/workspace/Quut/src/parser/SqlParser_gen.cpp
00001 /* A Bison parser, made by GNU Bison 2.3.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004 
00005    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00006    Free Software Foundation, Inc.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2, or (at your option)
00011    any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.  */
00022 
00023 /* As a special exception, you may create a larger work that contains
00024    part or all of the Bison parser skeleton and distribute that work
00025    under terms of your choice, so long as that work isn't itself a
00026    parser generator using the skeleton or a modified version thereof
00027    as a parser skeleton.  Alternatively, if you modify or redistribute
00028    the parser skeleton itself, you may (at your option) remove this
00029    special exception, which will cause the skeleton and the resulting
00030    Bison output files to be licensed under the GNU General Public
00031    License without this special exception.
00032 
00033    This special exception was added by the Free Software Foundation in
00034    version 2.2 of Bison.  */
00035 
00036 /* C LALR(1) parser skeleton written by Richard Stallman, by
00037    simplifying the original so-called "semantic" parser.  */
00038 
00039 /* All symbols defined below should begin with yy or YY, to avoid
00040    infringing on user name space.  This should be done even for local
00041    variables, as they might otherwise be expanded by user macros.
00042    There are some unavoidable exceptions within include files to
00043    define necessary library symbols; they are noted "INFRINGES ON
00044    USER NAME SPACE" below.  */
00045 
00046 /* Identify Bison output.  */
00047 #define YYBISON 1
00048 
00049 /* Bison version.  */
00050 #define YYBISON_VERSION "2.3"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 0
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 0
00060 
00061 
00062 
00063 /* Tokens.  */
00064 #ifndef YYTOKENTYPE
00065 # define YYTOKENTYPE
00066    /* Put the tokens into the symbol table, so that GDB and other debuggers
00067       know about them.  */
00068    enum yytokentype {
00069      PTOK_NAME = 258,
00070      PTOK_STRING = 259,
00071      PTOK_INTNUM = 260,
00072      PTOK_DOUBLE = 261,
00073      PTOK_PARAMETER = 262,
00074      PTOK_QSTRING = 263,
00075      PTOK_OR = 264,
00076      PTOK_AND = 265,
00077      PTOK_NOT = 266,
00078      PTOK_GEQ = 267,
00079      PTOK_GT = 268,
00080      PTOK_LEQ = 269,
00081      PTOK_LT = 270,
00082      PTOK_NEQ = 271,
00083      PTOK_EQ = 272,
00084      PTOK_UMINUS = 273,
00085      PTOK_ALL = 274,
00086      PTOK_ANY = 275,
00087      PTOK_ASC = 276,
00088      PTOK_BETWEEN = 277,
00089      PTOK_BY = 278,
00090      PTOK_CHARACTER = 279,
00091      PTOK_CHECK = 280,
00092      PTOK_CREATE = 281,
00093      PTOK_DECIMAL = 282,
00094      PTOK_DEFAULT = 283,
00095      PTOK_DELETE = 284,
00096      PTOK_DESC = 285,
00097      PTOK_DISTINCT = 286,
00098      PTOK_ESCAPE = 287,
00099      PTOK_EXISTS = 288,
00100      PTOK_FLOAT = 289,
00101      PTOK_FOREIGN = 290,
00102      PTOK_FROM = 291,
00103      PTOK_GROUP = 292,
00104      PTOK_HAVING = 293,
00105      PTOK_IN = 294,
00106      PTOK_INDICATOR = 295,
00107      PTOK_INSERT = 296,
00108      PTOK_INTEGER = 297,
00109      PTOK_INTO = 298,
00110      PTOK_IS = 299,
00111      PTOK_KEY = 300,
00112      PTOK_LIKE = 301,
00113      PTOK_LOAD = 302,
00114      PTOK_NULLX = 303,
00115      PTOK_NUMERIC = 304,
00116      PTOK_ = 305,
00117      PTOK_ORDER = 306,
00118      PTOK_PRECISION = 307,
00119      PTOK_PRIMARY = 308,
00120      PTOK_REAL = 309,
00121      PTOK_REFERENCES = 310,
00122      PTOK_SELECT = 311,
00123      PTOK_SET = 312,
00124      PTOK_SMALLINT = 313,
00125      PTOK_SOME = 314,
00126      PTOK_TABLE = 315,
00127      PTOK_UNION = 316,
00128      PTOK_UNIQUE = 317,
00129      PTOK_UPDATE = 318,
00130      PTOK_USER = 319,
00131      PTOK_VALUES = 320,
00132      PTOK_WHERE = 321,
00133      PTOK_DROP = 322,
00134      PTOK_EOF = 323,
00135      PTOK_AVG = 324,
00136      PTOK_COUNT = 325,
00137      PTOK_MIN = 326,
00138      PTOK_MAX = 327,
00139      PTOK_SUM = 328,
00140      PTOK_HASH = 329,
00141      PTOK_BTREE = 330,
00142      PTOK_INDEX = 331
00143    };
00144 #endif
00145 /* Tokens.  */
00146 #define PTOK_NAME 258
00147 #define PTOK_STRING 259
00148 #define PTOK_INTNUM 260
00149 #define PTOK_DOUBLE 261
00150 #define PTOK_PARAMETER 262
00151 #define PTOK_QSTRING 263
00152 #define PTOK_OR 264
00153 #define PTOK_AND 265
00154 #define PTOK_NOT 266
00155 #define PTOK_GEQ 267
00156 #define PTOK_GT 268
00157 #define PTOK_LEQ 269
00158 #define PTOK_LT 270
00159 #define PTOK_NEQ 271
00160 #define PTOK_EQ 272
00161 #define PTOK_UMINUS 273
00162 #define PTOK_ALL 274
00163 #define PTOK_ANY 275
00164 #define PTOK_ASC 276
00165 #define PTOK_BETWEEN 277
00166 #define PTOK_BY 278
00167 #define PTOK_CHARACTER 279
00168 #define PTOK_CHECK 280
00169 #define PTOK_CREATE 281
00170 #define PTOK_DECIMAL 282
00171 #define PTOK_DEFAULT 283
00172 #define PTOK_DELETE 284
00173 #define PTOK_DESC 285
00174 #define PTOK_DISTINCT 286
00175 #define PTOK_ESCAPE 287
00176 #define PTOK_EXISTS 288
00177 #define PTOK_FLOAT 289
00178 #define PTOK_FOREIGN 290
00179 #define PTOK_FROM 291
00180 #define PTOK_GROUP 292
00181 #define PTOK_HAVING 293
00182 #define PTOK_IN 294
00183 #define PTOK_INDICATOR 295
00184 #define PTOK_INSERT 296
00185 #define PTOK_INTEGER 297
00186 #define PTOK_INTO 298
00187 #define PTOK_IS 299
00188 #define PTOK_KEY 300
00189 #define PTOK_LIKE 301
00190 #define PTOK_LOAD 302
00191 #define PTOK_NULLX 303
00192 #define PTOK_NUMERIC 304
00193 #define PTOK_ 305
00194 #define PTOK_ORDER 306
00195 #define PTOK_PRECISION 307
00196 #define PTOK_PRIMARY 308
00197 #define PTOK_REAL 309
00198 #define PTOK_REFERENCES 310
00199 #define PTOK_SELECT 311
00200 #define PTOK_SET 312
00201 #define PTOK_SMALLINT 313
00202 #define PTOK_SOME 314
00203 #define PTOK_TABLE 315
00204 #define PTOK_UNION 316
00205 #define PTOK_UNIQUE 317
00206 #define PTOK_UPDATE 318
00207 #define PTOK_USER 319
00208 #define PTOK_VALUES 320
00209 #define PTOK_WHERE 321
00210 #define PTOK_DROP 322
00211 #define PTOK_EOF 323
00212 #define PTOK_AVG 324
00213 #define PTOK_COUNT 325
00214 #define PTOK_MIN 326
00215 #define PTOK_MAX 327
00216 #define PTOK_SUM 328
00217 #define PTOK_HASH 329
00218 #define PTOK_BTREE 330
00219 #define PTOK_INDEX 331
00220 
00221 
00222 
00223 
00224 /* Copy the first part of user declarations.  */
00225 #line 17 "SqlParser.y"
00226 
00227 #include <iostream>
00228 #include "SqlScanner.h"
00229 #include "SqlParser.h"
00230 #include "SqlInterp.h"
00231 //#include "file.h"
00232 
00233 extern "C" int isatty(int);
00234 extern int yylex();
00235 extern void quit();
00236 
00237 void yyerror(const char *);
00238 void PxxIgnoring(char* feature);
00239 void PxxNotSupported(const char* feature);
00240 
00241 extern char *yytext;         // tokens in string format
00242 PxxPnode *PxxPtree;   // root of parse tree
00243 extern PxxScanner PsqlScan;  // My scanner class
00244 
00245 
00246 
00247 /* Enabling traces.  */
00248 #ifndef YYDEBUG
00249 # define YYDEBUG 0
00250 #endif
00251 
00252 /* Enabling verbose error messages.  */
00253 #ifdef YYERROR_VERBOSE
00254 # undef YYERROR_VERBOSE
00255 # define YYERROR_VERBOSE 1
00256 #else
00257 # define YYERROR_VERBOSE 0
00258 #endif
00259 
00260 /* Enabling the token table.  */
00261 #ifndef YYTOKEN_TABLE
00262 # define YYTOKEN_TABLE 0
00263 #endif
00264 
00265 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00266 typedef union YYSTYPE
00267 #line 38 "SqlParser.y"
00268 {
00269   int intVal;
00270   double dblVal;
00271   char *strVal;
00272   char typeVal;
00273   int subTok;
00274   PxxPnode *pTree;
00275 }
00276 /* Line 193 of yacc.c.  */
00277 #line 278 "y.tab.c"
00278   YYSTYPE;
00279 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00280 # define YYSTYPE_IS_DECLARED 1
00281 # define YYSTYPE_IS_TRIVIAL 1
00282 #endif
00283 
00284 
00285 
00286 /* Copy the second part of user declarations.  */
00287 
00288 
00289 /* Line 216 of yacc.c.  */
00290 #line 291 "y.tab.c"
00291 
00292 #ifdef short
00293 # undef short
00294 #endif
00295 
00296 #ifdef YYTYPE_UINT8
00297 typedef YYTYPE_UINT8 yytype_uint8;
00298 #else
00299 typedef unsigned char yytype_uint8;
00300 #endif
00301 
00302 #ifdef YYTYPE_INT8
00303 typedef YYTYPE_INT8 yytype_int8;
00304 #elif (defined __STDC__ || defined __C99__FUNC__ \
00305      || defined __cplusplus || defined _MSC_VER)
00306 typedef signed char yytype_int8;
00307 #else
00308 typedef short int yytype_int8;
00309 #endif
00310 
00311 #ifdef YYTYPE_UINT16
00312 typedef YYTYPE_UINT16 yytype_uint16;
00313 #else
00314 typedef unsigned short int yytype_uint16;
00315 #endif
00316 
00317 #ifdef YYTYPE_INT16
00318 typedef YYTYPE_INT16 yytype_int16;
00319 #else
00320 typedef short int yytype_int16;
00321 #endif
00322 
00323 #ifndef YYSIZE_T
00324 # ifdef __SIZE_TYPE__
00325 #  define YYSIZE_T __SIZE_TYPE__
00326 # elif defined size_t
00327 #  define YYSIZE_T size_t
00328 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00329      || defined __cplusplus || defined _MSC_VER)
00330 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00331 #  define YYSIZE_T size_t
00332 # else
00333 #  define YYSIZE_T unsigned int
00334 # endif
00335 #endif
00336 
00337 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00338 
00339 #ifndef YY_
00340 # if YYENABLE_NLS
00341 #  if ENABLE_NLS
00342 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00343 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00344 #  endif
00345 # endif
00346 # ifndef YY_
00347 #  define YY_(msgid) msgid
00348 # endif
00349 #endif
00350 
00351 /* Suppress unused-variable warnings by "using" E.  */
00352 #if ! defined lint || defined __GNUC__
00353 # define YYUSE(e) ((void) (e))
00354 #else
00355 # define YYUSE(e) /* empty */
00356 #endif
00357 
00358 /* Identity function, used to suppress warnings about constant conditions.  */
00359 #ifndef lint
00360 # define YYID(n) (n)
00361 #else
00362 #if (defined __STDC__ || defined __C99__FUNC__ \
00363      || defined __cplusplus || defined _MSC_VER)
00364 static int
00365 YYID (int i)
00366 #else
00367 static int
00368 YYID (i)
00369     int i;
00370 #endif
00371 {
00372   return i;
00373 }
00374 #endif
00375 
00376 #if ! defined yyoverflow || YYERROR_VERBOSE
00377 
00378 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00379 
00380 # ifdef YYSTACK_USE_ALLOCA
00381 #  if YYSTACK_USE_ALLOCA
00382 #   ifdef __GNUC__
00383 #    define YYSTACK_ALLOC __builtin_alloca
00384 #   elif defined __BUILTIN_VA_ARG_INCR
00385 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00386 #   elif defined _AIX
00387 #    define YYSTACK_ALLOC __alloca
00388 #   elif defined _MSC_VER
00389 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00390 #    define alloca _alloca
00391 #   else
00392 #    define YYSTACK_ALLOC alloca
00393 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00394      || defined __cplusplus || defined _MSC_VER)
00395 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00396 #     ifndef _STDLIB_H
00397 #      define _STDLIB_H 1
00398 #     endif
00399 #    endif
00400 #   endif
00401 #  endif
00402 # endif
00403 
00404 # ifdef YYSTACK_ALLOC
00405    /* Pacify GCC's `empty if-body' warning.  */
00406 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00407 #  ifndef YYSTACK_ALLOC_MAXIMUM
00408     /* The OS might guarantee only one guard page at the bottom of the stack,
00409        and a page size can be as small as 4096 bytes.  So we cannot safely
00410        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00411        to allow for a few compiler-allocated temporary stack slots.  */
00412 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00413 #  endif
00414 # else
00415 #  define YYSTACK_ALLOC YYMALLOC
00416 #  define YYSTACK_FREE YYFREE
00417 #  ifndef YYSTACK_ALLOC_MAXIMUM
00418 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00419 #  endif
00420 #  if (defined __cplusplus && ! defined _STDLIB_H \
00421        && ! ((defined YYMALLOC || defined malloc) \
00422        && (defined YYFREE || defined free)))
00423 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00424 #   ifndef _STDLIB_H
00425 #    define _STDLIB_H 1
00426 #   endif
00427 #  endif
00428 #  ifndef YYMALLOC
00429 #   define YYMALLOC malloc
00430 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00431      || defined __cplusplus || defined _MSC_VER)
00432 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00433 #   endif
00434 #  endif
00435 #  ifndef YYFREE
00436 #   define YYFREE free
00437 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00438      || defined __cplusplus || defined _MSC_VER)
00439 void free (void *); /* INFRINGES ON USER NAME SPACE */
00440 #   endif
00441 #  endif
00442 # endif
00443 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00444 
00445 
00446 #if (! defined yyoverflow \
00447      && (! defined __cplusplus \
00448    || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00449 
00450 /* A type that is properly aligned for any stack member.  */
00451 union yyalloc
00452 {
00453   yytype_int16 yyss;
00454   YYSTYPE yyvs;
00455   };
00456 
00457 /* The size of the maximum gap between one aligned stack and the next.  */
00458 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00459 
00460 /* The size of an array large to enough to hold all stacks, each with
00461    N elements.  */
00462 # define YYSTACK_BYTES(N) \
00463      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00464       + YYSTACK_GAP_MAXIMUM)
00465 
00466 /* Copy COUNT objects from FROM to TO.  The source and destination do
00467    not overlap.  */
00468 # ifndef YYCOPY
00469 #  if defined __GNUC__ && 1 < __GNUC__
00470 #   define YYCOPY(To, From, Count) \
00471       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00472 #  else
00473 #   define YYCOPY(To, From, Count)    \
00474       do          \
00475   {         \
00476     YYSIZE_T yyi;       \
00477     for (yyi = 0; yyi < (Count); yyi++) \
00478       (To)[yyi] = (From)[yyi];    \
00479   }         \
00480       while (YYID (0))
00481 #  endif
00482 # endif
00483 
00484 /* Relocate STACK from its old location to the new one.  The
00485    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00486    elements in the stack, and YYPTR gives the new location of the
00487    stack.  Advance YYPTR to a properly aligned location for the next
00488    stack.  */
00489 # define YYSTACK_RELOCATE(Stack)          \
00490     do                  \
00491       {                 \
00492   YYSIZE_T yynewbytes;            \
00493   YYCOPY (&yyptr->Stack, Stack, yysize);        \
00494   Stack = &yyptr->Stack;            \
00495   yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00496   yyptr += yynewbytes / sizeof (*yyptr);        \
00497       }                 \
00498     while (YYID (0))
00499 
00500 #endif
00501 
00502 /* YYFINAL -- State number of the termination state.  */
00503 #define YYFINAL  32
00504 /* YYLAST -- Last index in YYTABLE.  */
00505 #define YYLAST   420
00506 
00507 /* YYNTOKENS -- Number of terminals.  */
00508 #define YYNTOKENS  87
00509 /* YYNNTS -- Number of nonterminals.  */
00510 #define YYNNTS  60
00511 /* YYNRULES -- Number of rules.  */
00512 #define YYNRULES  149
00513 /* YYNRULES -- Number of states.  */
00514 #define YYNSTATES  275
00515 
00516 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00517 #define YYUNDEFTOK  2
00518 #define YYMAXUTOK   331
00519 
00520 #define YYTRANSLATE(YYX)            \
00521   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00522 
00523 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00524 static const yytype_uint8 yytranslate[] =
00525 {
00526        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00527        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00528        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00529        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00530       82,    83,    20,    18,    84,    19,    86,    21,     2,     2,
00531        2,     2,     2,     2,     2,     2,     2,     2,     2,    81,
00532        2,    85,     2,     2,     2,     2,     2,     2,     2,     2,
00533        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00534        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00535        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00536        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00537        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00538        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00539        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00540        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00541        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00542        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00543        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00544        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00545        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00546        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00547        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00548        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00549        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00550        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00551        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00552        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00553       15,    16,    17,    22,    23,    24,    25,    26,    27,    28,
00554       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
00555       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
00556       49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
00557       59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
00558       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
00559       79,    80
00560 };
00561 
00562 #if YYDEBUG
00563 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00564    YYRHS.  */
00565 static const yytype_uint16 yyprhs[] =
00566 {
00567        0,     0,     3,     6,     8,    10,    12,    14,    21,    28,
00568       37,    39,    43,    45,    49,    50,    53,    56,    60,    65,
00569       68,    71,    74,    79,    82,    88,    94,    96,   100,   101,
00570      105,   107,   109,   111,   113,   115,   117,   121,   128,   133,
00571      144,   150,   155,   157,   161,   163,   165,   173,   174,   176,
00572      178,   184,   186,   190,   194,   198,   199,   201,   203,   205,
00573      208,   210,   214,   216,   219,   222,   223,   227,   229,   233,
00574      234,   237,   241,   245,   248,   252,   254,   256,   258,   260,
00575      262,   264,   266,   268,   272,   276,   278,   280,   282,   284,
00576      286,   288,   295,   301,   307,   312,   313,   316,   321,   325,
00577      332,   338,   345,   351,   353,   357,   362,   364,   366,   368,
00578      371,   375,   379,   383,   387,   391,   394,   397,   399,   401,
00579      403,   407,   409,   413,   415,   417,   419,   422,   426,   431,
00580      437,   443,   448,   450,   452,   454,   456,   458,   460,   462,
00581      464,   466,   468,   472,   474,   479,   481,   483,   485,   487
00582 };
00583 
00584 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00585 static const yytype_int16 yyrhs[] =
00586 {
00587       88,     0,    -1,    89,    81,    -1,     1,    -1,    72,    -1,
00588       91,    -1,    90,    -1,    30,    80,     3,    82,   144,    83,
00589       -1,    30,    64,   141,    82,    92,    83,    -1,    30,    64,
00590      141,    82,    92,    84,    97,    83,    -1,    93,    -1,    92,
00591       84,    93,    -1,    94,    -1,   144,   143,    95,    -1,    -1,
00592       95,    96,    -1,    11,    52,    -1,    11,    52,    66,    -1,
00593       11,    52,    57,    49,    -1,    32,   140,    -1,    32,    52,
00594       -1,    32,    68,    -1,    29,    82,   120,    83,    -1,    59,
00595      141,    -1,    59,   141,    82,    98,    83,    -1,    57,    49,
00596       82,    98,    83,    -1,   144,    -1,    98,    84,   144,    -1,
00597       -1,    82,    98,    83,    -1,   100,    -1,   101,    -1,   102,
00598       -1,   103,    -1,   106,    -1,   108,    -1,    71,    64,   141,
00599       -1,    71,    80,     3,    82,   144,    83,    -1,    33,    40,
00600      141,   111,    -1,    45,    47,   141,    82,    98,    83,    69,
00601       82,   104,    83,    -1,    51,    47,   141,    99,     8,    -1,
00602       45,    47,   141,   106,    -1,   105,    -1,   104,    84,   105,
00603       -1,   136,    -1,    52,    -1,    60,   107,   112,   113,   111,
00604      117,   119,    -1,    -1,    23,    -1,    35,    -1,    67,   141,
00605       61,   109,   111,    -1,   110,    -1,   109,    84,   110,    -1,
00606      144,    85,   134,    -1,   144,    85,    52,    -1,    -1,   116,
00607       -1,   135,    -1,    20,    -1,    40,   114,    -1,   115,    -1,
00608      114,    84,   115,    -1,   141,    -1,   141,   146,    -1,    70,
00609      120,    -1,    -1,    41,    27,   118,    -1,   142,    -1,   118,
00610       84,   142,    -1,    -1,    42,   120,    -1,   120,     9,   120,
00611       -1,   120,    10,   120,    -1,    11,   120,    -1,    82,   120,
00612       83,    -1,   121,    -1,   122,    -1,   125,    -1,   124,    -1,
00613      127,    -1,   128,    -1,   130,    -1,   132,    -1,   134,   123,
00614      134,    -1,   134,   123,   133,    -1,    17,    -1,    16,    -1,
00615       15,    -1,    14,    -1,    13,    -1,    12,    -1,   134,    11,
00616       26,   134,    10,   134,    -1,   134,    26,   134,    10,   134,
00617       -1,   134,    11,    50,   136,   126,    -1,   134,    50,   136,
00618      126,    -1,    -1,    36,   136,    -1,   142,    48,    11,    52,
00619       -1,   142,    48,    52,    -1,   134,    11,    43,    82,   133,
00620       83,    -1,   134,    43,    82,   133,    83,    -1,   134,    11,
00621       43,    82,   129,    83,    -1,   134,    43,    82,   129,    83,
00622       -1,   136,    -1,   129,    84,   136,    -1,   134,   123,   131,
00623      133,    -1,    24,    -1,    23,    -1,    63,    -1,    37,   133,
00624       -1,    82,   106,    83,    -1,   134,    18,   134,    -1,   134,
00625       19,   134,    -1,   134,    20,   134,    -1,   134,    21,   134,
00626       -1,    18,   134,    -1,    19,   134,    -1,   136,    -1,   142,
00627       -1,   138,    -1,    82,   134,    83,    -1,   134,    -1,   135,
00628       84,   134,    -1,   137,    -1,   140,    -1,   145,    -1,   145,
00629      145,    -1,   145,    44,   145,    -1,   139,    82,    20,    83,
00630       -1,   139,    82,    35,   142,    83,    -1,   139,    82,    23,
00631      134,    83,    -1,   139,    82,   134,    83,    -1,    73,    -1,
00632       74,    -1,    75,    -1,    76,    -1,    77,    -1,     4,    -1,
00633        5,    -1,     6,    -1,     3,    -1,     3,    -1,     3,    86,
00634        3,    -1,    28,    -1,    28,    82,     5,    83,    -1,    46,
00635       -1,     6,    -1,     3,    -1,     7,    -1,     3,    -1
00636 };
00637 
00638 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00639 static const yytype_uint16 yyrline[] =
00640 {
00641        0,   150,   150,   155,   161,   169,   170,   175,   196,   200,
00642      207,   211,   218,   221,   229,   230,   234,   235,   236,   237,
00643      238,   239,   240,   241,   242,   246,   255,   260,   269,   272,
00644      279,   285,   286,   287,   288,   289,   293,   300,   308,   320,
00645      324,   330,   339,   343,   350,   354,   358,   369,   370,   371,
00646      375,   379,   380,   387,   388,   393,   396,   404,   408,   419,
00647      426,   430,   437,   441,   448,   455,   456,   463,   467,   475,
00648      478,   486,   511,   535,   536,   537,   544,   548,   552,   553,
00649      554,   555,   556,   560,   565,   569,   570,   571,   572,   573,
00650      574,   577,   578,   582,   587,   595,   596,   600,   601,   605,
00651      606,   607,   608,   612,   613,   620,   624,   625,   626,   630,
00652      634,   639,   640,   641,   642,   643,   644,   645,   649,   653,
00653      657,   661,   665,   672,   673,   681,   682,   683,   687,   693,
00654      697,   701,   709,   710,   711,   712,   713,   716,   720,   724,
00655      732,   739,   744,   752,   756,   760,   764,   771,   778,   784
00656 };
00657 #endif
00658 
00659 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00660 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00661    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00662 static const char *const yytname[] =
00663 {
00664   "$end", "error", "$undefined", "PTOK_NAME", "PTOK_STRING",
00665   "PTOK_INTNUM", "PTOK_DOUBLE", "PTOK_PARAMETER", "PTOK_QSTRING",
00666   "PTOK_OR", "PTOK_AND", "PTOK_NOT", "PTOK_GEQ", "PTOK_GT", "PTOK_LEQ",
00667   "PTOK_LT", "PTOK_NEQ", "PTOK_EQ", "'+'", "'-'", "'*'", "'/'",
00668   "PTOK_UMINUS", "PTOK_ALL", "PTOK_ANY", "PTOK_ASC", "PTOK_BETWEEN",
00669   "PTOK_BY", "PTOK_CHARACTER", "PTOK_CHECK", "PTOK_CREATE", "PTOK_DECIMAL",
00670   "PTOK_DEFAULT", "PTOK_DELETE", "PTOK_DESC", "PTOK_DISTINCT",
00671   "PTOK_ESCAPE", "PTOK_EXISTS", "PTOK_FLOAT", "PTOK_FOREIGN", "PTOK_FROM",
00672   "PTOK_GROUP", "PTOK_HAVING", "PTOK_IN", "PTOK_INDICATOR", "PTOK_INSERT",
00673   "PTOK_INTEGER", "PTOK_INTO", "PTOK_IS", "PTOK_KEY", "PTOK_LIKE",
00674   "PTOK_LOAD", "PTOK_NULLX", "PTOK_NUMERIC", "PTOK_", "PTOK_ORDER",
00675   "PTOK_PRECISION", "PTOK_PRIMARY", "PTOK_REAL", "PTOK_REFERENCES",
00676   "PTOK_SELECT", "PTOK_SET", "PTOK_SMALLINT", "PTOK_SOME", "PTOK_TABLE",
00677   "PTOK_UNION", "PTOK_UNIQUE", "PTOK_UPDATE", "PTOK_USER", "PTOK_VALUES",
00678   "PTOK_WHERE", "PTOK_DROP", "PTOK_EOF", "PTOK_AVG", "PTOK_COUNT",
00679   "PTOK_MIN", "PTOK_MAX", "PTOK_SUM", "PTOK_HASH", "PTOK_BTREE",
00680   "PTOK_INDEX", "';'", "'('", "')'", "','", "'='", "'.'", "$accept",
00681   "start", "sql", "create_index", "base_table_def",
00682   "base_table_element_commalist", "base_table_element", "column_def",
00683   "column_def_opt_list", "column_def_opt", "table_constraint_def",
00684   "column_commalist", "opt_column_commalist", "manipulative_statement",
00685   "drop_statement", "delete_statement", "insert_statement",
00686   "insert_atom_commalist", "insert_atom", "select_statement",
00687   "opt_all_distinct", "update_statement", "assignment_commalist",
00688   "assignment", "opt_where_clause", "selection", "from_clause",
00689   "table_ref_commalist", "table_ref", "where_clause",
00690   "opt_group_by_clause", "column_ref_commalist", "opt_having_clause",
00691   "search_condition", "predicate", "comparison_predicate", "comparison_op",
00692   "between_predicate", "like_predicate", "opt_escape", "test_for_null",
00693   "in_predicate", "atom_commalist", "all_or_any_predicate", "any_all_some",
00694   "existence_test", "subquery", "scalar_exp", "scalar_exp_commalist",
00695   "atom", "parameter_ref", "function_ref", "aggr_function", "literal",
00696   "table", "column_ref", "data_type", "column", "parameter",
00697   "range_variable", 0
00698 };
00699 #endif
00700 
00701 # ifdef YYPRINT
00702 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00703    token YYLEX-NUM.  */
00704 static const yytype_uint16 yytoknum[] =
00705 {
00706        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00707      265,   266,   267,   268,   269,   270,   271,   272,    43,    45,
00708       42,    47,   273,   274,   275,   276,   277,   278,   279,   280,
00709      281,   282,   283,   284,   285,   286,   287,   288,   289,   290,
00710      291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
00711      301,   302,   303,   304,   305,   306,   307,   308,   309,   310,
00712      311,   312,   313,   314,   315,   316,   317,   318,   319,   320,
00713      321,   322,   323,   324,   325,   326,   327,   328,   329,   330,
00714      331,    59,    40,    41,    44,    61,    46
00715 };
00716 # endif
00717 
00718 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00719 static const yytype_uint8 yyr1[] =
00720 {
00721        0,    87,    88,    88,    88,    89,    89,    90,    91,    91,
00722       92,    92,    93,    94,    95,    95,    96,    96,    96,    96,
00723       96,    96,    96,    96,    96,    97,    98,    98,    99,    99,
00724       89,   100,   100,   100,   100,   100,   101,   101,   102,   103,
00725      103,   103,   104,   104,   105,   105,   106,   107,   107,   107,
00726      108,   109,   109,   110,   110,   111,   111,   112,   112,   113,
00727      114,   114,   115,   115,   116,   117,   117,   118,   118,   119,
00728      119,   120,   120,   120,   120,   120,   121,   121,   121,   121,
00729      121,   121,   121,   122,   122,   123,   123,   123,   123,   123,
00730      123,   124,   124,   125,   125,   126,   126,   127,   127,   128,
00731      128,   128,   128,   129,   129,   130,   131,   131,   131,   132,
00732      133,   134,   134,   134,   134,   134,   134,   134,   134,   134,
00733      134,   135,   135,   136,   136,   137,   137,   137,   138,   138,
00734      138,   138,   139,   139,   139,   139,   139,   140,   140,   140,
00735      141,   142,   142,   143,   143,   143,   143,   144,   145,   146
00736 };
00737 
00738 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00739 static const yytype_uint8 yyr2[] =
00740 {
00741        0,     2,     2,     1,     1,     1,     1,     6,     6,     8,
00742        1,     3,     1,     3,     0,     2,     2,     3,     4,     2,
00743        2,     2,     4,     2,     5,     5,     1,     3,     0,     3,
00744        1,     1,     1,     1,     1,     1,     3,     6,     4,    10,
00745        5,     4,     1,     3,     1,     1,     7,     0,     1,     1,
00746        5,     1,     3,     3,     3,     0,     1,     1,     1,     2,
00747        1,     3,     1,     2,     2,     0,     3,     1,     3,     0,
00748        2,     3,     3,     2,     3,     1,     1,     1,     1,     1,
00749        1,     1,     1,     3,     3,     1,     1,     1,     1,     1,
00750        1,     6,     5,     5,     4,     0,     2,     4,     3,     6,
00751        5,     6,     5,     1,     3,     4,     1,     1,     1,     2,
00752        3,     3,     3,     3,     3,     2,     2,     1,     1,     1,
00753        3,     1,     3,     1,     1,     1,     2,     3,     4,     5,
00754        5,     4,     1,     1,     1,     1,     1,     1,     1,     1,
00755        1,     1,     3,     1,     4,     1,     1,     1,     1,     1
00756 };
00757 
00758 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00759    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00760    means the default is an error.  */
00761 static const yytype_uint8 yydefact[] =
00762 {
00763        0,     3,     0,     0,     0,     0,    47,     0,     0,     4,
00764        0,     0,     6,     5,    30,    31,    32,    33,    34,    35,
00765        0,     0,     0,     0,     0,    48,    49,     0,   140,     0,
00766        0,     0,     1,     2,     0,     0,    55,     0,    28,   141,
00767      137,   138,   139,   148,     0,     0,    58,   132,   133,   134,
00768      135,   136,     0,     0,   121,    57,   117,   123,   119,     0,
00769      124,   118,   125,     0,    36,     0,     0,     0,     0,    38,
00770       56,     0,    41,     0,     0,     0,   115,   116,     0,     0,
00771       55,     0,     0,     0,     0,     0,     0,     0,   126,   147,
00772       55,    51,     0,     0,     0,    10,    12,     0,     0,     0,
00773        0,     0,    64,    75,    76,    78,    77,    79,    80,    81,
00774       82,     0,   118,     0,    26,     0,    40,   142,   120,    59,
00775       60,    62,    65,   111,   112,   113,   114,   122,     0,     0,
00776        0,     0,   127,     0,    50,     0,     0,     8,     0,   146,
00777      143,   145,    14,     7,    73,     0,   109,     0,     0,     0,
00778        0,     0,    90,    89,    88,    87,    86,    85,     0,     0,
00779        0,     0,     0,     0,     0,    29,     0,   149,    63,     0,
00780       69,   128,     0,     0,   131,    52,    54,    53,    37,     0,
00781       11,     0,     0,    13,     0,    74,    71,    72,     0,     0,
00782        0,     0,     0,    95,   107,   106,   108,     0,     0,    84,
00783       83,     0,    98,     0,    27,    61,     0,     0,    46,   130,
00784      129,     0,     9,     0,     0,     0,     0,     0,    15,   110,
00785        0,     0,    95,     0,     0,     0,   103,     0,    94,   105,
00786       97,     0,    66,    67,    70,     0,   144,    16,     0,    20,
00787       21,    19,    23,     0,     0,     0,    93,    92,   102,     0,
00788      100,    96,    45,     0,    42,    44,     0,     0,     0,    17,
00789        0,     0,    91,   101,    99,   104,    39,     0,    68,    25,
00790       18,    22,     0,    43,    24
00791 };
00792 
00793 /* YYDEFGOTO[NTERM-NUM].  */
00794 static const yytype_int16 yydefgoto[] =
00795 {
00796       -1,    10,    11,    12,    13,    94,    95,    96,   183,   218,
00797      181,   113,    74,    14,    15,    16,    17,   253,   254,   184,
00798       27,    19,    90,    91,    69,    53,    80,   119,   120,    70,
00799      170,   232,   208,   102,   103,   104,   161,   105,   106,   228,
00800      107,   108,   224,   109,   198,   110,   146,   111,    55,    56,
00801       57,    58,    59,    60,   121,    61,   142,   114,    62,   168
00802 };
00803 
00804 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00805    STATE-NUM.  */
00806 #define YYPACT_NINF -156
00807 static const yytype_int16 yypact[] =
00808 {
00809      308,  -156,    25,   -12,    56,    83,   -14,    30,    26,  -156,
00810      107,    57,  -156,  -156,  -156,  -156,  -156,  -156,  -156,  -156,
00811       30,   159,    30,    30,    30,  -156,  -156,   204,  -156,   118,
00812       30,   192,  -156,  -156,   100,   102,   134,   -41,   124,   128,
00813     -156,  -156,  -156,  -156,   242,   242,  -156,  -156,  -156,  -156,
00814     -156,  -156,   242,   203,   200,   148,  -156,  -156,  -156,   152,
00815     -156,  -156,    31,   263,  -156,   190,   263,   263,   194,  -156,
00816     -156,   263,  -156,   263,   265,   271,  -156,  -156,    60,    30,
00817      134,   242,   242,   242,   242,   242,    81,   268,  -156,  -156,
00818       27,  -156,   197,   263,    49,  -156,  -156,    67,   201,   194,
00819      205,   194,   126,  -156,  -156,  -156,  -156,  -156,  -156,  -156,
00820     -156,   370,   237,    76,  -156,    90,  -156,  -156,  -156,   206,
00821     -156,   285,   248,   167,   167,  -156,  -156,   200,   208,   242,
00822      289,   132,  -156,   263,  -156,    46,   210,  -156,     5,  -156,
00823      212,  -156,  -156,  -156,  -156,   235,  -156,    -6,   314,   194,
00824      194,   207,  -156,  -156,  -156,  -156,  -156,  -156,   242,   219,
00825      247,   162,    15,   233,   263,  -156,    30,  -156,  -156,   276,
00826      262,  -156,   157,   224,  -156,  -156,  -156,   200,  -156,   257,
00827     -156,   225,   305,    85,   228,  -156,   302,  -156,   242,   231,
00828      247,   127,     9,   278,  -156,  -156,  -156,   223,   205,  -156,
00829      200,   269,  -156,   238,  -156,  -156,   289,   194,  -156,  -156,
00830     -156,   240,  -156,   253,   287,   241,    41,    30,  -156,  -156,
00831      173,     9,   278,   242,   119,   254,  -156,   247,  -156,  -156,
00832     -156,   120,   258,  -156,   126,   263,  -156,   -30,   194,  -156,
00833     -156,  -156,   261,   242,   172,   264,  -156,   200,  -156,   247,
00834     -156,  -156,  -156,   175,  -156,  -156,   289,   179,   295,  -156,
00835       59,   263,   200,  -156,  -156,  -156,  -156,   120,  -156,  -156,
00836     -156,  -156,   181,  -156,  -156
00837 };
00838 
00839 /* YYPGOTO[NTERM-NUM].  */
00840 static const yytype_int16 yypgoto[] =
00841 {
00842     -156,  -156,  -156,  -156,  -156,  -156,   211,  -156,  -156,  -156,
00843     -156,   -71,  -156,  -156,  -156,  -156,  -156,  -156,    78,    92,
00844     -156,  -156,  -156,   213,   -51,  -156,  -156,  -156,   182,  -156,
00845     -156,  -156,  -156,   -89,  -156,  -156,  -156,  -156,  -156,   129,
00846     -156,  -156,   131,  -156,  -156,  -156,  -150,   -27,  -156,  -155,
00847     -156,  -156,  -156,   138,     0,   -67,  -156,   -23,   -56,  -156
00848 };
00849 
00850 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00851    positive, shift that token.  If negative, reduce the rule which
00852    number is the opposite.  If zero, do what YYDEFACT says.
00853    If YYTABLE_NINF, syntax error.  */
00854 #define YYTABLE_NINF -1
00855 static const yytype_uint16 yytable[] =
00856 {
00857       54,   112,   115,   149,   150,   193,    88,    29,    89,    25,
00858      144,   199,   147,    40,    41,    42,    43,    76,    77,     6,
00859       34,    26,    36,    37,    38,    78,   201,   258,    22,   122,
00860       64,   132,   112,    28,   112,   222,   259,   226,    43,   134,
00861       92,    71,   225,    97,    98,    40,    41,    42,   229,    39,
00862       40,    41,    42,    43,   123,   124,   125,   126,   127,   131,
00863      186,   187,   179,   173,    44,    45,   226,   202,   149,   150,
00864      136,   245,   251,   139,   148,    87,   255,   185,    81,    82,
00865       83,    84,   112,   112,    39,    40,    41,    42,    43,    20,
00866       30,   145,    18,   239,   265,   140,   214,    68,   176,    44,
00867       45,   128,   172,    23,   129,    21,    31,    32,   177,   240,
00868       92,   133,   255,   141,   215,    97,   130,   216,   234,    47,
00869       48,    49,    50,    51,    40,    41,    42,    43,    52,    72,
00870       24,   191,   137,   138,   200,   149,   150,   223,    33,   233,
00871      112,   204,   271,   118,   217,    81,    82,    83,    84,   260,
00872       81,    82,    83,    84,    47,    48,    49,    50,    51,   163,
00873      164,   220,    35,    52,   257,    39,    40,    41,    42,    43,
00874       78,   112,   252,   165,   164,    81,    82,    83,    84,    63,
00875       44,    45,    66,   243,    67,   194,   195,    83,    84,   268,
00876      272,    81,    82,    83,    84,    65,   247,    39,    40,    41,
00877       42,    43,   248,   249,    68,    99,    73,    39,    40,    41,
00878       42,    43,    44,    45,    75,   174,   262,   242,    81,    82,
00879       83,    84,    44,    45,    46,   196,    39,    40,    41,    42,
00880       43,   100,    85,   188,    86,    47,    48,    49,    50,    51,
00881      209,    44,    45,    79,   197,    39,    40,    41,    42,    43,
00882      189,    40,    41,    42,    43,   263,   249,   190,   266,   267,
00883       44,    45,   269,   164,   274,   164,    89,    47,    48,    49,
00884       50,    51,    93,   116,   117,    43,   101,    47,    48,    49,
00885       50,    51,   135,     6,   143,   162,    52,   145,   167,   169,
00886      166,   171,    39,   178,   182,     6,    47,    48,    49,    50,
00887       51,   192,   203,   206,   207,    52,   211,   210,   212,     1,
00888      213,   219,   150,   221,   227,    47,    48,    49,    50,    51,
00889      231,   230,   235,   238,    52,   151,   152,   153,   154,   155,
00890      156,   157,    81,    82,    83,    84,   236,   250,     2,   237,
00891      158,     3,   256,   261,   270,   273,   175,   264,   205,   180,
00892        0,   246,   244,     4,   241,     0,     0,   159,     0,     5,
00893        0,     0,     0,     0,   160,     0,     0,     0,     6,     0,
00894        0,     0,     0,     0,     0,     7,     0,     0,     0,     8,
00895        9,   151,   152,   153,   154,   155,   156,   157,    81,    82,
00896       83,    84,     0,     0,     0,     0,   158,   118,     0,     0,
00897        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00898        0,     0,     0,   159,     0,     0,     0,     0,     0,     0,
00899      160
00900 };
00901 
00902 static const yytype_int16 yycheck[] =
00903 {
00904       27,    68,    73,     9,    10,   160,    62,     7,     3,    23,
00905       99,   161,   101,     4,     5,     6,     7,    44,    45,    60,
00906       20,    35,    22,    23,    24,    52,    11,    57,    40,    80,
00907       30,    87,    99,     3,   101,   190,    66,   192,     7,    90,
00908       63,    82,   192,    66,    67,     4,     5,     6,   198,     3,
00909        4,     5,     6,     7,    81,    82,    83,    84,    85,    86,
00910      149,   150,    57,   130,    18,    19,   221,    52,     9,    10,
00911       93,   221,   227,     6,   101,    44,   231,    83,    18,    19,
00912       20,    21,   149,   150,     3,     4,     5,     6,     7,    64,
00913       64,    82,     0,    52,   249,    28,    11,    70,    52,    18,
00914       19,    20,   129,    47,    23,    80,    80,     0,   135,    68,
00915      133,    84,   267,    46,    29,   138,    35,    32,   207,    73,
00916       74,    75,    76,    77,     4,     5,     6,     7,    82,    37,
00917       47,   158,    83,    84,   161,     9,    10,    10,    81,   206,
00918      207,   164,    83,    83,    59,    18,    19,    20,    21,   238,
00919       18,    19,    20,    21,    73,    74,    75,    76,    77,    83,
00920       84,   188,     3,    82,   235,     3,     4,     5,     6,     7,
00921      197,   238,    52,    83,    84,    18,    19,    20,    21,    61,
00922       18,    19,    82,    10,    82,    23,    24,    20,    21,   256,
00923      261,    18,    19,    20,    21,     3,   223,     3,     4,     5,
00924        6,     7,    83,    84,    70,    11,    82,     3,     4,     5,
00925        6,     7,    18,    19,    86,    83,   243,   217,    18,    19,
00926       20,    21,    18,    19,    20,    63,     3,     4,     5,     6,
00927        7,    37,    84,    26,    82,    73,    74,    75,    76,    77,
00928       83,    18,    19,    40,    82,     3,     4,     5,     6,     7,
00929       43,     4,     5,     6,     7,    83,    84,    50,    83,    84,
00930       18,    19,    83,    84,    83,    84,     3,    73,    74,    75,
00931       76,    77,    82,     8,     3,     7,    82,    73,    74,    75,
00932       76,    77,    85,    60,    83,    48,    82,    82,     3,    41,
00933       84,    83,     3,    83,    82,    60,    73,    74,    75,    76,
00934       77,    82,    69,    27,    42,    82,    49,    83,    83,     1,
00935        5,    83,    10,    82,    36,    73,    74,    75,    76,    77,
00936       82,    52,    82,    82,    82,    11,    12,    13,    14,    15,
00937       16,    17,    18,    19,    20,    21,    83,    83,    30,    52,
00938       26,    33,    84,    82,    49,   267,   133,    83,   166,   138,
00939       -1,   222,   221,    45,   216,    -1,    -1,    43,    -1,    51,
00940       -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,    60,    -1,
00941       -1,    -1,    -1,    -1,    -1,    67,    -1,    -1,    -1,    71,
00942       72,    11,    12,    13,    14,    15,    16,    17,    18,    19,
00943       20,    21,    -1,    -1,    -1,    -1,    26,    83,    -1,    -1,
00944       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
00945       -1,    -1,    -1,    43,    -1,    -1,    -1,    -1,    -1,    -1,
00946       50
00947 };
00948 
00949 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00950    symbol of state STATE-NUM.  */
00951 static const yytype_uint8 yystos[] =
00952 {
00953        0,     1,    30,    33,    45,    51,    60,    67,    71,    72,
00954       88,    89,    90,    91,   100,   101,   102,   103,   106,   108,
00955       64,    80,    40,    47,    47,    23,    35,   107,     3,   141,
00956       64,    80,     0,    81,   141,     3,   141,   141,   141,     3,
00957        4,     5,     6,     7,    18,    19,    20,    73,    74,    75,
00958       76,    77,    82,   112,   134,   135,   136,   137,   138,   139,
00959      140,   142,   145,    61,   141,     3,    82,    82,    70,   111,
00960      116,    82,   106,    82,    99,    86,   134,   134,   134,    40,
00961      113,    18,    19,    20,    21,    84,    82,    44,   145,     3,
00962      109,   110,   144,    82,    92,    93,    94,   144,   144,    11,
00963       37,    82,   120,   121,   122,   124,   125,   127,   128,   130,
00964      132,   134,   142,    98,   144,    98,     8,     3,    83,   114,
00965      115,   141,   111,   134,   134,   134,   134,   134,    20,    23,
00966       35,   134,   145,    84,   111,    85,   144,    83,    84,     6,
00967       28,    46,   143,    83,   120,    82,   133,   120,   134,     9,
00968       10,    11,    12,    13,    14,    15,    16,    17,    26,    43,
00969       50,   123,    48,    83,    84,    83,    84,     3,   146,    41,
00970      117,    83,   134,   142,    83,   110,    52,   134,    83,    57,
00971       93,    97,    82,    95,   106,    83,   120,   120,    26,    43,
00972       50,   134,    82,   136,    23,    24,    63,    82,   131,   133,
00973      134,    11,    52,    69,   144,   115,    27,    42,   119,    83,
00974       83,    49,    83,     5,    11,    29,    32,    59,    96,    83,
00975      134,    82,   136,    10,   129,   133,   136,    36,   126,   133,
00976       52,    82,   118,   142,   120,    82,    83,    52,    82,    52,
00977       68,   140,   141,    10,   129,   133,   126,   134,    83,    84,
00978       83,   136,    52,   104,   105,   136,    84,    98,    57,    66,
00979      120,    82,   134,    83,    83,   136,    83,    84,   142,    83,
00980       49,    83,    98,   105,    83
00981 };
00982 
00983 #define yyerrok   (yyerrstatus = 0)
00984 #define yyclearin (yychar = YYEMPTY)
00985 #define YYEMPTY   (-2)
00986 #define YYEOF   0
00987 
00988 #define YYACCEPT  goto yyacceptlab
00989 #define YYABORT   goto yyabortlab
00990 #define YYERROR   goto yyerrorlab
00991 
00992 
00993 /* Like YYERROR except do call yyerror.  This remains here temporarily
00994    to ease the transition to the new meaning of YYERROR, for GCC.
00995    Once GCC version 2 has supplanted version 1, this can go.  */
00996 
00997 #define YYFAIL    goto yyerrlab
00998 
00999 #define YYRECOVERING()  (!!yyerrstatus)
01000 
01001 #define YYBACKUP(Token, Value)          \
01002 do                \
01003   if (yychar == YYEMPTY && yylen == 1)        \
01004     {               \
01005       yychar = (Token);           \
01006       yylval = (Value);           \
01007       yytoken = YYTRANSLATE (yychar);       \
01008       YYPOPSTACK (1);           \
01009       goto yybackup;            \
01010     }               \
01011   else                \
01012     {               \
01013       yyerror (YY_("syntax error: cannot back up")); \
01014       YYERROR;              \
01015     }               \
01016 while (YYID (0))
01017 
01018 
01019 #define YYTERROR  1
01020 #define YYERRCODE 256
01021 
01022 
01023 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
01024    If N is 0, then set CURRENT to the empty location which ends
01025    the previous symbol: RHS[0] (always defined).  */
01026 
01027 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
01028 #ifndef YYLLOC_DEFAULT
01029 # define YYLLOC_DEFAULT(Current, Rhs, N)        \
01030     do                  \
01031       if (YYID (N))                                                    \
01032   {               \
01033     (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;  \
01034     (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
01035     (Current).last_line    = YYRHSLOC (Rhs, N).last_line;   \
01036     (Current).last_column  = YYRHSLOC (Rhs, N).last_column; \
01037   }               \
01038       else                \
01039   {               \
01040     (Current).first_line   = (Current).last_line   =    \
01041       YYRHSLOC (Rhs, 0).last_line;        \
01042     (Current).first_column = (Current).last_column =    \
01043       YYRHSLOC (Rhs, 0).last_column;        \
01044   }               \
01045     while (YYID (0))
01046 #endif
01047 
01048 
01049 /* YY_LOCATION_PRINT -- Print the location on the stream.
01050    This macro was not mandated originally: define only if we know
01051    we won't break user code: when these are the locations we know.  */
01052 
01053 #ifndef YY_LOCATION_PRINT
01054 # if YYLTYPE_IS_TRIVIAL
01055 #  define YY_LOCATION_PRINT(File, Loc)      \
01056      fprintf (File, "%d.%d-%d.%d",      \
01057         (Loc).first_line, (Loc).first_column, \
01058         (Loc).last_line,  (Loc).last_column)
01059 # else
01060 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
01061 # endif
01062 #endif
01063 
01064 
01065 /* YYLEX -- calling `yylex' with the right arguments.  */
01066 
01067 #ifdef YYLEX_PARAM
01068 # define YYLEX yylex (YYLEX_PARAM)
01069 #else
01070 # define YYLEX yylex ()
01071 #endif
01072 
01073 /* Enable debugging if requested.  */
01074 #if YYDEBUG
01075 
01076 # ifndef YYFPRINTF
01077 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
01078 #  define YYFPRINTF fprintf
01079 # endif
01080 
01081 # define YYDPRINTF(Args)      \
01082 do {            \
01083   if (yydebug)          \
01084     YYFPRINTF Args;       \
01085 } while (YYID (0))
01086 
01087 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)        \
01088 do {                    \
01089   if (yydebug)                  \
01090     {                   \
01091       YYFPRINTF (stderr, "%s ", Title);           \
01092       yy_symbol_print (stderr,              \
01093       Type, Value); \
01094       YYFPRINTF (stderr, "\n");             \
01095     }                   \
01096 } while (YYID (0))
01097 
01098 
01099 /*--------------------------------.
01100 | Print this symbol on YYOUTPUT.  |
01101 `--------------------------------*/
01102 
01103 /*ARGSUSED*/
01104 #if (defined __STDC__ || defined __C99__FUNC__ \
01105      || defined __cplusplus || defined _MSC_VER)
01106 static void
01107 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01108 #else
01109 static void
01110 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
01111     FILE *yyoutput;
01112     int yytype;
01113     YYSTYPE const * const yyvaluep;
01114 #endif
01115 {
01116   if (!yyvaluep)
01117     return;
01118 # ifdef YYPRINT
01119   if (yytype < YYNTOKENS)
01120     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01121 # else
01122   YYUSE (yyoutput);
01123 # endif
01124   switch (yytype)
01125     {
01126       default:
01127   break;
01128     }
01129 }
01130 
01131 
01132 /*--------------------------------.
01133 | Print this symbol on YYOUTPUT.  |
01134 `--------------------------------*/
01135 
01136 #if (defined __STDC__ || defined __C99__FUNC__ \
01137      || defined __cplusplus || defined _MSC_VER)
01138 static void
01139 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01140 #else
01141 static void
01142 yy_symbol_print (yyoutput, yytype, yyvaluep)
01143     FILE *yyoutput;
01144     int yytype;
01145     YYSTYPE const * const yyvaluep;
01146 #endif
01147 {
01148   if (yytype < YYNTOKENS)
01149     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01150   else
01151     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01152 
01153   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01154   YYFPRINTF (yyoutput, ")");
01155 }
01156 
01157 /*------------------------------------------------------------------.
01158 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01159 | TOP (included).                                                   |
01160 `------------------------------------------------------------------*/
01161 
01162 #if (defined __STDC__ || defined __C99__FUNC__ \
01163      || defined __cplusplus || defined _MSC_VER)
01164 static void
01165 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
01166 #else
01167 static void
01168 yy_stack_print (bottom, top)
01169     yytype_int16 *bottom;
01170     yytype_int16 *top;
01171 #endif
01172 {
01173   YYFPRINTF (stderr, "Stack now");
01174   for (; bottom <= top; ++bottom)
01175     YYFPRINTF (stderr, " %d", *bottom);
01176   YYFPRINTF (stderr, "\n");
01177 }
01178 
01179 # define YY_STACK_PRINT(Bottom, Top)        \
01180 do {                \
01181   if (yydebug)              \
01182     yy_stack_print ((Bottom), (Top));       \
01183 } while (YYID (0))
01184 
01185 
01186 /*------------------------------------------------.
01187 | Report that the YYRULE is going to be reduced.  |
01188 `------------------------------------------------*/
01189 
01190 #if (defined __STDC__ || defined __C99__FUNC__ \
01191      || defined __cplusplus || defined _MSC_VER)
01192 static void
01193 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
01194 #else
01195 static void
01196 yy_reduce_print (yyvsp, yyrule)
01197     YYSTYPE *yyvsp;
01198     int yyrule;
01199 #endif
01200 {
01201   int yynrhs = yyr2[yyrule];
01202   int yyi;
01203   unsigned long int yylno = yyrline[yyrule];
01204   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01205        yyrule - 1, yylno);
01206   /* The symbols being reduced.  */
01207   for (yyi = 0; yyi < yynrhs; yyi++)
01208     {
01209       fprintf (stderr, "   $%d = ", yyi + 1);
01210       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01211            &(yyvsp[(yyi + 1) - (yynrhs)])
01212                      );
01213       fprintf (stderr, "\n");
01214     }
01215 }
01216 
01217 # define YY_REDUCE_PRINT(Rule)    \
01218 do {          \
01219   if (yydebug)        \
01220     yy_reduce_print (yyvsp, Rule); \
01221 } while (YYID (0))
01222 
01223 /* Nonzero means print parse trace.  It is left uninitialized so that
01224    multiple parsers can coexist.  */
01225 int yydebug;
01226 #else /* !YYDEBUG */
01227 # define YYDPRINTF(Args)
01228 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01229 # define YY_STACK_PRINT(Bottom, Top)
01230 # define YY_REDUCE_PRINT(Rule)
01231 #endif /* !YYDEBUG */
01232 
01233 
01234 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01235 #ifndef YYINITDEPTH
01236 # define YYINITDEPTH 200
01237 #endif
01238 
01239 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01240    if the built-in stack extension method is used).
01241 
01242    Do not make this value too large; the results are undefined if
01243    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
01244    evaluated with infinite-precision integer arithmetic.  */
01245 
01246 #ifndef YYMAXDEPTH
01247 # define YYMAXDEPTH 10000
01248 #endif
01249 
01250 
01251 
01252 #if YYERROR_VERBOSE
01253 
01254 # ifndef yystrlen
01255 #  if defined __GLIBC__ && defined _STRING_H
01256 #   define yystrlen strlen
01257 #  else
01258 /* Return the length of YYSTR.  */
01259 #if (defined __STDC__ || defined __C99__FUNC__ \
01260      || defined __cplusplus || defined _MSC_VER)
01261 static YYSIZE_T
01262 yystrlen (const char *yystr)
01263 #else
01264 static YYSIZE_T
01265 yystrlen (yystr)
01266     const char *yystr;
01267 #endif
01268 {
01269   YYSIZE_T yylen;
01270   for (yylen = 0; yystr[yylen]; yylen++)
01271     continue;
01272   return yylen;
01273 }
01274 #  endif
01275 # endif
01276 
01277 # ifndef yystpcpy
01278 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01279 #   define yystpcpy stpcpy
01280 #  else
01281 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01282    YYDEST.  */
01283 #if (defined __STDC__ || defined __C99__FUNC__ \
01284      || defined __cplusplus || defined _MSC_VER)
01285 static char *
01286 yystpcpy (char *yydest, const char *yysrc)
01287 #else
01288 static char *
01289 yystpcpy (yydest, yysrc)
01290     char *yydest;
01291     const char *yysrc;
01292 #endif
01293 {
01294   char *yyd = yydest;
01295   const char *yys = yysrc;
01296 
01297   while ((*yyd++ = *yys++) != '\0')
01298     continue;
01299 
01300   return yyd - 1;
01301 }
01302 #  endif
01303 # endif
01304 
01305 # ifndef yytnamerr
01306 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
01307    quotes and backslashes, so that it's suitable for yyerror.  The
01308    heuristic is that double-quoting is unnecessary unless the string
01309    contains an apostrophe, a comma, or backslash (other than
01310    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01311    null, do not copy; instead, return the length of what the result
01312    would have been.  */
01313 static YYSIZE_T
01314 yytnamerr (char *yyres, const char *yystr)
01315 {
01316   if (*yystr == '"')
01317     {
01318       YYSIZE_T yyn = 0;
01319       char const *yyp = yystr;
01320 
01321       for (;;)
01322   switch (*++yyp)
01323     {
01324     case '\'':
01325     case ',':
01326       goto do_not_strip_quotes;
01327 
01328     case '\\':
01329       if (*++yyp != '\\')
01330         goto do_not_strip_quotes;
01331       /* Fall through.  */
01332     default:
01333       if (yyres)
01334         yyres[yyn] = *yyp;
01335       yyn++;
01336       break;
01337 
01338     case '"':
01339       if (yyres)
01340         yyres[yyn] = '\0';
01341       return yyn;
01342     }
01343     do_not_strip_quotes: ;
01344     }
01345 
01346   if (! yyres)
01347     return yystrlen (yystr);
01348 
01349   return yystpcpy (yyres, yystr) - yyres;
01350 }
01351 # endif
01352 
01353 /* Copy into YYRESULT an error message about the unexpected token
01354    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01355    including the terminating null byte.  If YYRESULT is null, do not
01356    copy anything; just return the number of bytes that would be
01357    copied.  As a special case, return 0 if an ordinary "syntax error"
01358    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01359    size calculation.  */
01360 static YYSIZE_T
01361 yysyntax_error (char *yyresult, int yystate, int yychar)
01362 {
01363   int yyn = yypact[yystate];
01364 
01365   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01366     return 0;
01367   else
01368     {
01369       int yytype = YYTRANSLATE (yychar);
01370       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01371       YYSIZE_T yysize = yysize0;
01372       YYSIZE_T yysize1;
01373       int yysize_overflow = 0;
01374       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01375       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01376       int yyx;
01377 
01378 # if 0
01379       /* This is so xgettext sees the translatable formats that are
01380    constructed on the fly.  */
01381       YY_("syntax error, unexpected %s");
01382       YY_("syntax error, unexpected %s, expecting %s");
01383       YY_("syntax error, unexpected %s, expecting %s or %s");
01384       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01385       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01386 # endif
01387       char *yyfmt;
01388       char const *yyf;
01389       static char const yyunexpected[] = "syntax error, unexpected %s";
01390       static char const yyexpecting[] = ", expecting %s";
01391       static char const yyor[] = " or %s";
01392       char yyformat[sizeof yyunexpected
01393         + sizeof yyexpecting - 1
01394         + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01395            * (sizeof yyor - 1))];
01396       char const *yyprefix = yyexpecting;
01397 
01398       /* Start YYX at -YYN if negative to avoid negative indexes in
01399    YYCHECK.  */
01400       int yyxbegin = yyn < 0 ? -yyn : 0;
01401 
01402       /* Stay within bounds of both yycheck and yytname.  */
01403       int yychecklim = YYLAST - yyn + 1;
01404       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01405       int yycount = 1;
01406 
01407       yyarg[0] = yytname[yytype];
01408       yyfmt = yystpcpy (yyformat, yyunexpected);
01409 
01410       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01411   if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01412     {
01413       if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01414         {
01415     yycount = 1;
01416     yysize = yysize0;
01417     yyformat[sizeof yyunexpected - 1] = '\0';
01418     break;
01419         }
01420       yyarg[yycount++] = yytname[yyx];
01421       yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01422       yysize_overflow |= (yysize1 < yysize);
01423       yysize = yysize1;
01424       yyfmt = yystpcpy (yyfmt, yyprefix);
01425       yyprefix = yyor;
01426     }
01427 
01428       yyf = YY_(yyformat);
01429       yysize1 = yysize + yystrlen (yyf);
01430       yysize_overflow |= (yysize1 < yysize);
01431       yysize = yysize1;
01432 
01433       if (yysize_overflow)
01434   return YYSIZE_MAXIMUM;
01435 
01436       if (yyresult)
01437   {
01438     /* Avoid sprintf, as that infringes on the user's name space.
01439        Don't have undefined behavior even if the translation
01440        produced a string with the wrong number of "%s"s.  */
01441     char *yyp = yyresult;
01442     int yyi = 0;
01443     while ((*yyp = *yyf) != '\0')
01444       {
01445         if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01446     {
01447       yyp += yytnamerr (yyp, yyarg[yyi++]);
01448       yyf += 2;
01449     }
01450         else
01451     {
01452       yyp++;
01453       yyf++;
01454     }
01455       }
01456   }
01457       return yysize;
01458     }
01459 }
01460 #endif /* YYERROR_VERBOSE */
01461 
01462 
01463 /*-----------------------------------------------.
01464 | Release the memory associated to this symbol.  |
01465 `-----------------------------------------------*/
01466 
01467 /*ARGSUSED*/
01468 #if (defined __STDC__ || defined __C99__FUNC__ \
01469      || defined __cplusplus || defined _MSC_VER)
01470 static void
01471 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01472 #else
01473 static void
01474 yydestruct (yymsg, yytype, yyvaluep)
01475     const char *yymsg;
01476     int yytype;
01477     YYSTYPE *yyvaluep;
01478 #endif
01479 {
01480   YYUSE (yyvaluep);
01481 
01482   if (!yymsg)
01483     yymsg = "Deleting";
01484   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01485 
01486   switch (yytype)
01487     {
01488 
01489       default:
01490   break;
01491     }
01492 }
01493 
01494 
01495 /* Prevent warnings from -Wmissing-prototypes.  */
01496 
01497 #ifdef YYPARSE_PARAM
01498 #if defined __STDC__ || defined __cplusplus
01499 int yyparse (void *YYPARSE_PARAM);
01500 #else
01501 int yyparse ();
01502 #endif
01503 #else /* ! YYPARSE_PARAM */
01504 #if defined __STDC__ || defined __cplusplus
01505 int yyparse (void);
01506 #else
01507 int yyparse ();
01508 #endif
01509 #endif /* ! YYPARSE_PARAM */
01510 
01511 
01512 
01513 /* The look-ahead symbol.  */
01514 int yychar;
01515 
01516 /* The semantic value of the look-ahead symbol.  */
01517 YYSTYPE yylval;
01518 
01519 /* Number of syntax errors so far.  */
01520 int yynerrs;
01521 
01522 
01523 
01524 /*----------.
01525 | yyparse.  |
01526 `----------*/
01527 
01528 #ifdef YYPARSE_PARAM
01529 #if (defined __STDC__ || defined __C99__FUNC__ \
01530      || defined __cplusplus || defined _MSC_VER)
01531 int
01532 yyparse (void *YYPARSE_PARAM)
01533 #else
01534 int
01535 yyparse (YYPARSE_PARAM)
01536     void *YYPARSE_PARAM;
01537 #endif
01538 #else /* ! YYPARSE_PARAM */
01539 #if (defined __STDC__ || defined __C99__FUNC__ \
01540      || defined __cplusplus || defined _MSC_VER)
01541 int
01542 yyparse (void)
01543 #else
01544 int
01545 yyparse ()
01546 
01547 #endif
01548 #endif
01549 {
01550   
01551   int yystate;
01552   int yyn;
01553   int yyresult;
01554   /* Number of tokens to shift before error messages enabled.  */
01555   int yyerrstatus;
01556   /* Look-ahead token as an internal (translated) token number.  */
01557   int yytoken = 0;
01558 #if YYERROR_VERBOSE
01559   /* Buffer for error messages, and its allocated size.  */
01560   char yymsgbuf[128];
01561   char *yymsg = yymsgbuf;
01562   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01563 #endif
01564 
01565   /* Three stacks and their tools:
01566      `yyss': related to states,
01567      `yyvs': related to semantic values,
01568      `yyls': related to locations.
01569 
01570      Refer to the stacks thru separate pointers, to allow yyoverflow
01571      to reallocate them elsewhere.  */
01572 
01573   /* The state stack.  */
01574   yytype_int16 yyssa[YYINITDEPTH];
01575   yytype_int16 *yyss = yyssa;
01576   yytype_int16 *yyssp;
01577 
01578   /* The semantic value stack.  */
01579   YYSTYPE yyvsa[YYINITDEPTH];
01580   YYSTYPE *yyvs = yyvsa;
01581   YYSTYPE *yyvsp;
01582 
01583 
01584 
01585 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01586 
01587   YYSIZE_T yystacksize = YYINITDEPTH;
01588 
01589   /* The variables used to return semantic value and location from the
01590      action routines.  */
01591   YYSTYPE yyval;
01592 
01593 
01594   /* The number of symbols on the RHS of the reduced rule.
01595      Keep to zero when no symbol should be popped.  */
01596   int yylen = 0;
01597 
01598   YYDPRINTF ((stderr, "Starting parse\n"));
01599 
01600   yystate = 0;
01601   yyerrstatus = 0;
01602   yynerrs = 0;
01603   yychar = YYEMPTY;   /* Cause a token to be read.  */
01604 
01605   /* Initialize stack pointers.
01606      Waste one element of value and location stack
01607      so that they stay on the same level as the state stack.
01608      The wasted elements are never initialized.  */
01609 
01610   yyssp = yyss;
01611   yyvsp = yyvs;
01612 
01613   goto yysetstate;
01614 
01615 /*------------------------------------------------------------.
01616 | yynewstate -- Push a new state, which is found in yystate.  |
01617 `------------------------------------------------------------*/
01618  yynewstate:
01619   /* In all cases, when you get here, the value and location stacks
01620      have just been pushed.  So pushing a state here evens the stacks.  */
01621   yyssp++;
01622 
01623  yysetstate:
01624   *yyssp = yystate;
01625 
01626   if (yyss + yystacksize - 1 <= yyssp)
01627     {
01628       /* Get the current used size of the three stacks, in elements.  */
01629       YYSIZE_T yysize = yyssp - yyss + 1;
01630 
01631 #ifdef yyoverflow
01632       {
01633   /* Give user a chance to reallocate the stack.  Use copies of
01634      these so that the &'s don't force the real ones into
01635      memory.  */
01636   YYSTYPE *yyvs1 = yyvs;
01637   yytype_int16 *yyss1 = yyss;
01638 
01639 
01640   /* Each stack pointer address is followed by the size of the
01641      data in use in that stack, in bytes.  This used to be a
01642      conditional around just the two extra args, but that might
01643      be undefined if yyoverflow is a macro.  */
01644   yyoverflow (YY_("memory exhausted"),
01645         &yyss1, yysize * sizeof (*yyssp),
01646         &yyvs1, yysize * sizeof (*yyvsp),
01647 
01648         &yystacksize);
01649 
01650   yyss = yyss1;
01651   yyvs = yyvs1;
01652       }
01653 #else /* no yyoverflow */
01654 # ifndef YYSTACK_RELOCATE
01655       goto yyexhaustedlab;
01656 # else
01657       /* Extend the stack our own way.  */
01658       if (YYMAXDEPTH <= yystacksize)
01659   goto yyexhaustedlab;
01660       yystacksize *= 2;
01661       if (YYMAXDEPTH < yystacksize)
01662   yystacksize = YYMAXDEPTH;
01663 
01664       {
01665   yytype_int16 *yyss1 = yyss;
01666   union yyalloc *yyptr =
01667     (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01668   if (! yyptr)
01669     goto yyexhaustedlab;
01670   YYSTACK_RELOCATE (yyss);
01671   YYSTACK_RELOCATE (yyvs);
01672 
01673 #  undef YYSTACK_RELOCATE
01674   if (yyss1 != yyssa)
01675     YYSTACK_FREE (yyss1);
01676       }
01677 # endif
01678 #endif /* no yyoverflow */
01679 
01680       yyssp = yyss + yysize - 1;
01681       yyvsp = yyvs + yysize - 1;
01682 
01683 
01684       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01685       (unsigned long int) yystacksize));
01686 
01687       if (yyss + yystacksize - 1 <= yyssp)
01688   YYABORT;
01689     }
01690 
01691   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01692 
01693   goto yybackup;
01694 
01695 /*-----------.
01696 | yybackup.  |
01697 `-----------*/
01698 yybackup:
01699 
01700   /* Do appropriate processing given the current state.  Read a
01701      look-ahead token if we need one and don't already have one.  */
01702 
01703   /* First try to decide what to do without reference to look-ahead token.  */
01704   yyn = yypact[yystate];
01705   if (yyn == YYPACT_NINF)
01706     goto yydefault;
01707 
01708   /* Not known => get a look-ahead token if don't already have one.  */
01709 
01710   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01711   if (yychar == YYEMPTY)
01712     {
01713       YYDPRINTF ((stderr, "Reading a token: "));
01714       yychar = YYLEX;
01715     }
01716 
01717   if (yychar <= YYEOF)
01718     {
01719       yychar = yytoken = YYEOF;
01720       YYDPRINTF ((stderr, "Now at end of input.\n"));
01721     }
01722   else
01723     {
01724       yytoken = YYTRANSLATE (yychar);
01725       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01726     }
01727 
01728   /* If the proper action on seeing token YYTOKEN is to reduce or to
01729      detect an error, take that action.  */
01730   yyn += yytoken;
01731   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01732     goto yydefault;
01733   yyn = yytable[yyn];
01734   if (yyn <= 0)
01735     {
01736       if (yyn == 0 || yyn == YYTABLE_NINF)
01737   goto yyerrlab;
01738       yyn = -yyn;
01739       goto yyreduce;
01740     }
01741 
01742   if (yyn == YYFINAL)
01743     YYACCEPT;
01744 
01745   /* Count tokens shifted since error; after three, turn off error
01746      status.  */
01747   if (yyerrstatus)
01748     yyerrstatus--;
01749 
01750   /* Shift the look-ahead token.  */
01751   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01752 
01753   /* Discard the shifted token unless it is eof.  */
01754   if (yychar != YYEOF)
01755     yychar = YYEMPTY;
01756 
01757   yystate = yyn;
01758   *++yyvsp = yylval;
01759 
01760   goto yynewstate;
01761 
01762 
01763 /*-----------------------------------------------------------.
01764 | yydefault -- do the default action for the current state.  |
01765 `-----------------------------------------------------------*/
01766 yydefault:
01767   yyn = yydefact[yystate];
01768   if (yyn == 0)
01769     goto yyerrlab;
01770   goto yyreduce;
01771 
01772 
01773 /*-----------------------------.
01774 | yyreduce -- Do a reduction.  |
01775 `-----------------------------*/
01776 yyreduce:
01777   /* yyn is the number of a rule to reduce with.  */
01778   yylen = yyr2[yyn];
01779 
01780   /* If YYLEN is nonzero, implement the default value of the action:
01781      `$$ = $1'.
01782 
01783      Otherwise, the following line sets YYVAL to garbage.
01784      This behavior is undocumented and Bison
01785      users should not rely upon it.  Assigning to YYVAL
01786      unconditionally makes the parser a bit smaller, and it avoids a
01787      GCC warning that YYVAL may be used uninitialized.  */
01788   yyval = yyvsp[1-yylen];
01789 
01790 
01791   YY_REDUCE_PRINT (yyn);
01792   switch (yyn)
01793     {
01794         case 2:
01795 #line 151 "SqlParser.y"
01796     {
01797       PxxPtree = (yyvsp[(1) - (2)].pTree);
01798       YYACCEPT;
01799    }
01800     break;
01801 
01802   case 3:
01803 #line 156 "SqlParser.y"
01804     {
01805       PsqlScan.Reset();
01806       PxxPtree = NULL;
01807       YYACCEPT;
01808    }
01809     break;
01810 
01811   case 4:
01812 #line 162 "SqlParser.y"
01813     {
01814       PxxInterp::quit();
01815    }
01816     break;
01817 
01818   case 5:
01819 #line 169 "SqlParser.y"
01820     {(yyval.pTree) = (yyvsp[(1) - (1)].pTree);}
01821     break;
01822 
01823   case 6:
01824 #line 170 "SqlParser.y"
01825     {(yyval.pTree) = (yyvsp[(1) - (1)].pTree);}
01826     break;
01827 
01828   case 7:
01829 #line 176 "SqlParser.y"
01830     {
01831          (yyval.pTree) = new PxxCreateIndex ((yyvsp[(3) - (6)].strVal), (yyvsp[(5) - (6)].strVal));
01832       }
01833     break;
01834 
01835   case 8:
01836 #line 197 "SqlParser.y"
01837     {
01838          (yyval.pTree) = new PxxCreate((yyvsp[(3) - (6)].strVal), (PxxList*)(yyvsp[(5) - (6)].pTree));
01839       }
01840     break;
01841 
01842   case 9:
01843 #line 201 "SqlParser.y"
01844     {
01845          (yyval.pTree) = new PxxCreate((yyvsp[(3) - (8)].strVal), (PxxList*)(yyvsp[(5) - (8)].pTree), (PxxList*)(yyvsp[(7) - (8)].pTree));
01846       }
01847     break;
01848 
01849   case 10:
01850 #line 208 "SqlParser.y"
01851     {
01852          (yyval.pTree) = new PxxList((yyvsp[(1) - (1)].pTree));
01853       }
01854     break;
01855 
01856   case 11:
01857 #line 212 "SqlParser.y"
01858     {
01859          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
01860       }
01861     break;
01862 
01863   case 13:
01864 #line 222 "SqlParser.y"
01865     {
01866          ((PxxAttrType*)(yyvsp[(2) - (3)].pTree))->SetAttrName((yyvsp[(1) - (3)].strVal));
01867          (yyval.pTree) = (yyvsp[(2) - (3)].pTree); 
01868       }
01869     break;
01870 
01871   case 14:
01872 #line 229 "SqlParser.y"
01873     {(yyval.pTree) = 0;}
01874     break;
01875 
01876   case 15:
01877 #line 230 "SqlParser.y"
01878     {PxxNotSupported("Column Constraints");}
01879     break;
01880 
01881   case 16:
01882 #line 234 "SqlParser.y"
01883     {(yyval.pTree) = 0;}
01884     break;
01885 
01886   case 17:
01887 #line 235 "SqlParser.y"
01888     {(yyval.pTree) = 0;}
01889     break;
01890 
01891   case 18:
01892 #line 236 "SqlParser.y"
01893     {(yyval.pTree) = 0;}
01894     break;
01895 
01896   case 19:
01897 #line 237 "SqlParser.y"
01898     {(yyval.pTree) = 0;}
01899     break;
01900 
01901   case 20:
01902 #line 238 "SqlParser.y"
01903     {(yyval.pTree) = 0;}
01904     break;
01905 
01906   case 21:
01907 #line 239 "SqlParser.y"
01908     {(yyval.pTree) = 0;}
01909     break;
01910 
01911   case 22:
01912 #line 240 "SqlParser.y"
01913     {(yyval.pTree) = 0;}
01914     break;
01915 
01916   case 23:
01917 #line 241 "SqlParser.y"
01918     {(yyval.pTree) = 0;}
01919     break;
01920 
01921   case 24:
01922 #line 242 "SqlParser.y"
01923     {(yyval.pTree) = 0;}
01924     break;
01925 
01926   case 25:
01927 #line 247 "SqlParser.y"
01928     {
01929       PxxNotSupported("Key Constraints");
01930       /* 
01931       $$ = $4;
01932       */
01933    }
01934     break;
01935 
01936   case 26:
01937 #line 256 "SqlParser.y"
01938     {
01939          PxxAttrName* newCol = new PxxAttrName((yyvsp[(1) - (1)].strVal));
01940          (yyval.pTree) = new PxxList(newCol);
01941       }
01942     break;
01943 
01944   case 27:
01945 #line 261 "SqlParser.y"
01946     {
01947          PxxAttrName* newCol = new PxxAttrName((yyvsp[(3) - (3)].strVal));
01948          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add(newCol);
01949       }
01950     break;
01951 
01952   case 28:
01953 #line 269 "SqlParser.y"
01954     {
01955          (yyval.pTree) = 0;
01956       }
01957     break;
01958 
01959   case 29:
01960 #line 273 "SqlParser.y"
01961     {
01962          (yyval.pTree) = (yyvsp[(2) - (3)].pTree);
01963       }
01964     break;
01965 
01966   case 30:
01967 #line 280 "SqlParser.y"
01968     {
01969    }
01970     break;
01971 
01972   case 36:
01973 #line 294 "SqlParser.y"
01974     {
01975          (yyval.pTree) = new PxxDrop((yyvsp[(3) - (3)].strVal));
01976       }
01977     break;
01978 
01979   case 37:
01980 #line 301 "SqlParser.y"
01981     {
01982          (yyval.pTree) = new PxxDropIndex((yyvsp[(3) - (6)].strVal), (yyvsp[(5) - (6)].strVal));
01983       }
01984     break;
01985 
01986   case 38:
01987 #line 309 "SqlParser.y"
01988     {
01989          PxxRelName *from = new PxxRelName((yyvsp[(3) - (4)].strVal));
01990          PxxList* fromList = new PxxList(from);
01991 
01992          PxxQuery* delQuery = new PxxDelete(fromList);
01993          if ((yyvsp[(4) - (4)].pTree)) delQuery->AddWhere((PxxPredTree*)(yyvsp[(4) - (4)].pTree));
01994          (yyval.pTree) = delQuery;
01995       }
01996     break;
01997 
01998   case 39:
01999 #line 321 "SqlParser.y"
02000     {
02001          (yyval.pTree) = new PxxInsert((yyvsp[(3) - (10)].strVal), (PxxList*)(yyvsp[(5) - (10)].pTree), (PxxList*)(yyvsp[(9) - (10)].pTree));
02002       }
02003     break;
02004 
02005   case 40:
02006 #line 325 "SqlParser.y"
02007     {
02008          /* Warning!: Non SQL-compliant statement to bulkoad a relation from an external file */
02009          (yyval.pTree) = new PxxInsert((yyvsp[(3) - (5)].strVal), (PxxList*)(yyvsp[(4) - (5)].pTree), (yyvsp[(5) - (5)].strVal));
02010       }
02011     break;
02012 
02013   case 41:
02014 #line 331 "SqlParser.y"
02015     {
02016          PxxNotSupported("Insert into results of a SQL query");
02017          ((PxxQuery*)(yyvsp[(4) - (4)].pTree))->AddInsertInto((yyvsp[(3) - (4)].strVal));
02018          (yyval.pTree) = (yyvsp[(4) - (4)].pTree);
02019       }
02020     break;
02021 
02022   case 42:
02023 #line 340 "SqlParser.y"
02024     {
02025          (yyval.pTree) = new PxxList((yyvsp[(1) - (1)].pTree));
02026       }
02027     break;
02028 
02029   case 43:
02030 #line 344 "SqlParser.y"
02031     {
02032          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02033       }
02034     break;
02035 
02036   case 44:
02037 #line 351 "SqlParser.y"
02038     {
02039          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02040       }
02041     break;
02042 
02043   case 45:
02044 #line 354 "SqlParser.y"
02045     {PxxNotSupported("NULL");}
02046     break;
02047 
02048   case 46:
02049 #line 359 "SqlParser.y"
02050     {
02051          PxxQuery* query = new PxxQuery((PxxList*)(yyvsp[(3) - (7)].pTree), (PxxList*)(yyvsp[(4) - (7)].pTree));
02052          if ((yyvsp[(5) - (7)].pTree)) query->AddWhere((PxxPredTree*)(yyvsp[(5) - (7)].pTree));
02053          if ((yyvsp[(6) - (7)].pTree)) query->AddGroupBy((PxxList*)(yyvsp[(6) - (7)].pTree));
02054          if ((yyvsp[(7) - (7)].pTree)) query->AddHaving((PxxPredTree*)(yyvsp[(7) - (7)].pTree));
02055          (yyval.pTree) = query;
02056       }
02057     break;
02058 
02059   case 47:
02060 #line 369 "SqlParser.y"
02061     {(yyval.pTree) = 0;}
02062     break;
02063 
02064   case 48:
02065 #line 370 "SqlParser.y"
02066     {PxxNotSupported("All");}
02067     break;
02068 
02069   case 49:
02070 #line 371 "SqlParser.y"
02071     {PxxNotSupported("Distinct");}
02072     break;
02073 
02074   case 50:
02075 #line 375 "SqlParser.y"
02076     {(yyval.pTree) = 0;}
02077     break;
02078 
02079   case 51:
02080 #line 379 "SqlParser.y"
02081     {(yyval.pTree) = 0;}
02082     break;
02083 
02084   case 52:
02085 #line 381 "SqlParser.y"
02086     {
02087          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02088       }
02089     break;
02090 
02091   case 53:
02092 #line 387 "SqlParser.y"
02093     {(yyval.pTree) = 0;}
02094     break;
02095 
02096   case 54:
02097 #line 388 "SqlParser.y"
02098     {(yyval.pTree) = 0;}
02099     break;
02100 
02101   case 55:
02102 #line 393 "SqlParser.y"
02103     {
02104          (yyval.pTree) = 0;
02105       }
02106     break;
02107 
02108   case 56:
02109 #line 397 "SqlParser.y"
02110     {
02111          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02112       }
02113     break;
02114 
02115   case 57:
02116 #line 405 "SqlParser.y"
02117     {
02118          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02119       }
02120     break;
02121 
02122   case 58:
02123 #line 409 "SqlParser.y"
02124     {
02125          /* 
02126          PxxNotSupported("* in the select clause");
02127          */
02128          PxxAttrName* starAttr = new PxxAttrName(true);
02129          (yyval.pTree) = new PxxList(starAttr);
02130       }
02131     break;
02132 
02133   case 59:
02134 #line 420 "SqlParser.y"
02135     {
02136          (yyval.pTree) = (yyvsp[(2) - (2)].pTree);
02137       }
02138     break;
02139 
02140   case 60:
02141 #line 427 "SqlParser.y"
02142     {
02143          (yyval.pTree) = new PxxList((yyvsp[(1) - (1)].pTree));
02144       }
02145     break;
02146 
02147   case 61:
02148 #line 431 "SqlParser.y"
02149     {
02150          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02151       }
02152     break;
02153 
02154   case 62:
02155 #line 438 "SqlParser.y"
02156     {
02157          (yyval.pTree) = new PxxRelName((yyvsp[(1) - (1)].strVal));
02158       }
02159     break;
02160 
02161   case 63:
02162 #line 442 "SqlParser.y"
02163     {
02164          (yyval.pTree) = new PxxRelName((yyvsp[(1) - (2)].strVal), (yyvsp[(2) - (2)].strVal));
02165       }
02166     break;
02167 
02168   case 64:
02169 #line 449 "SqlParser.y"
02170     {
02171          (yyval.pTree) = (yyvsp[(2) - (2)].pTree);
02172       }
02173     break;
02174 
02175   case 65:
02176 #line 455 "SqlParser.y"
02177     {(yyval.pTree) = 0;}
02178     break;
02179 
02180   case 66:
02181 #line 457 "SqlParser.y"
02182     {
02183          (yyval.pTree) = (yyvsp[(3) - (3)].pTree);
02184       }
02185     break;
02186 
02187   case 67:
02188 #line 464 "SqlParser.y"
02189     {
02190          (yyval.pTree) = new PxxList((yyvsp[(1) - (1)].pTree));
02191       }
02192     break;
02193 
02194   case 68:
02195 #line 468 "SqlParser.y"
02196     {
02197          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02198       }
02199     break;
02200 
02201   case 69:
02202 #line 475 "SqlParser.y"
02203     {
02204          (yyval.pTree) = 0;
02205       }
02206     break;
02207 
02208   case 70:
02209 #line 479 "SqlParser.y"
02210     {
02211          (yyval.pTree) = (yyvsp[(2) - (2)].pTree);
02212       }
02213     break;
02214 
02215   case 71:
02216 #line 487 "SqlParser.y"
02217     {
02218          PxxNotSupported("Compound Predicates (i.e. predicates connected by AND or OR)");
02219          if ((yyvsp[(1) - (3)].pTree)->MyType() == PxxPnode::Predicate && 
02220              (yyvsp[(3) - (3)].pTree)->MyType() == PxxPnode::Predicate)
02221          {
02222              // Create a new "OR" Predicate tree and insert this predicate.
02223              (yyval.pTree) = new PxxPredTree(PxxPredTree::OR);
02224              ((PxxPredTree*)(yyval.pTree))->AddPredicate(PxxPredTree::OR, (yyvsp[(1) - (3)].pTree));
02225              ((PxxPredTree*)(yyval.pTree))->AddPredicate(PxxPredTree::OR, (yyvsp[(3) - (3)].pTree));
02226          }
02227          else
02228          {
02229              if ((yyvsp[(1) - (3)].pTree)->MyType() == PxxPnode::PredTree)
02230              {
02231                 (yyval.pTree) = ((PxxPredTree*)(yyvsp[(1) - (3)].pTree))->AddPredicate(PxxPredTree::OR, (yyvsp[(3) - (3)].pTree));
02232              }
02233              else 
02234              {
02235                 yyerror("Invalid SQL statement");
02236                 assert(!"Illegal search condition");
02237              }
02238          }
02239       }
02240     break;
02241 
02242   case 72:
02243 #line 512 "SqlParser.y"
02244     {
02245          PxxNotSupported("Compound Predicates (i.e. predicates connected by AND or OR)");
02246          if ((yyvsp[(1) - (3)].pTree)->MyType() == PxxPnode::Predicate && 
02247              (yyvsp[(3) - (3)].pTree)->MyType() == PxxPnode::Predicate)
02248          {
02249              // Create a new "AND" Predicate tree and insert this predicate.
02250              (yyval.pTree) = new PxxPredTree(PxxPredTree::AND);
02251              ((PxxPredTree*)(yyval.pTree))->AddPredicate(PxxPredTree::AND, (yyvsp[(1) - (3)].pTree));
02252              ((PxxPredTree*)(yyval.pTree))->AddPredicate(PxxPredTree::AND, (yyvsp[(3) - (3)].pTree));
02253          }
02254          else
02255          {
02256              if ((yyvsp[(1) - (3)].pTree)->MyType() == PxxPnode::PredTree)
02257              {
02258                 (yyval.pTree) = ((PxxPredTree*)(yyvsp[(1) - (3)].pTree))->AddPredicate(PxxPredTree::AND, (yyvsp[(3) - (3)].pTree));
02259              }
02260              else 
02261              {
02262                 yyerror("Invalid SQL statement");
02263                 assert(!"Illegal search condition");
02264              }
02265          }
02266       }
02267     break;
02268 
02269   case 73:
02270 #line 535 "SqlParser.y"
02271     {PxxNotSupported("Not Predicate");}
02272     break;
02273 
02274   case 74:
02275 #line 536 "SqlParser.y"
02276     {PxxNotSupported("Complex AND/OR Predicate");}
02277     break;
02278 
02279   case 75:
02280 #line 538 "SqlParser.y"
02281     {
02282          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02283       }
02284     break;
02285 
02286   case 76:
02287 #line 545 "SqlParser.y"
02288     {
02289          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02290       }
02291     break;
02292 
02293   case 77:
02294 #line 549 "SqlParser.y"
02295     {
02296          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02297       }
02298     break;
02299 
02300   case 78:
02301 #line 552 "SqlParser.y"
02302     {PxxNotSupported("Between");}
02303     break;
02304 
02305   case 79:
02306 #line 553 "SqlParser.y"
02307     {PxxNotSupported("NULL");}
02308     break;
02309 
02310   case 80:
02311 #line 554 "SqlParser.y"
02312     {PxxNotSupported("IN");}
02313     break;
02314 
02315   case 81:
02316 #line 555 "SqlParser.y"
02317     {PxxNotSupported("Quantifiers");}
02318     break;
02319 
02320   case 82:
02321 #line 556 "SqlParser.y"
02322     {PxxNotSupported("exists");}
02323     break;
02324 
02325   case 83:
02326 #line 561 "SqlParser.y"
02327     {
02328          ((PxxPredicate*)(yyvsp[(2) - (3)].pTree))->Set((yyvsp[(1) - (3)].pTree), (yyvsp[(3) - (3)].pTree));
02329          (yyval.pTree) = (yyvsp[(2) - (3)].pTree);
02330       }
02331     break;
02332 
02333   case 84:
02334 #line 565 "SqlParser.y"
02335     {PxxNotSupported("subqueries");}
02336     break;
02337 
02338   case 85:
02339 #line 569 "SqlParser.y"
02340     {(yyval.pTree) = new PxxPredicate(EQ);}
02341     break;
02342 
02343   case 86:
02344 #line 570 "SqlParser.y"
02345     {(yyval.pTree) = new PxxPredicate(NE);}
02346     break;
02347 
02348   case 87:
02349 #line 571 "SqlParser.y"
02350     {(yyval.pTree) = new PxxPredicate(LT);}
02351     break;
02352 
02353   case 88:
02354 #line 572 "SqlParser.y"
02355     {(yyval.pTree) = new PxxPredicate(LTE);}
02356     break;
02357 
02358   case 89:
02359 #line 573 "SqlParser.y"
02360     {(yyval.pTree) = new PxxPredicate(GT);}
02361     break;
02362 
02363   case 90:
02364 #line 574 "SqlParser.y"
02365     {(yyval.pTree) = new PxxPredicate(GTE);}
02366     break;
02367 
02368   case 91:
02369 #line 577 "SqlParser.y"
02370     {(yyval.pTree) = 0;}
02371     break;
02372 
02373   case 92:
02374 #line 578 "SqlParser.y"
02375     {(yyval.pTree) = 0;}
02376     break;
02377 
02378   case 93:
02379 #line 583 "SqlParser.y"
02380     {
02381          (yyval.pTree) = new PxxPredicate(EQ, true);
02382          ((PxxPredicate*)(yyval.pTree))->Set((yyvsp[(1) - (5)].pTree), (yyvsp[(4) - (5)].pTree));
02383       }
02384     break;
02385 
02386   case 94:
02387 #line 588 "SqlParser.y"
02388     {
02389          (yyval.pTree) = new PxxPredicate(EQ);
02390          ((PxxPredicate*)(yyval.pTree))->Set((yyvsp[(1) - (4)].pTree), (yyvsp[(3) - (4)].pTree));
02391       }
02392     break;
02393 
02394   case 95:
02395 #line 595 "SqlParser.y"
02396     {(yyval.pTree) = 0;}
02397     break;
02398 
02399   case 96:
02400 #line 596 "SqlParser.y"
02401     {PxxNotSupported("Escape character in LIKE");}
02402     break;
02403 
02404   case 97:
02405 #line 600 "SqlParser.y"
02406     {(yyval.pTree) = 0;}
02407     break;
02408 
02409   case 98:
02410 #line 601 "SqlParser.y"
02411     {(yyval.pTree) = 0;}
02412     break;
02413 
02414   case 99:
02415 #line 605 "SqlParser.y"
02416     {(yyval.pTree) = 0;}
02417     break;
02418 
02419   case 100:
02420 #line 606 "SqlParser.y"
02421     {(yyval.pTree) = 0;}
02422     break;
02423 
02424   case 101:
02425 #line 607 "SqlParser.y"
02426     {(yyval.pTree) = 0;}
02427     break;
02428 
02429   case 102:
02430 #line 608 "SqlParser.y"
02431     {(yyval.pTree) = 0;}
02432     break;
02433 
02434   case 103:
02435 #line 612 "SqlParser.y"
02436     {(yyval.pTree) = 0;}
02437     break;
02438 
02439   case 104:
02440 #line 614 "SqlParser.y"
02441     {
02442          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02443       }
02444     break;
02445 
02446   case 105:
02447 #line 620 "SqlParser.y"
02448     {(yyval.pTree) = 0;}
02449     break;
02450 
02451   case 106:
02452 #line 624 "SqlParser.y"
02453     {(yyval.pTree) = 0;}
02454     break;
02455 
02456   case 107:
02457 #line 625 "SqlParser.y"
02458     {(yyval.pTree) = 0;}
02459     break;
02460 
02461   case 108:
02462 #line 626 "SqlParser.y"
02463     {(yyval.pTree) = 0;}
02464     break;
02465 
02466   case 109:
02467 #line 630 "SqlParser.y"
02468     {(yyval.pTree) = 0;}
02469     break;
02470 
02471   case 110:
02472 #line 634 "SqlParser.y"
02473     {(yyval.pTree) = 0;}
02474     break;
02475 
02476   case 111:
02477 #line 639 "SqlParser.y"
02478     {PxxNotSupported("arithmetic expression");}
02479     break;
02480 
02481   case 112:
02482 #line 640 "SqlParser.y"
02483     {PxxNotSupported("arithmetic expression");}
02484     break;
02485 
02486   case 113:
02487 #line 641 "SqlParser.y"
02488     {PxxNotSupported("arithmetic expression");}
02489     break;
02490 
02491   case 114:
02492 #line 642 "SqlParser.y"
02493     {PxxNotSupported("arithmetic expression");}
02494     break;
02495 
02496   case 115:
02497 #line 643 "SqlParser.y"
02498     {PxxNotSupported("arithmetic expression");}
02499     break;
02500 
02501   case 116:
02502 #line 644 "SqlParser.y"
02503     {PxxNotSupported("arithmetic expression");}
02504     break;
02505 
02506   case 117:
02507 #line 646 "SqlParser.y"
02508     {
02509       (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02510    }
02511     break;
02512 
02513   case 118:
02514 #line 650 "SqlParser.y"
02515     {
02516       (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02517    }
02518     break;
02519 
02520   case 119:
02521 #line 654 "SqlParser.y"
02522     {
02523          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02524       }
02525     break;
02526 
02527   case 120:
02528 #line 657 "SqlParser.y"
02529     {PxxNotSupported("arithmetic expression");}
02530     break;
02531 
02532   case 121:
02533 #line 662 "SqlParser.y"
02534     {
02535          (yyval.pTree) = new PxxList((yyvsp[(1) - (1)].pTree));
02536       }
02537     break;
02538 
02539   case 122:
02540 #line 666 "SqlParser.y"
02541     {
02542          (yyval.pTree) = ((PxxList*)(yyvsp[(1) - (3)].pTree))->Add((yyvsp[(3) - (3)].pTree));
02543       }
02544     break;
02545 
02546   case 123:
02547 #line 672 "SqlParser.y"
02548     {PxxNotSupported("Parameter reference");}
02549     break;
02550 
02551   case 124:
02552 #line 674 "SqlParser.y"
02553     {
02554          (yyval.pTree) = (yyvsp[(1) - (1)].pTree);
02555       }
02556     break;
02557 
02558   case 125:
02559 #line 681 "SqlParser.y"
02560     {(yyval.pTree) = 0;}
02561     break;
02562 
02563   case 126:
02564 #line 682 "SqlParser.y"
02565     {(yyval.pTree) = 0;}
02566     break;
02567 
02568   case 127:
02569 #line 683 "SqlParser.y"
02570     {(yyval.pTree) = 0;}
02571     break;
02572 
02573   case 128:
02574 #line 688 "SqlParser.y"
02575     {
02576          PxxAttrName* starAttr = new PxxAttrName(true);
02577          (yyval.pTree) = new PxxAggrFunc(starAttr, PxxAggrFunc::AggrFunc((yyvsp[(1) - (4)].intVal)));
02578       }
02579     break;
02580 
02581   case 129:
02582 #line 694 "SqlParser.y"
02583     {
02584          PxxNotSupported("Aggregates with DISTINCT");
02585       }
02586     break;
02587 
02588   case 130:
02589 #line 698 "SqlParser.y"
02590     {
02591          PxxNotSupported("Aggregates with ALL");
02592       }
02593     break;
02594 
02595   case 131:
02596 #line 702 "SqlParser.y"
02597     {
02598          assert ((yyvsp[(3) - (4)].pTree)->MyType() == PxxPnode::AttrName);
02599          (yyval.pTree) = new PxxAggrFunc((PxxAttrName*)(yyvsp[(3) - (4)].pTree), PxxAggrFunc::AggrFunc((yyvsp[(1) - (4)].intVal)));
02600       }
02601     break;
02602 
02603   case 132:
02604 #line 709 "SqlParser.y"
02605     {(yyval.intVal) = PxxAggrFunc::Avg;}
02606     break;
02607 
02608   case 133:
02609 #line 710 "SqlParser.y"
02610     {(yyval.intVal) = PxxAggrFunc::Count;}
02611     break;
02612 
02613   case 134:
02614 #line 711 "SqlParser.y"
02615     {(yyval.intVal) = PxxAggrFunc::Min;}
02616     break;
02617 
02618   case 135:
02619 #line 712 "SqlParser.y"
02620     {(yyval.intVal) = PxxAggrFunc::Max;}
02621     break;
02622 
02623   case 136:
02624 #line 713 "SqlParser.y"
02625     {(yyval.intVal) = PxxAggrFunc::Sum;}
02626     break;
02627 
02628   case 137:
02629 #line 717 "SqlParser.y"
02630     {
02631          (yyval.pTree) = new PxxLiteral((yyvsp[(1) - (1)].strVal), PxxAttrType::STRING);
02632       }
02633     break;
02634 
02635   case 138:
02636 #line 721 "SqlParser.y"
02637     {
02638          (yyval.pTree) = new PxxLiteral(&((yyvsp[(1) - (1)].intVal)), PxxAttrType::INTEGER);
02639       }
02640     break;
02641 
02642   case 139:
02643 #line 725 "SqlParser.y"
02644     {
02645          (yyval.pTree) = new PxxLiteral(&((yyvsp[(1) - (1)].dblVal)), PxxAttrType::DOUBLE);
02646       }
02647     break;
02648 
02649   case 140:
02650 #line 733 "SqlParser.y"
02651     {
02652          (yyval.strVal) = (yyvsp[(1) - (1)].strVal);
02653       }
02654     break;
02655 
02656   case 141:
02657 #line 740 "SqlParser.y"
02658     {
02659          PxxNotSupported("References to column name, please use 'Rel.attr' format (not simple 'attr' to refer to columns");
02660          (yyval.pTree) = new PxxAttrName((yyvsp[(1) - (1)].strVal));
02661       }
02662     break;
02663 
02664   case 142:
02665 #line 745 "SqlParser.y"
02666     {
02667          (yyval.pTree) = new PxxAttrName((yyvsp[(3) - (3)].strVal), (yyvsp[(1) - (3)].strVal));
02668       }
02669     break;
02670 
02671   case 143:
02672 #line 753 "SqlParser.y"
02673     {
02674          (yyval.pTree) = new PxxAttrType(PxxAttrType::STRING);
02675       }
02676     break;
02677 
02678   case 144:
02679 #line 757 "SqlParser.y"
02680     {
02681          (yyval.pTree) = new PxxAttrType(PxxAttrType::STRING, (yyvsp[(3) - (4)].intVal));
02682       }
02683     break;
02684 
02685   case 145:
02686 #line 761 "SqlParser.y"
02687     {
02688          (yyval.pTree) = new PxxAttrType(PxxAttrType::INTEGER);
02689       }
02690     break;
02691 
02692   case 146:
02693 #line 765 "SqlParser.y"
02694     {
02695          (yyval.pTree) = new PxxAttrType(PxxAttrType::DOUBLE);
02696       }
02697     break;
02698 
02699   case 147:
02700 #line 772 "SqlParser.y"
02701     {
02702          (yyval.strVal) = (yyvsp[(1) - (1)].strVal);
02703       }
02704     break;
02705 
02706   case 148:
02707 #line 779 "SqlParser.y"
02708     {
02709          (yyval.strVal) = (yyvsp[(1) - (1)].strVal);
02710       }
02711     break;
02712 
02713   case 149:
02714 #line 785 "SqlParser.y"
02715     {
02716       (yyval.strVal) = (yyvsp[(1) - (1)].strVal);
02717    }
02718     break;
02719 
02720 
02721 /* Line 1267 of yacc.c.  */
02722 #line 2723 "y.tab.c"
02723       default: break;
02724     }
02725   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02726 
02727   YYPOPSTACK (yylen);
02728   yylen = 0;
02729   YY_STACK_PRINT (yyss, yyssp);
02730 
02731   *++yyvsp = yyval;
02732 
02733 
02734   /* Now `shift' the result of the reduction.  Determine what state
02735      that goes to, based on the state we popped back to and the rule
02736      number reduced by.  */
02737 
02738   yyn = yyr1[yyn];
02739 
02740   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02741   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02742     yystate = yytable[yystate];
02743   else
02744     yystate = yydefgoto[yyn - YYNTOKENS];
02745 
02746   goto yynewstate;
02747 
02748 
02749 /*------------------------------------.
02750 | yyerrlab -- here on detecting error |
02751 `------------------------------------*/
02752 yyerrlab:
02753   /* If not already recovering from an error, report this error.  */
02754   if (!yyerrstatus)
02755     {
02756       ++yynerrs;
02757 #if ! YYERROR_VERBOSE
02758       yyerror (YY_("syntax error"));
02759 #else
02760       {
02761   YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
02762   if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
02763     {
02764       YYSIZE_T yyalloc = 2 * yysize;
02765       if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
02766         yyalloc = YYSTACK_ALLOC_MAXIMUM;
02767       if (yymsg != yymsgbuf)
02768         YYSTACK_FREE (yymsg);
02769       yymsg = (char *) YYSTACK_ALLOC (yyalloc);
02770       if (yymsg)
02771         yymsg_alloc = yyalloc;
02772       else
02773         {
02774     yymsg = yymsgbuf;
02775     yymsg_alloc = sizeof yymsgbuf;
02776         }
02777     }
02778 
02779   if (0 < yysize && yysize <= yymsg_alloc)
02780     {
02781       (void) yysyntax_error (yymsg, yystate, yychar);
02782       yyerror (yymsg);
02783     }
02784   else
02785     {
02786       yyerror (YY_("syntax error"));
02787       if (yysize != 0)
02788         goto yyexhaustedlab;
02789     }
02790       }
02791 #endif
02792     }
02793 
02794 
02795 
02796   if (yyerrstatus == 3)
02797     {
02798       /* If just tried and failed to reuse look-ahead token after an
02799    error, discard it.  */
02800 
02801       if (yychar <= YYEOF)
02802   {
02803     /* Return failure if at end of input.  */
02804     if (yychar == YYEOF)
02805       YYABORT;
02806   }
02807       else
02808   {
02809     yydestruct ("Error: discarding",
02810           yytoken, &yylval);
02811     yychar = YYEMPTY;
02812   }
02813     }
02814 
02815   /* Else will try to reuse look-ahead token after shifting the error
02816      token.  */
02817   goto yyerrlab1;
02818 
02819 
02820 /*---------------------------------------------------.
02821 | yyerrorlab -- error raised explicitly by YYERROR.  |
02822 `---------------------------------------------------*/
02823 yyerrorlab:
02824 
02825   /* Pacify compilers like GCC when the user code never invokes
02826      YYERROR and the label yyerrorlab therefore never appears in user
02827      code.  */
02828   if (/*CONSTCOND*/ 0)
02829      goto yyerrorlab;
02830 
02831   /* Do not reclaim the symbols of the rule which action triggered
02832      this YYERROR.  */
02833   YYPOPSTACK (yylen);
02834   yylen = 0;
02835   YY_STACK_PRINT (yyss, yyssp);
02836   yystate = *yyssp;
02837   goto yyerrlab1;
02838 
02839 
02840 /*-------------------------------------------------------------.
02841 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
02842 `-------------------------------------------------------------*/
02843 yyerrlab1:
02844   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
02845 
02846   for (;;)
02847     {
02848       yyn = yypact[yystate];
02849       if (yyn != YYPACT_NINF)
02850   {
02851     yyn += YYTERROR;
02852     if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02853       {
02854         yyn = yytable[yyn];
02855         if (0 < yyn)
02856     break;
02857       }
02858   }
02859 
02860       /* Pop the current state because it cannot handle the error token.  */
02861       if (yyssp == yyss)
02862   YYABORT;
02863 
02864 
02865       yydestruct ("Error: popping",
02866       yystos[yystate], yyvsp);
02867       YYPOPSTACK (1);
02868       yystate = *yyssp;
02869       YY_STACK_PRINT (yyss, yyssp);
02870     }
02871 
02872   if (yyn == YYFINAL)
02873     YYACCEPT;
02874 
02875   *++yyvsp = yylval;
02876 
02877 
02878   /* Shift the error token.  */
02879   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02880 
02881   yystate = yyn;
02882   goto yynewstate;
02883 
02884 
02885 /*-------------------------------------.
02886 | yyacceptlab -- YYACCEPT comes here.  |
02887 `-------------------------------------*/
02888 yyacceptlab:
02889   yyresult = 0;
02890   goto yyreturn;
02891 
02892 /*-----------------------------------.
02893 | yyabortlab -- YYABORT comes here.  |
02894 `-----------------------------------*/
02895 yyabortlab:
02896   yyresult = 1;
02897   goto yyreturn;
02898 
02899 #ifndef yyoverflow
02900 /*-------------------------------------------------.
02901 | yyexhaustedlab -- memory exhaustion comes here.  |
02902 `-------------------------------------------------*/
02903 yyexhaustedlab:
02904   yyerror (YY_("memory exhausted"));
02905   yyresult = 2;
02906   /* Fall through.  */
02907 #endif
02908 
02909 yyreturn:
02910   if (yychar != YYEOF && yychar != YYEMPTY)
02911      yydestruct ("Cleanup: discarding lookahead",
02912      yytoken, &yylval);
02913   /* Do not reclaim the symbols of the rule which action triggered
02914      this YYABORT or YYACCEPT.  */
02915   YYPOPSTACK (yylen);
02916   YY_STACK_PRINT (yyss, yyssp);
02917   while (yyssp != yyss)
02918     {
02919       yydestruct ("Cleanup: popping",
02920       yystos[*yyssp], yyvsp);
02921       YYPOPSTACK (1);
02922     }
02923 #ifndef yyoverflow
02924   if (yyss != yyssa)
02925     YYSTACK_FREE (yyss);
02926 #endif
02927 #if YYERROR_VERBOSE
02928   if (yymsg != yymsgbuf)
02929     YYSTACK_FREE (yymsg);
02930 #endif
02931   /* Make sure YYID is used.  */
02932   return YYID (yyresult);
02933 }
02934 
02935 
02936 #line 790 "SqlParser.y"
02937 
02938 
02939 unsigned __lnum = 1; 
02940 void parse(void)
02941 {
02942   for(;;)
02943   {
02944     // reset parser and scanner for a new query
02945     PsqlScan.Reset();
02946 
02947     // print a prompt
02948     printf("%d %s", __lnum++, PxxParser::Prompt);
02949     fflush(stdout);
02950 
02951     // if a query was successfully read, interpret it
02952     // if(yyparse() == 0 && PxxPtree)
02953     if(yyparse() == 0)
02954     {
02955        if (PsqlScan.Quitting()) return;
02956 
02957        if (PxxPtree)
02958        {
02959           PsqlScan.PrintQuery();
02960           PxxInterp::eval(PxxPtree);
02961           delete PxxPtree;
02962        }
02963     }
02964   }
02965 }
02966 
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends