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