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 dl.meetei 1.22 603, 645, 683, 729, 787, 795, 884, 915, 944, 975,
675 990, 997, 1009, 1016, 1022, 1029, 1035, 1041, 1049, 1056,
676 1068, 1079, 1109, 1139, 1156, 1172, 1179, 1189, 1196, 1211,
677 1218, 1232, 1251, 1310, 1317, 1329, 1342, 1349, 1358, 1375,
678 1397, 1406, 1415, 1417, 1427, 1436, 1438, 1449
|
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 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)
2218 (_factory.getObject
2219 ((yyvsp[(1) - (4)]._node),Predicate,ChainedIdentifier)));
2220 CQLIdentifier tmpid = _cid->getLastIdentifier();
2221 String tmp = tmpid.getName().getString();
2222 tmp.append("[").append(*(yyvsp[(3) - (4)]._string)).append("]");
2223 CQLIdentifier _id1(tmp);
2224 CQLChainedIdentifier _tmpcid(_id1);
|
2225 karl 1.16
|
2226 karl 1.15 if(_cid->size() == 1)
2227 {
|
2228 karl 1.16 _cid = &_tmpcid;
|
2229 karl 1.15 }
2230 else
2231 {
|
2232 karl 1.16 _cid->append(_id1);
|
2233 karl 1.15 }
2234 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (4)]._node)),_cid,ChainedIdentifier);
2235 (yyval._node) = (yyvsp[(1) - (4)]._node);
|
2236 karl 1.16 }
2237 else /* error */
2238 {
|
2239 karl 1.15 String _msg("chain->chain[ array_index_list ] : chain state not"
2240 " CQLIDENTIFIER or CQLCHAINEDIDENTIFIER or CQLVALUE");
|
2241 karl 1.16
|
2242 karl 1.15 throw CQLSyntaxErrorException(
2243 MessageLoaderParms(
2244 "CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER_OR_VALUE",
2245 "Chain state not a CQLIdentifier or a "
2246 "CQLChainedIdentifier or a CQLValue while parsing rule"
2247 " $0 in position $1.",
2248 "chain->chain[ array_index_list ]",
2249 CQL_globalParserState->currentTokenPos) );
2250 }
|
2251 karl 1.16 ;}
|
2252 karl 1.15 break;
2253
2254 case 34:
|
2255 dl.meetei 1.22 #line 788 "CQL.y"
|
2256 karl 1.15 {
|
2257 dave.sudlik 1.17 CQL_globalParserState->currentRule = "concat->chain";
2258 CQL_DEBUG_TRACE("BISON::concat->chain\n");
|
2259 kumpf 1.20
|
2260 karl 1.16 (yyval._predicate) = ((CQLPredicate*)(yyvsp[(1) - (1)]._node));
2261 ;}
|
2262 karl 1.15 break;
2263
2264 case 35:
|
2265 dl.meetei 1.22 #line 796 "CQL.y"
|
2266 karl 1.15 {
|
2267 kumpf 1.20 CQL_globalParserState->currentRule =
|
2268 dave.sudlik 1.17 "concat->concat || literal_string";
2269 CQL_DEBUG_TRACE("BISON::concat->concat || literal_string\n");
|
2270 kumpf 1.20
|
2271 karl 1.16 CQLValue* tmpval = new CQLValue(*(yyvsp[(3) - (3)]._string));
2272 _ObjPtr._ptr = tmpval;
2273 _ObjPtr.type = Val;
|
2274 kumpf 1.20 _ptrs.append(_ObjPtr);
2275
|
2276 karl 1.16 if((CQLPredicate*)(yyvsp[(1) - (3)]._predicate)->isSimple())
2277 {
2278 CQLSimplePredicate sp = ((CQLPredicate*)(yyvsp[(1) - (3)]._predicate))->getSimplePredicate();
2279 if(sp.isSimple())
|
2280 karl 1.15 {
|
2281 karl 1.16 CQLExpression exp = sp.getLeftExpression();
2282 if(exp.isSimple())
2283 {
2284 CQLTerm* _term = ((CQLTerm*)
2285 (_factory.getObject((yyvsp[(1) - (3)]._predicate), Predicate, Term)));
2286 // check for simple literal values
2287 Array<CQLFactor> factors = _term->getFactors();
2288 for(Uint32 i = 0; i < factors.size(); i++)
2289 {
2290 if(!factors[i].isSimpleValue())
2291 {
2292 MessageLoaderParms mparms(
2293 "CQL.CQL_y.CONCAT_PRODUCTION_FACTORS_NOT"
2294 "_SIMPLE",
2295 "The CQLFactors are not simple while"
2296 " processing rule $0.",
2297 CQL_globalParserState->currentRule);
2298 throw CQLSyntaxErrorException(mparms);
2299 }
2300 else /* !factors[i].isSimpleValue() */
|
2301 karl 1.15 {
|
2302 karl 1.16 CQLValue val = factors[i].getValue();
2303 if(val.getValueType() != CQLValue::String_type)
2304 {
2305 MessageLoaderParms mparms(
2306 "CQL.CQL_y."
2307 "CONCAT_PRODUCTION_VALUE_NOT_LITERAL",
2308 "The CQLValue is not a string literal while"
2309 " processing rule $0.",
|
2310 karl 1.15 CQL_globalParserState->currentRule);
|
2311 karl 1.16 throw CQLSyntaxErrorException(mparms);
2312 }
|
2313 karl 1.15 }
|
2314 karl 1.16 } // End For factors.size() Loop
2315
2316 CQLFactor* _fctr2 = ((CQLFactor*)
2317 (_factory.makeObject(tmpval, Factor)));
2318 _term->appendOperation(concat,*_fctr2);
2319 (yyval._predicate) = (CQLPredicate*)(_factory.makeObject
|
2320 kumpf 1.20 (_term,Predicate));
|
2321 karl 1.16 }
2322 else /* exp.isSimple() */
2323 {
2324 MessageLoaderParms mparms(
|
2325 karl 1.15 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2326 "The $0 is not simple while processing rule $1.",
|
2327 karl 1.16 "CQLExpression",
|
2328 karl 1.15 CQL_globalParserState->currentRule);
|
2329 karl 1.16 throw CQLSyntaxErrorException(mparms);
2330 }
2331 }
2332 else /*sp.isSimple() */
2333 {
2334 MessageLoaderParms mparms(
2335 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2336 "The $0 is not simple while processing rule $1.",
2337 "CQLSimplePredicate",
2338 CQL_globalParserState->currentRule);
2339 throw CQLSyntaxErrorException(mparms);
2340 }
2341 }
2342 else /* end if((CQLPredicate*)$1->isSimple()) */
2343 {
2344 MessageLoaderParms mparms(
2345 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2346 "The $0 is not simple while processing rule $1.",
2347 "CQLPredicate",
2348 CQL_globalParserState->currentRule);
2349 throw CQLSyntaxErrorException(mparms);
2350 karl 1.16 }
2351 ;}
|
2352 karl 1.15 break;
2353
2354 case 36:
|
2355 dl.meetei 1.22 #line 885 "CQL.y"
|
2356 karl 1.15 {
|
2357 dave.sudlik 1.17 CQL_globalParserState->currentRule = "factor->concat";
2358 CQL_DEBUG_TRACE("BISON::factor->concat\n");
|
2359 kumpf 1.20
|
2360 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2361 ;}
|
2362 karl 1.15 break;
2363
2364 case 37:
|
2365 dl.meetei 1.22 #line 916 "CQL.y"
|
2366 karl 1.15 {
|
2367 dave.sudlik 1.17 CQL_globalParserState->currentRule = "term->factor";
2368 CQL_DEBUG_TRACE("BISON::term->factor\n");
|
2369 kumpf 1.20
|
2370 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2371 ;}
|
2372 karl 1.15 break;
2373
2374 case 38:
|
2375 dl.meetei 1.22 #line 945 "CQL.y"
|
2376 karl 1.15 {
|
2377 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arith->term";
2378 CQL_DEBUG_TRACE("BISON::arith->term\n");
|
2379 kumpf 1.20
|
2380 dave.sudlik 1.17 //CQLPredicate* _pred = new CQLPredicate(*$1);
2381 // _factory._predicates.append(_pred);
2382 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2383 ;}
|
2384 karl 1.15 break;
2385
2386 case 39:
|
2387 dl.meetei 1.22 #line 976 "CQL.y"
|
2388 karl 1.15 {
|
2389 dave.sudlik 1.17 CQL_globalParserState->currentRule = "value_symbol->#literal_string";
2390 CQL_DEBUG_TRACE("BISON::value_symbol->#literal_string\n");
|
2391 kumpf 1.20
|
2392 karl 1.16 String tmp("#");
2393 tmp.append(*(yyvsp[(2) - (2)]._string));
2394 CQLIdentifier tmpid(tmp);
2395 (yyval._value) = new CQLValue(tmpid);
2396 _ObjPtr._ptr = (yyval._value);
2397 _ObjPtr.type = Val;
2398 _ptrs.append(_ObjPtr);
2399 ;}
|
2400 karl 1.15 break;
2401
2402 case 40:
|
2403 dl.meetei 1.22 #line 991 "CQL.y"
|
2404 karl 1.15 {
|
2405 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arith_or_value_symbol->arith";
2406 CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->arith\n");
|
2407 kumpf 1.20
|
2408 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2409 ;}
|
2410 karl 1.15 break;
2411
2412 case 41:
|
2413 dl.meetei 1.22 #line 998 "CQL.y"
|
2414 karl 1.15 {
|
2415 karl 1.16 /* make into predicate */
|
2416 kumpf 1.20 CQL_globalParserState->currentRule =
|
2417 dave.sudlik 1.17 "arith_or_value_symbol->value_symbol";
2418 CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->value_symbol\n");
|
2419 kumpf 1.20
|
2420 karl 1.16 CQLFactor _fctr(*(yyvsp[(1) - (1)]._value));
2421 (yyval._predicate) = (CQLPredicate*)(_factory.makeObject(&_fctr, Predicate));
2422 ;}
|
2423 karl 1.15 break;
2424
2425 case 42:
|
2426 dl.meetei 1.22 #line 1010 "CQL.y"
|
2427 karl 1.15 {
|
2428 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_EQ";
2429 CQL_DEBUG_TRACE("BISON::comp_op->TOK_EQ\n");
|
2430 kumpf 1.20
|
2431 dave.sudlik 1.17 (yyval._opType) = EQ;
|
2432 karl 1.16 ;}
|
2433 karl 1.15 break;
2434
2435 case 43:
|
2436 dl.meetei 1.22 #line 1017 "CQL.y"
|
2437 karl 1.15 {
|
2438 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_NE";
2439 CQL_DEBUG_TRACE("BISON::comp_op->TOK_NE\n");
2440 (yyval._opType) = NE;
|
2441 karl 1.16 ;}
|
2442 karl 1.15 break;
2443
2444 case 44:
|
2445 dl.meetei 1.22 #line 1023 "CQL.y"
|
2446 karl 1.15 {
|
2447 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_GT";
2448 CQL_DEBUG_TRACE("BISON::comp_op->TOK_GT\n");
|
2449 kumpf 1.20
|
2450 dave.sudlik 1.17 (yyval._opType) = GT;
|
2451 karl 1.16 ;}
|
2452 karl 1.15 break;
2453
2454 case 45:
|
2455 dl.meetei 1.22 #line 1030 "CQL.y"
|
2456 karl 1.15 {
|
2457 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_LT";
2458 CQL_DEBUG_TRACE("BISON::comp_op->TOK_LT\n");
2459 (yyval._opType) = LT;
|
2460 karl 1.16 ;}
|
2461 karl 1.15 break;
2462
2463 case 46:
|
2464 dl.meetei 1.22 #line 1036 "CQL.y"
|
2465 karl 1.15 {
|
2466 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_GE";
2467 CQL_DEBUG_TRACE("BISON::comp_op->TOK_GE\n");
2468 (yyval._opType) = GE;
|
2469 karl 1.16 ;}
|
2470 karl 1.15 break;
2471
2472 case 47:
|
2473 dl.meetei 1.22 #line 1042 "CQL.y"
|
2474 karl 1.15 {
|
2475 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_LE";
2476 CQL_DEBUG_TRACE("BISON::comp_op->TOK_LE\n");
2477 (yyval._opType) = LE;
|
2478 karl 1.16 ;}
|
2479 karl 1.15 break;
2480
2481 case 48:
|
2482 dl.meetei 1.22 #line 1050 "CQL.y"
|
2483 karl 1.15 {
|
2484 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith";
2485 CQL_DEBUG_TRACE("BISON::comp->arith\n");
|
2486 kumpf 1.20
|
2487 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2488 ;}
|
2489 karl 1.15 break;
2490
2491 case 49:
|
2492 dl.meetei 1.22 #line 1057 "CQL.y"
|
2493 karl 1.15 {
|
2494 kumpf 1.20 CQL_globalParserState->currentRule =
|
2495 dave.sudlik 1.17 "comp->arith TOK_IS TOK_NOT TOK_NULL";
2496 CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NOT TOK_NULL\n");
|
2497 kumpf 1.20
|
2498 karl 1.16 CQLExpression *_expr =
|
2499 dave.sudlik 1.17 (CQLExpression*)(_factory.getObject((yyvsp[(1) - (4)]._predicate),Expression));
|
2500 karl 1.16 CQLSimplePredicate _sp(*_expr, IS_NOT_NULL);
2501 _factory.setObject((yyvsp[(1) - (4)]._predicate),&_sp,SimplePredicate);
2502 (yyval._predicate) = (yyvsp[(1) - (4)]._predicate);
2503 ;}
|
2504 karl 1.15 break;
2505
2506 case 50:
|
2507 dl.meetei 1.22 #line 1069 "CQL.y"
|
2508 karl 1.15 {
|
2509 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith TOK_IS TOK_NULL";
2510 CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NULL\n");
|
2511 kumpf 1.20
|
2512 karl 1.16 CQLExpression *_expr =
|
2513 dave.sudlik 1.17 (CQLExpression*)(_factory.getObject((yyvsp[(1) - (3)]._predicate),Expression));
|
2514 karl 1.16 CQLSimplePredicate _sp(*_expr, IS_NULL);
2515 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2516 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2517 ;}
|
2518 karl 1.15 break;
2519
2520 case 51:
|
2521 dl.meetei 1.22 #line 1080 "CQL.y"
|
2522 karl 1.15 {
|
2523 kumpf 1.20 CQL_globalParserState->currentRule =
|
2524 dave.sudlik 1.17 "comp->arith comp_op arith_or_value_symbol";
2525 CQL_DEBUG_TRACE("BISON::comp->arith comp_op arith_or_value_symbol\n");
|
2526 kumpf 1.20
|
2527 karl 1.16 if((yyvsp[(1) - (3)]._predicate)->isSimple() && (yyvsp[(3) - (3)]._predicate)->isSimple())
2528 {
|
2529 karl 1.15 CQLExpression* _exp1 = (CQLExpression*)
|
2530 karl 1.16 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
|
2531 karl 1.15 CQLExpression* _exp2 = (CQLExpression*)
|
2532 karl 1.16 (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
|
2533 karl 1.15 CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2534 (yyval._predicate) = new CQLPredicate(_sp);
2535 _ObjPtr._ptr = (yyval._predicate);
|
2536 humberto 1.8 _ObjPtr.type = Pred;
2537 _ptrs.append(_ObjPtr);
|
2538 karl 1.16 }
2539 else /* error */
2540 {
2541 String _msg("comp->arith comp_op arith_or_value_symbol : $1 is "
2542 "not simple OR $3 is not simple");
2543 throw CQLSyntaxErrorException(
2544 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2545 "The CQLSimplePredicate is not simple while parsing "
2546 "rule $0 in position $1.",
2547 "comp->arith comp_op arith_or_value_symbol",
2548 CQL_globalParserState->currentTokenPos) );
2549 }
2550 ;}
|
2551 karl 1.15 break;
2552
2553 case 52:
|
2554 dl.meetei 1.22 #line 1110 "CQL.y"
|
2555 karl 1.15 {
|
2556 kumpf 1.20 CQL_globalParserState->currentRule =
|
2557 dave.sudlik 1.17 "comp->value_symbol comp_op arith";
2558 CQL_DEBUG_TRACE("BISON::comp->value_symbol comp_op arith\n");
|
2559 kumpf 1.20
|
2560 karl 1.16 if((yyvsp[(3) - (3)]._predicate)->isSimple())
2561 {
|
2562 karl 1.15 CQLExpression* _exp1 = (CQLExpression*)
2563 (_factory.makeObject((yyvsp[(1) - (3)]._value), Expression));
2564 CQLExpression* _exp2 = (CQLExpression*)
2565 (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
2566 CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2567 (yyval._predicate) = new CQLPredicate(_sp);
2568 _ObjPtr._ptr = (yyval._predicate);
|
2569 humberto 1.8 _ObjPtr.type = Pred;
2570 _ptrs.append(_ObjPtr);
|
2571 karl 1.16 }
2572 else /* error */
2573 {
|
2574 karl 1.15 String _msg("comp->value_symbol comp_op arith : $3 is not simple");
2575 throw CQLSyntaxErrorException(
|
2576 karl 1.16 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2577 "The CQLSimplePredicate is not simple while parsing"
2578 " rule $0 in position $1.",
2579 "comp->value_symbol comp_op arith",
2580 CQL_globalParserState->currentTokenPos) );
|
2581 kumpf 1.20
|
2582 karl 1.16 }
2583 ;}
|
2584 karl 1.15 break;
2585
2586 case 53:
|
2587 dl.meetei 1.22 #line 1140 "CQL.y"
|
2588 karl 1.15 {
|
2589 kumpf 1.20 /* make sure $1 isSimple(), get its expression, make
2590 simplepred->predicate
|
2591 karl 1.16 */
|
2592 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith _TOK_ISA identifier";
2593 CQL_DEBUG_TRACE("BISON::comp->arith _TOK_ISA identifier\n");
|
2594 kumpf 1.20
|
2595 karl 1.16 CQLExpression *_expr1 = (CQLExpression*)
2596 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
2597 CQLChainedIdentifier _cid(*(yyvsp[(3) - (3)]._identifier));
2598 CQLExpression *_expr2 = (CQLExpression*)
2599 (_factory.makeObject(&_cid,Expression));
2600 CQLSimplePredicate _sp(*_expr1, *_expr2, ISA);
2601 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2602 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2603 ;}
|
2604 karl 1.15 break;
2605
2606 case 54:
|
2607 dl.meetei 1.22 #line 1157 "CQL.y"
|
2608 karl 1.15 {
|
2609 kumpf 1.20 CQL_globalParserState->currentRule =
|
2610 dave.sudlik 1.17 "comp->arith TOK_LIKE literal_string";
2611 CQL_DEBUG_TRACE("BISON::comp->arith TOK_LIKE literal_string\n");
|
2612 kumpf 1.20
|
2613 dave.sudlik 1.17 CQLExpression *_expr1 = (CQLExpression*)
|
2614 karl 1.15 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
|
2615 dave.sudlik 1.17 CQLValue _val(*(yyvsp[(3) - (3)]._string));
2616 CQLExpression *_expr2 = (CQLExpression*)
|
2617 karl 1.15 (_factory.makeObject(&_val,Expression));
|
2618 dave.sudlik 1.17 CQLSimplePredicate _sp(*_expr1, *_expr2, LIKE);
2619 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2620 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
|
2621 karl 1.16 ;}
|
2622 karl 1.15 break;
2623
2624 case 55:
|
2625 dl.meetei 1.22 #line 1173 "CQL.y"
|
2626 karl 1.15 {
|
2627 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_factor->comp";
2628 CQL_DEBUG_TRACE("BISON::expr_factor->comp\n");
|
2629 kumpf 1.20
|
2630 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2631 ;}
|
2632 karl 1.15 break;
2633
2634 case 56:
|
2635 dl.meetei 1.22 #line 1180 "CQL.y"
|
2636 karl 1.15 {
|
2637 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_factor->TOK_NOT comp";
2638 CQL_DEBUG_TRACE("BISON::expr_factor->TOK_NOT comp\n");
|
2639 kumpf 1.20
|
2640 karl 1.16 (yyvsp[(2) - (2)]._predicate)->setInverted(!((yyvsp[(2) - (2)]._predicate)->getInverted()));
2641 (yyval._predicate) = (yyvsp[(2) - (2)]._predicate);
2642 ;}
|
2643 karl 1.15 break;
2644
2645 case 57:
|
2646 dl.meetei 1.22 #line 1190 "CQL.y"
|
2647 karl 1.15 {
|
2648 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_term->expr_factor";
2649 CQL_DEBUG_TRACE("BISON::expr_term->expr_factor\n");
|
2650 kumpf 1.20
|
2651 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2652 ;}
|
2653 karl 1.15 break;
2654
2655 case 58:
|
2656 dl.meetei 1.22 #line 1197 "CQL.y"
|
2657 karl 1.15 {
|
2658 kumpf 1.20 CQL_globalParserState->currentRule =
|
2659 dave.sudlik 1.17 "expr_term->expr_term AND expr_factor";
2660 CQL_DEBUG_TRACE("BISON::expr_term->expr_term AND expr_factor\n");
|
2661 kumpf 1.20
|
2662 karl 1.16 (yyval._predicate) = new CQLPredicate();
2663 (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
|
2664 kumpf 1.20 (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), AND);
|
2665 karl 1.16 _ObjPtr._ptr = (yyval._predicate);
2666 _ObjPtr.type = Pred;
2667 _ptrs.append(_ObjPtr);
2668 ;}
|
2669 karl 1.15 break;
2670
2671 case 59:
|
2672 dl.meetei 1.22 #line 1212 "CQL.y"
|
2673 karl 1.15 {
|
2674 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr->expr_term";
2675 CQL_DEBUG_TRACE("BISON::expr->expr_term\n");
|
2676 kumpf 1.20
2677 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
|
2678 karl 1.16 ;}
|
2679 karl 1.15 break;
2680
2681 case 60:
|
2682 dl.meetei 1.22 #line 1219 "CQL.y"
|
2683 karl 1.15 {
|
2684 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr->expr OR expr_term";
2685 CQL_DEBUG_TRACE("BISON::expr->expr OR expr_term\n");
|
2686 kumpf 1.20
|
2687 karl 1.16 (yyval._predicate) = new CQLPredicate();
2688 (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
2689 (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), OR);
2690 _ObjPtr._ptr = (yyval._predicate);
2691 _ObjPtr.type = Pred;
2692 _ptrs.append(_ObjPtr);
2693 ;}
|
2694 karl 1.15 break;
2695
2696 case 61:
|
2697 dl.meetei 1.22 #line 1232 "CQL.y"
|
2698 karl 1.15 {;;}
2699 break;
2700
2701 case 62:
|
2702 dl.meetei 1.22 #line 1252 "CQL.y"
|
2703 karl 1.15 {
|
2704 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arg_list->arg_list_sub->expr";
2705 CQL_DEBUG_TRACE("BISON::arg_list->arg_list_sub->expr\n");
|
2706 kumpf 1.20
|
2707 karl 1.16 _arglist.append(*(yyvsp[(1) - (1)]._predicate));
2708 /*
2709 since arg_list can loop back on itself,
2710 we need to store away previous solutions
2711 production. We keep track of previous productions
2712 in the _arglist array and later pass that to CQLFunction
2713 as part of chain: identifier TOK_LPAR arg_list TOK_RPAR
2714 */
2715 ;}
|
2716 karl 1.15 break;
|
2717 chuck 1.2
|
2718 karl 1.15 case 63:
|
2719 dl.meetei 1.22 #line 1311 "CQL.y"
|
2720 karl 1.15 {
|
2721 dave.sudlik 1.17 CQL_globalParserState->currentRule = "from_specifier->class_path";
2722 CQL_DEBUG_TRACE("BISON::from_specifier->class_path\n");
|
2723 kumpf 1.20
|
2724 karl 1.16 CQL_globalParserState->statement->appendClassPath(*(yyvsp[(1) - (1)]._identifier));
2725 ;}
|
2726 karl 1.15 break;
|
2727 chuck 1.2
|
2728 karl 1.15 case 64:
|
2729 dl.meetei 1.22 #line 1318 "CQL.y"
|
2730 karl 1.15 {
|
2731 kumpf 1.20 CQL_globalParserState->currentRule =
|
2732 dave.sudlik 1.17 "from_specifier->class_path TOK_AS identifier";
2733 CQL_DEBUG_TRACE(
2734 "BISON::from_specifier->class_path TOK_AS identifier\n");
|
2735 kumpf 1.20
|
2736 karl 1.16 CQLIdentifier _class(*(yyvsp[(1) - (3)]._identifier));
2737 String _alias((yyvsp[(3) - (3)]._identifier)->getName().getString());
2738 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2739 CQL_globalParserState->statement->appendClassPath(_class);
2740 ;}
|
2741 karl 1.15 break;
2742
2743 case 65:
|
2744 dl.meetei 1.22 #line 1330 "CQL.y"
|
2745 karl 1.15 {
|
2746 kumpf 1.20 CQL_globalParserState->currentRule =
|
2747 dave.sudlik 1.17 "from_specifier->class_path identifier";
2748 CQL_DEBUG_TRACE("BISON::from_specifier->class_path identifier\n");
|
2749 kumpf 1.20
|
2750 karl 1.16 CQLIdentifier _class(*(yyvsp[(1) - (2)]._identifier));
2751 String _alias((yyvsp[(2) - (2)]._identifier)->getName().getString());
2752 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2753 CQL_globalParserState->statement->appendClassPath(_class);
2754 ;}
|
2755 karl 1.15 break;
2756
2757 case 66:
|
2758 dl.meetei 1.22 #line 1343 "CQL.y"
|
2759 karl 1.15 {
|
2760 dave.sudlik 1.17 CQL_globalParserState->currentRule = "from_criteria->from_specifier";
2761 CQL_DEBUG_TRACE("BISON::from_criteria->from_specifier\n");
|
2762 karl 1.16 ;}
|
2763 karl 1.15 break;
2764
2765 case 67:
|
2766 dl.meetei 1.22 #line 1350 "CQL.y"
|
2767 karl 1.15 {
|
2768 dave.sudlik 1.17 CQL_globalParserState->currentRule = "star_expr->TOK_STAR";
2769 CQL_DEBUG_TRACE("BISON::star_expr->TOK_STAR\n");
|
2770 kumpf 1.20
|
2771 karl 1.15 CQLIdentifier _id("*");
|
2772 karl 1.16 (yyval._chainedIdentifier) = (CQLChainedIdentifier*)
2773 (_factory.makeObject(&_id,ChainedIdentifier));
2774 ;}
|
2775 karl 1.15 break;
2776
2777 case 68:
|
2778 dl.meetei 1.22 #line 1359 "CQL.y"
|
2779 karl 1.15 {
|
2780 dave.sudlik 1.17 CQL_globalParserState->currentRule = "star_expr->chain.*";
2781 CQL_DEBUG_TRACE("BISON::star_expr->chain.*\n");
|
2782 kumpf 1.20
|
2783 karl 1.16 CQLChainedIdentifier* _tmp = (CQLChainedIdentifier*)
2784 (_factory.getObject((yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier));
2785 CQLChainedIdentifier* _cid = new CQLChainedIdentifier(*_tmp);
2786 CQLIdentifier _id("*");
2787 _cid->append(_id);
2788 (yyval._chainedIdentifier) = _cid;
2789 _ObjPtr._ptr = (yyval._chainedIdentifier);
2790 _ObjPtr.type = CId;
2791 _ptrs.append(_ObjPtr);
2792 ;}
|
2793 karl 1.15 break;
2794
2795 case 69:
|
2796 dl.meetei 1.22 #line 1376 "CQL.y"
|
2797 karl 1.15 {
|
2798 dave.sudlik 1.17 CQL_globalParserState->currentRule = "selected_entry->expr";
2799 CQL_DEBUG_TRACE("BISON::selected_entry->expr\n");
|
2800 kumpf 1.20
|
2801 karl 1.16 if((yyvsp[(1) - (1)]._predicate)->isSimpleValue())
2802 {
|
2803 karl 1.15 CQLChainedIdentifier *_cid = (CQLChainedIdentifier*)
2804 (_factory.getObject((yyvsp[(1) - (1)]._predicate),Predicate,ChainedIdentifier));
2805 CQL_globalParserState->statement->appendSelectIdentifier(*_cid);
|
2806 karl 1.16 }
2807 else /* errot*/
2808 {
|
2809 karl 1.15 String _msg("selected_entry->expr : $1 is not a simple value");
2810 throw CQLSyntaxErrorException(
2811 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE_VALUE",
2812 "The CQLPredicate is not a simple value while "
2813 "parsing rule $0 in position $1.",
2814 "selected_entry->expr",
|
2815 kumpf 1.20 CQL_globalParserState->currentTokenPos) );
|
2816 karl 1.16 }
2817 ;}
|
2818 karl 1.15 break;
2819
2820 case 70:
|
2821 dl.meetei 1.22 #line 1398 "CQL.y"
|
2822 karl 1.15 {
|
2823 dave.sudlik 1.17 CQL_globalParserState->currentRule = "selected_entry->star_expr";
2824 CQL_DEBUG_TRACE("BISON::selected_entry->star_expr\n");
|
2825 kumpf 1.20
|
2826 karl 1.16 CQL_globalParserState->statement->appendSelectIdentifier(*(yyvsp[(1) - (1)]._chainedIdentifier));
2827 ;}
|
2828 karl 1.15 break;
2829
2830 case 71:
|
2831 dl.meetei 1.22 #line 1407 "CQL.y"
|
2832 karl 1.15 {
|
2833 kumpf 1.20 CQL_globalParserState->currentRule =
|
2834 dave.sudlik 1.17 "select_list->selected_entry select_list_tail";
2835 CQL_DEBUG_TRACE(
2836 "BISON::select_list->selected_entry select_list_tail\n");
|
2837 karl 1.16 ;}
|
2838 karl 1.15 break;
2839
2840 case 72:
|
2841 dl.meetei 1.22 #line 1415 "CQL.y"
|
2842 karl 1.15 {;;}
2843 break;
2844
2845 case 73:
|
2846 dl.meetei 1.22 #line 1418 "CQL.y"
|
2847 karl 1.15 {
|
2848 kumpf 1.20 CQL_globalParserState->currentRule =
|
2849 dave.sudlik 1.17 "select_list_tail->TOK_COMMA selected_entry select_list_tail";
2850 CQL_DEBUG_TRACE(
2851 "BISON::select_list_tail->TOK_COMMA"
2852 " selected_entry select_list_tail\n");
|
2853 karl 1.16 ;}
|
2854 karl 1.15 break;
2855
2856 case 74:
|
2857 dl.meetei 1.22 #line 1428 "CQL.y"
|
2858 karl 1.15 {
|
2859 dave.sudlik 1.17 CQL_globalParserState->currentRule = "search_condition->expr";
2860 CQL_DEBUG_TRACE("BISON::search_condition->expr\n");
|
2861 kumpf 1.20
|
2862 karl 1.16 CQL_globalParserState->statement->setPredicate(*(yyvsp[(1) - (1)]._predicate));
2863 ;}
|
2864 karl 1.15 break;
2865
2866 case 75:
|
2867 dl.meetei 1.22 #line 1436 "CQL.y"
|
2868 karl 1.15 {;}
2869 break;
2870
2871 case 76:
|
2872 dl.meetei 1.22 #line 1439 "CQL.y"
|
2873 karl 1.15 {
|
2874 kumpf 1.20 CQL_globalParserState->currentRule =
|
2875 dave.sudlik 1.17 "optional_where->TOK_WHERE search_condition";
2876 CQL_DEBUG_TRACE(
2877 "BISON::optional_where->TOK_WHERE search_condition\n");
|
2878 kumpf 1.20
|
2879 karl 1.16 CQL_globalParserState->statement->setHasWhereClause();
2880 ;}
|
2881 karl 1.15 break;
2882
2883 case 77:
|
2884 dl.meetei 1.22 #line 1450 "CQL.y"
|
2885 karl 1.15 {
|
2886 dave.sudlik 1.17 CQL_globalParserState->currentRule = "select_statement";
2887 CQL_DEBUG_TRACE("select_statement\n");
|
2888 kumpf 1.20
|
2889 karl 1.16 CQL_Bison_Cleanup();
2890 ;}
|
2891 karl 1.15 break;
2892
2893
2894 /* Line 1267 of yacc.c. */
|
2895 dl.meetei 1.22 #line 2893 "CQLtemp"
|
2896 karl 1.15 default: break;
2897 }
2898 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2899
2900 YYPOPSTACK (yylen);
2901 yylen = 0;
2902 YY_STACK_PRINT (yyss, yyssp);
2903
2904 *++yyvsp = yyval;
2905
2906
2907 /* Now `shift' the result of the reduction. Determine what state
2908 that goes to, based on the state we popped back to and the rule
2909 number reduced by. */
2910
2911 yyn = yyr1[yyn];
2912
2913 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2914 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2915 yystate = yytable[yystate];
2916 else
2917 karl 1.15 yystate = yydefgoto[yyn - YYNTOKENS];
2918
2919 goto yynewstate;
2920
2921
2922 /*------------------------------------.
2923 | yyerrlab -- here on detecting error |
2924 `------------------------------------*/
2925 yyerrlab:
2926 /* If not already recovering from an error, report this error. */
2927 if (!yyerrstatus)
2928 {
2929 ++yynerrs;
2930 #if ! YYERROR_VERBOSE
2931 yyerror (YY_("syntax error"));
2932 #else
2933 {
|
2934 karl 1.16 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2935 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2936 {
2937 YYSIZE_T yyalloc = 2 * yysize;
2938 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2939 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2940 if (yymsg != yymsgbuf)
2941 YYSTACK_FREE (yymsg);
2942 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2943 if (yymsg)
2944 yymsg_alloc = yyalloc;
2945 else
2946 {
2947 yymsg = yymsgbuf;
2948 yymsg_alloc = sizeof yymsgbuf;
2949 }
2950 }
2951
2952 if (0 < yysize && yysize <= yymsg_alloc)
2953 {
2954 (void) yysyntax_error (yymsg, yystate, yychar);
2955 karl 1.16 yyerror (yymsg);
2956 }
2957 else
2958 {
2959 yyerror (YY_("syntax error"));
2960 if (yysize != 0)
2961 goto yyexhaustedlab;
2962 }
|
2963 karl 1.15 }
2964 #endif
2965 }
2966
2967
2968
2969 if (yyerrstatus == 3)
2970 {
2971 /* If just tried and failed to reuse look-ahead token after an
|
2972 karl 1.16 error, discard it. */
|
2973 karl 1.15
2974 if (yychar <= YYEOF)
|
2975 karl 1.16 {
2976 /* Return failure if at end of input. */
2977 if (yychar == YYEOF)
2978 YYABORT;
2979 }
|
2980 karl 1.15 else
|
2981 karl 1.16 {
2982 yydestruct ("Error: discarding",
2983 yytoken, &yylval);
2984 yychar = YYEMPTY;
2985 }
|
2986 chuck 1.2 }
|
2987 karl 1.15
2988 /* Else will try to reuse look-ahead token after shifting the error
2989 token. */
2990 goto yyerrlab1;
2991
2992
2993 /*---------------------------------------------------.
2994 | yyerrorlab -- error raised explicitly by YYERROR. |
2995 `---------------------------------------------------*/
2996 yyerrorlab:
2997
2998 /* Pacify compilers like GCC when the user code never invokes
2999 YYERROR and the label yyerrorlab therefore never appears in user
3000 code. */
3001 if (/*CONSTCOND*/ 0)
3002 goto yyerrorlab;
3003
3004 /* Do not reclaim the symbols of the rule which action triggered
3005 this YYERROR. */
3006 YYPOPSTACK (yylen);
3007 yylen = 0;
3008 karl 1.15 YY_STACK_PRINT (yyss, yyssp);
3009 yystate = *yyssp;
3010 goto yyerrlab1;
3011
3012
3013 /*-------------------------------------------------------------.
3014 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3015 `-------------------------------------------------------------*/
3016 yyerrlab1:
|
3017 karl 1.16 yyerrstatus = 3; /* Each real token shifted decrements this. */
|
3018 karl 1.15
3019 for (;;)
|
3020 chuck 1.2 {
|
3021 karl 1.15 yyn = yypact[yystate];
3022 if (yyn != YYPACT_NINF)
|
3023 karl 1.16 {
3024 yyn += YYTERROR;
3025 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3026 {
3027 yyn = yytable[yyn];
3028 if (0 < yyn)
3029 break;
3030 }
3031 }
|
3032 karl 1.15
3033 /* Pop the current state because it cannot handle the error token. */
3034 if (yyssp == yyss)
|
3035 karl 1.16 YYABORT;
|
3036 karl 1.15
3037
3038 yydestruct ("Error: popping",
|
3039 karl 1.16 yystos[yystate], yyvsp);
|
3040 karl 1.15 YYPOPSTACK (1);
3041 yystate = *yyssp;
3042 YY_STACK_PRINT (yyss, yyssp);
3043 }
3044
3045 if (yyn == YYFINAL)
3046 YYACCEPT;
3047
3048 *++yyvsp = yylval;
3049
3050
3051 /* Shift the error token. */
3052 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3053
3054 yystate = yyn;
3055 goto yynewstate;
3056
3057
3058 /*-------------------------------------.
3059 | yyacceptlab -- YYACCEPT comes here. |
3060 `-------------------------------------*/
3061 karl 1.15 yyacceptlab:
3062 yyresult = 0;
3063 goto yyreturn;
3064
3065 /*-----------------------------------.
3066 | yyabortlab -- YYABORT comes here. |
3067 `-----------------------------------*/
3068 yyabortlab:
3069 yyresult = 1;
3070 goto yyreturn;
3071
3072 #ifndef yyoverflow
3073 /*-------------------------------------------------.
3074 | yyexhaustedlab -- memory exhaustion comes here. |
3075 `-------------------------------------------------*/
3076 yyexhaustedlab:
3077 yyerror (YY_("memory exhausted"));
3078 yyresult = 2;
3079 /* Fall through. */
|
3080 chuck 1.2 #endif
|
3081 karl 1.15
3082 yyreturn:
3083 if (yychar != YYEOF && yychar != YYEMPTY)
3084 yydestruct ("Cleanup: discarding lookahead",
|
3085 karl 1.16 yytoken, &yylval);
|
3086 karl 1.15 /* Do not reclaim the symbols of the rule which action triggered
3087 this YYABORT or YYACCEPT. */
3088 YYPOPSTACK (yylen);
3089 YY_STACK_PRINT (yyss, yyssp);
3090 while (yyssp != yyss)
|
3091 chuck 1.2 {
|
3092 karl 1.15 yydestruct ("Cleanup: popping",
|
3093 karl 1.16 yystos[*yyssp], yyvsp);
|
3094 karl 1.15 YYPOPSTACK (1);
|
3095 chuck 1.2 }
|
3096 karl 1.15 #ifndef yyoverflow
3097 if (yyss != yyssa)
3098 YYSTACK_FREE (yyss);
3099 #endif
3100 #if YYERROR_VERBOSE
3101 if (yymsg != yymsgbuf)
3102 YYSTACK_FREE (yymsg);
3103 #endif
3104 /* Make sure YYID is used. */
3105 return YYID (yyresult);
|
3106 chuck 1.2 }
|
3107 karl 1.15
3108
|
3109 dl.meetei 1.22 #line 1459 "CQL.y"
|
3110 karl 1.15
|
3111 karl 1.16 /*int yyerror(char * err){yyclearin; yyerrok;throw Exception(String(err));
3112 return 1;}*/
|
3113 karl 1.15
|