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 karl 1.19 0, 257, 257, 283, 292, 308, 341, 370, 380, 394,
672 404, 418, 428, 442, 452, 465, 474, 479, 484, 489,
673 494, 504, 517, 531, 541, 550, 559, 568, 581, 590,
674 601, 643, 681, 727, 786, 794, 883, 914, 943, 974,
675 989, 996, 1008, 1015, 1021, 1028, 1034, 1040, 1048, 1055,
676 1067, 1078, 1108, 1138, 1155, 1171, 1178, 1188, 1195, 1210,
677 1217, 1231, 1250, 1309, 1316, 1328, 1341, 1348, 1357, 1374,
678 1396, 1405, 1414, 1416, 1426, 1435, 1437, 1448
|
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
1372 default:
|
1373 karl 1.16 break;
|
1374 karl 1.15 }
1375 }
1376
1377
1378 /* Prevent warnings from -Wmissing-prototypes. */
1379
1380 #ifdef YYPARSE_PARAM
1381 #if defined __STDC__ || defined __cplusplus
1382 int yyparse (void *YYPARSE_PARAM);
1383 #else
1384 int yyparse ();
1385 #endif
1386 #else /* ! YYPARSE_PARAM */
1387 #if defined __STDC__ || defined __cplusplus
1388 int yyparse (void);
1389 #else
1390 int yyparse ();
1391 #endif
1392 #endif /* ! YYPARSE_PARAM */
1393
1394
1395 karl 1.15
1396 /* The look-ahead symbol. */
1397 int yychar;
1398
1399 /* The semantic value of the look-ahead symbol. */
1400 YYSTYPE yylval;
1401
1402 /* Number of syntax errors so far. */
1403 int yynerrs;
1404
1405
1406
1407 /*----------.
1408 | yyparse. |
1409 `----------*/
1410
1411 #ifdef YYPARSE_PARAM
1412 #if (defined __STDC__ || defined __C99__FUNC__ \
1413 || defined __cplusplus || defined _MSC_VER)
1414 int
1415 yyparse (void *YYPARSE_PARAM)
1416 karl 1.15 #else
1417 int
1418 yyparse (YYPARSE_PARAM)
1419 void *YYPARSE_PARAM;
1420 #endif
1421 #else /* ! YYPARSE_PARAM */
1422 #if (defined __STDC__ || defined __C99__FUNC__ \
1423 || defined __cplusplus || defined _MSC_VER)
1424 int
1425 yyparse (void)
1426 #else
1427 int
1428 yyparse ()
1429
1430 #endif
1431 #endif
1432 {
|
1433 kumpf 1.20
|
1434 karl 1.15 int yystate;
1435 int yyn;
1436 int yyresult;
1437 /* Number of tokens to shift before error messages enabled. */
1438 int yyerrstatus;
1439 /* Look-ahead token as an internal (translated) token number. */
1440 int yytoken = 0;
1441 #if YYERROR_VERBOSE
1442 /* Buffer for error messages, and its allocated size. */
1443 char yymsgbuf[128];
1444 char *yymsg = yymsgbuf;
1445 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1446 #endif
1447
1448 /* Three stacks and their tools:
1449 `yyss': related to states,
1450 `yyvs': related to semantic values,
1451 `yyls': related to locations.
1452
1453 Refer to the stacks thru separate pointers, to allow yyoverflow
1454 to reallocate them elsewhere. */
1455 karl 1.15
1456 /* The state stack. */
1457 yytype_int16 yyssa[YYINITDEPTH];
1458 yytype_int16 *yyss = yyssa;
1459 yytype_int16 *yyssp;
1460
1461 /* The semantic value stack. */
1462 YYSTYPE yyvsa[YYINITDEPTH];
1463 YYSTYPE *yyvs = yyvsa;
1464 YYSTYPE *yyvsp;
1465
1466
1467
1468 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1469
1470 YYSIZE_T yystacksize = YYINITDEPTH;
1471
1472 /* The variables used to return semantic value and location from the
1473 action routines. */
1474 YYSTYPE yyval;
1475
1476 karl 1.15
1477 /* The number of symbols on the RHS of the reduced rule.
1478 Keep to zero when no symbol should be popped. */
1479 int yylen = 0;
1480
1481 YYDPRINTF ((stderr, "Starting parse\n"));
1482
1483 yystate = 0;
1484 yyerrstatus = 0;
1485 yynerrs = 0;
|
1486 karl 1.16 yychar = YYEMPTY; /* Cause a token to be read. */
|
1487 karl 1.15
1488 /* Initialize stack pointers.
1489 Waste one element of value and location stack
1490 so that they stay on the same level as the state stack.
1491 The wasted elements are never initialized. */
1492
1493 yyssp = yyss;
1494 yyvsp = yyvs;
1495
1496 goto yysetstate;
1497
1498 /*------------------------------------------------------------.
1499 | yynewstate -- Push a new state, which is found in yystate. |
1500 `------------------------------------------------------------*/
1501 yynewstate:
1502 /* In all cases, when you get here, the value and location stacks
1503 have just been pushed. So pushing a state here evens the stacks. */
1504 yyssp++;
1505
1506 yysetstate:
1507 *yyssp = yystate;
1508 karl 1.15
1509 if (yyss + yystacksize - 1 <= yyssp)
1510 {
1511 /* Get the current used size of the three stacks, in elements. */
1512 YYSIZE_T yysize = yyssp - yyss + 1;
1513
1514 #ifdef yyoverflow
1515 {
|
1516 karl 1.16 /* Give user a chance to reallocate the stack. Use copies of
1517 these so that the &'s don't force the real ones into
1518 memory. */
1519 YYSTYPE *yyvs1 = yyvs;
1520 yytype_int16 *yyss1 = yyss;
1521
1522
1523 /* Each stack pointer address is followed by the size of the
1524 data in use in that stack, in bytes. This used to be a
1525 conditional around just the two extra args, but that might
1526 be undefined if yyoverflow is a macro. */
1527 yyoverflow (YY_("memory exhausted"),
1528 &yyss1, yysize * sizeof (*yyssp),
1529 &yyvs1, yysize * sizeof (*yyvsp),
|
1530 karl 1.15
|
1531 karl 1.16 &yystacksize);
|
1532 karl 1.15
|
1533 karl 1.16 yyss = yyss1;
1534 yyvs = yyvs1;
|
1535 karl 1.15 }
1536 #else /* no yyoverflow */
1537 # ifndef YYSTACK_RELOCATE
1538 goto yyexhaustedlab;
1539 # else
1540 /* Extend the stack our own way. */
1541 if (YYMAXDEPTH <= yystacksize)
|
1542 karl 1.16 goto yyexhaustedlab;
|
1543 karl 1.15 yystacksize *= 2;
1544 if (YYMAXDEPTH < yystacksize)
|
1545 karl 1.16 yystacksize = YYMAXDEPTH;
|
1546 karl 1.15
1547 {
|
1548 karl 1.16 yytype_int16 *yyss1 = yyss;
1549 union yyalloc *yyptr =
1550 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1551 if (! yyptr)
1552 goto yyexhaustedlab;
1553 YYSTACK_RELOCATE (yyss);
1554 YYSTACK_RELOCATE (yyvs);
|
1555 karl 1.15
1556 # undef YYSTACK_RELOCATE
|
1557 karl 1.16 if (yyss1 != yyssa)
1558 YYSTACK_FREE (yyss1);
|
1559 karl 1.15 }
1560 # endif
1561 #endif /* no yyoverflow */
1562
1563 yyssp = yyss + yysize - 1;
1564 yyvsp = yyvs + yysize - 1;
1565
1566
1567 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
1568 karl 1.16 (unsigned long int) yystacksize));
|
1569 karl 1.15
1570 if (yyss + yystacksize - 1 <= yyssp)
|
1571 karl 1.16 YYABORT;
|
1572 karl 1.15 }
1573
1574 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1575
1576 goto yybackup;
1577
1578 /*-----------.
1579 | yybackup. |
1580 `-----------*/
1581 yybackup:
1582
1583 /* Do appropriate processing given the current state. Read a
1584 look-ahead token if we need one and don't already have one. */
1585
1586 /* First try to decide what to do without reference to look-ahead token. */
1587 yyn = yypact[yystate];
1588 if (yyn == YYPACT_NINF)
1589 goto yydefault;
1590
1591 /* Not known => get a look-ahead token if don't already have one. */
1592
1593 karl 1.15 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1594 if (yychar == YYEMPTY)
1595 {
1596 YYDPRINTF ((stderr, "Reading a token: "));
1597 yychar = YYLEX;
1598 }
1599
1600 if (yychar <= YYEOF)
1601 {
1602 yychar = yytoken = YYEOF;
1603 YYDPRINTF ((stderr, "Now at end of input.\n"));
1604 }
1605 else
1606 {
1607 yytoken = YYTRANSLATE (yychar);
1608 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1609 }
1610
1611 /* If the proper action on seeing token YYTOKEN is to reduce or to
1612 detect an error, take that action. */
1613 yyn += yytoken;
1614 karl 1.15 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1615 goto yydefault;
1616 yyn = yytable[yyn];
1617 if (yyn <= 0)
1618 {
1619 if (yyn == 0 || yyn == YYTABLE_NINF)
|
1620 karl 1.16 goto yyerrlab;
|
1621 karl 1.15 yyn = -yyn;
1622 goto yyreduce;
1623 }
1624
1625 if (yyn == YYFINAL)
1626 YYACCEPT;
1627
1628 /* Count tokens shifted since error; after three, turn off error
1629 status. */
1630 if (yyerrstatus)
1631 yyerrstatus--;
1632
1633 /* Shift the look-ahead token. */
1634 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1635
1636 /* Discard the shifted token unless it is eof. */
1637 if (yychar != YYEOF)
1638 yychar = YYEMPTY;
1639
1640 yystate = yyn;
1641 *++yyvsp = yylval;
1642 karl 1.15
1643 goto yynewstate;
1644
1645
1646 /*-----------------------------------------------------------.
1647 | yydefault -- do the default action for the current state. |
1648 `-----------------------------------------------------------*/
1649 yydefault:
1650 yyn = yydefact[yystate];
1651 if (yyn == 0)
1652 goto yyerrlab;
1653 goto yyreduce;
1654
1655
1656 /*-----------------------------.
1657 | yyreduce -- Do a reduction. |
1658 `-----------------------------*/
1659 yyreduce:
1660 /* yyn is the number of a rule to reduce with. */
1661 yylen = yyr2[yyn];
1662
1663 karl 1.15 /* If YYLEN is nonzero, implement the default value of the action:
1664 `$$ = $1'.
1665
1666 Otherwise, the following line sets YYVAL to garbage.
1667 This behavior is undocumented and Bison
1668 users should not rely upon it. Assigning to YYVAL
1669 unconditionally makes the parser a bit smaller, and it avoids a
1670 GCC warning that YYVAL may be used uninitialized. */
1671 yyval = yyvsp[1-yylen];
1672
1673
1674 YY_REDUCE_PRINT (yyn);
1675 switch (yyn)
1676 {
1677 case 2:
|
1678 karl 1.19 #line 258 "CQL.y"
|
1679 kumpf 1.20 {
|
1680 dave.sudlik 1.17 CQL_globalParserState->currentRule = "identifier";
1681 CQL_DEBUG_TRACE("BISON::identifier\n");
|
1682 karl 1.15
|
1683 karl 1.16 if(isUTF8Str(CQL_lval.strValue))
|
1684 kumpf 1.20 {
|
1685 karl 1.16 (yyval._identifier) = new CQLIdentifier(String(CQL_lval.strValue));
|
1686 karl 1.15 _ObjPtr._ptr = (yyval._identifier);
1687 _ObjPtr.type = Id;
1688 _ptrs.append(_ObjPtr);
|
1689 karl 1.16 }
1690 else
1691 {
|
1692 dave.sudlik 1.17 CQL_DEBUG_TRACE("BISON::identifier-> BAD UTF\n");
|
1693 karl 1.16
1694 throw CQLSyntaxErrorException(
1695 MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1696 "Bad UTF8 encountered parsing rule $0"
1697 " in position $1.",
1698 "identifier",
1699 CQL_globalParserState->currentTokenPos) );
1700 }
1701 ;}
|
1702 karl 1.15 break;
1703
1704 case 3:
|
1705 karl 1.19 #line 284 "CQL.y"
|
1706 karl 1.15 {
|
1707 dave.sudlik 1.17 CQL_globalParserState->currentRule = "class_name";
|
1708 kumpf 1.20 CQL_DEBUG_TRACE2("BISON::class_name = %s\n",
|
1709 dave.sudlik 1.17 (const char *)((yyvsp[(1) - (1)]._identifier)->getName().getString().getCString()));
|
1710 karl 1.16 (yyval._identifier) = (yyvsp[(1) - (1)]._identifier);
1711 ;}
|
1712 karl 1.15 break;
1713
1714 case 4:
|
1715 karl 1.19 #line 293 "CQL.y"
|
1716 kumpf 1.20 {
|
1717 dave.sudlik 1.17 CQL_globalParserState->currentRule = "class_path";
1718 CQL_DEBUG_TRACE("BISON::class_path\n");
|
1719 karl 1.16 (yyval._identifier) = (yyvsp[(1) - (1)]._identifier);
1720 ;}
|
1721 karl 1.15 break;
1722
1723 case 5:
|
1724 karl 1.19 #line 309 "CQL.y"
|
1725 karl 1.15 {
|
1726 karl 1.16 /*
1727 TOK_SCOPED_PROPERTY can be:
1728 - "A::prop"
1729 - "A::class.prop"
1730 - "A::class.prop#'OK'
1731 - "A::class.prop[4]"
1732 */
|
1733 dave.sudlik 1.17 CQL_globalParserState->currentRule = "scoped_property";
1734 CQL_DEBUG_TRACE2("BISON::scoped_property = %s\n", CQL_lval.strValue);
|
1735 kumpf 1.20
|
1736 karl 1.16 if(isUTF8Str(CQL_lval.strValue))
1737 {
|
1738 karl 1.15 String tmp(CQL_lval.strValue);
1739 (yyval._identifier) = new CQLIdentifier(tmp);
1740 _ObjPtr._ptr = (yyval._identifier);
1741 _ObjPtr.type = Id;
1742 _ptrs.append(_ObjPtr);
|
1743 karl 1.16 }
1744 else
1745 {
|
1746 dave.sudlik 1.17 CQL_DEBUG_TRACE("BISON::scoped_property-> BAD UTF\n");
|
1747 karl 1.15 throw CQLSyntaxErrorException(
1748 MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1749 "Bad UTF8 encountered parsing rule $0 in position $1.",
1750 "scoped_property",
1751 CQL_globalParserState->currentTokenPos) );
|
1752 karl 1.16 }
1753 ;}
|
1754 karl 1.15 break;
1755
1756 case 6:
|
1757 karl 1.19 #line 342 "CQL.y"
|
1758 kumpf 1.20 {
|
1759 karl 1.16 /*
1760 Make sure the literal is valid UTF8, then make a String
1761 */
|
1762 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal_string";
1763 CQL_DEBUG_TRACE2("BISON::literal_string-> %s\n", CQL_lval.strValue);
|
1764 kumpf 1.20
|
1765 karl 1.16 if(isUTF8Str(CQL_lval.strValue))
1766 {
|
1767 karl 1.15 (yyval._string) = new String(CQL_lval.strValue);
1768 _ObjPtr._ptr = (yyval._string);
1769 _ObjPtr.type = Str;
|
1770 humberto 1.8 _ptrs.append(_ObjPtr);
|
1771 karl 1.16 }
1772 else
1773 {
|
1774 dave.sudlik 1.17 CQL_DEBUG_TRACE("BISON::literal_string-> BAD UTF\n");
|
1775 kumpf 1.20
|
1776 karl 1.15 throw CQLSyntaxErrorException(
1777 MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1778 "Bad UTF8 encountered parsing rule $0 in position $1.",
1779 "literal_string",
1780 CQL_globalParserState->currentTokenPos));
1781 }
|
1782 karl 1.16 ;}
|
1783 karl 1.15 break;
1784
1785 case 7:
|
1786 karl 1.19 #line 371 "CQL.y"
|
1787 kumpf 1.20 {
|
1788 dave.sudlik 1.17 CQL_globalParserState->currentRule = "binary_value->TOK_BINARY";
1789 CQL_DEBUG_TRACE2("BISON::binary_value-> %s\n", CQL_lval.strValue);
|
1790 kumpf 1.20
1791 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Binary);
|
1792 dave.sudlik 1.17 _ObjPtr._ptr = (yyval._value);
1793 _ObjPtr.type = Val;
1794 _ptrs.append(_ObjPtr);
|
1795 karl 1.16 ;}
|
1796 karl 1.15 break;
1797
1798 case 8:
|
1799 karl 1.19 #line 381 "CQL.y"
|
1800 kumpf 1.20 {
1801 CQL_globalParserState->currentRule =
|
1802 dave.sudlik 1.17 "binary_value->TOK_NEGATIVE_BINARY";
1803 CQL_DEBUG_TRACE2("BISON::binary_value-> %s\n", CQL_lval.strValue);
|
1804 kumpf 1.20
1805 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Binary, false);
|
1806 dave.sudlik 1.17 _ObjPtr._ptr = (yyval._value);
1807 _ObjPtr.type = Val;
1808 _ptrs.append(_ObjPtr);
|
1809 karl 1.16 ;}
|
1810 karl 1.15 break;
1811
1812 case 9:
|
1813 karl 1.19 #line 395 "CQL.y"
|
1814 kumpf 1.20 {
|
1815 dave.sudlik 1.17 CQL_globalParserState->currentRule = "hex_value->TOK_HEXADECIMAL";
1816 CQL_DEBUG_TRACE2("BISON::hex_value-> %s\n", CQL_lval.strValue);
|
1817 kumpf 1.20
|
1818 karl 1.16 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Hex);
1819 _ObjPtr._ptr = (yyval._value);
1820 _ObjPtr.type = Val;
1821 _ptrs.append(_ObjPtr);
1822 ;}
|
1823 karl 1.15 break;
1824
1825 case 10:
|
1826 karl 1.19 #line 405 "CQL.y"
|
1827 kumpf 1.20 {
1828 CQL_globalParserState->currentRule =
|
1829 dave.sudlik 1.17 "hex_value->TOK_NEGATIVE_HEXADECIMAL";
1830 CQL_DEBUG_TRACE2("BISON::hex_value-> %s\n", CQL_lval.strValue);
|
1831 kumpf 1.20
|
1832 karl 1.16 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Hex, false);
1833 _ObjPtr._ptr = (yyval._value);
1834 _ObjPtr.type = Val;
1835 _ptrs.append(_ObjPtr);
1836 ;}
|
1837 karl 1.15 break;
1838
1839 case 11:
|
1840 karl 1.19 #line 419 "CQL.y"
|
1841 kumpf 1.20 {
|
1842 dave.sudlik 1.17 CQL_globalParserState->currentRule = "decimal_value->TOK_INTEGER";
1843 CQL_DEBUG_TRACE2("BISON::decimal_value-> %s\n", CQL_lval.strValue);
|
1844 kumpf 1.20
1845 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Decimal);
|
1846 karl 1.16 _ObjPtr._ptr = (yyval._value);
1847 _ObjPtr.type = Val;
1848 _ptrs.append(_ObjPtr);
1849 ;}
|
1850 karl 1.15 break;
1851
1852 case 12:
|
1853 karl 1.19 #line 429 "CQL.y"
|
1854 kumpf 1.20 {
1855 CQL_globalParserState->currentRule =
|
1856 dave.sudlik 1.17 "decimal_value->TOK_NEGATIVE_INTEGER";
1857 CQL_DEBUG_TRACE2("BISON::decimal_value-> %s\n", CQL_lval.strValue);
|
1858 kumpf 1.20
|
1859 karl 1.16 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Decimal, false);
1860 _ObjPtr._ptr = (yyval._value);
1861 _ObjPtr.type = Val;
1862 _ptrs.append(_ObjPtr);
1863 ;}
|
1864 karl 1.15 break;
1865
1866 case 13:
|
1867 karl 1.19 #line 443 "CQL.y"
|
1868 kumpf 1.20 {
|
1869 dave.sudlik 1.17 CQL_globalParserState->currentRule = "real_value->TOK_REAL";
1870 CQL_DEBUG_TRACE2("BISON::real_value-> %s\n", CQL_lval.strValue);
|
1871 kumpf 1.20
|
1872 karl 1.16 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Real);
1873 _ObjPtr._ptr = (yyval._value);
1874 _ObjPtr.type = Val;
1875 _ptrs.append(_ObjPtr);
1876 ;}
|
1877 karl 1.15 break;
1878
1879 case 14:
|
1880 karl 1.19 #line 453 "CQL.y"
|
1881 kumpf 1.20 {
|
1882 dave.sudlik 1.17 CQL_globalParserState->currentRule = "real_value->TOK_NEGATIVE_REAL";
1883 CQL_DEBUG_TRACE2("BISON::real_value-> %s\n", CQL_lval.strValue);
|
1884 kumpf 1.20
|
1885 karl 1.16 (yyval._value) = new CQLValue(CQL_lval.strValue, CQLValue::Real, false);
1886 _ObjPtr._ptr = (yyval._value);
1887 _ObjPtr.type = Val;
1888 _ptrs.append(_ObjPtr);
1889 ;}
|
1890 karl 1.15 break;
1891
1892 case 15:
|
1893 karl 1.19 #line 466 "CQL.y"
|
1894 karl 1.15 {
|
1895 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->literal_string";
1896 CQL_DEBUG_TRACE("BISON::literal->literal_string\n");
|
1897 karl 1.16 (yyval._value) = new CQLValue(*(yyvsp[(1) - (1)]._string));
1898 _ObjPtr._ptr = (yyval._value);
1899 _ObjPtr.type = Val;
1900 _ptrs.append(_ObjPtr);
1901 ;}
|
1902 karl 1.15 break;
1903
1904 case 16:
|
1905 karl 1.19 #line 475 "CQL.y"
|
1906 karl 1.15 {
|
1907 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->decimal_value";
1908 CQL_DEBUG_TRACE("BISON::literal->decimal_value\n");
|
1909 karl 1.16 ;}
|
1910 karl 1.15 break;
1911
1912 case 17:
|
1913 karl 1.19 #line 480 "CQL.y"
|
1914 karl 1.15 {
|
1915 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->binary_value";
1916 CQL_DEBUG_TRACE("BISON::literal->binary_value\n");
|
1917 karl 1.16 ;}
|
1918 karl 1.15 break;
1919
1920 case 18:
|
1921 karl 1.19 #line 485 "CQL.y"
|
1922 karl 1.15 {
|
1923 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->hex_value";
1924 CQL_DEBUG_TRACE("BISON::literal->hex_value\n");
|
1925 karl 1.16 ;}
|
1926 karl 1.15 break;
1927
1928 case 19:
|
1929 karl 1.19 #line 490 "CQL.y"
|
1930 karl 1.15 {
|
1931 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->real_value";
1932 CQL_DEBUG_TRACE("BISON::literal->real_value\n");
|
1933 karl 1.16 ;}
|
1934 karl 1.15 break;
1935
1936 case 20:
|
1937 karl 1.19 #line 495 "CQL.y"
|
1938 karl 1.15 {
|
1939 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->TOK_TRUE";
1940 CQL_DEBUG_TRACE("BISON::literal->TOK_TRUE\n");
|
1941 kumpf 1.20
|
1942 karl 1.16 (yyval._value) = new CQLValue(Boolean(true));
1943 _ObjPtr._ptr = (yyval._value);
1944 _ObjPtr.type = Val;
1945 _ptrs.append(_ObjPtr);
1946 ;}
|
1947 karl 1.15 break;
1948
1949 case 21:
|
1950 karl 1.19 #line 505 "CQL.y"
|
1951 karl 1.15 {
|
1952 dave.sudlik 1.17 CQL_globalParserState->currentRule = "literal->TOK_FALSE";
1953 CQL_DEBUG_TRACE("BISON::literal->TOK_FALSE\n");
|
1954 kumpf 1.20
|
1955 dave.sudlik 1.17 (yyval._value) = new CQLValue(Boolean(false));
1956 _ObjPtr._ptr = (yyval._value);
1957 _ObjPtr.type = Val;
1958 _ptrs.append(_ObjPtr);
|
1959 karl 1.16 ;}
|
1960 karl 1.15 break;
1961
1962 case 22:
|
1963 karl 1.19 #line 518 "CQL.y"
|
1964 karl 1.15 {
|
1965 dave.sudlik 1.17 CQL_globalParserState->currentRule = "array_index->expr";
1966 CQL_DEBUG_TRACE("BISON::array_index->expr\n");
|
1967 kumpf 1.20
|
1968 karl 1.16 CQLValue* _val = (CQLValue*)_factory.getObject((yyvsp[(1) - (1)]._predicate),Predicate,Value);
1969 (yyval._string) = new String(_val->toString());
1970 _ObjPtr._ptr = (yyval._string);
1971 _ObjPtr.type = Str;
1972 _ptrs.append(_ObjPtr);
1973 ;}
|
1974 karl 1.15 break;
1975
1976 case 23:
|
1977 karl 1.19 #line 532 "CQL.y"
|
1978 karl 1.15 {
|
1979 dave.sudlik 1.17 CQL_globalParserState->currentRule = "array_index_list->array_index";
1980 CQL_DEBUG_TRACE("BISON::array_index_list->array_index\n");
|
1981 kumpf 1.20
|
1982 karl 1.16 (yyval._string) = (yyvsp[(1) - (1)]._string);
1983 ;}
|
1984 karl 1.15 break;
1985
1986 case 24:
|
1987 karl 1.19 #line 542 "CQL.y"
|
1988 karl 1.15 {
|
1989 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain->literal";
1990 CQL_DEBUG_TRACE("BISON::chain->literal\n");
|
1991 kumpf 1.20
|
1992 karl 1.16 chain_state = CQLVALUE;
|
1993 kumpf 1.20 (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._value),Predicate);
|
1994 karl 1.16 ;}
|
1995 karl 1.15 break;
1996
1997 case 25:
|
1998 karl 1.19 #line 551 "CQL.y"
|
1999 karl 1.15 {
|
2000 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain-> ( expr )";
2001 CQL_DEBUG_TRACE("BISON::chain-> ( expr )\n");
|
2002 karl 1.16
2003 chain_state = CQLPREDICATE;
2004 (yyval._node) = (yyvsp[(2) - (3)]._predicate);
2005 ;}
|
2006 karl 1.15 break;
2007
2008 case 26:
|
2009 karl 1.19 #line 560 "CQL.y"
|
2010 karl 1.15 {
|
2011 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain->identifier";
2012 CQL_DEBUG_TRACE("BISON::chain->identifier\n");
|
2013 kumpf 1.20
|
2014 karl 1.16 chain_state = CQLIDENTIFIER;
2015 (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._identifier),Predicate);
2016 ;}
|
2017 karl 1.15 break;
2018
2019 case 27:
|
2020 karl 1.19 #line 569 "CQL.y"
|
2021 karl 1.15 {
|
2022 kumpf 1.20 CQL_globalParserState->currentRule =
|
2023 dave.sudlik 1.17 "chain->identifier#literal_string";
2024 CQL_DEBUG_TRACE("BISON::chain->identifier#literal_string\n");
|
2025 kumpf 1.20
|
2026 karl 1.16 String tmp = (yyvsp[(1) - (3)]._identifier)->getName().getString();
2027 tmp.append("#").append(*(yyvsp[(3) - (3)]._string));
2028 CQLIdentifier _id(tmp);
2029 (yyval._node) = _factory.makeObject(&_id,Predicate);
2030 chain_state = CQLIDENTIFIER;
2031 ;}
|
2032 karl 1.15 break;
2033
2034 case 28:
|
2035 karl 1.19 #line 582 "CQL.y"
|
2036 karl 1.15 {
|
2037 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain->scoped_property";
2038 CQL_DEBUG_TRACE("BISON::chain->scoped_property\n");
|
2039 kumpf 1.20
|
2040 dave.sudlik 1.17 chain_state = CQLIDENTIFIER;
2041 (yyval._node) = _factory.makeObject((yyvsp[(1) - (1)]._identifier),Predicate);
|
2042 karl 1.16 ;}
|
2043 karl 1.15 break;
2044
2045 case 29:
|
2046 karl 1.19 #line 591 "CQL.y"
|
2047 karl 1.15 {
|
2048 dave.sudlik 1.17 CQL_globalParserState->currentRule = "identifier( arg_list )";
2049 CQL_DEBUG_TRACE("BISON::identifier( arg_list )\n");
|
2050 kumpf 1.20
|
2051 dave.sudlik 1.17 chain_state = CQLFUNCTION;
2052 CQLFunction _func(*(yyvsp[(1) - (4)]._identifier),_arglist);
2053 (yyval._node) = (CQLPredicate*)(_factory.makeObject(&_func,Predicate));
|
2054 venkat.puvvada 1.18 CQL_Arglist_Cleanup();
|
2055 karl 1.16 ;}
|
2056 karl 1.15 break;
2057
2058 case 30:
|
2059 karl 1.19 #line 602 "CQL.y"
|
2060 karl 1.15 {
|
2061 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain->chain.scoped_property";
2062 CQL_DEBUG_TRACE2(
2063 "BISON::chain-> chain TOK_DOT scoped_property : chain_state = %d\n"
2064 ,chain_state);
|
2065 kumpf 1.20
|
2066 karl 1.16 CQLIdentifier *_id;
2067 if(chain_state == CQLIDENTIFIER)
2068 {
|
2069 karl 1.15 _id = ((CQLIdentifier*)(_factory.getObject(
2070 (yyvsp[(1) - (3)]._node),Predicate,Identifier)));
2071 CQLChainedIdentifier _cid(*_id);
2072 _cid.append(*(yyvsp[(3) - (3)]._identifier));
2073 (yyval._node) = _factory.makeObject(&_cid,Predicate);
|
2074 karl 1.16 }
2075 else if(chain_state == CQLCHAINEDIDENTIFIER)
2076 {
|
2077 karl 1.15 CQLChainedIdentifier *_cid;
2078 _cid = ((CQLChainedIdentifier*)(_factory.getObject(
2079 (yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier)));
2080 _cid->append(*(yyvsp[(3) - (3)]._identifier));
2081 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (3)]._node)),_cid,ChainedIdentifier);
2082 (yyval._node) = (yyvsp[(1) - (3)]._node);
|
2083 karl 1.16 }
2084 else /* error */
2085 {
|
2086 karl 1.15 String _msg("chain-> chain TOK_DOT scoped_property :"
2087 " chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
|
2088 karl 1.16
|
2089 karl 1.15 throw CQLSyntaxErrorException(
|
2090 karl 1.16 MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2091 "Chain state not a CQLIdentifier or a"
2092 " CQLChainedIdentifier while parsing rule $0 in"
2093 " position $1.",
2094 "chain.scoped_property",
2095 CQL_globalParserState->currentTokenPos));
2096 }
|
2097 kumpf 1.20
|
2098 karl 1.16 chain_state = CQLCHAINEDIDENTIFIER;
2099 ;}
|
2100 karl 1.15 break;
2101
2102 case 31:
|
2103 karl 1.19 #line 644 "CQL.y"
|
2104 karl 1.15 {
|
2105 dave.sudlik 1.17 CQL_globalParserState->currentRule = "chain->chain.identifier";
2106 CQL_DEBUG_TRACE2("BISON::chain->chain.identifier : chain_state = %d\n"
2107 ,chain_state);
|
2108 kumpf 1.20
|
2109 karl 1.16 if(chain_state == CQLIDENTIFIER)
2110 {
|
2111 karl 1.15 CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(
|
2112 karl 1.16 (yyvsp[(1) - (3)]._node),Predicate,Identifier)));
|
2113 karl 1.15 CQLChainedIdentifier _cid(*_id);
2114 _cid.append(*(yyvsp[(3) - (3)]._identifier));
2115 (yyval._node) = _factory.makeObject(&_cid,Predicate);
|
2116 karl 1.16 }
2117 else if(chain_state == CQLCHAINEDIDENTIFIER)
2118 {
|
2119 kumpf 1.20 CQLChainedIdentifier *_cid =
|
2120 karl 1.16 ((CQLChainedIdentifier*)(_factory.getObject(
2121 (yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier)));
|
2122 karl 1.15 _cid->append(*(yyvsp[(3) - (3)]._identifier));
2123 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (3)]._node)),_cid,ChainedIdentifier);
2124 (yyval._node) = (yyvsp[(1) - (3)]._node);
|
2125 karl 1.16 }
2126 else /* error */
2127 {
|
2128 karl 1.15 String _msg("chain-> chain TOK_DOT identifier : chain state not"
2129 " CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
|
2130 karl 1.16
|
2131 karl 1.15 throw CQLSyntaxErrorException(
|
2132 karl 1.16 MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2133 "Chain state not a CQLIdentifier or a CQLChainedId"
2134 "Identifier while parsing rule $0 in position $1.",
2135 "chain.identifier",
2136 CQL_globalParserState->currentTokenPos));
2137 }
|
2138 karl 1.15 chain_state = CQLCHAINEDIDENTIFIER;
|
2139 karl 1.16 ;}
|
2140 karl 1.15 break;
2141
2142 case 32:
|
2143 karl 1.19 #line 682 "CQL.y"
|
2144 karl 1.15 {
|
2145 kumpf 1.20 CQL_globalParserState->currentRule =
|
2146 dave.sudlik 1.17 "chain->chain.identifier#literal_string";
2147 CQL_DEBUG_TRACE2(
2148 "BISON::chain->chain.identifier#literal_string : chain_state = %d\n"
2149 ,chain_state);
|
2150 kumpf 1.20
|
2151 karl 1.16 if(chain_state == CQLIDENTIFIER)
2152 {
|
2153 karl 1.15 CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(
|
2154 kumpf 1.20 (yyvsp[(1) - (5)]._node),Predicate,Identifier)));
|
2155 karl 1.15 CQLChainedIdentifier _cid(*_id);
2156 String tmp((yyvsp[(3) - (5)]._identifier)->getName().getString());
2157 tmp.append("#").append(*(yyvsp[(5) - (5)]._string));
2158 CQLIdentifier _id1(tmp);
2159 _cid.append(_id1);
2160 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (5)]._node)),&_cid,ChainedIdentifier);
2161 (yyval._node) = (yyvsp[(1) - (5)]._node);
|
2162 karl 1.16 }
2163 else if(chain_state == CQLCHAINEDIDENTIFIER)
2164 {
|
2165 karl 1.15 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)(
2166 _factory.getObject((yyvsp[(1) - (5)]._node),Predicate,ChainedIdentifier)));
2167 String tmp((yyvsp[(3) - (5)]._identifier)->getName().getString());
2168 tmp.append("#").append(*(yyvsp[(5) - (5)]._string));
2169 CQLIdentifier _id1(tmp);
2170 _cid->append(_id1);
2171 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (5)]._node)),_cid,ChainedIdentifier);
2172 (yyval._node) = (yyvsp[(1) - (5)]._node);
|
2173 karl 1.16 }
2174 else /* error */
2175 {
|
2176 karl 1.15 String _msg("chain->chain.identifier#literal_string : chain"
2177 " state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
|
2178 karl 1.16
|
2179 karl 1.15 throw CQLSyntaxErrorException(
2180 MessageLoaderParms("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER",
2181 "Chain state not a CQLIdentifier or a CQLChained"
2182 "Identifier while parsing rule $0 in position $1.",
2183 "chain.identifier#literal_string",
2184 CQL_globalParserState->currentTokenPos) );
|
2185 karl 1.16 }
2186 chain_state = CQLCHAINEDIDENTIFIER;
2187 ;}
|
2188 karl 1.15 break;
2189
2190 case 33:
|
2191 karl 1.19 #line 728 "CQL.y"
|
2192 karl 1.15 {
|
2193 kumpf 1.20 CQL_globalParserState->currentRule =
|
2194 dave.sudlik 1.17 "chain->chain[ array_index_list ]";
2195 CQL_DEBUG_TRACE2(
2196 "BISON::chain->chain[ array_index_list ] : chain_state = %d\n"
2197 ,chain_state);
|
2198 kumpf 1.20
|
2199 karl 1.16 if(chain_state == CQLIDENTIFIER)
2200 {
|
2201 karl 1.15 CQLIdentifier *_id = ((CQLIdentifier*)
2202 (_factory.getObject((yyvsp[(1) - (4)]._node),Predicate,Identifier)));
2203 String tmp = _id->getName().getString();
2204 tmp.append("[").append(*(yyvsp[(3) - (4)]._string)).append("]");
2205 CQLIdentifier _id1(tmp);
2206 CQLChainedIdentifier _cid(_id1);
2207 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (4)]._node)),&_cid,ChainedIdentifier);
|
2208 kumpf 1.20 (yyval._node) = (yyvsp[(1) - (4)]._node);
|
2209 karl 1.16 }
2210 else if(chain_state == CQLCHAINEDIDENTIFIER || chain_state == CQLVALUE)
2211 {
|
2212 karl 1.15 CQLPredicate* _pred = (CQLPredicate*)(yyvsp[(1) - (4)]._node);
2213 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)
2214 (_factory.getObject
2215 ((yyvsp[(1) - (4)]._node),Predicate,ChainedIdentifier)));
2216 CQLIdentifier tmpid = _cid->getLastIdentifier();
2217 String tmp = tmpid.getName().getString();
2218 tmp.append("[").append(*(yyvsp[(3) - (4)]._string)).append("]");
2219 CQLIdentifier _id1(tmp);
2220 CQLChainedIdentifier _tmpcid(_id1);
|
2221 karl 1.16
|
2222 karl 1.15 if(_cid->size() == 1)
2223 {
|
2224 karl 1.16 _cid = &_tmpcid;
|
2225 karl 1.15 }
2226 else
2227 {
|
2228 karl 1.16 _cid->append(_id1);
|
2229 karl 1.15 }
2230 _factory.setObject(((CQLPredicate*)(yyvsp[(1) - (4)]._node)),_cid,ChainedIdentifier);
2231 (yyval._node) = (yyvsp[(1) - (4)]._node);
|
2232 karl 1.16 }
2233 else /* error */
2234 {
|
2235 karl 1.15 String _msg("chain->chain[ array_index_list ] : chain state not"
2236 " CQLIDENTIFIER or CQLCHAINEDIDENTIFIER or CQLVALUE");
|
2237 karl 1.16
|
2238 karl 1.15 throw CQLSyntaxErrorException(
2239 MessageLoaderParms(
2240 "CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER_OR_VALUE",
2241 "Chain state not a CQLIdentifier or a "
2242 "CQLChainedIdentifier or a CQLValue while parsing rule"
2243 " $0 in position $1.",
2244 "chain->chain[ array_index_list ]",
2245 CQL_globalParserState->currentTokenPos) );
2246 }
|
2247 karl 1.16 ;}
|
2248 karl 1.15 break;
2249
2250 case 34:
|
2251 karl 1.19 #line 787 "CQL.y"
|
2252 karl 1.15 {
|
2253 dave.sudlik 1.17 CQL_globalParserState->currentRule = "concat->chain";
2254 CQL_DEBUG_TRACE("BISON::concat->chain\n");
|
2255 kumpf 1.20
|
2256 karl 1.16 (yyval._predicate) = ((CQLPredicate*)(yyvsp[(1) - (1)]._node));
2257 ;}
|
2258 karl 1.15 break;
2259
2260 case 35:
|
2261 karl 1.19 #line 795 "CQL.y"
|
2262 karl 1.15 {
|
2263 kumpf 1.20 CQL_globalParserState->currentRule =
|
2264 dave.sudlik 1.17 "concat->concat || literal_string";
2265 CQL_DEBUG_TRACE("BISON::concat->concat || literal_string\n");
|
2266 kumpf 1.20
|
2267 karl 1.16 CQLValue* tmpval = new CQLValue(*(yyvsp[(3) - (3)]._string));
2268 _ObjPtr._ptr = tmpval;
2269 _ObjPtr.type = Val;
|
2270 kumpf 1.20 _ptrs.append(_ObjPtr);
2271
|
2272 karl 1.16 if((CQLPredicate*)(yyvsp[(1) - (3)]._predicate)->isSimple())
2273 {
2274 CQLSimplePredicate sp = ((CQLPredicate*)(yyvsp[(1) - (3)]._predicate))->getSimplePredicate();
2275 if(sp.isSimple())
|
2276 karl 1.15 {
|
2277 karl 1.16 CQLExpression exp = sp.getLeftExpression();
2278 if(exp.isSimple())
2279 {
2280 CQLTerm* _term = ((CQLTerm*)
2281 (_factory.getObject((yyvsp[(1) - (3)]._predicate), Predicate, Term)));
2282 // check for simple literal values
2283 Array<CQLFactor> factors = _term->getFactors();
2284 for(Uint32 i = 0; i < factors.size(); i++)
2285 {
2286 if(!factors[i].isSimpleValue())
2287 {
2288 MessageLoaderParms mparms(
2289 "CQL.CQL_y.CONCAT_PRODUCTION_FACTORS_NOT"
2290 "_SIMPLE",
2291 "The CQLFactors are not simple while"
2292 " processing rule $0.",
2293 CQL_globalParserState->currentRule);
2294 throw CQLSyntaxErrorException(mparms);
2295 }
2296 else /* !factors[i].isSimpleValue() */
|
2297 karl 1.15 {
|
2298 karl 1.16 CQLValue val = factors[i].getValue();
2299 if(val.getValueType() != CQLValue::String_type)
2300 {
2301 MessageLoaderParms mparms(
2302 "CQL.CQL_y."
2303 "CONCAT_PRODUCTION_VALUE_NOT_LITERAL",
2304 "The CQLValue is not a string literal while"
2305 " processing rule $0.",
|
2306 karl 1.15 CQL_globalParserState->currentRule);
|
2307 karl 1.16 throw CQLSyntaxErrorException(mparms);
2308 }
|
2309 karl 1.15 }
|
2310 karl 1.16 } // End For factors.size() Loop
2311
2312 CQLFactor* _fctr2 = ((CQLFactor*)
2313 (_factory.makeObject(tmpval, Factor)));
2314 _term->appendOperation(concat,*_fctr2);
2315 (yyval._predicate) = (CQLPredicate*)(_factory.makeObject
|
2316 kumpf 1.20 (_term,Predicate));
|
2317 karl 1.16 }
2318 else /* exp.isSimple() */
2319 {
2320 MessageLoaderParms mparms(
|
2321 karl 1.15 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2322 "The $0 is not simple while processing rule $1.",
|
2323 karl 1.16 "CQLExpression",
|
2324 karl 1.15 CQL_globalParserState->currentRule);
|
2325 karl 1.16 throw CQLSyntaxErrorException(mparms);
2326 }
2327 }
2328 else /*sp.isSimple() */
2329 {
2330 MessageLoaderParms mparms(
2331 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2332 "The $0 is not simple while processing rule $1.",
2333 "CQLSimplePredicate",
2334 CQL_globalParserState->currentRule);
2335 throw CQLSyntaxErrorException(mparms);
2336 }
2337 }
2338 else /* end if((CQLPredicate*)$1->isSimple()) */
2339 {
2340 MessageLoaderParms mparms(
2341 "CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
2342 "The $0 is not simple while processing rule $1.",
2343 "CQLPredicate",
2344 CQL_globalParserState->currentRule);
2345 throw CQLSyntaxErrorException(mparms);
2346 karl 1.16 }
2347 ;}
|
2348 karl 1.15 break;
2349
2350 case 36:
|
2351 karl 1.19 #line 884 "CQL.y"
|
2352 karl 1.15 {
|
2353 dave.sudlik 1.17 CQL_globalParserState->currentRule = "factor->concat";
2354 CQL_DEBUG_TRACE("BISON::factor->concat\n");
|
2355 kumpf 1.20
|
2356 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2357 ;}
|
2358 karl 1.15 break;
2359
2360 case 37:
|
2361 karl 1.19 #line 915 "CQL.y"
|
2362 karl 1.15 {
|
2363 dave.sudlik 1.17 CQL_globalParserState->currentRule = "term->factor";
2364 CQL_DEBUG_TRACE("BISON::term->factor\n");
|
2365 kumpf 1.20
|
2366 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2367 ;}
|
2368 karl 1.15 break;
2369
2370 case 38:
|
2371 karl 1.19 #line 944 "CQL.y"
|
2372 karl 1.15 {
|
2373 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arith->term";
2374 CQL_DEBUG_TRACE("BISON::arith->term\n");
|
2375 kumpf 1.20
|
2376 dave.sudlik 1.17 //CQLPredicate* _pred = new CQLPredicate(*$1);
2377 // _factory._predicates.append(_pred);
2378 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2379 ;}
|
2380 karl 1.15 break;
2381
2382 case 39:
|
2383 karl 1.19 #line 975 "CQL.y"
|
2384 karl 1.15 {
|
2385 dave.sudlik 1.17 CQL_globalParserState->currentRule = "value_symbol->#literal_string";
2386 CQL_DEBUG_TRACE("BISON::value_symbol->#literal_string\n");
|
2387 kumpf 1.20
|
2388 karl 1.16 String tmp("#");
2389 tmp.append(*(yyvsp[(2) - (2)]._string));
2390 CQLIdentifier tmpid(tmp);
2391 (yyval._value) = new CQLValue(tmpid);
2392 _ObjPtr._ptr = (yyval._value);
2393 _ObjPtr.type = Val;
2394 _ptrs.append(_ObjPtr);
2395 ;}
|
2396 karl 1.15 break;
2397
2398 case 40:
|
2399 karl 1.19 #line 990 "CQL.y"
|
2400 karl 1.15 {
|
2401 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arith_or_value_symbol->arith";
2402 CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->arith\n");
|
2403 kumpf 1.20
|
2404 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2405 ;}
|
2406 karl 1.15 break;
2407
2408 case 41:
|
2409 karl 1.19 #line 997 "CQL.y"
|
2410 karl 1.15 {
|
2411 karl 1.16 /* make into predicate */
|
2412 kumpf 1.20 CQL_globalParserState->currentRule =
|
2413 dave.sudlik 1.17 "arith_or_value_symbol->value_symbol";
2414 CQL_DEBUG_TRACE("BISON::arith_or_value_symbol->value_symbol\n");
|
2415 kumpf 1.20
|
2416 karl 1.16 CQLFactor _fctr(*(yyvsp[(1) - (1)]._value));
2417 (yyval._predicate) = (CQLPredicate*)(_factory.makeObject(&_fctr, Predicate));
2418 ;}
|
2419 karl 1.15 break;
2420
2421 case 42:
|
2422 karl 1.19 #line 1009 "CQL.y"
|
2423 karl 1.15 {
|
2424 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_EQ";
2425 CQL_DEBUG_TRACE("BISON::comp_op->TOK_EQ\n");
|
2426 kumpf 1.20
|
2427 dave.sudlik 1.17 (yyval._opType) = EQ;
|
2428 karl 1.16 ;}
|
2429 karl 1.15 break;
2430
2431 case 43:
|
2432 karl 1.19 #line 1016 "CQL.y"
|
2433 karl 1.15 {
|
2434 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_NE";
2435 CQL_DEBUG_TRACE("BISON::comp_op->TOK_NE\n");
2436 (yyval._opType) = NE;
|
2437 karl 1.16 ;}
|
2438 karl 1.15 break;
2439
2440 case 44:
|
2441 karl 1.19 #line 1022 "CQL.y"
|
2442 karl 1.15 {
|
2443 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_GT";
2444 CQL_DEBUG_TRACE("BISON::comp_op->TOK_GT\n");
|
2445 kumpf 1.20
|
2446 dave.sudlik 1.17 (yyval._opType) = GT;
|
2447 karl 1.16 ;}
|
2448 karl 1.15 break;
2449
2450 case 45:
|
2451 karl 1.19 #line 1029 "CQL.y"
|
2452 karl 1.15 {
|
2453 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_LT";
2454 CQL_DEBUG_TRACE("BISON::comp_op->TOK_LT\n");
2455 (yyval._opType) = LT;
|
2456 karl 1.16 ;}
|
2457 karl 1.15 break;
2458
2459 case 46:
|
2460 karl 1.19 #line 1035 "CQL.y"
|
2461 karl 1.15 {
|
2462 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_GE";
2463 CQL_DEBUG_TRACE("BISON::comp_op->TOK_GE\n");
2464 (yyval._opType) = GE;
|
2465 karl 1.16 ;}
|
2466 karl 1.15 break;
2467
2468 case 47:
|
2469 karl 1.19 #line 1041 "CQL.y"
|
2470 karl 1.15 {
|
2471 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp_op->TOK_LE";
2472 CQL_DEBUG_TRACE("BISON::comp_op->TOK_LE\n");
2473 (yyval._opType) = LE;
|
2474 karl 1.16 ;}
|
2475 karl 1.15 break;
2476
2477 case 48:
|
2478 karl 1.19 #line 1049 "CQL.y"
|
2479 karl 1.15 {
|
2480 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith";
2481 CQL_DEBUG_TRACE("BISON::comp->arith\n");
|
2482 kumpf 1.20
|
2483 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2484 ;}
|
2485 karl 1.15 break;
2486
2487 case 49:
|
2488 karl 1.19 #line 1056 "CQL.y"
|
2489 karl 1.15 {
|
2490 kumpf 1.20 CQL_globalParserState->currentRule =
|
2491 dave.sudlik 1.17 "comp->arith TOK_IS TOK_NOT TOK_NULL";
2492 CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NOT TOK_NULL\n");
|
2493 kumpf 1.20
|
2494 karl 1.16 CQLExpression *_expr =
|
2495 dave.sudlik 1.17 (CQLExpression*)(_factory.getObject((yyvsp[(1) - (4)]._predicate),Expression));
|
2496 karl 1.16 CQLSimplePredicate _sp(*_expr, IS_NOT_NULL);
2497 _factory.setObject((yyvsp[(1) - (4)]._predicate),&_sp,SimplePredicate);
2498 (yyval._predicate) = (yyvsp[(1) - (4)]._predicate);
2499 ;}
|
2500 karl 1.15 break;
2501
2502 case 50:
|
2503 karl 1.19 #line 1068 "CQL.y"
|
2504 karl 1.15 {
|
2505 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith TOK_IS TOK_NULL";
2506 CQL_DEBUG_TRACE("BISON::comp->arith TOK_IS TOK_NULL\n");
|
2507 kumpf 1.20
|
2508 karl 1.16 CQLExpression *_expr =
|
2509 dave.sudlik 1.17 (CQLExpression*)(_factory.getObject((yyvsp[(1) - (3)]._predicate),Expression));
|
2510 karl 1.16 CQLSimplePredicate _sp(*_expr, IS_NULL);
2511 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2512 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2513 ;}
|
2514 karl 1.15 break;
2515
2516 case 51:
|
2517 karl 1.19 #line 1079 "CQL.y"
|
2518 karl 1.15 {
|
2519 kumpf 1.20 CQL_globalParserState->currentRule =
|
2520 dave.sudlik 1.17 "comp->arith comp_op arith_or_value_symbol";
2521 CQL_DEBUG_TRACE("BISON::comp->arith comp_op arith_or_value_symbol\n");
|
2522 kumpf 1.20
|
2523 karl 1.16 if((yyvsp[(1) - (3)]._predicate)->isSimple() && (yyvsp[(3) - (3)]._predicate)->isSimple())
2524 {
|
2525 karl 1.15 CQLExpression* _exp1 = (CQLExpression*)
|
2526 karl 1.16 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
|
2527 karl 1.15 CQLExpression* _exp2 = (CQLExpression*)
|
2528 karl 1.16 (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
|
2529 karl 1.15 CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2530 (yyval._predicate) = new CQLPredicate(_sp);
2531 _ObjPtr._ptr = (yyval._predicate);
|
2532 humberto 1.8 _ObjPtr.type = Pred;
2533 _ptrs.append(_ObjPtr);
|
2534 karl 1.16 }
2535 else /* error */
2536 {
2537 String _msg("comp->arith comp_op arith_or_value_symbol : $1 is "
2538 "not simple OR $3 is not simple");
2539 throw CQLSyntaxErrorException(
2540 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2541 "The CQLSimplePredicate is not simple while parsing "
2542 "rule $0 in position $1.",
2543 "comp->arith comp_op arith_or_value_symbol",
2544 CQL_globalParserState->currentTokenPos) );
2545 }
2546 ;}
|
2547 karl 1.15 break;
2548
2549 case 52:
|
2550 karl 1.19 #line 1109 "CQL.y"
|
2551 karl 1.15 {
|
2552 kumpf 1.20 CQL_globalParserState->currentRule =
|
2553 dave.sudlik 1.17 "comp->value_symbol comp_op arith";
2554 CQL_DEBUG_TRACE("BISON::comp->value_symbol comp_op arith\n");
|
2555 kumpf 1.20
|
2556 karl 1.16 if((yyvsp[(3) - (3)]._predicate)->isSimple())
2557 {
|
2558 karl 1.15 CQLExpression* _exp1 = (CQLExpression*)
2559 (_factory.makeObject((yyvsp[(1) - (3)]._value), Expression));
2560 CQLExpression* _exp2 = (CQLExpression*)
2561 (_factory.getObject((yyvsp[(3) - (3)]._predicate),Predicate,Expression));
2562 CQLSimplePredicate _sp(*_exp1, *_exp2, (yyvsp[(2) - (3)]._opType));
2563 (yyval._predicate) = new CQLPredicate(_sp);
2564 _ObjPtr._ptr = (yyval._predicate);
|
2565 humberto 1.8 _ObjPtr.type = Pred;
2566 _ptrs.append(_ObjPtr);
|
2567 karl 1.16 }
2568 else /* error */
2569 {
|
2570 karl 1.15 String _msg("comp->value_symbol comp_op arith : $3 is not simple");
2571 throw CQLSyntaxErrorException(
|
2572 karl 1.16 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE",
2573 "The CQLSimplePredicate is not simple while parsing"
2574 " rule $0 in position $1.",
2575 "comp->value_symbol comp_op arith",
2576 CQL_globalParserState->currentTokenPos) );
|
2577 kumpf 1.20
|
2578 karl 1.16 }
2579 ;}
|
2580 karl 1.15 break;
2581
2582 case 53:
|
2583 karl 1.19 #line 1139 "CQL.y"
|
2584 karl 1.15 {
|
2585 kumpf 1.20 /* make sure $1 isSimple(), get its expression, make
2586 simplepred->predicate
|
2587 karl 1.16 */
|
2588 dave.sudlik 1.17 CQL_globalParserState->currentRule = "comp->arith _TOK_ISA identifier";
2589 CQL_DEBUG_TRACE("BISON::comp->arith _TOK_ISA identifier\n");
|
2590 kumpf 1.20
|
2591 karl 1.16 CQLExpression *_expr1 = (CQLExpression*)
2592 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
2593 CQLChainedIdentifier _cid(*(yyvsp[(3) - (3)]._identifier));
2594 CQLExpression *_expr2 = (CQLExpression*)
2595 (_factory.makeObject(&_cid,Expression));
2596 CQLSimplePredicate _sp(*_expr1, *_expr2, ISA);
2597 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2598 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
2599 ;}
|
2600 karl 1.15 break;
2601
2602 case 54:
|
2603 karl 1.19 #line 1156 "CQL.y"
|
2604 karl 1.15 {
|
2605 kumpf 1.20 CQL_globalParserState->currentRule =
|
2606 dave.sudlik 1.17 "comp->arith TOK_LIKE literal_string";
2607 CQL_DEBUG_TRACE("BISON::comp->arith TOK_LIKE literal_string\n");
|
2608 kumpf 1.20
|
2609 dave.sudlik 1.17 CQLExpression *_expr1 = (CQLExpression*)
|
2610 karl 1.15 (_factory.getObject((yyvsp[(1) - (3)]._predicate),Predicate,Expression));
|
2611 dave.sudlik 1.17 CQLValue _val(*(yyvsp[(3) - (3)]._string));
2612 CQLExpression *_expr2 = (CQLExpression*)
|
2613 karl 1.15 (_factory.makeObject(&_val,Expression));
|
2614 dave.sudlik 1.17 CQLSimplePredicate _sp(*_expr1, *_expr2, LIKE);
2615 _factory.setObject((yyvsp[(1) - (3)]._predicate),&_sp,SimplePredicate);
2616 (yyval._predicate) = (yyvsp[(1) - (3)]._predicate);
|
2617 karl 1.16 ;}
|
2618 karl 1.15 break;
2619
2620 case 55:
|
2621 karl 1.19 #line 1172 "CQL.y"
|
2622 karl 1.15 {
|
2623 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_factor->comp";
2624 CQL_DEBUG_TRACE("BISON::expr_factor->comp\n");
|
2625 kumpf 1.20
|
2626 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2627 ;}
|
2628 karl 1.15 break;
2629
2630 case 56:
|
2631 karl 1.19 #line 1179 "CQL.y"
|
2632 karl 1.15 {
|
2633 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_factor->TOK_NOT comp";
2634 CQL_DEBUG_TRACE("BISON::expr_factor->TOK_NOT comp\n");
|
2635 kumpf 1.20
|
2636 karl 1.16 (yyvsp[(2) - (2)]._predicate)->setInverted(!((yyvsp[(2) - (2)]._predicate)->getInverted()));
2637 (yyval._predicate) = (yyvsp[(2) - (2)]._predicate);
2638 ;}
|
2639 karl 1.15 break;
2640
2641 case 57:
|
2642 karl 1.19 #line 1189 "CQL.y"
|
2643 karl 1.15 {
|
2644 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr_term->expr_factor";
2645 CQL_DEBUG_TRACE("BISON::expr_term->expr_factor\n");
|
2646 kumpf 1.20
|
2647 karl 1.16 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
2648 ;}
|
2649 karl 1.15 break;
2650
2651 case 58:
|
2652 karl 1.19 #line 1196 "CQL.y"
|
2653 karl 1.15 {
|
2654 kumpf 1.20 CQL_globalParserState->currentRule =
|
2655 dave.sudlik 1.17 "expr_term->expr_term AND expr_factor";
2656 CQL_DEBUG_TRACE("BISON::expr_term->expr_term AND expr_factor\n");
|
2657 kumpf 1.20
|
2658 karl 1.16 (yyval._predicate) = new CQLPredicate();
2659 (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
|
2660 kumpf 1.20 (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), AND);
|
2661 karl 1.16 _ObjPtr._ptr = (yyval._predicate);
2662 _ObjPtr.type = Pred;
2663 _ptrs.append(_ObjPtr);
2664 ;}
|
2665 karl 1.15 break;
2666
2667 case 59:
|
2668 karl 1.19 #line 1211 "CQL.y"
|
2669 karl 1.15 {
|
2670 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr->expr_term";
2671 CQL_DEBUG_TRACE("BISON::expr->expr_term\n");
|
2672 kumpf 1.20
2673 (yyval._predicate) = (yyvsp[(1) - (1)]._predicate);
|
2674 karl 1.16 ;}
|
2675 karl 1.15 break;
2676
2677 case 60:
|
2678 karl 1.19 #line 1218 "CQL.y"
|
2679 karl 1.15 {
|
2680 dave.sudlik 1.17 CQL_globalParserState->currentRule = "expr->expr OR expr_term";
2681 CQL_DEBUG_TRACE("BISON::expr->expr OR expr_term\n");
|
2682 kumpf 1.20
|
2683 karl 1.16 (yyval._predicate) = new CQLPredicate();
2684 (yyval._predicate)->appendPredicate(*(yyvsp[(1) - (3)]._predicate));
2685 (yyval._predicate)->appendPredicate(*(yyvsp[(3) - (3)]._predicate), OR);
2686 _ObjPtr._ptr = (yyval._predicate);
2687 _ObjPtr.type = Pred;
2688 _ptrs.append(_ObjPtr);
2689 ;}
|
2690 karl 1.15 break;
2691
2692 case 61:
|
2693 karl 1.19 #line 1231 "CQL.y"
|
2694 karl 1.15 {;;}
2695 break;
2696
2697 case 62:
|
2698 karl 1.19 #line 1251 "CQL.y"
|
2699 karl 1.15 {
|
2700 dave.sudlik 1.17 CQL_globalParserState->currentRule = "arg_list->arg_list_sub->expr";
2701 CQL_DEBUG_TRACE("BISON::arg_list->arg_list_sub->expr\n");
|
2702 kumpf 1.20
|
2703 karl 1.16 _arglist.append(*(yyvsp[(1) - (1)]._predicate));
2704 /*
2705 since arg_list can loop back on itself,
2706 we need to store away previous solutions
2707 production. We keep track of previous productions
2708 in the _arglist array and later pass that to CQLFunction
2709 as part of chain: identifier TOK_LPAR arg_list TOK_RPAR
2710 */
2711 ;}
|
2712 karl 1.15 break;
|
2713 chuck 1.2
|
2714 karl 1.15 case 63:
|
2715 karl 1.19 #line 1310 "CQL.y"
|
2716 karl 1.15 {
|
2717 dave.sudlik 1.17 CQL_globalParserState->currentRule = "from_specifier->class_path";
2718 CQL_DEBUG_TRACE("BISON::from_specifier->class_path\n");
|
2719 kumpf 1.20
|
2720 karl 1.16 CQL_globalParserState->statement->appendClassPath(*(yyvsp[(1) - (1)]._identifier));
2721 ;}
|
2722 karl 1.15 break;
|
2723 chuck 1.2
|
2724 karl 1.15 case 64:
|
2725 karl 1.19 #line 1317 "CQL.y"
|
2726 karl 1.15 {
|
2727 kumpf 1.20 CQL_globalParserState->currentRule =
|
2728 dave.sudlik 1.17 "from_specifier->class_path TOK_AS identifier";
2729 CQL_DEBUG_TRACE(
2730 "BISON::from_specifier->class_path TOK_AS identifier\n");
|
2731 kumpf 1.20
|
2732 karl 1.16 CQLIdentifier _class(*(yyvsp[(1) - (3)]._identifier));
2733 String _alias((yyvsp[(3) - (3)]._identifier)->getName().getString());
2734 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2735 CQL_globalParserState->statement->appendClassPath(_class);
2736 ;}
|
2737 karl 1.15 break;
2738
2739 case 65:
|
2740 karl 1.19 #line 1329 "CQL.y"
|
2741 karl 1.15 {
|
2742 kumpf 1.20 CQL_globalParserState->currentRule =
|
2743 dave.sudlik 1.17 "from_specifier->class_path identifier";
2744 CQL_DEBUG_TRACE("BISON::from_specifier->class_path identifier\n");
|
2745 kumpf 1.20
|
2746 karl 1.16 CQLIdentifier _class(*(yyvsp[(1) - (2)]._identifier));
2747 String _alias((yyvsp[(2) - (2)]._identifier)->getName().getString());
2748 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
2749 CQL_globalParserState->statement->appendClassPath(_class);
2750 ;}
|
2751 karl 1.15 break;
2752
2753 case 66:
|
2754 karl 1.19 #line 1342 "CQL.y"
|
2755 karl 1.15 {
|
2756 dave.sudlik 1.17 CQL_globalParserState->currentRule = "from_criteria->from_specifier";
2757 CQL_DEBUG_TRACE("BISON::from_criteria->from_specifier\n");
|
2758 karl 1.16 ;}
|
2759 karl 1.15 break;
2760
2761 case 67:
|
2762 karl 1.19 #line 1349 "CQL.y"
|
2763 karl 1.15 {
|
2764 dave.sudlik 1.17 CQL_globalParserState->currentRule = "star_expr->TOK_STAR";
2765 CQL_DEBUG_TRACE("BISON::star_expr->TOK_STAR\n");
|
2766 kumpf 1.20
|
2767 karl 1.15 CQLIdentifier _id("*");
|
2768 karl 1.16 (yyval._chainedIdentifier) = (CQLChainedIdentifier*)
2769 (_factory.makeObject(&_id,ChainedIdentifier));
2770 ;}
|
2771 karl 1.15 break;
2772
2773 case 68:
|
2774 karl 1.19 #line 1358 "CQL.y"
|
2775 karl 1.15 {
|
2776 dave.sudlik 1.17 CQL_globalParserState->currentRule = "star_expr->chain.*";
2777 CQL_DEBUG_TRACE("BISON::star_expr->chain.*\n");
|
2778 kumpf 1.20
|
2779 karl 1.16 CQLChainedIdentifier* _tmp = (CQLChainedIdentifier*)
2780 (_factory.getObject((yyvsp[(1) - (3)]._node),Predicate,ChainedIdentifier));
2781 CQLChainedIdentifier* _cid = new CQLChainedIdentifier(*_tmp);
2782 CQLIdentifier _id("*");
2783 _cid->append(_id);
2784 (yyval._chainedIdentifier) = _cid;
2785 _ObjPtr._ptr = (yyval._chainedIdentifier);
2786 _ObjPtr.type = CId;
2787 _ptrs.append(_ObjPtr);
2788 ;}
|
2789 karl 1.15 break;
2790
2791 case 69:
|
2792 karl 1.19 #line 1375 "CQL.y"
|
2793 karl 1.15 {
|
2794 dave.sudlik 1.17 CQL_globalParserState->currentRule = "selected_entry->expr";
2795 CQL_DEBUG_TRACE("BISON::selected_entry->expr\n");
|
2796 kumpf 1.20
|
2797 karl 1.16 if((yyvsp[(1) - (1)]._predicate)->isSimpleValue())
2798 {
|
2799 karl 1.15 CQLChainedIdentifier *_cid = (CQLChainedIdentifier*)
2800 (_factory.getObject((yyvsp[(1) - (1)]._predicate),Predicate,ChainedIdentifier));
2801 CQL_globalParserState->statement->appendSelectIdentifier(*_cid);
|
2802 karl 1.16 }
2803 else /* errot*/
2804 {
|
2805 karl 1.15 String _msg("selected_entry->expr : $1 is not a simple value");
2806 throw CQLSyntaxErrorException(
2807 MessageLoaderParms("CQL.CQL_y.NOT_SIMPLE_VALUE",
2808 "The CQLPredicate is not a simple value while "
2809 "parsing rule $0 in position $1.",
2810 "selected_entry->expr",
|
2811 kumpf 1.20 CQL_globalParserState->currentTokenPos) );
|
2812 karl 1.16 }
2813 ;}
|
2814 karl 1.15 break;
2815
2816 case 70:
|
2817 karl 1.19 #line 1397 "CQL.y"
|
2818 karl 1.15 {
|
2819 dave.sudlik 1.17 CQL_globalParserState->currentRule = "selected_entry->star_expr";
2820 CQL_DEBUG_TRACE("BISON::selected_entry->star_expr\n");
|
2821 kumpf 1.20
|
2822 karl 1.16 CQL_globalParserState->statement->appendSelectIdentifier(*(yyvsp[(1) - (1)]._chainedIdentifier));
2823 ;}
|
2824 karl 1.15 break;
2825
2826 case 71:
|
2827 karl 1.19 #line 1406 "CQL.y"
|
2828 karl 1.15 {
|
2829 kumpf 1.20 CQL_globalParserState->currentRule =
|
2830 dave.sudlik 1.17 "select_list->selected_entry select_list_tail";
2831 CQL_DEBUG_TRACE(
2832 "BISON::select_list->selected_entry select_list_tail\n");
|
2833 karl 1.16 ;}
|
2834 karl 1.15 break;
2835
2836 case 72:
|
2837 karl 1.19 #line 1414 "CQL.y"
|
2838 karl 1.15 {;;}
2839 break;
2840
2841 case 73:
|
2842 karl 1.19 #line 1417 "CQL.y"
|
2843 karl 1.15 {
|
2844 kumpf 1.20 CQL_globalParserState->currentRule =
|
2845 dave.sudlik 1.17 "select_list_tail->TOK_COMMA selected_entry select_list_tail";
2846 CQL_DEBUG_TRACE(
2847 "BISON::select_list_tail->TOK_COMMA"
2848 " selected_entry select_list_tail\n");
|
2849 karl 1.16 ;}
|
2850 karl 1.15 break;
2851
2852 case 74:
|
2853 karl 1.19 #line 1427 "CQL.y"
|
2854 karl 1.15 {
|
2855 dave.sudlik 1.17 CQL_globalParserState->currentRule = "search_condition->expr";
2856 CQL_DEBUG_TRACE("BISON::search_condition->expr\n");
|
2857 kumpf 1.20
|
2858 karl 1.16 CQL_globalParserState->statement->setPredicate(*(yyvsp[(1) - (1)]._predicate));
2859 ;}
|
2860 karl 1.15 break;
2861
2862 case 75:
|
2863 karl 1.19 #line 1435 "CQL.y"
|
2864 karl 1.15 {;}
2865 break;
2866
2867 case 76:
|
2868 karl 1.19 #line 1438 "CQL.y"
|
2869 karl 1.15 {
|
2870 kumpf 1.20 CQL_globalParserState->currentRule =
|
2871 dave.sudlik 1.17 "optional_where->TOK_WHERE search_condition";
2872 CQL_DEBUG_TRACE(
2873 "BISON::optional_where->TOK_WHERE search_condition\n");
|
2874 kumpf 1.20
|
2875 karl 1.16 CQL_globalParserState->statement->setHasWhereClause();
2876 ;}
|
2877 karl 1.15 break;
2878
2879 case 77:
|
2880 karl 1.19 #line 1449 "CQL.y"
|
2881 karl 1.15 {
|
2882 dave.sudlik 1.17 CQL_globalParserState->currentRule = "select_statement";
2883 CQL_DEBUG_TRACE("select_statement\n");
|
2884 kumpf 1.20
|
2885 karl 1.16 CQL_Bison_Cleanup();
2886 ;}
|
2887 karl 1.15 break;
2888
2889
2890 /* Line 1267 of yacc.c. */
|
2891 venkat.puvvada 1.18 #line 2889 "CQLtemp"
|
2892 karl 1.15 default: break;
2893 }
2894 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2895
2896 YYPOPSTACK (yylen);
2897 yylen = 0;
2898 YY_STACK_PRINT (yyss, yyssp);
2899
2900 *++yyvsp = yyval;
2901
2902
2903 /* Now `shift' the result of the reduction. Determine what state
2904 that goes to, based on the state we popped back to and the rule
2905 number reduced by. */
2906
2907 yyn = yyr1[yyn];
2908
2909 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2910 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2911 yystate = yytable[yystate];
2912 else
2913 karl 1.15 yystate = yydefgoto[yyn - YYNTOKENS];
2914
2915 goto yynewstate;
2916
2917
2918 /*------------------------------------.
2919 | yyerrlab -- here on detecting error |
2920 `------------------------------------*/
2921 yyerrlab:
2922 /* If not already recovering from an error, report this error. */
2923 if (!yyerrstatus)
2924 {
2925 ++yynerrs;
2926 #if ! YYERROR_VERBOSE
2927 yyerror (YY_("syntax error"));
2928 #else
2929 {
|
2930 karl 1.16 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2931 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2932 {
2933 YYSIZE_T yyalloc = 2 * yysize;
2934 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2935 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2936 if (yymsg != yymsgbuf)
2937 YYSTACK_FREE (yymsg);
2938 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2939 if (yymsg)
2940 yymsg_alloc = yyalloc;
2941 else
2942 {
2943 yymsg = yymsgbuf;
2944 yymsg_alloc = sizeof yymsgbuf;
2945 }
2946 }
2947
2948 if (0 < yysize && yysize <= yymsg_alloc)
2949 {
2950 (void) yysyntax_error (yymsg, yystate, yychar);
2951 karl 1.16 yyerror (yymsg);
2952 }
2953 else
2954 {
2955 yyerror (YY_("syntax error"));
2956 if (yysize != 0)
2957 goto yyexhaustedlab;
2958 }
|
2959 karl 1.15 }
2960 #endif
2961 }
2962
2963
2964
2965 if (yyerrstatus == 3)
2966 {
2967 /* If just tried and failed to reuse look-ahead token after an
|
2968 karl 1.16 error, discard it. */
|
2969 karl 1.15
2970 if (yychar <= YYEOF)
|
2971 karl 1.16 {
2972 /* Return failure if at end of input. */
2973 if (yychar == YYEOF)
2974 YYABORT;
2975 }
|
2976 karl 1.15 else
|
2977 karl 1.16 {
2978 yydestruct ("Error: discarding",
2979 yytoken, &yylval);
2980 yychar = YYEMPTY;
2981 }
|
2982 chuck 1.2 }
|
2983 karl 1.15
2984 /* Else will try to reuse look-ahead token after shifting the error
2985 token. */
2986 goto yyerrlab1;
2987
2988
2989 /*---------------------------------------------------.
2990 | yyerrorlab -- error raised explicitly by YYERROR. |
2991 `---------------------------------------------------*/
2992 yyerrorlab:
2993
2994 /* Pacify compilers like GCC when the user code never invokes
2995 YYERROR and the label yyerrorlab therefore never appears in user
2996 code. */
2997 if (/*CONSTCOND*/ 0)
2998 goto yyerrorlab;
2999
3000 /* Do not reclaim the symbols of the rule which action triggered
3001 this YYERROR. */
3002 YYPOPSTACK (yylen);
3003 yylen = 0;
3004 karl 1.15 YY_STACK_PRINT (yyss, yyssp);
3005 yystate = *yyssp;
3006 goto yyerrlab1;
3007
3008
3009 /*-------------------------------------------------------------.
3010 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3011 `-------------------------------------------------------------*/
3012 yyerrlab1:
|
3013 karl 1.16 yyerrstatus = 3; /* Each real token shifted decrements this. */
|
3014 karl 1.15
3015 for (;;)
|
3016 chuck 1.2 {
|
3017 karl 1.15 yyn = yypact[yystate];
3018 if (yyn != YYPACT_NINF)
|
3019 karl 1.16 {
3020 yyn += YYTERROR;
3021 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3022 {
3023 yyn = yytable[yyn];
3024 if (0 < yyn)
3025 break;
3026 }
3027 }
|
3028 karl 1.15
3029 /* Pop the current state because it cannot handle the error token. */
3030 if (yyssp == yyss)
|
3031 karl 1.16 YYABORT;
|
3032 karl 1.15
3033
3034 yydestruct ("Error: popping",
|
3035 karl 1.16 yystos[yystate], yyvsp);
|
3036 karl 1.15 YYPOPSTACK (1);
3037 yystate = *yyssp;
3038 YY_STACK_PRINT (yyss, yyssp);
3039 }
3040
3041 if (yyn == YYFINAL)
3042 YYACCEPT;
3043
3044 *++yyvsp = yylval;
3045
3046
3047 /* Shift the error token. */
3048 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3049
3050 yystate = yyn;
3051 goto yynewstate;
3052
3053
3054 /*-------------------------------------.
3055 | yyacceptlab -- YYACCEPT comes here. |
3056 `-------------------------------------*/
3057 karl 1.15 yyacceptlab:
3058 yyresult = 0;
3059 goto yyreturn;
3060
3061 /*-----------------------------------.
3062 | yyabortlab -- YYABORT comes here. |
3063 `-----------------------------------*/
3064 yyabortlab:
3065 yyresult = 1;
3066 goto yyreturn;
3067
3068 #ifndef yyoverflow
3069 /*-------------------------------------------------.
3070 | yyexhaustedlab -- memory exhaustion comes here. |
3071 `-------------------------------------------------*/
3072 yyexhaustedlab:
3073 yyerror (YY_("memory exhausted"));
3074 yyresult = 2;
3075 /* Fall through. */
|
3076 chuck 1.2 #endif
|
3077 karl 1.15
3078 yyreturn:
3079 if (yychar != YYEOF && yychar != YYEMPTY)
3080 yydestruct ("Cleanup: discarding lookahead",
|
3081 karl 1.16 yytoken, &yylval);
|
3082 karl 1.15 /* Do not reclaim the symbols of the rule which action triggered
3083 this YYABORT or YYACCEPT. */
3084 YYPOPSTACK (yylen);
3085 YY_STACK_PRINT (yyss, yyssp);
3086 while (yyssp != yyss)
|
3087 chuck 1.2 {
|
3088 karl 1.15 yydestruct ("Cleanup: popping",
|
3089 karl 1.16 yystos[*yyssp], yyvsp);
|
3090 karl 1.15 YYPOPSTACK (1);
|
3091 chuck 1.2 }
|
3092 karl 1.15 #ifndef yyoverflow
3093 if (yyss != yyssa)
3094 YYSTACK_FREE (yyss);
3095 #endif
3096 #if YYERROR_VERBOSE
3097 if (yymsg != yymsgbuf)
3098 YYSTACK_FREE (yymsg);
3099 #endif
3100 /* Make sure YYID is used. */
3101 return YYID (yyresult);
|
3102 chuck 1.2 }
|
3103 karl 1.15
3104
|
3105 karl 1.19 #line 1458 "CQL.y"
|
3106 karl 1.15
|
3107 karl 1.16 /*int yyerror(char * err){yyclearin; yyerrok;throw Exception(String(err));
3108 return 1;}*/
|
3109 karl 1.15
|