(file) Return to CQLYACC.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

   1 karl  1.19 /* To be inserted in other files to bypass the chksrc tests */
   2 dave.sudlik 1.17 /* NOCHKSRC */
   3 karl        1.19 
   4 karl        1.15 /* A Bison parser, made by GNU Bison 2.3.  */
   5                  
   6                  /* Skeleton implementation for Bison's Yacc-like parsers in C
   7                  
   8                     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   9                     Free Software Foundation, Inc.
  10                  
  11                     This program is free software; you can redistribute it and/or modify
  12                     it under the terms of the GNU General Public License as published by
  13                     the Free Software Foundation; either version 2, or (at your option)
  14                     any later version.
  15                  
  16                     This program is distributed in the hope that it will be useful,
  17                     but WITHOUT ANY WARRANTY; without even the implied warranty of
  18                     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19                     GNU General Public License for more details.
  20                  
  21                     You should have received a copy of the GNU General Public License
  22                     along with this program; if not, write to the Free Software
  23                     Foundation, Inc., 51 Franklin Street, Fifth Floor,
  24                     Boston, MA 02110-1301, USA.  */
  25 karl        1.15 
  26                  /* As a special exception, you may create a larger work that contains
  27                     part or all of the Bison parser skeleton and distribute that work
  28                     under terms of your choice, so long as that work isn't itself a
  29                     parser generator using the skeleton or a modified version thereof
  30                     as a parser skeleton.  Alternatively, if you modify or redistribute
  31                     the parser skeleton itself, you may (at your option) remove this
  32                     special exception, which will cause the skeleton and the resulting
  33                     Bison output files to be licensed under the GNU General Public
  34                     License without this special exception.
  35                  
  36                     This special exception was added by the Free Software Foundation in
  37                     version 2.2 of Bison.  */
  38                  
  39                  /* C LALR(1) parser skeleton written by Richard Stallman, by
  40                     simplifying the original so-called "semantic" parser.  */
  41                  
  42                  /* All symbols defined below should begin with yy or YY, to avoid
  43                     infringing on user name space.  This should be done even for local
  44                     variables, as they might otherwise be expanded by user macros.
  45                     There are some unavoidable exceptions within include files to
  46 karl        1.15    define necessary library symbols; they are noted "INFRINGES ON
  47                     USER NAME SPACE" below.  */
  48                  
  49                  /* Identify Bison output.  */
  50                  #define YYBISON 1
  51                  
  52                  /* Bison version.  */
  53                  #define YYBISON_VERSION "2.3"
  54                  
  55                  /* Skeleton name.  */
  56                  #define YYSKELETON_NAME "yacc.c"
  57                  
  58                  /* Pure parsers.  */
  59                  #define YYPURE 0
  60                  
  61                  /* Using locations.  */
  62                  #define YYLSP_NEEDED 0
  63                  
  64                  /* Substitute the variable and function names.  */
  65 chuck       1.2  #define yyparse CQL_parse
  66 karl        1.15 #define yylex   CQL_lex
  67 chuck       1.2  #define yyerror CQL_error
  68 karl        1.15 #define yylval  CQL_lval
  69                  #define yychar  CQL_char
  70 chuck       1.2  #define yydebug CQL_debug
  71                  #define yynerrs CQL_nerrs
  72 karl        1.15 
  73                  
  74                  /* Tokens.  */
  75                  #ifndef YYTOKENTYPE
  76                  # define YYTOKENTYPE
  77                     /* Put the tokens into the symbol table, so that GDB and other debuggers
  78                        know about them.  */
  79                     enum yytokentype {
  80                       TOK_IDENTIFIER = 258,
  81                       TOK_STRING_LITERAL = 259,
  82                       TOK_BINARY = 260,
  83                       TOK_NEGATIVE_BINARY = 261,
  84                       TOK_HEXADECIMAL = 262,
  85                       TOK_NEGATIVE_HEXADECIMAL = 263,
  86                       TOK_INTEGER = 264,
  87                       TOK_NEGATIVE_INTEGER = 265,
  88                       TOK_REAL = 266,
  89                       TOK_NEGATIVE_REAL = 267,
  90                       TOK_TRUE = 268,
  91                       TOK_FALSE = 269,
  92                       TOK_SCOPED_PROPERTY = 270,
  93 karl        1.15      TOK_LPAR = 271,
  94                       TOK_RPAR = 272,
  95                       TOK_HASH = 273,
  96                       TOK_DOT = 274,
  97                       TOK_LBRKT = 275,
  98                       TOK_RBRKT = 276,
  99                       TOK_UNDERSCORE = 277,
 100                       TOK_COMMA = 278,
 101                       TOK_CONCAT = 279,
 102                       TOK_DBL_PIPE = 280,
 103                       TOK_PLUS = 281,
 104                       TOK_MINUS = 282,
 105                       TOK_TIMES = 283,
 106                       TOK_DIV = 284,
 107                       TOK_IS = 285,
 108                       TOK_NULL = 286,
 109                       TOK_EQ = 287,
 110                       TOK_NE = 288,
 111                       TOK_GT = 289,
 112                       TOK_LT = 290,
 113                       TOK_GE = 291,
 114 karl        1.15      TOK_LE = 292,
 115                       TOK_ISA = 293,
 116                       TOK_LIKE = 294,
 117                       TOK_NOT = 295,
 118                       TOK_AND = 296,
 119                       TOK_OR = 297,
 120                       TOK_SCOPE = 298,
 121                       TOK_ANY = 299,
 122                       TOK_EVERY = 300,
 123                       TOK_IN = 301,
 124                       TOK_SATISFIES = 302,
 125                       TOK_STAR = 303,
 126                       TOK_DOTDOT = 304,
 127                       TOK_SHARP = 305,
 128                       TOK_DISTINCT = 306,
 129                       TOK_SELECT = 307,
 130                       TOK_FIRST = 308,
 131                       TOK_FROM = 309,
 132                       TOK_WHERE = 310,
 133                       TOK_ORDER = 311,
 134                       TOK_BY = 312,
 135 karl        1.15      TOK_ASC = 313,
 136                       TOK_DESC = 314,
 137                       TOK_AS = 315,
 138                       TOK_UNEXPECTED_CHAR = 316
 139                     };
 140                  #endif
 141                  /* Tokens.  */
 142                  #define TOK_IDENTIFIER 258
 143                  #define TOK_STRING_LITERAL 259
 144                  #define TOK_BINARY 260
 145                  #define TOK_NEGATIVE_BINARY 261
 146                  #define TOK_HEXADECIMAL 262
 147                  #define TOK_NEGATIVE_HEXADECIMAL 263
 148                  #define TOK_INTEGER 264
 149                  #define TOK_NEGATIVE_INTEGER 265
 150                  #define TOK_REAL 266
 151                  #define TOK_NEGATIVE_REAL 267
 152                  #define TOK_TRUE 268
 153                  #define TOK_FALSE 269
 154                  #define TOK_SCOPED_PROPERTY 270
 155                  #define TOK_LPAR 271
 156 karl        1.15 #define TOK_RPAR 272
 157                  #define TOK_HASH 273
 158                  #define TOK_DOT 274
 159                  #define TOK_LBRKT 275
 160                  #define TOK_RBRKT 276
 161                  #define TOK_UNDERSCORE 277
 162                  #define TOK_COMMA 278
 163                  #define TOK_CONCAT 279
 164                  #define TOK_DBL_PIPE 280
 165                  #define TOK_PLUS 281
 166                  #define TOK_MINUS 282
 167                  #define TOK_TIMES 283
 168                  #define TOK_DIV 284
 169                  #define TOK_IS 285
 170                  #define TOK_NULL 286
 171                  #define TOK_EQ 287
 172                  #define TOK_NE 288
 173                  #define TOK_GT 289
 174                  #define TOK_LT 290
 175                  #define TOK_GE 291
 176                  #define TOK_LE 292
 177 karl        1.15 #define TOK_ISA 293
 178                  #define TOK_LIKE 294
 179                  #define TOK_NOT 295
 180                  #define TOK_AND 296
 181                  #define TOK_OR 297
 182                  #define TOK_SCOPE 298
 183                  #define TOK_ANY 299
 184                  #define TOK_EVERY 300
 185                  #define TOK_IN 301
 186                  #define TOK_SATISFIES 302
 187                  #define TOK_STAR 303
 188                  #define TOK_DOTDOT 304
 189                  #define TOK_SHARP 305
 190                  #define TOK_DISTINCT 306
 191                  #define TOK_SELECT 307
 192                  #define TOK_FIRST 308
 193                  #define TOK_FROM 309
 194                  #define TOK_WHERE 310
 195                  #define TOK_ORDER 311
 196                  #define TOK_BY 312
 197                  #define TOK_ASC 313
 198 karl        1.15 #define TOK_DESC 314
 199                  #define TOK_AS 315
 200                  #define TOK_UNEXPECTED_CHAR 316
 201                  
 202                  
 203                  
 204                  
 205                  /* Copy the first part of user declarations.  */
 206 karl        1.19 #line 29 "CQL.y"
 207 karl        1.15 
 208 chuck       1.2  #include <Pegasus/Common/Config.h>
 209                  #include <Pegasus/Common/String.h>
 210                  #include <Pegasus/Common/CommonUTF.h>
 211                  #include <Pegasus/Query/QueryCommon/QueryException.h>
 212                  #include <Pegasus/Common/MessageLoader.h>
 213                  #include <Pegasus/CQL/CQLFactory.h>
 214                  #include "CQLObjects.h"
 215                  #include <stdio.h>
 216                  
 217                  #define yyparse CQL_parse
 218                  #define CQLPREDICATE 0
 219                  #define CQLVALUE 1
 220                  #define CQLIDENTIFIER 2
 221                  #define CQLFUNCTION 3
 222                  #define CQLCHAINEDIDENTIFIER 4
 223                  
 224                  int yylex();
 225 karl        1.15 #ifdef CQL_DEBUG_GRAMMAR
 226 dave.sudlik 1.17 #define CQL_DEBUG_TRACE(X) \
 227                      printf(X);
 228                  #define CQL_DEBUG_TRACE2(X,Y) \
 229                      printf(X,Y);
 230 karl        1.15 #else
 231 dave.sudlik 1.17 #define CQL_DEBUG_TRACE(X)
 232                  #define CQL_DEBUG_TRACE2(X,Y)
 233 karl        1.15 #endif
 234                  
 235                  
 236 chuck       1.2  extern char * yytext;
 237                  int chain_state;
 238                  CQLFactory _factory = CQLFactory();
 239                  extern int CQL_error(const char *err);
 240 humberto    1.8  
 241                  enum CQLType { Id, CId, Val, Func, Fact, Trm, Expr, SPred, Pred, Str };
 242                  
 243                  typedef struct CQLObjPtr {
 244                          void* _ptr;
 245 kumpf       1.20           CQLType type;
 246 humberto    1.8  } CQLOBJPTR;
 247                  
 248                  Array<CQLObjPtr> _ptrs;
 249                  CQLOBJPTR _ObjPtr;
 250                  
 251 karl        1.15 PEGASUS_NAMESPACE_BEGIN
 252 kumpf       1.20 
 253 karl        1.15 extern CQLParserState* CQL_globalParserState;
 254                  Array<CQLPredicate> _arglist;
 255                  
 256                  
 257                  PEGASUS_NAMESPACE_END
 258                  
 259 humberto    1.10 
 260 venkat.puvvada 1.18 void CQL_Arglist_Cleanup()
 261                     {
 262                         _arglist.clear();
 263                     }
 264                     
 265 humberto       1.10 void CQL_Bison_Cleanup(){
 266 karl           1.15     for(Uint32 i = 0; i < _ptrs.size(); i++)
 267                         {
 268                           if(_ptrs[i]._ptr)
 269                           {
 270                             switch(_ptrs[i].type)
 271                             {
 272                                 case Id:
 273                                         delete (CQLIdentifier*)_ptrs[i]._ptr;
 274                                         break;
 275                                 case CId:
 276                                         delete (CQLChainedIdentifier*)_ptrs[i]._ptr;
 277                                         break;
 278                                 case Val:
 279                                         delete (CQLValue*)_ptrs[i]._ptr;
 280                                         break;
 281                                 case Func:
 282                                         delete (CQLFunction*)_ptrs[i]._ptr;
 283                                         break;
 284                                 case Fact:
 285                                         delete (CQLFactor*)_ptrs[i]._ptr;
 286                                         break;
 287 karl           1.15             case Trm:
 288                                         delete (CQLTerm*)_ptrs[i]._ptr;
 289                                         break;
 290                                 case Expr:
 291                                         delete (CQLExpression*)_ptrs[i]._ptr;
 292                                         break;
 293                                 case SPred:
 294                                         delete (CQLSimplePredicate*)_ptrs[i]._ptr;
 295                                         break;
 296                                 case Pred:
 297                                         delete (CQLPredicate*)_ptrs[i]._ptr;
 298                                         break;
 299                                 case Str:
 300                                         delete (String*)_ptrs[i]._ptr;
 301                             }
 302                           }
 303                         }
 304 venkat.puvvada 1.18     CQL_Arglist_Cleanup();
 305 karl           1.15     _ptrs.clear();
 306 humberto       1.8     _factory.cleanup();
 307 karl           1.15     _factory = CQLFactory();
 308 humberto       1.8  }
 309                     
 310 humberto       1.10 
 311                     
 312 karl           1.15 /* Enabling traces.  */
 313                     #ifndef YYDEBUG
 314                     # define YYDEBUG 0
 315                     #endif
 316                     
 317                     /* Enabling verbose error messages.  */
 318                     #ifdef YYERROR_VERBOSE
 319                     # undef YYERROR_VERBOSE
 320                     # define YYERROR_VERBOSE 1
 321                     #else
 322                     # define YYERROR_VERBOSE 0
 323                     #endif
 324                     
 325                     /* Enabling the token table.  */
 326                     #ifndef YYTOKEN_TABLE
 327                     # define YYTOKEN_TABLE 0
 328                     #endif
 329                     
 330                     #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 331                     typedef union YYSTYPE
 332 karl           1.19 #line 133 "CQL.y"
 333 karl           1.15 {
 334 karl           1.16     char * strValue;
 335                         String * _string;
 336                         CQLValue * _value;
 337                         CQLIdentifier * _identifier;
 338                         CQLChainedIdentifier * _chainedIdentifier;
 339                         CQLPredicate * _predicate;
 340                         ExpressionOpType _opType;
 341                         void * _node;
 342 karl           1.15 }
 343 karl           1.19 /* Line 187 of yacc.c.  */
 344 venkat.puvvada 1.18 #line 342 "CQLtemp"
 345 karl           1.16 	YYSTYPE;
 346 karl           1.15 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 347                     # define YYSTYPE_IS_DECLARED 1
 348                     # define YYSTYPE_IS_TRIVIAL 1
 349 chuck          1.2  #endif
 350 karl           1.15 
 351                     
 352                     
 353                     /* Copy the second part of user declarations.  */
 354                     
 355                     
 356                     /* Line 216 of yacc.c.  */
 357 venkat.puvvada 1.18 #line 355 "CQLtemp"
 358 karl           1.15 
 359                     #ifdef short
 360                     # undef short
 361 chuck          1.2  #endif
 362 karl           1.15 
 363                     #ifdef YYTYPE_UINT8
 364                     typedef YYTYPE_UINT8 yytype_uint8;
 365                     #else
 366                     typedef unsigned char yytype_uint8;
 367 chuck          1.2  #endif
 368 karl           1.15 
 369                     #ifdef YYTYPE_INT8
 370                     typedef YYTYPE_INT8 yytype_int8;
 371                     #elif (defined __STDC__ || defined __C99__FUNC__ \
 372                          || defined __cplusplus || defined _MSC_VER)
 373                     typedef signed char yytype_int8;
 374 chuck          1.2  #else
 375 karl           1.15 typedef short int yytype_int8;
 376                     #endif
 377                     
 378                     #ifdef YYTYPE_UINT16
 379                     typedef YYTYPE_UINT16 yytype_uint16;
 380 chuck          1.2  #else
 381 karl           1.15 typedef unsigned short int yytype_uint16;
 382 chuck          1.2  #endif
 383 karl           1.15 
 384                     #ifdef YYTYPE_INT16
 385                     typedef YYTYPE_INT16 yytype_int16;
 386                     #else
 387                     typedef short int yytype_int16;
 388 chuck          1.2  #endif
 389                     
 390 karl           1.15 #ifndef YYSIZE_T
 391                     # ifdef __SIZE_TYPE__
 392                     #  define YYSIZE_T __SIZE_TYPE__
 393                     # elif defined size_t
 394                     #  define YYSIZE_T size_t
 395                     # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 396                          || defined __cplusplus || defined _MSC_VER)
 397                     #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 398                     #  define YYSIZE_T size_t
 399                     # else
 400                     #  define YYSIZE_T unsigned int
 401                     # endif
 402                     #endif
 403 chuck          1.2  
 404 karl           1.15 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 405 chuck          1.2  
 406 karl           1.15 #ifndef YY_
 407                     # if YYENABLE_NLS
 408                     #  if ENABLE_NLS
 409                     #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 410                     #   define YY_(msgid) dgettext ("bison-runtime", msgid)
 411                     #  endif
 412                     # endif
 413                     # ifndef YY_
 414                     #  define YY_(msgid) msgid
 415                     # endif
 416                     #endif
 417 chuck          1.2  
 418 karl           1.15 /* Suppress unused-variable warnings by "using" E.  */
 419                     #if ! defined lint || defined __GNUC__
 420                     # define YYUSE(e) ((void) (e))
 421                     #else
 422                     # define YYUSE(e) /* empty */
 423 chuck          1.2  #endif
 424                     
 425 karl           1.15 /* Identity function, used to suppress warnings about constant conditions.  */
 426                     #ifndef lint
 427                     # define YYID(n) (n)
 428                     #else
 429                     #if (defined __STDC__ || defined __C99__FUNC__ \
 430                          || defined __cplusplus || defined _MSC_VER)
 431                     static int
 432                     YYID (int i)
 433                     #else
 434                     static int
 435                     YYID (i)
 436                         int i;
 437 chuck          1.2  #endif
 438 karl           1.15 {
 439                       return i;
 440                     }
 441 chuck          1.2  #endif
 442 karl           1.15 
 443                     #if ! defined yyoverflow || YYERROR_VERBOSE
 444                     
 445                     /* The parser invokes alloca or malloc; define the necessary symbols.  */
 446                     
 447                     # ifdef YYSTACK_USE_ALLOCA
 448                     #  if YYSTACK_USE_ALLOCA
 449                     #   ifdef __GNUC__
 450                     #    define YYSTACK_ALLOC __builtin_alloca
 451                     #   elif defined __BUILTIN_VA_ARG_INCR
 452                     #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 453                     #   elif defined _AIX
 454                     #    define YYSTACK_ALLOC __alloca
 455                     #   elif defined _MSC_VER
 456                     #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 457                     #    define alloca _alloca
 458                     #   else
 459                     #    define YYSTACK_ALLOC alloca
 460                     #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 461                          || defined __cplusplus || defined _MSC_VER)
 462                     #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 463 karl           1.15 #     ifndef _STDLIB_H
 464                     #      define _STDLIB_H 1
 465                     #     endif
 466                     #    endif
 467                     #   endif
 468                     #  endif
 469                     # endif
 470                     
 471                     # ifdef YYSTACK_ALLOC
 472                        /* Pacify GCC's `empty if-body' warning.  */
 473                     #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 474                     #  ifndef YYSTACK_ALLOC_MAXIMUM
 475                         /* The OS might guarantee only one guard page at the bottom of the stack,
 476                            and a page size can be as small as 4096 bytes.  So we cannot safely
 477                            invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 478                            to allow for a few compiler-allocated temporary stack slots.  */
 479                     #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 480                     #  endif
 481                     # else
 482                     #  define YYSTACK_ALLOC YYMALLOC
 483                     #  define YYSTACK_FREE YYFREE
 484 karl           1.15 #  ifndef YYSTACK_ALLOC_MAXIMUM
 485                     #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 486                     #  endif
 487                     #  if (defined __cplusplus && ! defined _STDLIB_H \
 488                            && ! ((defined YYMALLOC || defined malloc) \
 489 karl           1.16 	     && (defined YYFREE || defined free)))
 490 karl           1.15 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 491                     #   ifndef _STDLIB_H
 492                     #    define _STDLIB_H 1
 493                     #   endif
 494                     #  endif
 495                     #  ifndef YYMALLOC
 496                     #   define YYMALLOC malloc
 497                     #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 498                          || defined __cplusplus || defined _MSC_VER)
 499                     void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 500                     #   endif
 501                     #  endif
 502                     #  ifndef YYFREE
 503                     #   define YYFREE free
 504                     #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 505                          || defined __cplusplus || defined _MSC_VER)
 506                     void free (void *); /* INFRINGES ON USER NAME SPACE */
 507                     #   endif
 508                     #  endif
 509                     # endif
 510                     #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 511 karl           1.15 
 512                     
 513                     #if (! defined yyoverflow \
 514                          && (! defined __cplusplus \
 515 karl           1.16 	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 516 karl           1.15 
 517                     /* A type that is properly aligned for any stack member.  */
 518                     union yyalloc
 519                     {
 520                       yytype_int16 yyss;
 521                       YYSTYPE yyvs;
 522                       };
 523                     
 524                     /* The size of the maximum gap between one aligned stack and the next.  */
 525                     # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 526                     
 527                     /* The size of an array large to enough to hold all stacks, each with
 528                        N elements.  */
 529                     # define YYSTACK_BYTES(N) \
 530                          ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 531                           + YYSTACK_GAP_MAXIMUM)
 532                     
 533                     /* Copy COUNT objects from FROM to TO.  The source and destination do
 534                        not overlap.  */
 535                     # ifndef YYCOPY
 536                     #  if defined __GNUC__ && 1 < __GNUC__
 537 karl           1.15 #   define YYCOPY(To, From, Count) \
 538                           __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 539                     #  else
 540 karl           1.16 #   define YYCOPY(To, From, Count)		\
 541                           do					\
 542                     	{					\
 543                     	  YYSIZE_T yyi;				\
 544                     	  for (yyi = 0; yyi < (Count); yyi++)	\
 545                     	    (To)[yyi] = (From)[yyi];		\
 546                     	}					\
 547 karl           1.15       while (YYID (0))
 548                     #  endif
 549                     # endif
 550                     
 551                     /* Relocate STACK from its old location to the new one.  The
 552                        local variables YYSIZE and YYSTACKSIZE give the old and new number of
 553                        elements in the stack, and YYPTR gives the new location of the
 554                        stack.  Advance YYPTR to a properly aligned location for the next
 555                        stack.  */
 556 karl           1.16 # define YYSTACK_RELOCATE(Stack)					\
 557                         do									\
 558                           {									\
 559                     	YYSIZE_T yynewbytes;						\
 560                     	YYCOPY (&yyptr->Stack, Stack, yysize);				\
 561                     	Stack = &yyptr->Stack;						\
 562                     	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 563                     	yyptr += yynewbytes / sizeof (*yyptr);				\
 564                           }									\
 565 karl           1.15     while (YYID (0))
 566                     
 567 chuck          1.2  #endif
 568 karl           1.15 
 569                     /* YYFINAL -- State number of the termination state.  */
 570                     #define YYFINAL  41
 571                     /* YYLAST -- Last index in YYTABLE.  */
 572                     #define YYLAST   140
 573                     
 574                     /* YYNTOKENS -- Number of terminals.  */
 575                     #define YYNTOKENS  62
 576                     /* YYNNTS -- Number of nonterminals.  */
 577                     #define YYNNTS  35
 578                     /* YYNRULES -- Number of rules.  */
 579                     #define YYNRULES  77
 580                     /* YYNRULES -- Number of states.  */
 581                     #define YYNSTATES  108
 582                     
 583                     /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 584                     #define YYUNDEFTOK  2
 585                     #define YYMAXUTOK   316
 586                     
 587 karl           1.16 #define YYTRANSLATE(YYX)						\
 588 karl           1.15   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 589                     
 590                     /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 591                     static const yytype_uint8 yytranslate[] =
 592                     {
 593                            0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 594                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 595                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 596                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 597                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 598                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 599                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 600                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 601                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 602                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 603                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 604                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 605                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 606                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 607                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 608                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 609 karl           1.15        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 610                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 611                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 612                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 613                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 614                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 615                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 616                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 617                            2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 618                            2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 619                            5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 620                           15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
 621                           25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
 622                           35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
 623                           45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
 624                           55,    56,    57,    58,    59,    60,    61
 625                     };
 626                     
 627 chuck          1.2  #if YYDEBUG
 628 karl           1.15 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 629                        YYRHS.  */
 630                     static const yytype_uint8 yyprhs[] =
 631                     {
 632                            0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
 633                           19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
 634                           39,    41,    43,    45,    47,    49,    53,    55,    59,    61,
 635                           66,    70,    74,    80,    85,    87,    91,    93,    95,    97,
 636                          100,   102,   104,   106,   108,   110,   112,   114,   116,   118,
 637                          123,   127,   131,   135,   139,   143,   145,   148,   150,   154,
 638                          156,   160,   161,   163,   165,   169,   172,   174,   176,   180,
 639                          182,   184,   187,   188,   192,   194,   195,   198
 640                     };
 641                     
 642                     /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 643                     static const yytype_int8 yyrhs[] =
 644                     {
 645                           96,     0,    -1,     3,    -1,    63,    -1,    64,    -1,    15,
 646                           -1,     4,    -1,     5,    -1,     6,    -1,     7,    -1,     8,
 647                           -1,     9,    -1,    10,    -1,    11,    -1,    12,    -1,    67,
 648                           -1,    70,    -1,    68,    -1,    69,    -1,    71,    -1,    13,
 649 karl           1.15       -1,    14,    -1,    86,    -1,    73,    -1,    72,    -1,    16,
 650                           86,    17,    -1,    63,    -1,    63,    18,    67,    -1,    66,
 651                           -1,    63,    16,    87,    17,    -1,    75,    19,    66,    -1,
 652                           75,    19,    63,    -1,    75,    19,    63,    18,    67,    -1,
 653                           75,    20,    74,    21,    -1,    75,    -1,    76,    25,    67,
 654                           -1,    76,    -1,    77,    -1,    78,    -1,    18,    67,    -1,
 655                           79,    -1,    80,    -1,    32,    -1,    33,    -1,    34,    -1,
 656                           35,    -1,    36,    -1,    37,    -1,    79,    -1,    79,    30,
 657                           40,    31,    -1,    79,    30,    31,    -1,    79,    82,    81,
 658                           -1,    80,    82,    79,    -1,    79,    38,    63,    -1,    79,
 659                           39,    67,    -1,    83,    -1,    40,    83,    -1,    84,    -1,
 660                           85,    41,    84,    -1,    85,    -1,    86,    42,    85,    -1,
 661                           -1,    86,    -1,    65,    -1,    65,    60,    63,    -1,    65,
 662                           63,    -1,    88,    -1,    48,    -1,    75,    19,    48,    -1,
 663                           86,    -1,    90,    -1,    91,    93,    -1,    -1,    23,    91,
 664                           93,    -1,    86,    -1,    -1,    55,    94,    -1,    52,    92,
 665                           54,    89,    95,    -1
 666                     };
 667                     
 668                     /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 669                     static const yytype_uint16 yyrline[] =
 670 karl           1.15 {
 671 ajay.rao       1.21        0,   259,   259,   285,   294,   310,   343,   372,   382,   396,
 672                          406,   420,   430,   444,   454,   467,   476,   481,   486,   491,
 673                          496,   506,   519,   533,   543,   552,   561,   570,   583,   592,
 674                          603,   645,   683,   729,   788,   796,   885,   916,   945,   976,
 675                          991,   998,  1010,  1017,  1023,  1030,  1036,  1042,  1050,  1057,
 676                         1069,  1080,  1110,  1140,  1157,  1173,  1180,  1190,  1197,  1212,
 677                         1219,  1233,  1252,  1311,  1318,  1330,  1343,  1350,  1359,  1376,
 678                         1398,  1407,  1416,  1418,  1428,  1437,  1439,  1450
 679 karl           1.15 };
 680                     #endif
 681                     
 682                     #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 683                     /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 684                        First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 685                     static const char *const yytname[] =
 686                     {
 687                       "$end", "error", "$undefined", "TOK_IDENTIFIER", "TOK_STRING_LITERAL",
 688                       "TOK_BINARY", "TOK_NEGATIVE_BINARY", "TOK_HEXADECIMAL",
 689                       "TOK_NEGATIVE_HEXADECIMAL", "TOK_INTEGER", "TOK_NEGATIVE_INTEGER",
 690                       "TOK_REAL", "TOK_NEGATIVE_REAL", "TOK_TRUE", "TOK_FALSE",
 691                       "TOK_SCOPED_PROPERTY", "TOK_LPAR", "TOK_RPAR", "TOK_HASH", "TOK_DOT",
 692                       "TOK_LBRKT", "TOK_RBRKT", "TOK_UNDERSCORE", "TOK_COMMA", "TOK_CONCAT",
 693                       "TOK_DBL_PIPE", "TOK_PLUS", "TOK_MINUS", "TOK_TIMES", "TOK_DIV",
 694                       "TOK_IS", "TOK_NULL", "TOK_EQ", "TOK_NE", "TOK_GT", "TOK_LT", "TOK_GE",
 695                       "TOK_LE", "TOK_ISA", "TOK_LIKE", "TOK_NOT", "TOK_AND", "TOK_OR",
 696                       "TOK_SCOPE", "TOK_ANY", "TOK_EVERY", "TOK_IN", "TOK_SATISFIES",
 697                       "TOK_STAR", "TOK_DOTDOT", "TOK_SHARP", "TOK_DISTINCT", "TOK_SELECT",
 698                       "TOK_FIRST", "TOK_FROM", "TOK_WHERE", "TOK_ORDER", "TOK_BY", "TOK_ASC",
 699                       "TOK_DESC", "TOK_AS", "TOK_UNEXPECTED_CHAR", "$accept", "identifier",
 700 karl           1.15   "class_name", "class_path", "scoped_property", "literal_string",
 701                       "binary_value", "hex_value", "decimal_value", "real_value", "literal",
 702                       "array_index", "array_index_list", "chain", "concat", "factor", "term",
 703                       "arith", "value_symbol", "arith_or_value_symbol", "comp_op", "comp",
 704                       "expr_factor", "expr_term", "expr", "arg_list", "from_specifier",
 705                       "from_criteria", "star_expr", "selected_entry", "select_list",
 706                       "select_list_tail", "search_condition", "optional_where",
 707                       "select_statement", 0
 708                     };
 709 chuck          1.2  #endif
 710 karl           1.15 
 711                     # ifdef YYPRINT
 712                     /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 713                        token YYLEX-NUM.  */
 714                     static const yytype_uint16 yytoknum[] =
 715                     {
 716                            0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 717                          265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
 718                          275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
 719                          285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
 720                          295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
 721                          305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
 722                          315,   316
 723                     };
 724                     # endif
 725                     
 726                     /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 727                     static const yytype_uint8 yyr1[] =
 728                     {
 729                            0,    62,    63,    64,    65,    66,    67,    68,    68,    69,
 730                           69,    70,    70,    71,    71,    72,    72,    72,    72,    72,
 731 karl           1.15       72,    72,    73,    74,    75,    75,    75,    75,    75,    75,
 732                           75,    75,    75,    75,    76,    76,    77,    78,    79,    80,
 733                           81,    81,    82,    82,    82,    82,    82,    82,    83,    83,
 734                           83,    83,    83,    83,    83,    84,    84,    85,    85,    86,
 735                           86,    87,    87,    88,    88,    88,    89,    90,    90,    91,
 736                           91,    92,    93,    93,    94,    95,    95,    96
 737                     };
 738                     
 739                     /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 740                     static const yytype_uint8 yyr2[] =
 741 chuck          1.2  {
 742 karl           1.15        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
 743                            1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
 744                            1,     1,     1,     1,     1,     3,     1,     3,     1,     4,
 745                            3,     3,     5,     4,     1,     3,     1,     1,     1,     2,
 746                            1,     1,     1,     1,     1,     1,     1,     1,     1,     4,
 747                            3,     3,     3,     3,     3,     1,     2,     1,     3,     1,
 748                            3,     0,     1,     1,     3,     2,     1,     1,     3,     1,
 749                            1,     2,     0,     3,     1,     0,     2,     5
 750                     };
 751 chuck          1.2  
 752 karl           1.15 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 753                        STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 754                        means the default is an error.  */
 755                     static const yytype_uint8 yydefact[] =
 756                     {
 757                            0,     0,     0,     2,     6,     7,     8,     9,    10,    11,
 758                           12,    13,    14,    20,    21,     5,     0,     0,     0,    67,
 759                           26,    28,    15,    17,    18,    16,    19,    24,    34,    36,
 760                           37,    38,    48,     0,    55,    57,    59,    69,    70,    72,
 761                            0,     1,    34,     0,    39,    56,    61,     0,     0,     0,
 762                            0,     0,    42,    43,    44,    45,    46,    47,     0,     0,
 763                            0,     0,     0,     0,     0,    71,     0,     0,    25,    62,
 764                            0,    27,    68,    31,    30,    23,     0,    22,    35,    50,
 765                            0,    53,    54,    40,    41,    51,    52,    58,    60,    72,
 766                            3,     4,    63,    66,    75,    29,     0,    33,    49,    73,
 767                            0,    65,     0,    77,    32,    64,    74,    76
 768                     };
 769 chuck          1.2  
 770 karl           1.15 /* YYDEFGOTO[NTERM-NUM].  */
 771                     static const yytype_int8 yydefgoto[] =
 772                     {
 773                           -1,    20,    91,    92,    21,    22,    23,    24,    25,    26,
 774                           27,    75,    76,    42,    29,    30,    31,    32,    33,    85,
 775                           60,    34,    35,    36,    37,    70,    93,    94,    38,    39,
 776                           40,    65,   107,   103,     2
 777                     };
 778 chuck          1.2  
 779 karl           1.15 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 780                        STATE-NUM.  */
 781                     #define YYPACT_NINF -46
 782                     static const yytype_int8 yypact[] =
 783                     {
 784                          -36,    62,    11,   -46,   -46,   -46,   -46,   -46,   -46,   -46,
 785                          -46,   -46,   -46,   -46,   -46,   -46,    85,    15,   108,   -46,
 786                           -6,   -46,   -46,   -46,   -46,   -46,   -46,   -46,    -5,    20,
 787                          -46,   -46,     4,    72,   -46,   -46,   -12,   -17,   -46,    23,
 788                           -3,   -46,     8,   -11,   -46,   -46,    85,    15,     2,    85,
 789                           15,   -22,   -46,   -46,   -46,   -46,   -46,   -46,    45,    15,
 790                          108,   124,    85,    85,    62,   -46,    45,     5,   -46,   -17,
 791                           32,   -46,   -46,    34,   -46,   -46,    33,   -17,   -46,   -46,
 792                           22,   -46,   -46,   -46,   -46,   -46,   -46,   -46,   -12,    23,
 793                          -46,   -46,     1,   -46,     3,   -46,    15,   -46,   -46,   -46,
 794                           45,   -46,    85,   -46,   -46,   -46,   -17,   -46
 795                     };
 796 chuck          1.2  
 797 karl           1.15 /* YYPGOTO[NTERM-NUM].  */
 798                     static const yytype_int8 yypgoto[] =
 799 chuck          1.2  {
 800 karl           1.15      -46,   -45,   -46,   -46,   -41,   -15,   -46,   -46,   -46,   -46,
 801                          -46,   -46,   -46,     0,   -46,   -46,   -46,   -37,    -4,   -46,
 802                           24,    41,    -2,    -1,   -16,   -46,   -46,   -46,   -46,    18,
 803                          -46,   -26,   -46,   -46,   -46
 804                     };
 805 chuck          1.2  
 806 karl           1.15 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 807                        positive, shift that token.  If negative, reduce the rule which
 808                        number is the opposite.  If zero, do what YYDEFACT says.
 809                        If YYTABLE_NINF, syntax error.  */
 810                     #define YYTABLE_NINF -1
 811                     static const yytype_uint8 yytable[] =
 812                     {
 813                           43,    28,    44,    73,     3,     3,    68,    74,     3,    79,
 814                           46,    41,    47,    81,    48,    49,     1,    15,    80,     4,
 815                           15,    90,    73,    83,    86,    63,    74,    67,    49,    62,
 816                           69,    63,    71,    77,    51,    78,    52,    53,    54,    55,
 817                           56,    57,    58,    59,    82,    50,    64,   101,     3,    95,
 818                           72,    66,    96,    98,    97,   105,    84,    61,   102,    45,
 819                           87,   100,    88,    99,    28,     3,     4,     5,     6,     7,
 820                            8,     9,    10,    11,    12,    13,    14,    15,    16,     0,
 821                           17,   104,    89,     0,     0,     0,   106,     0,     3,     4,
 822                            5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 823                           15,    16,    18,    17,    52,    53,    54,    55,    56,    57,
 824                           19,     3,     4,     5,     6,     7,     8,     9,    10,    11,
 825                           12,    13,    14,    15,    16,    18,    17,     3,     4,     5,
 826                            6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
 827 karl           1.15       16
 828                     };
 829 chuck          1.2  
 830 karl           1.15 static const yytype_int8 yycheck[] =
 831 chuck          1.2  {
 832 karl           1.15       16,     1,    17,    48,     3,     3,    17,    48,     3,    31,
 833                           16,     0,    18,    58,    19,    20,    52,    15,    40,     4,
 834                           15,    66,    67,    60,    61,    42,    67,    19,    20,    41,
 835                           46,    42,    47,    49,    30,    50,    32,    33,    34,    35,
 836                           36,    37,    38,    39,    59,    25,    23,    92,     3,    17,
 837                           48,    54,    18,    31,    21,   100,    60,    33,    55,    18,
 838                           62,    60,    63,    89,    64,     3,     4,     5,     6,     7,
 839                            8,     9,    10,    11,    12,    13,    14,    15,    16,    -1,
 840                           18,    96,    64,    -1,    -1,    -1,   102,    -1,     3,     4,
 841                            5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 842                           15,    16,    40,    18,    32,    33,    34,    35,    36,    37,
 843                           48,     3,     4,     5,     6,     7,     8,     9,    10,    11,
 844                           12,    13,    14,    15,    16,    40,    18,     3,     4,     5,
 845                            6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
 846                           16
 847                     };
 848 chuck          1.2  
 849 karl           1.15 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 850                        symbol of state STATE-NUM.  */
 851                     static const yytype_uint8 yystos[] =
 852                     {
 853                            0,    52,    96,     3,     4,     5,     6,     7,     8,     9,
 854                           10,    11,    12,    13,    14,    15,    16,    18,    40,    48,
 855                           63,    66,    67,    68,    69,    70,    71,    72,    75,    76,
 856                           77,    78,    79,    80,    83,    84,    85,    86,    90,    91,
 857                           92,     0,    75,    86,    67,    83,    16,    18,    19,    20,
 858                           25,    30,    32,    33,    34,    35,    36,    37,    38,    39,
 859                           82,    82,    41,    42,    23,    93,    54,    19,    17,    86,
 860                           87,    67,    48,    63,    66,    73,    74,    86,    67,    31,
 861                           40,    63,    67,    79,    80,    81,    79,    84,    85,    91,
 862                           63,    64,    65,    88,    89,    17,    18,    21,    31,    93,
 863                           60,    63,    55,    95,    67,    63,    86,    94
 864                     };
 865 chuck          1.2  
 866 karl           1.16 #define yyerrok		(yyerrstatus = 0)
 867                     #define yyclearin	(yychar = YYEMPTY)
 868                     #define YYEMPTY		(-2)
 869                     #define YYEOF		0
 870                     
 871                     #define YYACCEPT	goto yyacceptlab
 872                     #define YYABORT		goto yyabortlab
 873                     #define YYERROR		goto yyerrorlab
 874 karl           1.15 
 875                     
 876                     /* Like YYERROR except do call yyerror.  This remains here temporarily
 877                        to ease the transition to the new meaning of YYERROR, for GCC.
 878                        Once GCC version 2 has supplanted version 1, this can go.  */
 879                     
 880 karl           1.16 #define YYFAIL		goto yyerrlab
 881 karl           1.15 
 882                     #define YYRECOVERING()  (!!yyerrstatus)
 883                     
 884 karl           1.16 #define YYBACKUP(Token, Value)					\
 885                     do								\
 886                       if (yychar == YYEMPTY && yylen == 1)				\
 887                         {								\
 888                           yychar = (Token);						\
 889                           yylval = (Value);						\
 890                           yytoken = YYTRANSLATE (yychar);				\
 891                           YYPOPSTACK (1);						\
 892                           goto yybackup;						\
 893                         }								\
 894                       else								\
 895                         {								\
 896 karl           1.15       yyerror (YY_("syntax error: cannot back up")); \
 897 karl           1.16       YYERROR;							\
 898                         }								\
 899 karl           1.15 while (YYID (0))
 900                     
 901                     
 902 karl           1.16 #define YYTERROR	1
 903                     #define YYERRCODE	256
 904 karl           1.15 
 905                     
 906                     /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 907                        If N is 0, then set CURRENT to the empty location which ends
 908                        the previous symbol: RHS[0] (always defined).  */
 909                     
 910                     #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 911                     #ifndef YYLLOC_DEFAULT
 912 karl           1.16 # define YYLLOC_DEFAULT(Current, Rhs, N)				\
 913                         do									\
 914 karl           1.15       if (YYID (N))                                                    \
 915 karl           1.16 	{								\
 916                     	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
 917                     	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
 918                     	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
 919                     	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
 920                     	}								\
 921                           else								\
 922                     	{								\
 923                     	  (Current).first_line   = (Current).last_line   =		\
 924                     	    YYRHSLOC (Rhs, 0).last_line;				\
 925                     	  (Current).first_column = (Current).last_column =		\
 926                     	    YYRHSLOC (Rhs, 0).last_column;				\
 927                     	}								\
 928 karl           1.15     while (YYID (0))
 929                     #endif
 930 chuck          1.2  
 931                     
 932 karl           1.15 /* YY_LOCATION_PRINT -- Print the location on the stream.
 933                        This macro was not mandated originally: define only if we know
 934                        we won't break user code: when these are the locations we know.  */
 935                     
 936                     #ifndef YY_LOCATION_PRINT
 937                     # if YYLTYPE_IS_TRIVIAL
 938 karl           1.16 #  define YY_LOCATION_PRINT(File, Loc)			\
 939                          fprintf (File, "%d.%d-%d.%d",			\
 940                     	      (Loc).first_line, (Loc).first_column,	\
 941                     	      (Loc).last_line,  (Loc).last_column)
 942 karl           1.15 # else
 943                     #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 944                     # endif
 945                     #endif
 946 chuck          1.2  
 947 humberto       1.10 
 948 karl           1.15 /* YYLEX -- calling `yylex' with the right arguments.  */
 949 chuck          1.2  
 950 karl           1.15 #ifdef YYLEX_PARAM
 951                     # define YYLEX yylex (YYLEX_PARAM)
 952                     #else
 953                     # define YYLEX yylex ()
 954                     #endif
 955 chuck          1.2  
 956 karl           1.15 /* Enable debugging if requested.  */
 957                     #if YYDEBUG
 958 chuck          1.2  
 959 karl           1.15 # ifndef YYFPRINTF
 960                     #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 961                     #  define YYFPRINTF fprintf
 962                     # endif
 963                     
 964 karl           1.16 # define YYDPRINTF(Args)			\
 965                     do {						\
 966                       if (yydebug)					\
 967                         YYFPRINTF Args;				\
 968 karl           1.15 } while (YYID (0))
 969                     
 970 karl           1.16 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
 971                     do {									  \
 972                       if (yydebug)								  \
 973                         {									  \
 974                           YYFPRINTF (stderr, "%s ", Title);					  \
 975                           yy_symbol_print (stderr,						  \
 976                     		  Type, Value); \
 977                           YYFPRINTF (stderr, "\n");						  \
 978                         }									  \
 979 karl           1.15 } while (YYID (0))
 980                     
 981                     
 982                     /*--------------------------------.
 983                     | Print this symbol on YYOUTPUT.  |
 984                     `--------------------------------*/
 985                     
 986                     /*ARGSUSED*/
 987                     #if (defined __STDC__ || defined __C99__FUNC__ \
 988                          || defined __cplusplus || defined _MSC_VER)
 989                     static void
 990                     yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 991                     #else
 992                     static void
 993                     yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 994                         FILE *yyoutput;
 995                         int yytype;
 996                         YYSTYPE const * const yyvaluep;
 997                     #endif
 998 chuck          1.2  {
 999 karl           1.15   if (!yyvaluep)
1000                         return;
1001                     # ifdef YYPRINT
1002                       if (yytype < YYNTOKENS)
1003                         YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1004                     # else
1005                       YYUSE (yyoutput);
1006                     # endif
1007                       switch (yytype)
1008                         {
1009                           default:
1010 karl           1.16 	break;
1011 karl           1.15     }
1012                     }
1013 chuck          1.2  
1014                     
1015 karl           1.15 /*--------------------------------.
1016                     | Print this symbol on YYOUTPUT.  |
1017                     `--------------------------------*/
1018                     
1019                     #if (defined __STDC__ || defined __C99__FUNC__ \
1020                          || defined __cplusplus || defined _MSC_VER)
1021                     static void
1022                     yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1023                     #else
1024                     static void
1025                     yy_symbol_print (yyoutput, yytype, yyvaluep)
1026                         FILE *yyoutput;
1027                         int yytype;
1028                         YYSTYPE const * const yyvaluep;
1029                     #endif
1030 chuck          1.2  {
1031 karl           1.15   if (yytype < YYNTOKENS)
1032                         YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1033                       else
1034                         YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1035                     
1036                       yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1037                       YYFPRINTF (yyoutput, ")");
1038                     }
1039 chuck          1.2  
1040 karl           1.15 /*------------------------------------------------------------------.
1041                     | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1042                     | TOP (included).                                                   |
1043                     `------------------------------------------------------------------*/
1044                     
1045                     #if (defined __STDC__ || defined __C99__FUNC__ \
1046                          || defined __cplusplus || defined _MSC_VER)
1047                     static void
1048                     yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1049                     #else
1050                     static void
1051                     yy_stack_print (bottom, top)
1052                         yytype_int16 *bottom;
1053                         yytype_int16 *top;
1054                     #endif
1055                     {
1056                       YYFPRINTF (stderr, "Stack now");
1057                       for (; bottom <= top; ++bottom)
1058                         YYFPRINTF (stderr, " %d", *bottom);
1059                       YYFPRINTF (stderr, "\n");
1060                     }
1061 karl           1.15 
1062 karl           1.16 # define YY_STACK_PRINT(Bottom, Top)				\
1063                     do {								\
1064                       if (yydebug)							\
1065                         yy_stack_print ((Bottom), (Top));				\
1066 karl           1.15 } while (YYID (0))
1067                     
1068                     
1069                     /*------------------------------------------------.
1070                     | Report that the YYRULE is going to be reduced.  |
1071                     `------------------------------------------------*/
1072                     
1073                     #if (defined __STDC__ || defined __C99__FUNC__ \
1074                          || defined __cplusplus || defined _MSC_VER)
1075                     static void
1076                     yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1077                     #else
1078                     static void
1079                     yy_reduce_print (yyvsp, yyrule)
1080                         YYSTYPE *yyvsp;
1081                         int yyrule;
1082                     #endif
1083                     {
1084                       int yynrhs = yyr2[yyrule];
1085                       int yyi;
1086                       unsigned long int yylno = yyrline[yyrule];
1087 karl           1.15   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1088 karl           1.16 	     yyrule - 1, yylno);
1089 karl           1.15   /* The symbols being reduced.  */
1090                       for (yyi = 0; yyi < yynrhs; yyi++)
1091                         {
1092                           fprintf (stderr, "   $%d = ", yyi + 1);
1093                           yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1094 karl           1.16 		       &(yyvsp[(yyi + 1) - (yynrhs)])
1095                     		       		       );
1096 karl           1.15       fprintf (stderr, "\n");
1097                         }
1098                     }
1099                     
1100 karl           1.16 # define YY_REDUCE_PRINT(Rule)		\
1101                     do {					\
1102                       if (yydebug)				\
1103 karl           1.15     yy_reduce_print (yyvsp, Rule); \
1104                     } while (YYID (0))
1105                     
1106                     /* Nonzero means print parse trace.  It is left uninitialized so that
1107                        multiple parsers can coexist.  */
1108                     int yydebug;
1109                     #else /* !YYDEBUG */
1110                     # define YYDPRINTF(Args)
1111                     # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1112                     # define YY_STACK_PRINT(Bottom, Top)
1113                     # define YY_REDUCE_PRINT(Rule)
1114                     #endif /* !YYDEBUG */
1115                     
1116                     
1117                     /* YYINITDEPTH -- initial size of the parser's stacks.  */
1118 karl           1.16 #ifndef	YYINITDEPTH
1119 karl           1.15 # define YYINITDEPTH 200
1120                     #endif
1121                     
1122                     /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1123                        if the built-in stack extension method is used).
1124                     
1125                        Do not make this value too large; the results are undefined if
1126                        YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1127                        evaluated with infinite-precision integer arithmetic.  */
1128                     
1129                     #ifndef YYMAXDEPTH
1130                     # define YYMAXDEPTH 10000
1131                     #endif
1132                     
1133                     
1134                     
1135                     #if YYERROR_VERBOSE
1136                     
1137                     # ifndef yystrlen
1138                     #  if defined __GLIBC__ && defined _STRING_H
1139                     #   define yystrlen strlen
1140 karl           1.15 #  else
1141                     /* Return the length of YYSTR.  */
1142                     #if (defined __STDC__ || defined __C99__FUNC__ \
1143                          || defined __cplusplus || defined _MSC_VER)
1144                     static YYSIZE_T
1145                     yystrlen (const char *yystr)
1146                     #else
1147                     static YYSIZE_T
1148                     yystrlen (yystr)
1149                         const char *yystr;
1150                     #endif
1151                     {
1152                       YYSIZE_T yylen;
1153                       for (yylen = 0; yystr[yylen]; yylen++)
1154                         continue;
1155                       return yylen;
1156                     }
1157                     #  endif
1158                     # endif
1159                     
1160                     # ifndef yystpcpy
1161 karl           1.15 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1162                     #   define yystpcpy stpcpy
1163                     #  else
1164                     /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1165                        YYDEST.  */
1166                     #if (defined __STDC__ || defined __C99__FUNC__ \
1167                          || defined __cplusplus || defined _MSC_VER)
1168                     static char *
1169                     yystpcpy (char *yydest, const char *yysrc)
1170                     #else
1171                     static char *
1172                     yystpcpy (yydest, yysrc)
1173                         char *yydest;
1174                         const char *yysrc;
1175                     #endif
1176                     {
1177                       char *yyd = yydest;
1178                       const char *yys = yysrc;
1179                     
1180                       while ((*yyd++ = *yys++) != '\0')
1181                         continue;
1182 karl           1.15 
1183                       return yyd - 1;
1184                     }
1185                     #  endif
1186                     # endif
1187                     
1188                     # ifndef yytnamerr
1189                     /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1190                        quotes and backslashes, so that it's suitable for yyerror.  The
1191                        heuristic is that double-quoting is unnecessary unless the string
1192                        contains an apostrophe, a comma, or backslash (other than
1193                        backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1194                        null, do not copy; instead, return the length of what the result
1195                        would have been.  */
1196                     static YYSIZE_T
1197                     yytnamerr (char *yyres, const char *yystr)
1198                     {
1199                       if (*yystr == '"')
1200                         {
1201                           YYSIZE_T yyn = 0;
1202                           char const *yyp = yystr;
1203 karl           1.15 
1204                           for (;;)
1205 karl           1.16 	switch (*++yyp)
1206                     	  {
1207                     	  case '\'':
1208                     	  case ',':
1209                     	    goto do_not_strip_quotes;
1210                     
1211                     	  case '\\':
1212                     	    if (*++yyp != '\\')
1213                     	      goto do_not_strip_quotes;
1214                     	    /* Fall through.  */
1215                     	  default:
1216                     	    if (yyres)
1217                     	      yyres[yyn] = *yyp;
1218                     	    yyn++;
1219                     	    break;
1220                     
1221                     	  case '"':
1222                     	    if (yyres)
1223                     	      yyres[yyn] = '\0';
1224                     	    return yyn;
1225                     	  }
1226 karl           1.15     do_not_strip_quotes: ;
1227                         }
1228                     
1229                       if (! yyres)
1230                         return yystrlen (yystr);
1231                     
1232                       return yystpcpy (yyres, yystr) - yyres;
1233                     }
1234                     # endif
1235                     
1236                     /* Copy into YYRESULT an error message about the unexpected token
1237                        YYCHAR while in state YYSTATE.  Return the number of bytes copied,
1238                        including the terminating null byte.  If YYRESULT is null, do not
1239                        copy anything; just return the number of bytes that would be
1240                        copied.  As a special case, return 0 if an ordinary "syntax error"
1241                        message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
1242                        size calculation.  */
1243                     static YYSIZE_T
1244                     yysyntax_error (char *yyresult, int yystate, int yychar)
1245                     {
1246                       int yyn = yypact[yystate];
1247 karl           1.15 
1248                       if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1249                         return 0;
1250                       else
1251                         {
1252                           int yytype = YYTRANSLATE (yychar);
1253                           YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1254                           YYSIZE_T yysize = yysize0;
1255                           YYSIZE_T yysize1;
1256                           int yysize_overflow = 0;
1257                           enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1258                           char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1259                           int yyx;
1260                     
1261                     # if 0
1262                           /* This is so xgettext sees the translatable formats that are
1263 karl           1.16 	 constructed on the fly.  */
1264 karl           1.15       YY_("syntax error, unexpected %s");
1265                           YY_("syntax error, unexpected %s, expecting %s");
1266                           YY_("syntax error, unexpected %s, expecting %s or %s");
1267                           YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1268                           YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1269                     # endif
1270                           char *yyfmt;
1271                           char const *yyf;
1272                           static char const yyunexpected[] = "syntax error, unexpected %s";
1273                           static char const yyexpecting[] = ", expecting %s";
1274                           static char const yyor[] = " or %s";
1275                           char yyformat[sizeof yyunexpected
1276 karl           1.16 		    + sizeof yyexpecting - 1
1277                     		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1278                     		       * (sizeof yyor - 1))];
1279 karl           1.15       char const *yyprefix = yyexpecting;
1280                     
1281                           /* Start YYX at -YYN if negative to avoid negative indexes in
1282 karl           1.16 	 YYCHECK.  */
1283 karl           1.15       int yyxbegin = yyn < 0 ? -yyn : 0;
1284                     
1285                           /* Stay within bounds of both yycheck and yytname.  */
1286                           int yychecklim = YYLAST - yyn + 1;
1287                           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1288                           int yycount = 1;
1289                     
1290                           yyarg[0] = yytname[yytype];
1291                           yyfmt = yystpcpy (yyformat, yyunexpected);
1292                     
1293                           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1294 karl           1.16 	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1295                     	  {
1296                     	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1297                     	      {
1298                     		yycount = 1;
1299                     		yysize = yysize0;
1300                     		yyformat[sizeof yyunexpected - 1] = '\0';
1301                     		break;
1302                     	      }
1303                     	    yyarg[yycount++] = yytname[yyx];
1304                     	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1305                     	    yysize_overflow |= (yysize1 < yysize);
1306                     	    yysize = yysize1;
1307                     	    yyfmt = yystpcpy (yyfmt, yyprefix);
1308                     	    yyprefix = yyor;
1309                     	  }
1310 karl           1.15 
1311                           yyf = YY_(yyformat);
1312                           yysize1 = yysize + yystrlen (yyf);
1313                           yysize_overflow |= (yysize1 < yysize);
1314                           yysize = yysize1;
1315                     
1316                           if (yysize_overflow)
1317 karl           1.16 	return YYSIZE_MAXIMUM;
1318 karl           1.15 
1319                           if (yyresult)
1320 karl           1.16 	{
1321                     	  /* Avoid sprintf, as that infringes on the user's name space.
1322                     	     Don't have undefined behavior even if the translation
1323                     	     produced a string with the wrong number of "%s"s.  */
1324                     	  char *yyp = yyresult;
1325                     	  int yyi = 0;
1326                     	  while ((*yyp = *yyf) != '\0')
1327                     	    {
1328                     	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1329                     		{
1330                     		  yyp += yytnamerr (yyp, yyarg[yyi++]);
1331                     		  yyf += 2;
1332                     		}
1333                     	      else
1334                     		{
1335                     		  yyp++;
1336                     		  yyf++;
1337                     		}
1338                     	    }
1339                     	}
1340 karl           1.15       return yysize;
1341                         }
1342                     }
1343                     #endif /* YYERROR_VERBOSE */
1344                     
1345                     
1346                     /*-----------------------------------------------.
1347                     | Release the memory associated to this symbol.  |
1348                     `-----------------------------------------------*/
1349                     
1350                     /*ARGSUSED*/
1351                     #if (defined __STDC__ || defined __C99__FUNC__ \
1352                          || defined __cplusplus || defined _MSC_VER)
1353                     static void
1354                     yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1355                     #else
1356                     static void
1357                     yydestruct (yymsg, yytype, yyvaluep)
1358                         const char *yymsg;
1359                         int yytype;
1360                         YYSTYPE *yyvaluep;
1361 karl           1.15 #endif
1362                     {
1363                       YYUSE (yyvaluep);
1364                     
1365                       if (!yymsg)
1366                         yymsg = "Deleting";
1367                       YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1368                     
1369                       switch (yytype)
1370                         {
1371 ajay.rao       1.21       case 52: /* "TOK_SELECT" */
1372                     #line 236 "CQL.y"
1373                     	{CQL_Bison_Cleanup(); };
1374                     #line 1372 "CQLtemp"
1375                     	break;
1376 karl           1.15 
1377                           default:
1378 karl           1.16 	break;
1379 karl           1.15     }
1380                     }
1381                     
1382                     
1383                     /* Prevent warnings from -Wmissing-prototypes.  */
1384                     
1385                     #ifdef YYPARSE_PARAM
1386                     #if defined __STDC__ || defined __cplusplus
1387                     int yyparse (void *YYPARSE_PARAM);
1388                     #else
1389                     int yyparse ();
1390                     #endif
1391                     #else /* ! YYPARSE_PARAM */
1392                     #if defined __STDC__ || defined __cplusplus
1393                     int yyparse (void);
1394                     #else
1395                     int yyparse ();
1396                     #endif
1397                     #endif /* ! YYPARSE_PARAM */
1398                     
1399                     
1400 karl           1.15 
1401                     /* The look-ahead symbol.  */
1402                     int yychar;
1403                     
1404                     /* The semantic value of the look-ahead symbol.  */
1405                     YYSTYPE yylval;
1406                     
1407                     /* Number of syntax errors so far.  */
1408                     int yynerrs;
1409                     
1410                     
1411                     
1412                     /*----------.
1413                     | yyparse.  |
1414                     `----------*/
1415                     
1416                     #ifdef YYPARSE_PARAM
1417                     #if (defined __STDC__ || defined __C99__FUNC__ \
1418                          || defined __cplusplus || defined _MSC_VER)
1419                     int
1420                     yyparse (void *YYPARSE_PARAM)
1421 karl           1.15 #else
1422                     int
1423                     yyparse (YYPARSE_PARAM)
1424                         void *YYPARSE_PARAM;
1425                     #endif
1426                     #else /* ! YYPARSE_PARAM */
1427                     #if (defined __STDC__ || defined __C99__FUNC__ \
1428                          || defined __cplusplus || defined _MSC_VER)
1429                     int
1430                     yyparse (void)
1431                     #else
1432                     int
1433                     yyparse ()
1434                     
1435                     #endif
1436                     #endif
1437                     {
1438 ajay.rao       1.21   
1439 karl           1.15   int yystate;
1440                       int yyn;
1441                       int yyresult;
1442                       /* Number of tokens to shift before error messages enabled.  */
1443                       int yyerrstatus;
1444                       /* Look-ahead token as an internal (translated) token number.  */
1445                       int yytoken = 0;
1446                     #if YYERROR_VERBOSE
1447                       /* Buffer for error messages, and its allocated size.  */
1448                       char yymsgbuf[128];
1449                       char *yymsg = yymsgbuf;
1450                       YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1451                     #endif
1452                     
1453                       /* Three stacks and their tools:
1454                          `yyss': related to states,
1455                          `yyvs': related to semantic values,
1456                          `yyls': related to locations.
1457                     
1458                          Refer to the stacks thru separate pointers, to allow yyoverflow
1459                          to reallocate them elsewhere.  */
1460 karl           1.15 
1461                       /* The state stack.  */
1462                       yytype_int16 yyssa[YYINITDEPTH];
1463                       yytype_int16 *yyss = yyssa;
1464                       yytype_int16 *yyssp;
1465                     
1466                       /* The semantic value stack.  */
1467                       YYSTYPE yyvsa[YYINITDEPTH];
1468                       YYSTYPE *yyvs = yyvsa;
1469                       YYSTYPE *yyvsp;
1470                     
1471                     
1472                     
1473                     #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1474                     
1475                       YYSIZE_T yystacksize = YYINITDEPTH;
1476                     
1477                       /* The variables used to return semantic value and location from the
1478                          action routines.  */
1479                       YYSTYPE yyval;
1480                     
1481 karl           1.15 
1482                       /* The number of symbols on the RHS of the reduced rule.
1483                          Keep to zero when no symbol should be popped.  */
1484                       int yylen = 0;
1485                     
1486                       YYDPRINTF ((stderr, "Starting parse\n"));
1487                     
1488                       yystate = 0;
1489                       yyerrstatus = 0;
1490                       yynerrs = 0;
1491 karl           1.16   yychar = YYEMPTY;		/* Cause a token to be read.  */
1492 karl           1.15 
1493                       /* Initialize stack pointers.
1494                          Waste one element of value and location stack
1495                          so that they stay on the same level as the state stack.
1496                          The wasted elements are never initialized.  */
1497                     
1498                       yyssp = yyss;
1499                       yyvsp = yyvs;
1500                     
1501                       goto yysetstate;
1502                     
1503                     /*------------------------------------------------------------.
1504                     | yynewstate -- Push a new state, which is found in yystate.  |
1505                     `------------------------------------------------------------*/
1506                      yynewstate:
1507                       /* In all cases, when you get here, the value and location stacks
1508                          have just been pushed.  So pushing a state here evens the stacks.  */
1509                       yyssp++;
1510                     
1511                      yysetstate:
1512                       *yyssp = yystate;
1513 karl           1.15 
1514                       if (yyss + yystacksize - 1 <= yyssp)
1515                         {
1516                           /* Get the current used size of the three stacks, in elements.  */
1517                           YYSIZE_T yysize = yyssp - yyss + 1;
1518                     
1519                     #ifdef yyoverflow
1520                           {
1521 karl           1.16 	/* Give user a chance to reallocate the stack.  Use copies of
1522                     	   these so that the &'s don't force the real ones into
1523                     	   memory.  */
1524                     	YYSTYPE *yyvs1 = yyvs;
1525                     	yytype_int16 *yyss1 = yyss;
1526                     
1527                     
1528                     	/* Each stack pointer address is followed by the size of the
1529                     	   data in use in that stack, in bytes.  This used to be a
1530                     	   conditional around just the two extra args, but that might
1531                     	   be undefined if yyoverflow is a macro.  */
1532                     	yyoverflow (YY_("memory exhausted"),
1533                     		    &yyss1, yysize * sizeof (*yyssp),
1534                     		    &yyvs1, yysize * sizeof (*yyvsp),
1535 karl           1.15 
1536 karl           1.16 		    &yystacksize);
1537 karl           1.15 
1538 karl           1.16 	yyss = yyss1;
1539                     	yyvs = yyvs1;
1540 karl           1.15       }
1541                     #else /* no yyoverflow */
1542                     # ifndef YYSTACK_RELOCATE
1543                           goto yyexhaustedlab;
1544                     # else
1545                           /* Extend the stack our own way.  */
1546                           if (YYMAXDEPTH <= yystacksize)
1547 karl           1.16 	goto yyexhaustedlab;
1548 karl           1.15       yystacksize *= 2;
1549                           if (YYMAXDEPTH < yystacksize)
1550 karl           1.16 	yystacksize = YYMAXDEPTH;
1551 karl           1.15 
1552                           {
1553 karl           1.16 	yytype_int16 *yyss1 = yyss;
1554                     	union yyalloc *yyptr =
1555                     	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1556                     	if (! yyptr)
1557                     	  goto yyexhaustedlab;
1558                     	YYSTACK_RELOCATE (yyss);
1559                     	YYSTACK_RELOCATE (yyvs);
1560 karl           1.15 
1561                     #  undef YYSTACK_RELOCATE
1562 karl           1.16 	if (yyss1 != yyssa)
1563                     	  YYSTACK_FREE (yyss1);
1564 karl           1.15       }
1565                     # endif
1566                     #endif /* no yyoverflow */
1567                     
1568                           yyssp = yyss + yysize - 1;
1569                           yyvsp = yyvs + yysize - 1;
1570                     
1571                     
1572                           YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1573 karl           1.16 		  (unsigned long int) yystacksize));
1574 karl           1.15 
1575                           if (yyss + yystacksize - 1 <= yyssp)
1576 karl           1.16 	YYABORT;
1577 karl           1.15     }
1578                     
1579                       YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1580                     
1581                       goto yybackup;
1582                     
1583                     /*-----------.
1584                     | yybackup.  |
1585                     `-----------*/
1586                     yybackup:
1587                     
1588                       /* Do appropriate processing given the current state.  Read a
1589                          look-ahead token if we need one and don't already have one.  */
1590                     
1591                       /* First try to decide what to do without reference to look-ahead token.  */
1592                       yyn = yypact[yystate];
1593                       if (yyn == YYPACT_NINF)
1594                         goto yydefault;
1595                     
1596                       /* Not known => get a look-ahead token if don't already have one.  */
1597                     
1598 karl           1.15   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1599                       if (yychar == YYEMPTY)
1600                         {
1601                           YYDPRINTF ((stderr, "Reading a token: "));
1602                           yychar = YYLEX;
1603                         }
1604                     
1605                       if (yychar <= YYEOF)
1606                         {
1607                           yychar = yytoken = YYEOF;
1608                           YYDPRINTF ((stderr, "Now at end of input.\n"));
1609                         }
1610                       else
1611                         {
1612                           yytoken = YYTRANSLATE (yychar);
1613                           YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1614                         }
1615                     
1616                       /* If the proper action on seeing token YYTOKEN is to reduce or to
1617                          detect an error, take that action.  */
1618                       yyn += yytoken;
1619 karl           1.15   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1620                         goto yydefault;
1621                       yyn = yytable[yyn];
1622                       if (yyn <= 0)
1623                         {
1624                           if (yyn == 0 || yyn == YYTABLE_NINF)
1625 karl           1.16 	goto yyerrlab;
1626 karl           1.15       yyn = -yyn;
1627                           goto yyreduce;
1628                         }
1629                     
1630                       if (yyn == YYFINAL)
1631                         YYACCEPT;
1632                     
1633                       /* Count tokens shifted since error; after three, turn off error
1634                          status.  */
1635                       if (yyerrstatus)
1636                         yyerrstatus--;
1637                     
1638                       /* Shift the look-ahead token.  */
1639                       YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1640                     
1641                       /* Discard the shifted token unless it is eof.  */
1642                       if (yychar != YYEOF)
1643                         yychar = YYEMPTY;
1644                     
1645                       yystate = yyn;
1646                       *++yyvsp = yylval;
1647 karl           1.15 
1648                       goto yynewstate;
1649                     
1650                     
1651                     /*-----------------------------------------------------------.
1652                     | yydefault -- do the default action for the current state.  |
1653                     `-----------------------------------------------------------*/
1654                     yydefault:
1655                       yyn = yydefact[yystate];
1656                       if (yyn == 0)
1657                         goto yyerrlab;
1658                       goto yyreduce;
1659                     
1660                     
1661                     /*-----------------------------.
1662                     | yyreduce -- Do a reduction.  |
1663                     `-----------------------------*/
1664                     yyreduce:
1665                       /* yyn is the number of a rule to reduce with.  */
1666                       yylen = yyr2[yyn];
1667                     
1668 karl           1.15   /* If YYLEN is nonzero, implement the default value of the action:
1669                          `$$ = $1'.
1670                     
1671                          Otherwise, the following line sets YYVAL to garbage.
1672                          This behavior is undocumented and Bison
1673                          users should not rely upon it.  Assigning to YYVAL
1674                          unconditionally makes the parser a bit smaller, and it avoids a
1675                          GCC warning that YYVAL may be used uninitialized.  */
1676                       yyval = yyvsp[1-yylen];
1677                     
1678                     
1679                       YY_REDUCE_PRINT (yyn);
1680                       switch (yyn)
1681                         {
1682                             case 2:
1683 ajay.rao       1.21 #line 260 "CQL.y"
1684 kumpf          1.20     {
1685 dave.sudlik    1.17         CQL_globalParserState->currentRule = "identifier";
1686                             CQL_DEBUG_TRACE("BISON::identifier\n");
1687 karl           1.15 
1688 karl           1.16         if(isUTF8Str(CQL_lval.strValue))
1689 kumpf          1.20         {
1690 karl           1.16             (yyval._identifier) = new CQLIdentifier(String(CQL_lval.strValue));
1691 karl           1.15                 _ObjPtr._ptr = (yyval._identifier);
1692                                     _ObjPtr.type = Id;
1693                                     _ptrs.append(_ObjPtr);
1694 karl           1.16         }
1695                             else
1696                             {
1697 dave.sudlik    1.17             CQL_DEBUG_TRACE("BISON::identifier-> BAD UTF\n");
1698 karl           1.16 
1699                                 throw CQLSyntaxErrorException(
1700                                     MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1701                                     "Bad UTF8 encountered parsing rule $0"
1702                                        " in position $1.",
1703                                     "identifier",
1704                                     CQL_globalParserState->currentTokenPos) );
1705                             }
1706                         ;}
1707 karl           1.15     break;
1708                     
1709                       case 3:
1710 ajay.rao       1.21 #line 286 "CQL.y"
1711 karl           1.15     {
1712 dave.sudlik    1.17         CQL_globalParserState->currentRule = "class_name";
1713 kumpf          1.20         CQL_DEBUG_TRACE2("BISON::class_name = %s\n",
1714 dave.sudlik    1.17             (const char *)((yyvsp[(1) - (1)]._identifier)->getName().getString().getCString()));
1715 karl           1.16         (yyval._identifier) = (yyvsp[(1) - (1)]._identifier);
1716                         ;}
1717 karl           1.15     break;
1718                     
1719                       case 4:
1720 ajay.rao       1.21 #line 295 "CQL.y"
1721 kumpf          1.20     {
1722 dave.sudlik    1.17         CQL_globalParserState->currentRule = "class_path";
1723                             CQL_DEBUG_TRACE("BISON::class_path\n");
1724 karl           1.16         (yyval._identifier) = (yyvsp[(1) - (1)]._identifier);
1725                         ;}
1726 karl           1.15     break;
1727                     
1728                       case 5:
1729 ajay.rao       1.21 #line 311 "CQL.y"
1730 karl           1.15     {
1731 karl           1.16         /*
1732                             TOK_SCOPED_PROPERTY can be:
1733                             - "A::prop"
1734                             - "A::class.prop"
1735                             - "A::class.prop#'OK'
1736                             - "A::class.prop[4]"
1737                             */
1738 dave.sudlik    1.17         CQL_globalParserState->currentRule = "scoped_property";
1739                             CQL_DEBUG_TRACE2("BISON::scoped_property = %s\n", CQL_lval.strValue);
1740 kumpf          1.20 
1741 karl           1.16         if(isUTF8Str(CQL_lval.strValue))
1742                             {
1743 karl           1.15             String tmp(CQL_lval.strValue);
1744                                 (yyval._identifier) = new CQLIdentifier(tmp);
1745                                 _ObjPtr._ptr = (yyval._identifier);
1746                                 _ObjPtr.type = Id;
1747                                 _ptrs.append(_ObjPtr);
1748 karl           1.16         }
1749                             else
1750                             {
1751 dave.sudlik    1.17             CQL_DEBUG_TRACE("BISON::scoped_property-> BAD UTF\n");
1752 karl           1.15             throw CQLSyntaxErrorException(
1753                                    MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1754                                       "Bad UTF8 encountered parsing rule $0 in position $1.",
1755                                       "scoped_property",
1756                                       CQL_globalParserState->currentTokenPos) );
1757 karl           1.16         }
1758                         ;}
1759 karl           1.15     break;
1760                     
1761                       case 6:
1762 ajay.rao       1.21 #line 344 "CQL.y"
1763 kumpf          1.20     {
1764 karl           1.16         /*
1765                             Make sure the literal is valid UTF8, then make a String
1766                             */
1767 dave.sudlik    1.17         CQL_globalParserState->currentRule = "literal_string";
1768                             CQL_DEBUG_TRACE2("BISON::literal_string-> %s\n", CQL_lval.strValue);
1769 kumpf          1.20 
1770 karl           1.16         if(isUTF8Str(CQL_lval.strValue))
1771                             {
1772 karl           1.15             (yyval._string) = new String(CQL_lval.strValue);
1773                                 _ObjPtr._ptr = (yyval._string);
1774                                 _ObjPtr.type = Str;
1775 humberto       1.8              _ptrs.append(_ObjPtr);
1776 karl           1.16         }
1777                             else
1778                             {
1779 dave.sudlik    1.17             CQL_DEBUG_TRACE("BISON::literal_string-> BAD UTF\n");
1780 kumpf          1.20 
1781 karl           1.15             throw CQLSyntaxErrorException(
1782                                    MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1783                                       "Bad UTF8 encountered parsing rule $0 in position $1.",
1784                                       "literal_string",
1785                                       CQL_globalParserState->currentTokenPos));
1786                             }
1787 karl           1.16     ;}
1788 karl           1.15     break;
1789                     
1790                       case 7:
1791 ajay.rao       1.21 #line 373 "CQL.y"
1792 kumpf          1.20     {
1793 dave.sudlik    1.17         CQL_globalParserState->currentRule = "binary_value->TOK_BINARY";
1794                             CQL_DEBUG_TRACE2("BISON::binary_value-> %s\n", CQL_lval.strValue);
1795 kumpf          1.20 
1796                             (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Binary);
1797 dave.sudlik    1.17         _ObjPtr._ptr = (yyval._value);
1798                             _ObjPtr.type = Val;
1799                             _ptrs.append(_ObjPtr);
1800 karl           1.16     ;}
1801 karl           1.15     break;
1802                     
1803                       case 8:
1804 ajay.rao       1.21 #line 383 "CQL.y"
1805 kumpf          1.20     {
1806                             CQL_globalParserState->currentRule =
1807 dave.sudlik    1.17             "binary_value->TOK_NEGATIVE_BINARY";
1808                             CQL_DEBUG_TRACE2("BISON::binary_value-> %s\n", CQL_lval.strValue);
1809 kumpf          1.20 
1810                             (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Binary, false);
1811 dave.sudlik    1.17         _ObjPtr._ptr = (yyval._value);
1812                             _ObjPtr.type = Val;
1813                             _ptrs.append(_ObjPtr);
1814 karl           1.16     ;}
1815 karl           1.15     break;
1816                     
1817                       case 9:
1818 ajay.rao       1.21 #line 397 "CQL.y"
1819 kumpf          1.20     {
1820 dave.sudlik    1.17         CQL_globalParserState->currentRule = "hex_value->TOK_HEXADECIMAL";
1821                             CQL_DEBUG_TRACE2("BISON::hex_value-> %s\n", CQL_lval.strValue);
1822 kumpf          1.20 
1823 karl           1.16         (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Hex);
1824                             _ObjPtr._ptr = (yyval._value);
1825                             _ObjPtr.type = Val;
1826                             _ptrs.append(_ObjPtr);
1827                         ;}
1828 karl           1.15     break;
1829                     
1830                       case 10:
1831 ajay.rao       1.21 #line 407 "CQL.y"
1832 kumpf          1.20     {
1833                             CQL_globalParserState->currentRule =
1834 dave.sudlik    1.17             "hex_value->TOK_NEGATIVE_HEXADECIMAL";
1835                             CQL_DEBUG_TRACE2("BISON::hex_value-> %s\n", CQL_lval.strValue);
1836 kumpf          1.20 
1837 karl           1.16         (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Hex, false);
1838                             _ObjPtr._ptr = (yyval._value);
1839                             _ObjPtr.type = Val;
1840                             _ptrs.append(_ObjPtr);
1841                         ;}
1842 karl           1.15     break;
1843                     
1844                       case 11:
1845 ajay.rao       1.21 #line 421 "CQL.y"
1846 kumpf          1.20     {
1847 dave.sudlik    1.17         CQL_globalParserState->currentRule = "decimal_value->TOK_INTEGER";
1848                             CQL_DEBUG_TRACE2("BISON::decimal_value-> %s\n", CQL_lval.strValue);
1849 kumpf          1.20 
1850                             (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Decimal);
1851 karl           1.16         _ObjPtr._ptr = (yyval._value);
1852                             _ObjPtr.type = Val;
1853                             _ptrs.append(_ObjPtr);
1854                         ;}
1855 karl           1.15     break;
1856                     
1857                       case 12:
1858 ajay.rao       1.21 #line 431 "CQL.y"
1859 kumpf          1.20     {
1860                             CQL_globalParserState->currentRule =
1861 dave.sudlik    1.17             "decimal_value->TOK_NEGATIVE_INTEGER";
1862                             CQL_DEBUG_TRACE2("BISON::decimal_value-> %s\n", CQL_lval.strValue);
1863 kumpf          1.20 
1864 karl           1.16         (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Decimal, false);
1865                             _ObjPtr._ptr = (yyval._value);
1866                             _ObjPtr.type = Val;
1867                             _ptrs.append(_ObjPtr);
1868                         ;}
1869 karl           1.15     break;
1870                     
1871                       case 13:
1872 ajay.rao       1.21 #line 445 "CQL.y"
1873 kumpf          1.20     {
1874 dave.sudlik    1.17         CQL_globalParserState->currentRule = "real_value->TOK_REAL";
1875                             CQL_DEBUG_TRACE2("BISON::real_value-> %s\n", CQL_lval.strValue);
1876 kumpf          1.20 
1877 karl           1.16         (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Real);
1878                             _ObjPtr._ptr = (yyval._value);
1879                             _ObjPtr.type = Val;
1880                             _ptrs.append(_ObjPtr);
1881                         ;}
1882 karl           1.15     break;
1883                     
1884                       case 14:
1885 ajay.rao       1.21 #line 455 "CQL.y"
1886 kumpf          1.20     {
1887 dave.sudlik    1.17         CQL_globalParserState->currentRule = "real_value->TOK_NEGATIVE_REAL";
1888                             CQL_DEBUG_TRACE2("BISON::real_value-> %s\n", CQL_lval.strValue);
1889 kumpf          1.20 
1890 karl           1.16         (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Real, false);
1891                             _ObjPtr._ptr = (yyval._value);
1892                             _ObjPtr.type = Val;
1893                             _ptrs.append(_ObjPtr);
1894                         ;}
1895 karl           1.15     break;
1896                     
1897                       case 15:
1898 ajay.rao       1.21 #line 468 "CQL.y"
1899 karl           1.15     {
1900 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->literal_string";
1901                                 CQL_DEBUG_TRACE("BISON::literal->literal_string\n");
1902 karl           1.16             (yyval._value) = new CQLValue(*(yyvsp[(1) - (1)]._string));
1903                                 _ObjPtr._ptr = (yyval._value);
1904                                 _ObjPtr.type = Val;
1905                                 _ptrs.append(_ObjPtr);
1906                             ;}
1907 karl           1.15     break;
1908                     
1909                       case 16:
1910 ajay.rao       1.21 #line 477 "CQL.y"
1911 karl           1.15     {
1912 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->decimal_value";
1913                                 CQL_DEBUG_TRACE("BISON::literal->decimal_value\n");
1914 karl           1.16         ;}
1915 karl           1.15     break;
1916                     
1917                       case 17:
1918 ajay.rao       1.21 #line 482 "CQL.y"
1919 karl           1.15     {
1920 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->binary_value";
1921                                 CQL_DEBUG_TRACE("BISON::literal->binary_value\n");
1922 karl           1.16         ;}
1923 karl           1.15     break;
1924                     
1925                       case 18:
1926 ajay.rao       1.21 #line 487 "CQL.y"
1927 karl           1.15     {
1928 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->hex_value";
1929                                 CQL_DEBUG_TRACE("BISON::literal->hex_value\n");
1930 karl           1.16         ;}
1931 karl           1.15     break;
1932                     
1933                       case 19:
1934 ajay.rao       1.21 #line 492 "CQL.y"
1935 karl           1.15     {
1936 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->real_value";
1937                                 CQL_DEBUG_TRACE("BISON::literal->real_value\n");
1938 karl           1.16         ;}
1939 karl           1.15     break;
1940                     
1941                       case 20:
1942 ajay.rao       1.21 #line 497 "CQL.y"
1943 karl           1.15     {
1944 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->TOK_TRUE";
1945                                 CQL_DEBUG_TRACE("BISON::literal->TOK_TRUE\n");
1946 kumpf          1.20 
1947 karl           1.16             (yyval._value) = new CQLValue(Boolean(true));
1948                                 _ObjPtr._ptr = (yyval._value);
1949                                 _ObjPtr.type = Val;
1950                                 _ptrs.append(_ObjPtr);
1951                             ;}
1952 karl           1.15     break;
1953                     
1954                       case 21:
1955 ajay.rao       1.21 #line 507 "CQL.y"
1956 karl           1.15     {
1957 dave.sudlik    1.17             CQL_globalParserState->currentRule = "literal->TOK_FALSE";
1958                                 CQL_DEBUG_TRACE("BISON::literal->TOK_FALSE\n");
1959 kumpf          1.20 
1960 dave.sudlik    1.17             (yyval._value) = new CQLValue(Boolean(false));
1961                                 _ObjPtr._ptr = (yyval._value);
1962                                 _ObjPtr.type = Val;
1963                                 _ptrs.append(_ObjPtr);
1964 karl           1.16         ;}
1965 karl           1.15     break;
1966                     
1967                       case 22:
1968 ajay.rao       1.21 #line 520 "CQL.y"
1969 karl           1.15     {
1970 dave.sudlik    1.17         CQL_globalParserState->currentRule = "array_index->expr";
1971                             CQL_DEBUG_TRACE("BISON::array_index->expr\n");
1972 kumpf          1.20 
1973 karl           1.16         CQLValue* _val = (CQLValue*)_factory.getObject((yyvsp[(1) - (1)]._predicate),Predicate,Value);
1974                             (yyval._string) = new String(_val->toString());
1975                             _ObjPtr._ptr = (yyval._string);
1976                             _ObjPtr.type = Str;
1977                             _ptrs.append(_ObjPtr);
1978                         ;}
1979 karl           1.15     break;
1980                     
1981                       case 23:
1982 ajay.rao       1.21 #line 534 "CQL.y"
1983 karl           1.15     {
1984 dave.sudlik    1.17         CQL_globalParserState->currentRule = "array_index_list->array_index";
1985                             CQL_DEBUG_TRACE("BISON::array_index_list->array_index\n");
1986 kumpf          1.20 
1987 karl           1.16         (yyval._string) = (yyvsp[(1) - (1)]._string);
1988                         ;}
1989 karl           1.15     break;
1990                     
1991                       case 24:
1992 ajay.rao       1.21 #line 544 "CQL.y"
1993 karl           1.15     {
1994 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain->literal";
1995                             CQL_DEBUG_TRACE("BISON::chain->literal\n");
1996 kumpf          1.20 
1997 karl           1.16         chain_state = CQLVALUE;
1998 kumpf          1.20         (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._value),Predicate);
1999 karl           1.16     ;}
2000 karl           1.15     break;
2001                     
2002                       case 25:
2003 ajay.rao       1.21 #line 553 "CQL.y"
2004 karl           1.15     {
2005 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain-> ( expr )";
2006                             CQL_DEBUG_TRACE("BISON::chain-> ( expr )\n");
2007 karl           1.16 
2008                             chain_state = CQLPREDICATE;
2009                             (yyval._node) = (yyvsp[(2) - (3)]._predicate);
2010                         ;}
2011 karl           1.15     break;
2012                     
2013                       case 26:
2014 ajay.rao       1.21 #line 562 "CQL.y"
2015 karl           1.15     {
2016 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain->identifier";
2017                             CQL_DEBUG_TRACE("BISON::chain->identifier\n");
2018 kumpf          1.20 
2019 karl           1.16         chain_state = CQLIDENTIFIER;
2020                             (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._identifier),Predicate);
2021                         ;}
2022 karl           1.15     break;
2023                     
2024                       case 27:
2025 ajay.rao       1.21 #line 571 "CQL.y"
2026 karl           1.15     {
2027 kumpf          1.20         CQL_globalParserState->currentRule =
2028 dave.sudlik    1.17             "chain->identifier#literal_string";
2029                             CQL_DEBUG_TRACE("BISON::chain->identifier#literal_string\n");
2030 kumpf          1.20 
2031 karl           1.16         String tmp = (yyvsp[(1) - (3)]._identifier)->getName().getString();
2032                             tmp.append("#").append(*(yyvsp[(3) - (3)]._string));
2033                             CQLIdentifier _id(tmp);
2034                             (yyval._node) = _factory.makeObject(&_id,Predicate);
2035                             chain_state = CQLIDENTIFIER;
2036                         ;}
2037 karl           1.15     break;
2038                     
2039                       case 28:
2040 ajay.rao       1.21 #line 584 "CQL.y"
2041 karl           1.15     {
2042 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain->scoped_property";
2043                             CQL_DEBUG_TRACE("BISON::chain->scoped_property\n");
2044 kumpf          1.20 
2045 dave.sudlik    1.17         chain_state = CQLIDENTIFIER;
2046                             (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._identifier),Predicate);
2047 karl           1.16     ;}
2048 karl           1.15     break;
2049                     
2050                       case 29:
2051 ajay.rao       1.21 #line 593 "CQL.y"
2052 karl           1.15     {
2053 dave.sudlik    1.17         CQL_globalParserState->currentRule = "identifier( arg_list )";
2054                             CQL_DEBUG_TRACE("BISON::identifier( arg_list )\n");
2055 kumpf          1.20 
2056 dave.sudlik    1.17         chain_state = CQLFUNCTION;
2057                             CQLFunction _func(*(yyvsp[(1) - (4)]._identifier),_arglist);
2058                             (yyval._node) = (CQLPredicate*)(_factory.makeObject(&_func,Predicate));
2059 venkat.puvvada 1.18         CQL_Arglist_Cleanup();
2060 karl           1.16     ;}
2061 karl           1.15     break;
2062                     
2063                       case 30:
2064 ajay.rao       1.21 #line 604 "CQL.y"
2065 karl           1.15     {
2066 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain->chain.scoped_property";
2067                             CQL_DEBUG_TRACE2(
2068                                 "BISON::chain-> chain TOK_DOT scoped_property : chain_state = %d\n"
2069                                 ,chain_state);
2070 kumpf          1.20 
2071 karl           1.16         CQLIdentifier *_id;
2072                             if(chain_state == CQLIDENTIFIER)
2073                             {
2074 karl           1.15             _id = ((CQLIdentifier*)(_factory.getObject(
2075                                     (yyvsp[(1) - (3)]._node),Predicate,Identifier)));
2076                                 CQLChainedIdentifier _cid(*_id);
2077                                 _cid.append(*(yyvsp[(3) - (3)]._identifier));
2078                                 (yyval._node) = _factory.makeObject(&_cid,Predicate);
2079 karl           1.16         }
2080                             else if(chain_state == CQLCHAINEDIDENTIFIER)
2081                             {
2082 karl           1.15             CQLChainedIdentifier *_cid;
2083                                 _cid = ((CQLChainedIdentifier*)(_factory.getObject(
2084                                     (yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier)));
2085                                 _cid->append(*(yyvsp[(3) - (3)]._identifier));
2086                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (3)]._node)),_cid,ChainedIdentifier);
2087                                 (yyval._node) = (yyvsp[(1) - (3)]._node);
2088 karl           1.16         }
2089                             else  /* error */
2090                             {
2091 karl           1.15             String _msg("chain-> chain TOK_DOT scoped_property :"
2092                                     " chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
2093 karl           1.16 
2094 karl           1.15             throw CQLSyntaxErrorException(
2095 karl           1.16                 MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2096                                         "Chain state not a CQLIdentifier or a"
2097                                             " CQLChainedIdentifier while parsing rule $0 in"
2098                                             " position $1.",
2099                                         "chain.scoped_property",
2100                                         CQL_globalParserState->currentTokenPos));
2101                             }
2102 kumpf          1.20 
2103 karl           1.16     chain_state = CQLCHAINEDIDENTIFIER;
2104                         ;}
2105 karl           1.15     break;
2106                     
2107                       case 31:
2108 ajay.rao       1.21 #line 646 "CQL.y"
2109 karl           1.15     {
2110 dave.sudlik    1.17         CQL_globalParserState->currentRule = "chain->chain.identifier";
2111                             CQL_DEBUG_TRACE2("BISON::chain->chain.identifier : chain_state = %d\n"
2112                                 ,chain_state);
2113 kumpf          1.20 
2114 karl           1.16         if(chain_state == CQLIDENTIFIER)
2115                             {
2116 karl           1.15             CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(
2117 karl           1.16             (yyvsp[(1) - (3)]._node),Predicate,Identifier)));
2118 karl           1.15             CQLChainedIdentifier _cid(*_id);
2119                                 _cid.append(*(yyvsp[(3) - (3)]._identifier));
2120                                 (yyval._node) = _factory.makeObject(&_cid,Predicate);
2121 karl           1.16         }
2122                             else if(chain_state == CQLCHAINEDIDENTIFIER)
2123                             {
2124 kumpf          1.20             CQLChainedIdentifier *_cid =
2125 karl           1.16             ((CQLChainedIdentifier*)(_factory.getObject(
2126                                 (yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier)));
2127 karl           1.15             _cid->append(*(yyvsp[(3) - (3)]._identifier));
2128                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (3)]._node)),_cid,ChainedIdentifier);
2129                                 (yyval._node) = (yyvsp[(1) - (3)]._node);
2130 karl           1.16         }
2131                             else  /* error */
2132                             {
2133 karl           1.15             String _msg("chain-> chain TOK_DOT identifier : chain state not"
2134                                     " CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
2135 karl           1.16 
2136 karl           1.15             throw CQLSyntaxErrorException(
2137 karl           1.16             MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2138                                     "Chain state not a CQLIdentifier or a CQLChainedId"
2139                                         "Identifier while parsing rule $0 in position $1.",
2140                                     "chain.identifier",
2141                                     CQL_globalParserState->currentTokenPos));
2142                             }
2143 karl           1.15         chain_state = CQLCHAINEDIDENTIFIER;
2144 karl           1.16     ;}
2145 karl           1.15     break;
2146                     
2147                       case 32:
2148 ajay.rao       1.21 #line 684 "CQL.y"
2149 karl           1.15     {
2150 kumpf          1.20         CQL_globalParserState->currentRule =
2151 dave.sudlik    1.17             "chain->chain.identifier#literal_string";
2152                             CQL_DEBUG_TRACE2(
2153                                 "BISON::chain->chain.identifier#literal_string : chain_state = %d\n"
2154                                 ,chain_state);
2155 kumpf          1.20 
2156 karl           1.16         if(chain_state == CQLIDENTIFIER)
2157                             {
2158 karl           1.15             CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(
2159 kumpf          1.20                 (yyvsp[(1) - (5)]._node),Predicate,Identifier)));
2160 karl           1.15             CQLChainedIdentifier _cid(*_id);
2161                                 String tmp((yyvsp[(3) - (5)]._identifier)->getName().getString());
2162                                 tmp.append("#").append(*(yyvsp[(5) - (5)]._string));
2163                                 CQLIdentifier _id1(tmp);
2164                                 _cid.append(_id1);
2165                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (5)]._node)),&_cid,ChainedIdentifier);
2166                                 (yyval._node) = (yyvsp[(1) - (5)]._node);
2167 karl           1.16         }
2168                             else if(chain_state == CQLCHAINEDIDENTIFIER)
2169                             {
2170 karl           1.15             CQLChainedIdentifier *_cid =  ((CQLChainedIdentifier*)(
2171                                     _factory.getObject((yyvsp[(1) - (5)]._node),Predicate,ChainedIdentifier)));
2172                                 String tmp((yyvsp[(3) - (5)]._identifier)->getName().getString());
2173                                 tmp.append("#").append(*(yyvsp[(5) - (5)]._string));
2174                                 CQLIdentifier _id1(tmp);
2175                                 _cid->append(_id1);
2176                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (5)]._node)),_cid,ChainedIdentifier);
2177                                 (yyval._node) = (yyvsp[(1) - (5)]._node);
2178 karl           1.16         }
2179                             else  /* error */
2180                             {
2181 karl           1.15             String _msg("chain->chain.identifier#literal_string : chain"
2182                                     " state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
2183 karl           1.16 
2184 karl           1.15             throw CQLSyntaxErrorException(
2185                                 MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2186                                     "Chain state not a CQLIdentifier or a CQLChained"
2187                                         "Identifier while parsing rule $0 in position $1.",
2188                                     "chain.identifier#literal_string",
2189                                     CQL_globalParserState->currentTokenPos) );
2190 karl           1.16             }
2191                             chain_state = CQLCHAINEDIDENTIFIER;
2192                         ;}
2193 karl           1.15     break;
2194                     
2195                       case 33:
2196 ajay.rao       1.21 #line 730 "CQL.y"
2197 karl           1.15     {
2198 kumpf          1.20         CQL_globalParserState->currentRule =
2199 dave.sudlik    1.17             "chain->chain[ array_index_list ]";
2200                             CQL_DEBUG_TRACE2(
2201                                 "BISON::chain->chain[ array_index_list ] : chain_state = %d\n"
2202                                 ,chain_state);
2203 kumpf          1.20 
2204 karl           1.16         if(chain_state == CQLIDENTIFIER)
2205                             {
2206 karl           1.15             CQLIdentifier *_id = ((CQLIdentifier*)
2207                                     (_factory.getObject((yyvsp[(1) - (4)]._node),Predicate,Identifier)));
2208                                 String tmp = _id->getName().getString();
2209                                 tmp.append("[").append(*(yyvsp[(3) - (4)]._string)).append("]");
2210                                 CQLIdentifier _id1(tmp);
2211                                 CQLChainedIdentifier _cid(_id1);
2212                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (4)]._node)),&_cid,ChainedIdentifier);
2213 kumpf          1.20             (yyval._node) = (yyvsp[(1) - (4)]._node);
2214 karl           1.16         }
2215                             else if(chain_state == CQLCHAINEDIDENTIFIER || chain_state == CQLVALUE)
2216                             {
2217 karl           1.15             CQLPredicate* _pred = (CQLPredicate*)(yyvsp[(1) - (4)]._node);
2218                                 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)
2219                                     (_factory.getObject
2220                                     ((yyvsp[(1) - (4)]._node),Predicate,ChainedIdentifier)));
2221                                 CQLIdentifier tmpid = _cid->getLastIdentifier();
2222                                 String tmp = tmpid.getName().getString();
2223                                 tmp.append("[").append(*(yyvsp[(3) - (4)]._string)).append("]");
2224                                 CQLIdentifier _id1(tmp);
2225                                 CQLChainedIdentifier _tmpcid(_id1);
2226 karl           1.16 
2227 karl           1.15             if(_cid->size() == 1)
2228                                 {
2229 karl           1.16                 _cid = &_tmpcid;
2230 karl           1.15             }
2231                                 else
2232                                 {
2233 karl           1.16                 _cid->append(_id1);
2234 karl           1.15             }
2235                                 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (4)]._node)),_cid,ChainedIdentifier);
2236                                 (yyval._node) = (yyvsp[(1) - (4)]._node);
2237 karl           1.16         }
2238                             else  /* error */
2239                             {
2240 karl           1.15             String _msg("chain->chain[ array_index_list ] : chain state not"
2241                                     " CQLIDENTIFIER or CQLCHAINEDIDENTIFIER or CQLVALUE");
2242 karl           1.16 
2243 karl           1.15             throw CQLSyntaxErrorException(
2244                                    MessageLoaderParms(
2245                                       "CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER_OR_VALUE",
2246                                       "Chain state not a CQLIdentifier or a "
2247                                         "CQLChainedIdentifier or a CQLValue while parsing rule"
2248                                             " $0 in position $1.",
2249                                       "chain->chain[ array_index_list ]",
2250                                       CQL_globalParserState->currentTokenPos) );
2251                             }
2252 karl           1.16     ;}
2253 karl           1.15     break;
2254                     
2255                       case 34:
2256 ajay.rao       1.21 #line 789 "CQL.y"
2257 karl           1.15     {
2258 dave.sudlik    1.17         CQL_globalParserState->currentRule = "concat->chain";
2259                             CQL_DEBUG_TRACE("BISON::concat->chain\n");
2260 kumpf          1.20 
2261 karl           1.16         (yyval._predicate) = ((CQLPredicate*)(yyvsp[(1) - (1)]._node));
2262                         ;}
2263 karl           1.15     break;
2264                     
2265                       case 35:
2266 ajay.rao       1.21 #line 797 "CQL.y"
2267 karl           1.15     {
2268 kumpf          1.20         CQL_globalParserState->currentRule =
2269 dave.sudlik    1.17             "concat->concat || literal_string";
2270                             CQL_DEBUG_TRACE("BISON::concat->concat || literal_string\n");
2271 kumpf          1.20 
2272 karl           1.16         CQLValue* tmpval = new CQLValue(*(yyvsp[(3) - (3)]._string));
2273                             _ObjPtr._ptr = tmpval;
2274                             _ObjPtr.type = Val;
2275 kumpf          1.20         _ptrs.append(_ObjPtr);
2276                     
2277 karl           1.16         if((CQLPredicate*)(yyvsp[(1) - (3)]._predicate)->isSimple())
2278                             {
2279                                 CQLSimplePredicate sp = ((CQLPredicate*)(yyvsp[(1) - (3)]._predicate))->getSimplePredicate();
2280                                 if(sp.isSimple())
2281 karl           1.15             {
2282 karl           1.16                 CQLExpression exp = sp.getLeftExpression();
2283                                     if(exp.isSimple())
2284                                     {
2285                                         CQLTerm* _term = ((CQLTerm*)
2286                                             (_factory.getObject((yyvsp[(1) - (3)]._predicate), Predicate, Term)));
2287                                         // check for simple literal values
2288                                         Array<CQLFactor> factors = _term->getFactors();
2289                                         for(Uint32 i = 0; i < factors.size(); i++)
2290                                         {
2291                                             if(!factors[i].isSimpleValue())
2292                                             {
2293                                                 MessageLoaderParms mparms(
2294                                                     "CQL.CQL_y.CONCAT_PRODUCTION_FACTORS_NOT"
2295                                                     "_SIMPLE",
2296                                                     "The CQLFactors are not simple while"
2297                                                     " processing rule $0.",
2298                                                     CQL_globalParserState->currentRule);
2299                                                 throw CQLSyntaxErrorException(mparms);
2300                                             }
2301                                             else /* !factors[i].isSimpleValue() */
2302 karl           1.15                         {
2303 karl           1.16                             CQLValue val = factors[i].getValue();
2304                                                 if(val.getValueType() != CQLValue::String_type)
2305                                                 {
2306                                                     MessageLoaderParms mparms(
2307                                                      "CQL.CQL_y."
2308                                                          "CONCAT_PRODUCTION_VALUE_NOT_LITERAL",
2309                                                      "The CQLValue is not a string literal while"
2310                                                          " processing rule $0.",
2311 karl           1.15                                  CQL_globalParserState->currentRule);
2312 karl           1.16                                 throw CQLSyntaxErrorException(mparms);
2313                                                 }
2314 karl           1.15                         }
2315 karl           1.16                     }  // End For factors.size() Loop
2316                     
2317                                         CQLFactor* _fctr2 = ((CQLFactor*)
2318                                             (_factory.makeObject(tmpval, Factor)));
2319                                         _term->appendOperation(concat,*_fctr2);
2320                                         (yyval._predicate) = (CQLPredicate*)(_factory.makeObject
2321 kumpf          1.20                         (_term,Predicate));
2322 karl           1.16                 }
2323                                     else /* exp.isSimple() */
2324                                     {
2325                                         MessageLoaderParms mparms(
2326 karl           1.15                         "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2327                                             "The $0 is not simple while processing rule $1.",
2328 karl           1.16                         "CQLExpression",
2329 karl           1.15                         CQL_globalParserState->currentRule);
2330 karl           1.16                     throw CQLSyntaxErrorException(mparms);
2331                                     }
2332                                 }
2333                                 else /*sp.isSimple() */
2334                                 {
2335                                      MessageLoaderParms mparms(
2336                                         "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2337                                         "The $0 is not simple while processing rule $1.",
2338                                         "CQLSimplePredicate",
2339                                         CQL_globalParserState->currentRule);
2340                                      throw CQLSyntaxErrorException(mparms);
2341                                 }
2342                             }
2343                             else /* end if((CQLPredicate*)$1->isSimple()) */
2344                             {
2345                                 MessageLoaderParms mparms(
2346                                     "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2347                                     "The $0 is not simple while processing rule $1.",
2348                                     "CQLPredicate",
2349                                     CQL_globalParserState->currentRule);
2350                                 throw CQLSyntaxErrorException(mparms);
2351 karl           1.16         }
2352                         ;}
2353 karl           1.15     break;
2354                     
2355                       case 36:
2356 ajay.rao       1.21 #line 886 "CQL.y"
2357 karl           1.15     {
2358 dave.sudlik    1.17         CQL_globalParserState->currentRule = "factor->concat";
2359                             CQL_DEBUG_TRACE("BISON::factor->concat\n");
2360 kumpf          1.20 
2361 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2362                         ;}
2363 karl           1.15     break;
2364                     
2365                       case 37:
2366 ajay.rao       1.21 #line 917 "CQL.y"
2367 karl           1.15     {
2368 dave.sudlik    1.17         CQL_globalParserState->currentRule = "term->factor";
2369                             CQL_DEBUG_TRACE("BISON::term->factor\n");
2370 kumpf          1.20 
2371 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2372                         ;}
2373 karl           1.15     break;
2374                     
2375                       case 38:
2376 ajay.rao       1.21 #line 946 "CQL.y"
2377 karl           1.15     {
2378 dave.sudlik    1.17         CQL_globalParserState->currentRule = "arith->term";
2379                             CQL_DEBUG_TRACE("BISON::arith->term\n");
2380 kumpf          1.20 
2381 dave.sudlik    1.17         //CQLPredicate* _pred = new CQLPredicate(*$1);
2382                             //      _factory._predicates.append(_pred);
2383                             (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2384                         ;}
2385 karl           1.15     break;
2386                     
2387                       case 39:
2388 ajay.rao       1.21 #line 977 "CQL.y"
2389 karl           1.15     {
2390 dave.sudlik    1.17         CQL_globalParserState->currentRule = "value_symbol->#literal_string";
2391                             CQL_DEBUG_TRACE("BISON::value_symbol->#literal_string\n");
2392 kumpf          1.20 
2393 karl           1.16         String tmp("#");
2394                             tmp.append(*(yyvsp[(2) - (2)]._string));
2395                             CQLIdentifier tmpid(tmp);
2396                             (yyval._value) = new CQLValue(tmpid);
2397                             _ObjPtr._ptr = (yyval._value);
2398                             _ObjPtr.type = Val;
2399                             _ptrs.append(_ObjPtr);
2400                         ;}
2401 karl           1.15     break;
2402                     
2403                       case 40:
2404 ajay.rao       1.21 #line 992 "CQL.y"
2405 karl           1.15     {
2406 dave.sudlik    1.17         CQL_globalParserState->currentRule = "arith_or_value_symbol->arith";
2407                             CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->arith\n");
2408 kumpf          1.20 
2409 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2410                         ;}
2411 karl           1.15     break;
2412                     
2413                       case 41:
2414 ajay.rao       1.21 #line 999 "CQL.y"
2415 karl           1.15     {
2416 karl           1.16         /* make into predicate */
2417 kumpf          1.20         CQL_globalParserState->currentRule =
2418 dave.sudlik    1.17             "arith_or_value_symbol->value_symbol";
2419                             CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->value_symbol\n");
2420 kumpf          1.20 
2421 karl           1.16         CQLFactor _fctr(*(yyvsp[(1) - (1)]._value));
2422                             (yyval._predicate) = (CQLPredicate*)(_factory.makeObject(&_fctr, Predicate));
2423                         ;}
2424 karl           1.15     break;
2425                     
2426                       case 42:
2427 ajay.rao       1.21 #line 1011 "CQL.y"
2428 karl           1.15     {
2429 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_EQ";
2430                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_EQ\n");
2431 kumpf          1.20 
2432 dave.sudlik    1.17         (yyval._opType) = EQ;
2433 karl           1.16     ;}
2434 karl           1.15     break;
2435                     
2436                       case 43:
2437 ajay.rao       1.21 #line 1018 "CQL.y"
2438 karl           1.15     {
2439 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_NE";
2440                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_NE\n");
2441                             (yyval._opType) = NE;
2442 karl           1.16     ;}
2443 karl           1.15     break;
2444                     
2445                       case 44:
2446 ajay.rao       1.21 #line 1024 "CQL.y"
2447 karl           1.15     {
2448 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_GT";
2449                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_GT\n");
2450 kumpf          1.20 
2451 dave.sudlik    1.17         (yyval._opType) = GT;
2452 karl           1.16     ;}
2453 karl           1.15     break;
2454                     
2455                       case 45:
2456 ajay.rao       1.21 #line 1031 "CQL.y"
2457 karl           1.15     {
2458 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_LT";
2459                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_LT\n");
2460                             (yyval._opType) = LT;
2461 karl           1.16     ;}
2462 karl           1.15     break;
2463                     
2464                       case 46:
2465 ajay.rao       1.21 #line 1037 "CQL.y"
2466 karl           1.15     {
2467 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_GE";
2468                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_GE\n");
2469                             (yyval._opType) = GE;
2470 karl           1.16     ;}
2471 karl           1.15     break;
2472                     
2473                       case 47:
2474 ajay.rao       1.21 #line 1043 "CQL.y"
2475 karl           1.15     {
2476 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp_op->TOK_LE";
2477                             CQL_DEBUG_TRACE("BISON::comp_op->TOK_LE\n");
2478                             (yyval._opType) = LE;
2479 karl           1.16     ;}
2480 karl           1.15     break;
2481                     
2482                       case 48:
2483 ajay.rao       1.21 #line 1051 "CQL.y"
2484 karl           1.15     {
2485 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp->arith";
2486                             CQL_DEBUG_TRACE("BISON::comp->arith\n");
2487 kumpf          1.20 
2488 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2489                         ;}
2490 karl           1.15     break;
2491                     
2492                       case 49:
2493 ajay.rao       1.21 #line 1058 "CQL.y"
2494 karl           1.15     {
2495 kumpf          1.20         CQL_globalParserState->currentRule =
2496 dave.sudlik    1.17             "comp->arith TOK_IS TOK_NOT TOK_NULL";
2497                             CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NOT TOK_NULL\n");
2498 kumpf          1.20 
2499 karl           1.16         CQLExpression *_expr =
2500 dave.sudlik    1.17             (CQLExpression*)(_factory.getObject((yyvsp[(1) - (4)]._predicate),Expression));
2501 karl           1.16         CQLSimplePredicate _sp(*_expr, IS_NOT_NULL);
2502                             _factory.setObject((yyvsp[(1) - (4)]._predicate),&_sp,SimplePredicate);
2503                             (yyval._predicate) = (yyvsp[(1) - (4)]._predicate);
2504                         ;}
2505 karl           1.15     break;
2506                     
2507                       case 50:
2508 ajay.rao       1.21 #line 1070 "CQL.y"
2509 karl           1.15     {
2510 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp->arith TOK_IS TOK_NULL";
2511                             CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NULL\n");
2512 kumpf          1.20 
2513 karl           1.16         CQLExpression *_expr =
2514 dave.sudlik    1.17             (CQLExpression*)(_factory.getObject((yyvsp[(1) - (3)]._predicate),Expression));
2515 karl           1.16         CQLSimplePredicate _sp(*_expr, IS_NULL);
2516                             _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2517                             (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2518                         ;}
2519 karl           1.15     break;
2520                     
2521                       case 51:
2522 ajay.rao       1.21 #line 1081 "CQL.y"
2523 karl           1.15     {
2524 kumpf          1.20         CQL_globalParserState->currentRule =
2525 dave.sudlik    1.17             "comp->arith comp_op arith_or_value_symbol";
2526                             CQL_DEBUG_TRACE("BISON::comp->arith comp_op arith_or_value_symbol\n");
2527 kumpf          1.20 
2528 karl           1.16         if((yyvsp[(1) - (3)]._predicate)->isSimple() && (yyvsp[(3) - (3)]._predicate)->isSimple())
2529                             {
2530 karl           1.15             CQLExpression* _exp1 = (CQLExpression*)
2531 karl           1.16             (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
2532 karl           1.15             CQLExpression* _exp2 = (CQLExpression*)
2533 karl           1.16             (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
2534 karl           1.15             CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2535                                 (yyval._predicate) = new CQLPredicate(_sp);
2536                                 _ObjPtr._ptr = (yyval._predicate);
2537 humberto       1.8              _ObjPtr.type = Pred;
2538                                 _ptrs.append(_ObjPtr);
2539 karl           1.16         }
2540                             else  /* error */
2541                             {
2542                                String _msg("comp->arith comp_op arith_or_value_symbol : $1 is "
2543                                    "not simple OR $3 is not simple");
2544                                throw CQLSyntaxErrorException(
2545                                    MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2546                                        "The CQLSimplePredicate is not simple while parsing "
2547                                        "rule $0 in position $1.",
2548                                            "comp->arith comp_op arith_or_value_symbol",
2549                                        CQL_globalParserState->currentTokenPos) );
2550                             }
2551                         ;}
2552 karl           1.15     break;
2553                     
2554                       case 52:
2555 ajay.rao       1.21 #line 1111 "CQL.y"
2556 karl           1.15     {
2557 kumpf          1.20         CQL_globalParserState->currentRule =
2558 dave.sudlik    1.17             "comp->value_symbol comp_op arith";
2559                             CQL_DEBUG_TRACE("BISON::comp->value_symbol comp_op arith\n");
2560 kumpf          1.20 
2561 karl           1.16         if((yyvsp[(3) - (3)]._predicate)->isSimple())
2562                             {
2563 karl           1.15             CQLExpression* _exp1 = (CQLExpression*)
2564                                     (_factory.makeObject((yyvsp[(1) - (3)]._value), Expression));
2565                                 CQLExpression* _exp2 = (CQLExpression*)
2566                                     (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
2567                                 CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2568                                 (yyval._predicate) = new CQLPredicate(_sp);
2569                                 _ObjPtr._ptr = (yyval._predicate);
2570 humberto       1.8              _ObjPtr.type = Pred;
2571                                 _ptrs.append(_ObjPtr);
2572 karl           1.16         }
2573                             else  /* error */
2574                             {
2575 karl           1.15             String _msg("comp->value_symbol comp_op arith : $3 is not simple");
2576                                 throw CQLSyntaxErrorException(
2577 karl           1.16                 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2578                                         "The CQLSimplePredicate is not simple while parsing"
2579                                             " rule $0 in position $1.",
2580                                         "comp->value_symbol comp_op arith",
2581                                     CQL_globalParserState->currentTokenPos) );
2582 kumpf          1.20 
2583 karl           1.16         }
2584                         ;}
2585 karl           1.15     break;
2586                     
2587                       case 53:
2588 ajay.rao       1.21 #line 1141 "CQL.y"
2589 karl           1.15     {
2590 kumpf          1.20         /* make sure $1 isSimple(), get its expression, make
2591                                simplepred->predicate
2592 karl           1.16         */
2593 dave.sudlik    1.17         CQL_globalParserState->currentRule = "comp->arith _TOK_ISA identifier";
2594                             CQL_DEBUG_TRACE("BISON::comp->arith _TOK_ISA identifier\n");
2595 kumpf          1.20 
2596 karl           1.16         CQLExpression *_expr1 = (CQLExpression*)
2597                             (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
2598                             CQLChainedIdentifier _cid(*(yyvsp[(3) - (3)]._identifier));
2599                             CQLExpression *_expr2 = (CQLExpression*)
2600                             (_factory.makeObject(&_cid,Expression));
2601                             CQLSimplePredicate _sp(*_expr1, *_expr2, ISA);
2602                             _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2603                             (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2604                         ;}
2605 karl           1.15     break;
2606                     
2607                       case 54:
2608 ajay.rao       1.21 #line 1158 "CQL.y"
2609 karl           1.15     {
2610 kumpf          1.20         CQL_globalParserState->currentRule =
2611 dave.sudlik    1.17             "comp->arith TOK_LIKE literal_string";
2612                             CQL_DEBUG_TRACE("BISON::comp->arith TOK_LIKE literal_string\n");
2613 kumpf          1.20 
2614 dave.sudlik    1.17         CQLExpression *_expr1 = (CQLExpression*)
2615 karl           1.15             (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
2616 dave.sudlik    1.17         CQLValue _val(*(yyvsp[(3) - (3)]._string));
2617                             CQLExpression *_expr2 = (CQLExpression*)
2618 karl           1.15             (_factory.makeObject(&_val,Expression));
2619 dave.sudlik    1.17         CQLSimplePredicate _sp(*_expr1, *_expr2, LIKE);
2620                             _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2621                             (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2622 karl           1.16     ;}
2623 karl           1.15     break;
2624                     
2625                       case 55:
2626 ajay.rao       1.21 #line 1174 "CQL.y"
2627 karl           1.15     {
2628 dave.sudlik    1.17         CQL_globalParserState->currentRule = "expr_factor->comp";
2629                             CQL_DEBUG_TRACE("BISON::expr_factor->comp\n");
2630 kumpf          1.20 
2631 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2632                         ;}
2633 karl           1.15     break;
2634                     
2635                       case 56:
2636 ajay.rao       1.21 #line 1181 "CQL.y"
2637 karl           1.15     {
2638 dave.sudlik    1.17         CQL_globalParserState->currentRule = "expr_factor->TOK_NOT comp";
2639                             CQL_DEBUG_TRACE("BISON::expr_factor->TOK_NOT comp\n");
2640 kumpf          1.20 
2641 karl           1.16         (yyvsp[(2) - (2)]._predicate)->setInverted(!((yyvsp[(2) - (2)]._predicate)->getInverted()));
2642                             (yyval._predicate) = (yyvsp[(2) - (2)]._predicate);
2643                         ;}
2644 karl           1.15     break;
2645                     
2646                       case 57:
2647 ajay.rao       1.21 #line 1191 "CQL.y"
2648 karl           1.15     {
2649 dave.sudlik    1.17         CQL_globalParserState->currentRule = "expr_term->expr_factor";
2650                             CQL_DEBUG_TRACE("BISON::expr_term->expr_factor\n");
2651 kumpf          1.20 
2652 karl           1.16         (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2653                         ;}
2654 karl           1.15     break;
2655                     
2656                       case 58:
2657 ajay.rao       1.21 #line 1198 "CQL.y"
2658 karl           1.15     {
2659 kumpf          1.20         CQL_globalParserState->currentRule =
2660 dave.sudlik    1.17             "expr_term->expr_term AND expr_factor";
2661                             CQL_DEBUG_TRACE("BISON::expr_term->expr_term AND expr_factor\n");
2662 kumpf          1.20 
2663 karl           1.16         (yyval._predicate) = new CQLPredicate();
2664                             (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
2665 kumpf          1.20         (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), AND);
2666 karl           1.16          _ObjPtr._ptr = (yyval._predicate);
2667                             _ObjPtr.type = Pred;
2668                             _ptrs.append(_ObjPtr);
2669                         ;}
2670 karl           1.15     break;
2671                     
2672                       case 59:
2673 ajay.rao       1.21 #line 1213 "CQL.y"
2674 karl           1.15     {
2675 dave.sudlik    1.17         CQL_globalParserState->currentRule = "expr->expr_term";
2676                             CQL_DEBUG_TRACE("BISON::expr->expr_term\n");
2677 kumpf          1.20 
2678                             (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2679 karl           1.16         ;}
2680 karl           1.15     break;
2681                     
2682                       case 60:
2683 ajay.rao       1.21 #line 1220 "CQL.y"
2684 karl           1.15     {
2685 dave.sudlik    1.17         CQL_globalParserState->currentRule = "expr->expr OR expr_term";
2686                             CQL_DEBUG_TRACE("BISON::expr->expr OR expr_term\n");
2687 kumpf          1.20 
2688 karl           1.16         (yyval._predicate) = new CQLPredicate();
2689                             (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
2690                             (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), OR);
2691                             _ObjPtr._ptr = (yyval._predicate);
2692                             _ObjPtr.type = Pred;
2693                             _ptrs.append(_ObjPtr);
2694                         ;}
2695 karl           1.15     break;
2696                     
2697                       case 61:
2698 ajay.rao       1.21 #line 1233 "CQL.y"
2699 karl           1.15     {;;}
2700                         break;
2701                     
2702                       case 62:
2703 ajay.rao       1.21 #line 1253 "CQL.y"
2704 karl           1.15     {
2705 dave.sudlik    1.17         CQL_globalParserState->currentRule = "arg_list->arg_list_sub->expr";
2706                             CQL_DEBUG_TRACE("BISON::arg_list->arg_list_sub->expr\n");
2707 kumpf          1.20 
2708 karl           1.16         _arglist.append(*(yyvsp[(1) - (1)]._predicate));
2709                             /*
2710                             since arg_list can loop back on itself,
2711                             we need to store away previous solutions
2712                             production.  We keep track of previous productions
2713                             in the _arglist array and later pass that to CQLFunction
2714                             as part of chain: identifier TOK_LPAR arg_list TOK_RPAR
2715                             */
2716                         ;}
2717 karl           1.15     break;
2718 chuck          1.2  
2719 karl           1.15   case 63:
2720 ajay.rao       1.21 #line 1312 "CQL.y"
2721 karl           1.15     {
2722 dave.sudlik    1.17         CQL_globalParserState->currentRule = "from_specifier->class_path";
2723                             CQL_DEBUG_TRACE("BISON::from_specifier->class_path\n");
2724 kumpf          1.20 
2725 karl           1.16         CQL_globalParserState->statement->appendClassPath(*(yyvsp[(1) - (1)]._identifier));
2726                         ;}
2727 karl           1.15     break;
2728 chuck          1.2  
2729 karl           1.15   case 64:
2730 ajay.rao       1.21 #line 1319 "CQL.y"
2731 karl           1.15     {
2732 kumpf          1.20         CQL_globalParserState->currentRule =
2733 dave.sudlik    1.17             "from_specifier->class_path TOK_AS identifier";
2734                             CQL_DEBUG_TRACE(
2735                                 "BISON::from_specifier->class_path TOK_AS identifier\n");
2736 kumpf          1.20 
2737 karl           1.16         CQLIdentifier _class(*(yyvsp[(1) - (3)]._identifier));
2738                             String _alias((yyvsp[(3) - (3)]._identifier)->getName().getString());
2739                             CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2740                             CQL_globalParserState->statement->appendClassPath(_class);
2741                         ;}
2742 karl           1.15     break;
2743                     
2744                       case 65:
2745 ajay.rao       1.21 #line 1331 "CQL.y"
2746 karl           1.15     {
2747 kumpf          1.20         CQL_globalParserState->currentRule =
2748 dave.sudlik    1.17             "from_specifier->class_path identifier";
2749                             CQL_DEBUG_TRACE("BISON::from_specifier->class_path identifier\n");
2750 kumpf          1.20 
2751 karl           1.16         CQLIdentifier _class(*(yyvsp[(1) - (2)]._identifier));
2752                             String _alias((yyvsp[(2) - (2)]._identifier)->getName().getString());
2753                             CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2754                             CQL_globalParserState->statement->appendClassPath(_class);
2755                         ;}
2756 karl           1.15     break;
2757                     
2758                       case 66:
2759 ajay.rao       1.21 #line 1344 "CQL.y"
2760 karl           1.15     {
2761 dave.sudlik    1.17         CQL_globalParserState->currentRule = "from_criteria->from_specifier";
2762                             CQL_DEBUG_TRACE("BISON::from_criteria->from_specifier\n");
2763 karl           1.16     ;}
2764 karl           1.15     break;
2765                     
2766                       case 67:
2767 ajay.rao       1.21 #line 1351 "CQL.y"
2768 karl           1.15     {
2769 dave.sudlik    1.17         CQL_globalParserState->currentRule = "star_expr->TOK_STAR";
2770                             CQL_DEBUG_TRACE("BISON::star_expr->TOK_STAR\n");
2771 kumpf          1.20 
2772 karl           1.15         CQLIdentifier _id("*");
2773 karl           1.16         (yyval._chainedIdentifier) = (CQLChainedIdentifier*)
2774                                  (_factory.makeObject(&_id,ChainedIdentifier));
2775                         ;}
2776 karl           1.15     break;
2777                     
2778                       case 68:
2779 ajay.rao       1.21 #line 1360 "CQL.y"
2780 karl           1.15     {
2781 dave.sudlik    1.17         CQL_globalParserState->currentRule = "star_expr->chain.*";
2782                             CQL_DEBUG_TRACE("BISON::star_expr->chain.*\n");
2783 kumpf          1.20 
2784 karl           1.16         CQLChainedIdentifier* _tmp = (CQLChainedIdentifier*)
2785                             (_factory.getObject((yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier));
2786                             CQLChainedIdentifier* _cid = new CQLChainedIdentifier(*_tmp);
2787                             CQLIdentifier _id("*");
2788                             _cid->append(_id);
2789                             (yyval._chainedIdentifier) = _cid;
2790                             _ObjPtr._ptr = (yyval._chainedIdentifier);
2791                             _ObjPtr.type = CId;
2792                             _ptrs.append(_ObjPtr);
2793                         ;}
2794 karl           1.15     break;
2795                     
2796                       case 69:
2797 ajay.rao       1.21 #line 1377 "CQL.y"
2798 karl           1.15     {
2799 dave.sudlik    1.17         CQL_globalParserState->currentRule = "selected_entry->expr";
2800                             CQL_DEBUG_TRACE("BISON::selected_entry->expr\n");
2801 kumpf          1.20 
2802 karl           1.16         if((yyvsp[(1) - (1)]._predicate)->isSimpleValue())
2803                             {
2804 karl           1.15             CQLChainedIdentifier *_cid = (CQLChainedIdentifier*)
2805                                     (_factory.getObject((yyvsp[(1) - (1)]._predicate),Predicate,ChainedIdentifier));
2806                                 CQL_globalParserState->statement->appendSelectIdentifier(*_cid);
2807 karl           1.16         }
2808                             else  /* errot*/
2809                             {
2810 karl           1.15             String _msg("selected_entry->expr : $1 is not a simple value");
2811                                 throw CQLSyntaxErrorException(
2812                                    MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE_VALUE",
2813                                       "The CQLPredicate is not a simple value while "
2814                                           "parsing rule $0 in position $1.",
2815                                       "selected_entry->expr",
2816 kumpf          1.20                   CQL_globalParserState->currentTokenPos) );
2817 karl           1.16         }
2818                         ;}
2819 karl           1.15     break;
2820                     
2821                       case 70:
2822 ajay.rao       1.21 #line 1399 "CQL.y"
2823 karl           1.15     {
2824 dave.sudlik    1.17         CQL_globalParserState->currentRule = "selected_entry->star_expr";
2825                             CQL_DEBUG_TRACE("BISON::selected_entry->star_expr\n");
2826 kumpf          1.20 
2827 karl           1.16         CQL_globalParserState->statement->appendSelectIdentifier(*(yyvsp[(1) - (1)]._chainedIdentifier));
2828                         ;}
2829 karl           1.15     break;
2830                     
2831                       case 71:
2832 ajay.rao       1.21 #line 1408 "CQL.y"
2833 karl           1.15     {
2834 kumpf          1.20         CQL_globalParserState->currentRule =
2835 dave.sudlik    1.17             "select_list->selected_entry select_list_tail";
2836                             CQL_DEBUG_TRACE(
2837                                 "BISON::select_list->selected_entry select_list_tail\n");
2838 karl           1.16     ;}
2839 karl           1.15     break;
2840                     
2841                       case 72:
2842 ajay.rao       1.21 #line 1416 "CQL.y"
2843 karl           1.15     {;;}
2844                         break;
2845                     
2846                       case 73:
2847 ajay.rao       1.21 #line 1419 "CQL.y"
2848 karl           1.15     {
2849 kumpf          1.20         CQL_globalParserState->currentRule =
2850 dave.sudlik    1.17             "select_list_tail->TOK_COMMA selected_entry select_list_tail";
2851                             CQL_DEBUG_TRACE(
2852                                "BISON::select_list_tail->TOK_COMMA"
2853                                " selected_entry select_list_tail\n");
2854 karl           1.16     ;}
2855 karl           1.15     break;
2856                     
2857                       case 74:
2858 ajay.rao       1.21 #line 1429 "CQL.y"
2859 karl           1.15     {
2860 dave.sudlik    1.17         CQL_globalParserState->currentRule = "search_condition->expr";
2861                             CQL_DEBUG_TRACE("BISON::search_condition->expr\n");
2862 kumpf          1.20 
2863 karl           1.16         CQL_globalParserState->statement->setPredicate(*(yyvsp[(1) - (1)]._predicate));
2864                         ;}
2865 karl           1.15     break;
2866                     
2867                       case 75:
2868 ajay.rao       1.21 #line 1437 "CQL.y"
2869 karl           1.15     {;}
2870                         break;
2871                     
2872                       case 76:
2873 ajay.rao       1.21 #line 1440 "CQL.y"
2874 karl           1.15     {
2875 kumpf          1.20         CQL_globalParserState->currentRule =
2876 dave.sudlik    1.17             "optional_where->TOK_WHERE search_condition";
2877                             CQL_DEBUG_TRACE(
2878                                 "BISON::optional_where->TOK_WHERE search_condition\n");
2879 kumpf          1.20 
2880 karl           1.16         CQL_globalParserState->statement->setHasWhereClause();
2881                         ;}
2882 karl           1.15     break;
2883                     
2884                       case 77:
2885 ajay.rao       1.21 #line 1451 "CQL.y"
2886 karl           1.15     {
2887 dave.sudlik    1.17         CQL_globalParserState->currentRule = "select_statement";
2888                             CQL_DEBUG_TRACE("select_statement\n");
2889 kumpf          1.20 
2890 karl           1.16         CQL_Bison_Cleanup();
2891                         ;}
2892 karl           1.15     break;
2893                     
2894                     
2895                     /* Line 1267 of yacc.c.  */
2896 ajay.rao       1.21 #line 2894 "CQLtemp"
2897 karl           1.15       default: break;
2898                         }
2899                       YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2900                     
2901                       YYPOPSTACK (yylen);
2902                       yylen = 0;
2903                       YY_STACK_PRINT (yyss, yyssp);
2904                     
2905                       *++yyvsp = yyval;
2906                     
2907                     
2908                       /* Now `shift' the result of the reduction.  Determine what state
2909                          that goes to, based on the state we popped back to and the rule
2910                          number reduced by.  */
2911                     
2912                       yyn = yyr1[yyn];
2913                     
2914                       yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2915                       if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2916                         yystate = yytable[yystate];
2917                       else
2918 karl           1.15     yystate = yydefgoto[yyn - YYNTOKENS];
2919                     
2920                       goto yynewstate;
2921                     
2922                     
2923                     /*------------------------------------.
2924                     | yyerrlab -- here on detecting error |
2925                     `------------------------------------*/
2926                     yyerrlab:
2927                       /* If not already recovering from an error, report this error.  */
2928                       if (!yyerrstatus)
2929                         {
2930                           ++yynerrs;
2931                     #if ! YYERROR_VERBOSE
2932                           yyerror (YY_("syntax error"));
2933                     #else
2934                           {
2935 karl           1.16 	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2936                     	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2937                     	  {
2938                     	    YYSIZE_T yyalloc = 2 * yysize;
2939                     	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2940                     	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
2941                     	    if (yymsg != yymsgbuf)
2942                     	      YYSTACK_FREE (yymsg);
2943                     	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2944                     	    if (yymsg)
2945                     	      yymsg_alloc = yyalloc;
2946                     	    else
2947                     	      {
2948                     		yymsg = yymsgbuf;
2949                     		yymsg_alloc = sizeof yymsgbuf;
2950                     	      }
2951                     	  }
2952                     
2953                     	if (0 < yysize && yysize <= yymsg_alloc)
2954                     	  {
2955                     	    (void) yysyntax_error (yymsg, yystate, yychar);
2956 karl           1.16 	    yyerror (yymsg);
2957                     	  }
2958                     	else
2959                     	  {
2960                     	    yyerror (YY_("syntax error"));
2961                     	    if (yysize != 0)
2962                     	      goto yyexhaustedlab;
2963                     	  }
2964 karl           1.15       }
2965                     #endif
2966                         }
2967                     
2968                     
2969                     
2970                       if (yyerrstatus == 3)
2971                         {
2972                           /* If just tried and failed to reuse look-ahead token after an
2973 karl           1.16 	 error, discard it.  */
2974 karl           1.15 
2975                           if (yychar <= YYEOF)
2976 karl           1.16 	{
2977                     	  /* Return failure if at end of input.  */
2978                     	  if (yychar == YYEOF)
2979                     	    YYABORT;
2980                     	}
2981 karl           1.15       else
2982 karl           1.16 	{
2983                     	  yydestruct ("Error: discarding",
2984                     		      yytoken, &yylval);
2985                     	  yychar = YYEMPTY;
2986                     	}
2987 chuck          1.2      }
2988 karl           1.15 
2989                       /* Else will try to reuse look-ahead token after shifting the error
2990                          token.  */
2991                       goto yyerrlab1;
2992                     
2993                     
2994                     /*---------------------------------------------------.
2995                     | yyerrorlab -- error raised explicitly by YYERROR.  |
2996                     `---------------------------------------------------*/
2997                     yyerrorlab:
2998                     
2999                       /* Pacify compilers like GCC when the user code never invokes
3000                          YYERROR and the label yyerrorlab therefore never appears in user
3001                          code.  */
3002                       if (/*CONSTCOND*/ 0)
3003                          goto yyerrorlab;
3004                     
3005                       /* Do not reclaim the symbols of the rule which action triggered
3006                          this YYERROR.  */
3007                       YYPOPSTACK (yylen);
3008                       yylen = 0;
3009 karl           1.15   YY_STACK_PRINT (yyss, yyssp);
3010                       yystate = *yyssp;
3011                       goto yyerrlab1;
3012                     
3013                     
3014                     /*-------------------------------------------------------------.
3015                     | yyerrlab1 -- common code for both syntax error and YYERROR.  |
3016                     `-------------------------------------------------------------*/
3017                     yyerrlab1:
3018 karl           1.16   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
3019 karl           1.15 
3020                       for (;;)
3021 chuck          1.2      {
3022 karl           1.15       yyn = yypact[yystate];
3023                           if (yyn != YYPACT_NINF)
3024 karl           1.16 	{
3025                     	  yyn += YYTERROR;
3026                     	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3027                     	    {
3028                     	      yyn = yytable[yyn];
3029                     	      if (0 < yyn)
3030                     		break;
3031                     	    }
3032                     	}
3033 karl           1.15 
3034                           /* Pop the current state because it cannot handle the error token.  */
3035                           if (yyssp == yyss)
3036 karl           1.16 	YYABORT;
3037 karl           1.15 
3038                     
3039                           yydestruct ("Error: popping",
3040 karl           1.16 		  yystos[yystate], yyvsp);
3041 karl           1.15       YYPOPSTACK (1);
3042                           yystate = *yyssp;
3043                           YY_STACK_PRINT (yyss, yyssp);
3044                         }
3045                     
3046                       if (yyn == YYFINAL)
3047                         YYACCEPT;
3048                     
3049                       *++yyvsp = yylval;
3050                     
3051                     
3052                       /* Shift the error token.  */
3053                       YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3054                     
3055                       yystate = yyn;
3056                       goto yynewstate;
3057                     
3058                     
3059                     /*-------------------------------------.
3060                     | yyacceptlab -- YYACCEPT comes here.  |
3061                     `-------------------------------------*/
3062 karl           1.15 yyacceptlab:
3063                       yyresult = 0;
3064                       goto yyreturn;
3065                     
3066                     /*-----------------------------------.
3067                     | yyabortlab -- YYABORT comes here.  |
3068                     `-----------------------------------*/
3069                     yyabortlab:
3070                       yyresult = 1;
3071                       goto yyreturn;
3072                     
3073                     #ifndef yyoverflow
3074                     /*-------------------------------------------------.
3075                     | yyexhaustedlab -- memory exhaustion comes here.  |
3076                     `-------------------------------------------------*/
3077                     yyexhaustedlab:
3078                       yyerror (YY_("memory exhausted"));
3079                       yyresult = 2;
3080                       /* Fall through.  */
3081 chuck          1.2  #endif
3082 karl           1.15 
3083                     yyreturn:
3084                       if (yychar != YYEOF && yychar != YYEMPTY)
3085                          yydestruct ("Cleanup: discarding lookahead",
3086 karl           1.16 		 yytoken, &yylval);
3087 karl           1.15   /* Do not reclaim the symbols of the rule which action triggered
3088                          this YYABORT or YYACCEPT.  */
3089                       YYPOPSTACK (yylen);
3090                       YY_STACK_PRINT (yyss, yyssp);
3091                       while (yyssp != yyss)
3092 chuck          1.2      {
3093 karl           1.15       yydestruct ("Cleanup: popping",
3094 karl           1.16 		  yystos[*yyssp], yyvsp);
3095 karl           1.15       YYPOPSTACK (1);
3096 chuck          1.2      }
3097 karl           1.15 #ifndef yyoverflow
3098                       if (yyss != yyssa)
3099                         YYSTACK_FREE (yyss);
3100                     #endif
3101                     #if YYERROR_VERBOSE
3102                       if (yymsg != yymsgbuf)
3103                         YYSTACK_FREE (yymsg);
3104                     #endif
3105                       /* Make sure YYID is used.  */
3106                       return YYID (yyresult);
3107 chuck          1.2  }
3108 karl           1.15 
3109                     
3110 ajay.rao       1.21 #line 1460 "CQL.y"
3111 karl           1.15 
3112 karl           1.16 /*int yyerror(char * err){yyclearin; yyerrok;throw Exception(String(err));
3113                     return 1;}*/
3114 karl           1.15 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2