1 karl 1.15 /* A Bison parser, made by GNU Bison 1.875c. */
|
2 karl 1.12
|
3 karl 1.15 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
5 karl 1.12
|
6 karl 1.15 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
|
10 karl 1.13
|
11 karl 1.15 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 karl 1.15 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36 /* Identify Bison output. */
37 #define YYBISON 1
38
39 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers. */
43 #define YYPURE 0
44
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
47
48 /* If NAME_PREFIX is specified substitute the variables and functions
49 names. */
|
50 mike 1.2 #define yyparse WQL_parse
|
51 karl 1.15 #define yylex WQL_lex
|
52 mike 1.2 #define yyerror WQL_error
|
53 karl 1.15 #define yylval WQL_lval
54 #define yychar WQL_char
|
55 mike 1.2 #define yydebug WQL_debug
56 #define yynerrs WQL_nerrs
|
57 karl 1.12
|
58 karl 1.15
59 /* Tokens. */
60 #ifndef YYTOKENTYPE
61 # define YYTOKENTYPE
62 /* Put the tokens into the symbol table, so that GDB and other debuggers
63 know about them. */
64 enum yytokentype {
65 TOK_INTEGER = 258,
66 TOK_DOUBLE = 259,
67 TOK_STRING = 260,
68 TOK_TRUE = 261,
69 TOK_FALSE = 262,
70 TOK_NULL = 263,
71 TOK_ISA = 264,
72 TOK_DOT = 265,
73 TOK_EQ = 266,
74 TOK_NE = 267,
75 TOK_LT = 268,
76 TOK_LE = 269,
77 TOK_GT = 270,
78 TOK_GE = 271,
79 karl 1.15 TOK_NOT = 272,
80 TOK_OR = 273,
81 TOK_AND = 274,
82 TOK_IS = 275,
83 TOK_IDENTIFIER = 276,
84 TOK_SELECT = 277,
85 TOK_WHERE = 278,
86 TOK_FROM = 279,
87 TOK_UNEXPECTED_CHAR = 280
88 };
89 #endif
90 #define TOK_INTEGER 258
91 #define TOK_DOUBLE 259
92 #define TOK_STRING 260
93 #define TOK_TRUE 261
94 #define TOK_FALSE 262
95 #define TOK_NULL 263
96 #define TOK_ISA 264
97 #define TOK_DOT 265
98 #define TOK_EQ 266
99 #define TOK_NE 267
100 karl 1.15 #define TOK_LT 268
101 #define TOK_LE 269
102 #define TOK_GT 270
103 #define TOK_GE 271
104 #define TOK_NOT 272
105 #define TOK_OR 273
106 #define TOK_AND 274
107 #define TOK_IS 275
108 #define TOK_IDENTIFIER 276
109 #define TOK_SELECT 277
110 #define TOK_WHERE 278
111 #define TOK_FROM 279
112 #define TOK_UNEXPECTED_CHAR 280
113
114
115
116
117 /* Copy the first part of user declarations. */
118 #line 37 "WQL.y"
|
119 karl 1.12
|
120 mike 1.2
121 #include <Pegasus/Common/Config.h>
122 #include <Pegasus/WQL/WQLOperation.h>
123 #include <Pegasus/WQL/WQLOperand.h>
124 #include <Pegasus/WQL/WQLParserState.h>
125 #include <Pegasus/WQL/WQLSelectStatement.h>
126 #include <string.h>
127 #include <stdlib.h>
128
129 #ifdef PEGASUS_OS_TYPE_WINDOWS
130 # include <malloc.h>
131 #endif
132
133 #if defined(PEGASUS_COMPILER_ACC) && defined(PEGASUS_OS_HPUX)
134 # include <alloca.h>
135 #endif
136
137 #if 0
138 # define WQL_TRACE(X) printf X
139 #else
140 # define WQL_TRACE(X)
141 mike 1.2 #endif
142
143 extern int WQL_lex();
|
144 kumpf 1.3 extern int WQL_error(const char*);
|
145 mike 1.2
|
146 karl 1.12 //
147 // Define the global parser state object:
148 //
|
149 mike 1.2
150 PEGASUS_USING_PEGASUS;
151
152 PEGASUS_NAMESPACE_BEGIN
153
|
154 karl 1.9 extern WQLParserState* globalParserState;
|
155 mike 1.2
156 PEGASUS_NAMESPACE_END
157
|
158 karl 1.12
|
159 karl 1.15
160 /* Enabling traces. */
161 #ifndef YYDEBUG
162 # define YYDEBUG 0
163 #endif
164
165 /* Enabling verbose error messages. */
166 #ifdef YYERROR_VERBOSE
167 # undef YYERROR_VERBOSE
168 # define YYERROR_VERBOSE 1
169 #else
170 # define YYERROR_VERBOSE 0
171 #endif
172
173 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
174 #line 87 "WQL.y"
175 typedef union YYSTYPE {
|
176 mike 1.2 int intValue;
177 double doubleValue;
178 char* strValue;
179 void* nodeValue;
180 } YYSTYPE;
|
181 karl 1.15 /* Line 191 of yacc.c. */
182 #line 183 "WQLtemp"
183 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
184 # define YYSTYPE_IS_DECLARED 1
185 # define YYSTYPE_IS_TRIVIAL 1
186 #endif
187
188
189
190 /* Copy the second part of user declarations. */
191
192
193 /* Line 214 of yacc.c. */
194 #line 195 "WQLtemp"
195
196 #if ! defined (yyoverflow) || YYERROR_VERBOSE
197
198 # ifndef YYFREE
199 # define YYFREE free
200 # endif
201 # ifndef YYMALLOC
202 karl 1.15 # define YYMALLOC malloc
203 # endif
204
205 /* The parser invokes alloca or malloc; define the necessary symbols. */
206
207 # ifdef YYSTACK_USE_ALLOCA
208 # if YYSTACK_USE_ALLOCA
209 # define YYSTACK_ALLOC alloca
210 # endif
211 # else
212 # if defined (alloca) || defined (_ALLOCA_H)
213 # define YYSTACK_ALLOC alloca
214 # else
215 # ifdef __GNUC__
216 # define YYSTACK_ALLOC __builtin_alloca
217 # endif
218 # endif
219 # endif
220
221 # ifdef YYSTACK_ALLOC
222 /* Pacify GCC's `empty if-body' warning. */
223 karl 1.15 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
224 # else
225 # if defined (__STDC__) || defined (__cplusplus)
226 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
227 # define YYSIZE_T size_t
228 # endif
229 # define YYSTACK_ALLOC YYMALLOC
230 # define YYSTACK_FREE YYFREE
231 # endif
232 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
233
234
235 #if (! defined (yyoverflow) \
236 && (! defined (__cplusplus) \
237 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
238
239 /* A type that is properly aligned for any stack member. */
240 union yyalloc
241 {
242 short yyss;
243 YYSTYPE yyvs;
244 karl 1.15 };
245
246 /* The size of the maximum gap between one aligned stack and the next. */
247 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
248
249 /* The size of an array large to enough to hold all stacks, each with
250 N elements. */
251 # define YYSTACK_BYTES(N) \
252 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
253 + YYSTACK_GAP_MAXIMUM)
254
255 /* Copy COUNT objects from FROM to TO. The source and destination do
256 not overlap. */
257 # ifndef YYCOPY
258 # if defined (__GNUC__) && 1 < __GNUC__
259 # define YYCOPY(To, From, Count) \
260 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
261 # else
262 # define YYCOPY(To, From, Count) \
263 do \
264 { \
265 karl 1.15 register YYSIZE_T yyi; \
266 for (yyi = 0; yyi < (Count); yyi++) \
267 (To)[yyi] = (From)[yyi]; \
268 } \
269 while (0)
270 # endif
271 # endif
272
273 /* Relocate STACK from its old location to the new one. The
274 local variables YYSIZE and YYSTACKSIZE give the old and new number of
275 elements in the stack, and YYPTR gives the new location of the
276 stack. Advance YYPTR to a properly aligned location for the next
277 stack. */
278 # define YYSTACK_RELOCATE(Stack) \
279 do \
280 { \
281 YYSIZE_T yynewbytes; \
282 YYCOPY (&yyptr->Stack, Stack, yysize); \
283 Stack = &yyptr->Stack; \
284 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
285 yyptr += yynewbytes / sizeof (*yyptr); \
286 karl 1.15 } \
287 while (0)
|
288 karl 1.12
|
289 karl 1.14 #endif
|
290 karl 1.15
291 #if defined (__STDC__) || defined (__cplusplus)
292 typedef signed char yysigned_char;
293 #else
294 typedef short yysigned_char;
|
295 karl 1.12 #endif
|
296 karl 1.13
|
297 karl 1.15 /* YYFINAL -- State number of the termination state. */
298 #define YYFINAL 9
299 /* YYLAST -- Last index in YYTABLE. */
300 #define YYLAST 69
301
302 /* YYNTOKENS -- Number of terminals. */
303 #define YYNTOKENS 30
304 /* YYNNTS -- Number of nonterminals. */
305 #define YYNNTS 16
306 /* YYNRULES -- Number of rules. */
307 #define YYNRULES 39
308 /* YYNRULES -- Number of states. */
309 #define YYNSTATES 65
310
311 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
312 #define YYUNDEFTOK 2
313 #define YYMAXUTOK 280
314
315 #define YYTRANSLATE(YYX) \
316 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
317
318 karl 1.15 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
319 static const unsigned char yytranslate[] =
320 {
321 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
322 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
323 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
324 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
325 28, 29, 26, 2, 27, 2, 2, 2, 2, 2,
326 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
327 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
328 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
329 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
330 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
331 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
332 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
333 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
334 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
335 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
336 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
337 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
338 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
339 karl 1.15 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
340 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
341 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
342 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
343 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
344 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
345 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
346 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
347 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
348 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
349 25
350 };
|
351 karl 1.12
|
352 karl 1.15 #if YYDEBUG
353 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
354 YYRHS. */
355 static const unsigned char yyprhs[] =
356 {
357 0, 0, 3, 5, 9, 11, 13, 15, 19, 22,
358 24, 27, 30, 34, 38, 41, 45, 47, 51, 56,
359 58, 60, 64, 68, 72, 76, 80, 84, 88, 92,
360 97, 99, 101, 103, 107, 109, 111, 113, 115, 117
|
361 karl 1.13 };
|
362 karl 1.12
|
363 karl 1.15 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
364 static const yysigned_char yyrhs[] =
365 {
366 31, 0, -1, 32, -1, 22, 33, 35, -1, 26,
367 -1, 34, -1, 43, -1, 34, 27, 43, -1, 36,
368 37, -1, 36, -1, 24, 44, -1, 23, 38, -1,
369 38, 18, 38, -1, 38, 19, 38, -1, 17, 38,
370 -1, 28, 38, 29, -1, 39, -1, 39, 20, 42,
371 -1, 39, 20, 17, 42, -1, 40, -1, 41, -1,
372 45, 13, 45, -1, 45, 15, 45, -1, 45, 14,
373 45, -1, 45, 16, 45, -1, 45, 11, 45, -1,
374 45, 12, 45, -1, 43, 9, 44, -1, 45, 20,
375 8, -1, 45, 20, 17, 8, -1, 6, -1, 7,
376 -1, 21, -1, 21, 10, 21, -1, 21, -1, 43,
377 -1, 3, -1, 4, -1, 5, -1, 42, -1
|
378 karl 1.12 };
379
|
380 karl 1.15 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
381 static const unsigned short yyrline[] =
382 {
383 0, 160, 160, 166, 172, 176, 182, 186, 192, 196,
384 202, 209, 215, 220, 225, 231, 235, 239, 244, 253,
385 257, 263, 268, 273, 278, 283, 288, 293, 303, 308,
386 315, 319, 332, 337, 349, 356, 362, 367, 372, 377
|
387 karl 1.12 };
|
388 karl 1.14 #endif
389
|
390 karl 1.15 #if YYDEBUG || YYERROR_VERBOSE
391 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
392 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
393 static const char *const yytname[] =
394 {
395 "$end", "error", "$undefined", "TOK_INTEGER", "TOK_DOUBLE",
396 "TOK_STRING", "TOK_TRUE", "TOK_FALSE", "TOK_NULL", "TOK_ISA", "TOK_DOT",
397 "TOK_EQ", "TOK_NE", "TOK_LT", "TOK_LE", "TOK_GT", "TOK_GE", "TOK_NOT",
398 "TOK_OR", "TOK_AND", "TOK_IS", "TOK_IDENTIFIER", "TOK_SELECT",
399 "TOK_WHERE", "TOK_FROM", "TOK_UNEXPECTED_CHAR", "'*'", "','", "'('",
400 "')'", "$accept", "start", "selectStatement", "selectList",
401 "propertyList", "selectExpression", "fromClause", "whereClause",
402 "searchCondition", "predicate", "comparisonPredicate", "nullPredicate",
403 "truthValue", "propertyName", "className", "comparisonTerm", 0
|
404 karl 1.12 };
405 #endif
406
|
407 karl 1.15 # ifdef YYPRINT
408 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
409 token YYLEX-NUM. */
410 static const unsigned short yytoknum[] =
411 {
412 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
413 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
414 275, 276, 277, 278, 279, 280, 42, 44, 40, 41
415 };
416 # endif
|
417 karl 1.14
|
418 karl 1.15 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
419 static const unsigned char yyr1[] =
420 {
421 0, 30, 31, 32, 33, 33, 34, 34, 35, 35,
422 36, 37, 38, 38, 38, 38, 38, 38, 38, 39,
423 39, 40, 40, 40, 40, 40, 40, 40, 41, 41,
424 42, 42, 43, 43, 44, 45, 45, 45, 45, 45
|
425 karl 1.12 };
426
|
427 karl 1.15 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
428 static const unsigned char yyr2[] =
429 {
430 0, 2, 1, 3, 1, 1, 1, 3, 2, 1,
431 2, 2, 3, 3, 2, 3, 1, 3, 4, 1,
432 1, 3, 3, 3, 3, 3, 3, 3, 3, 4,
433 1, 1, 1, 3, 1, 1, 1, 1, 1, 1
|
434 karl 1.13 };
|
435 karl 1.12
|
436 karl 1.15 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
437 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
438 means the default is an error. */
439 static const unsigned char yydefact[] =
440 {
441 0, 0, 0, 2, 32, 4, 0, 5, 6, 1,
442 0, 0, 3, 9, 0, 33, 34, 10, 0, 8,
443 7, 36, 37, 38, 30, 31, 0, 0, 11, 16,
444 19, 20, 39, 35, 0, 14, 0, 0, 0, 0,
445 0, 0, 0, 0, 0, 0, 0, 0, 15, 12,
446 13, 0, 17, 27, 35, 25, 26, 21, 23, 22,
447 24, 28, 0, 18, 29
|
448 mike 1.2 };
|
449 karl 1.12
|
450 karl 1.15 /* YYDEFGOTO[NTERM-NUM]. */
451 static const yysigned_char yydefgoto[] =
452 {
453 -1, 2, 3, 6, 7, 12, 13, 19, 28, 29,
454 30, 31, 32, 54, 17, 34
|
455 karl 1.12 };
456
|
457 karl 1.15 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
458 STATE-NUM. */
459 #define YYPACT_NINF -38
460 static const yysigned_char yypact[] =
461 {
462 -21, -10, 15, -38, 25, -38, 17, -8, -38, -38,
463 28, 39, -38, 38, 41, -38, -38, -38, 1, -38,
464 -38, -38, -38, -38, -38, -38, 1, 1, 5, 43,
465 -38, -38, -38, 55, 31, -38, 9, 1, 1, 33,
466 39, 27, 27, 27, 27, 27, 27, -5, -38, 46,
467 -38, 52, -38, -38, -38, -38, -38, -38, -38, -38,
468 -38, -38, 58, -38, -38
|
469 karl 1.12 };
470
|
471 karl 1.15 /* YYPGOTO[NTERM-NUM]. */
472 static const yysigned_char yypgoto[] =
473 {
474 -38, -38, -38, -38, -38, -38, -38, -38, -17, -38,
475 -38, -38, -37, -1, 29, 11
|
476 karl 1.12 };
477
|
478 karl 1.15 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
479 positive, shift that token. If negative, reduce the rule which
480 number is the opposite. If zero, do what YYDEFACT says.
481 If YYTABLE_NINF, syntax error. */
482 #define YYTABLE_NINF -1
483 static const unsigned char yytable[] =
484 {
485 8, 1, 52, 61, 21, 22, 23, 24, 25, 35,
486 36, 4, 62, 20, 63, 9, 5, 33, 26, 14,
487 49, 50, 4, 37, 38, 33, 33, 37, 38, 27,
488 21, 22, 23, 24, 25, 10, 33, 33, 48, 24,
489 25, 11, 41, 42, 43, 44, 45, 46, 4, 15,
490 51, 47, 55, 56, 57, 58, 59, 60, 24, 25,
491 16, 18, 4, 39, 40, 38, 64, 0, 0, 53
|
492 karl 1.12 };
493
|
494 karl 1.15 static const yysigned_char yycheck[] =
495 {
496 1, 22, 39, 8, 3, 4, 5, 6, 7, 26,
497 27, 21, 17, 14, 51, 0, 26, 18, 17, 27,
498 37, 38, 21, 18, 19, 26, 27, 18, 19, 28,
499 3, 4, 5, 6, 7, 10, 37, 38, 29, 6,
500 7, 24, 11, 12, 13, 14, 15, 16, 21, 21,
501 17, 20, 41, 42, 43, 44, 45, 46, 6, 7,
502 21, 23, 21, 20, 9, 19, 8, -1, -1, 40
|
503 karl 1.12 };
504
|
505 karl 1.15 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
506 symbol of state STATE-NUM. */
507 static const unsigned char yystos[] =
508 {
509 0, 22, 31, 32, 21, 26, 33, 34, 43, 0,
510 10, 24, 35, 36, 27, 21, 21, 44, 23, 37,
511 43, 3, 4, 5, 6, 7, 17, 28, 38, 39,
512 40, 41, 42, 43, 45, 38, 38, 18, 19, 20,
513 9, 11, 12, 13, 14, 15, 16, 20, 29, 38,
514 38, 17, 42, 44, 43, 45, 45, 45, 45, 45,
515 45, 8, 17, 42, 8
|
516 karl 1.12 };
|
517 karl 1.14
|
518 karl 1.15 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
519 # define YYSIZE_T __SIZE_TYPE__
520 #endif
521 #if ! defined (YYSIZE_T) && defined (size_t)
522 # define YYSIZE_T size_t
523 #endif
524 #if ! defined (YYSIZE_T)
525 # if defined (__STDC__) || defined (__cplusplus)
526 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
527 # define YYSIZE_T size_t
528 # endif
529 #endif
530 #if ! defined (YYSIZE_T)
531 # define YYSIZE_T unsigned int
|
532 mike 1.2 #endif
|
533 karl 1.14
|
534 karl 1.12 #define yyerrok (yyerrstatus = 0)
535 #define yyclearin (yychar = YYEMPTY)
|
536 karl 1.15 #define YYEMPTY (-2)
|
537 karl 1.12 #define YYEOF 0
|
538 karl 1.15
|
539 karl 1.12 #define YYACCEPT goto yyacceptlab
|
540 karl 1.15 #define YYABORT goto yyabortlab
541 #define YYERROR goto yyerrorlab
542
543
544 /* Like YYERROR except do call yyerror. This remains here temporarily
545 to ease the transition to the new meaning of YYERROR, for GCC.
|
546 karl 1.12 Once GCC version 2 has supplanted version 1, this can go. */
|
547 karl 1.15
|
548 karl 1.12 #define YYFAIL goto yyerrlab
|
549 karl 1.15
|
550 karl 1.12 #define YYRECOVERING() (!!yyerrstatus)
|
551 karl 1.15
552 #define YYBACKUP(Token, Value) \
|
553 karl 1.12 do \
554 if (yychar == YYEMPTY && yylen == 1) \
|
555 karl 1.15 { \
556 yychar = (Token); \
557 yylval = (Value); \
558 yytoken = YYTRANSLATE (yychar); \
|
559 karl 1.12 YYPOPSTACK; \
560 goto yybackup; \
561 } \
562 else \
|
563 karl 1.15 { \
564 yyerror ("syntax error: cannot back up");\
565 YYERROR; \
566 } \
|
567 karl 1.12 while (0)
568
569 #define YYTERROR 1
570 #define YYERRCODE 256
571
|
572 karl 1.15 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
573 are run). */
574
575 #ifndef YYLLOC_DEFAULT
576 # define YYLLOC_DEFAULT(Current, Rhs, N) \
577 ((Current).first_line = (Rhs)[1].first_line, \
578 (Current).first_column = (Rhs)[1].first_column, \
579 (Current).last_line = (Rhs)[N].last_line, \
580 (Current).last_column = (Rhs)[N].last_column)
|
581 karl 1.14 #endif
|
582 karl 1.13
|
583 karl 1.15 /* YYLEX -- calling `yylex' with the right arguments. */
584
|
585 karl 1.14 #ifdef YYLEX_PARAM
|
586 karl 1.15 # define YYLEX yylex (YYLEX_PARAM)
|
587 karl 1.14 #else
|
588 karl 1.15 # define YYLEX yylex ()
|
589 karl 1.12 #endif
|
590 karl 1.15
591 /* Enable debugging if requested. */
592 #if YYDEBUG
593
594 # ifndef YYFPRINTF
595 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
596 # define YYFPRINTF fprintf
597 # endif
598
599 # define YYDPRINTF(Args) \
600 do { \
601 if (yydebug) \
602 YYFPRINTF Args; \
603 } while (0)
604
605 # define YYDSYMPRINT(Args) \
606 do { \
607 if (yydebug) \
608 yysymprint Args; \
609 } while (0)
610
611 karl 1.15 # define YYDSYMPRINTF(Title, Token, Value, Location) \
612 do { \
613 if (yydebug) \
614 { \
615 YYFPRINTF (stderr, "%s ", Title); \
616 yysymprint (stderr, \
617 Token, Value); \
618 YYFPRINTF (stderr, "\n"); \
619 } \
620 } while (0)
621
622 /*------------------------------------------------------------------.
623 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
624 | TOP (included). |
625 `------------------------------------------------------------------*/
626
627 #if defined (__STDC__) || defined (__cplusplus)
628 static void
629 yy_stack_print (short *bottom, short *top)
|
630 mike 1.2 #else
|
631 karl 1.15 static void
632 yy_stack_print (bottom, top)
633 short *bottom;
634 short *top;
|
635 karl 1.12 #endif
|
636 karl 1.15 {
637 YYFPRINTF (stderr, "Stack now");
638 for (/* Nothing. */; bottom <= top; ++bottom)
639 YYFPRINTF (stderr, " %d", *bottom);
640 YYFPRINTF (stderr, "\n");
641 }
|
642 karl 1.13
|
643 karl 1.15 # define YY_STACK_PRINT(Bottom, Top) \
644 do { \
645 if (yydebug) \
646 yy_stack_print ((Bottom), (Top)); \
647 } while (0)
|
648 karl 1.13
649
|
650 karl 1.15 /*------------------------------------------------.
651 | Report that the YYRULE is going to be reduced. |
652 `------------------------------------------------*/
|
653 karl 1.13
|
654 karl 1.15 #if defined (__STDC__) || defined (__cplusplus)
655 static void
656 yy_reduce_print (int yyrule)
657 #else
658 static void
659 yy_reduce_print (yyrule)
660 int yyrule;
|
661 karl 1.12 #endif
|
662 karl 1.15 {
663 int yyi;
664 unsigned int yylno = yyrline[yyrule];
665 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
666 yyrule - 1, yylno);
667 /* Print the symbols being reduced, and their result. */
668 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
669 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
670 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
671 }
|
672 karl 1.12
|
673 karl 1.15 # define YY_REDUCE_PRINT(Rule) \
674 do { \
675 if (yydebug) \
676 yy_reduce_print (Rule); \
677 } while (0)
678
679 /* Nonzero means print parse trace. It is left uninitialized so that
680 multiple parsers can coexist. */
681 int yydebug;
682 #else /* !YYDEBUG */
683 # define YYDPRINTF(Args)
684 # define YYDSYMPRINT(Args)
685 # define YYDSYMPRINTF(Title, Token, Value, Location)
686 # define YY_STACK_PRINT(Bottom, Top)
687 # define YY_REDUCE_PRINT(Rule)
688 #endif /* !YYDEBUG */
|
689 karl 1.12
690
|
691 karl 1.15 /* YYINITDEPTH -- initial size of the parser's stacks. */
|
692 karl 1.12 #ifndef YYINITDEPTH
|
693 karl 1.15 # define YYINITDEPTH 200
|
694 karl 1.12 #endif
695
|
696 karl 1.15 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
697 if the built-in stack extension method is used).
698
699 Do not make this value too large; the results are undefined if
700 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
701 evaluated with infinite-precision integer arithmetic. */
|
702 karl 1.12
|
703 karl 1.15 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
704 # undef YYMAXDEPTH
|
705 karl 1.12 #endif
706
707 #ifndef YYMAXDEPTH
|
708 karl 1.15 # define YYMAXDEPTH 10000
|
709 mike 1.2 #endif
|
710 karl 1.15
|
711 karl 1.12
712
|
713 karl 1.15 #if YYERROR_VERBOSE
714
715 # ifndef yystrlen
716 # if defined (__GLIBC__) && defined (_STRING_H)
717 # define yystrlen strlen
718 # else
719 /* Return the length of YYSTR. */
720 static YYSIZE_T
721 # if defined (__STDC__) || defined (__cplusplus)
722 yystrlen (const char *yystr)
723 # else
724 yystrlen (yystr)
725 const char *yystr;
726 # endif
727 {
728 register const char *yys = yystr;
729
730 while (*yys++ != '\0')
731 continue;
732
733 return yys - yystr - 1;
734 karl 1.15 }
735 # endif
736 # endif
737
738 # ifndef yystpcpy
739 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
740 # define yystpcpy stpcpy
741 # else
742 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
743 YYDEST. */
744 static char *
745 # if defined (__STDC__) || defined (__cplusplus)
746 yystpcpy (char *yydest, const char *yysrc)
747 # else
748 yystpcpy (yydest, yysrc)
749 char *yydest;
750 const char *yysrc;
751 # endif
752 {
753 register char *yyd = yydest;
754 register const char *yys = yysrc;
755 karl 1.15
756 while ((*yyd++ = *yys++) != '\0')
757 continue;
|
758 karl 1.12
|
759 karl 1.15 return yyd - 1;
|
760 karl 1.12 }
|
761 karl 1.15 # endif
762 # endif
|
763 karl 1.13
|
764 karl 1.15 #endif /* !YYERROR_VERBOSE */
|
765 karl 1.13
|
766 karl 1.15
767
768 #if YYDEBUG
769 /*--------------------------------.
770 | Print this symbol on YYOUTPUT. |
771 `--------------------------------*/
772
773 #if defined (__STDC__) || defined (__cplusplus)
|
774 karl 1.13 static void
|
775 karl 1.15 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
776 #else
777 static void
778 yysymprint (yyoutput, yytype, yyvaluep)
779 FILE *yyoutput;
780 int yytype;
781 YYSTYPE *yyvaluep;
782 #endif
|
783 karl 1.12 {
|
784 karl 1.15 /* Pacify ``unused variable'' warnings. */
785 (void) yyvaluep;
|
786 karl 1.13
|
787 karl 1.15 if (yytype < YYNTOKENS)
788 {
789 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
790 # ifdef YYPRINT
791 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
792 # endif
793 }
794 else
795 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
796
797 switch (yytype)
798 {
799 default:
800 break;
801 }
802 YYFPRINTF (yyoutput, ")");
|
803 karl 1.12 }
804
|
805 karl 1.15 #endif /* ! YYDEBUG */
806 /*-----------------------------------------------.
807 | Release the memory associated to this symbol. |
808 `-----------------------------------------------*/
809
810 #if defined (__STDC__) || defined (__cplusplus)
811 static void
812 yydestruct (int yytype, YYSTYPE *yyvaluep)
813 #else
814 static void
815 yydestruct (yytype, yyvaluep)
816 int yytype;
817 YYSTYPE *yyvaluep;
|
818 mike 1.2 #endif
|
819 karl 1.15 {
820 /* Pacify ``unused variable'' warnings. */
821 (void) yyvaluep;
822
823 switch (yytype)
824 {
825
826 default:
827 break;
828 }
829 }
|
830 karl 1.12
|
831 mike 1.2
|
832 karl 1.15 /* Prevent warnings from -Wmissing-prototypes. */
|
833 karl 1.12
834 #ifdef YYPARSE_PARAM
|
835 karl 1.15 # if defined (__STDC__) || defined (__cplusplus)
836 int yyparse (void *YYPARSE_PARAM);
837 # else
838 int yyparse ();
839 # endif
840 #else /* ! YYPARSE_PARAM */
841 #if defined (__STDC__) || defined (__cplusplus)
842 int yyparse (void);
843 #else
844 int yyparse ();
845 #endif
846 #endif /* ! YYPARSE_PARAM */
847
848
849
850 /* The lookahead symbol. */
851 int yychar;
852
853 /* The semantic value of the lookahead symbol. */
854 YYSTYPE yylval;
855
856 karl 1.15 /* Number of syntax errors so far. */
857 int yynerrs;
858
859
860
861 /*----------.
862 | yyparse. |
863 `----------*/
|
864 karl 1.12
865 #ifdef YYPARSE_PARAM
|
866 karl 1.15 # if defined (__STDC__) || defined (__cplusplus)
867 int yyparse (void *YYPARSE_PARAM)
868 # else
869 int yyparse (YYPARSE_PARAM)
870 void *YYPARSE_PARAM;
871 # endif
872 #else /* ! YYPARSE_PARAM */
873 #if defined (__STDC__) || defined (__cplusplus)
874 int
875 yyparse (void)
|
876 karl 1.12 #else
|
877 karl 1.15 int
878 yyparse ()
879
|
880 karl 1.12 #endif
|
881 mike 1.2 #endif
882 {
|
883 karl 1.15
|
884 karl 1.12 register int yystate;
885 register int yyn;
|
886 karl 1.15 int yyresult;
887 /* Number of tokens to shift before error messages enabled. */
888 int yyerrstatus;
889 /* Lookahead token as an internal (translated) token number. */
890 int yytoken = 0;
891
892 /* Three stacks and their tools:
893 `yyss': related to states,
894 `yyvs': related to semantic values,
895 `yyls': related to locations.
896
897 Refer to the stacks thru separate pointers, to allow yyoverflow
898 to reallocate them elsewhere. */
899
900 /* The state stack. */
901 short yyssa[YYINITDEPTH];
902 short *yyss = yyssa;
|
903 karl 1.12 register short *yyssp;
|
904 karl 1.15
905 /* The semantic value stack. */
906 YYSTYPE yyvsa[YYINITDEPTH];
907 YYSTYPE *yyvs = yyvsa;
|
908 karl 1.14 register YYSTYPE *yyvsp;
|
909 karl 1.13
|
910 karl 1.12
911
912 #define YYPOPSTACK (yyvsp--, yyssp--)
913
|
914 karl 1.15 YYSIZE_T yystacksize = YYINITDEPTH;
|
915 karl 1.12
|
916 karl 1.15 /* The variables used to return semantic value and location from the
917 action routines. */
918 YYSTYPE yyval;
|
919 karl 1.12
920
|
921 karl 1.15 /* When reducing, the number of symbols on the RHS of the reduced
922 rule. */
|
923 karl 1.12 int yylen;
924
|
925 karl 1.15 YYDPRINTF ((stderr, "Starting parse\n"));
|
926 karl 1.12
927 yystate = 0;
928 yyerrstatus = 0;
929 yynerrs = 0;
930 yychar = YYEMPTY; /* Cause a token to be read. */
931
932 /* Initialize stack pointers.
933 Waste one element of value and location stack
934 so that they stay on the same level as the state stack.
935 The wasted elements are never initialized. */
936
|
937 karl 1.15 yyssp = yyss;
|
938 karl 1.12 yyvsp = yyvs;
939
|
940 karl 1.15 goto yysetstate;
941
942 /*------------------------------------------------------------.
943 | yynewstate -- Push a new state, which is found in yystate. |
944 `------------------------------------------------------------*/
945 yynewstate:
946 /* In all cases, when you get here, the value and location stacks
947 have just been pushed. so pushing a state here evens the stacks.
948 */
949 yyssp++;
|
950 karl 1.13
|
951 karl 1.15 yysetstate:
952 *yyssp = yystate;
|
953 karl 1.12
|
954 karl 1.15 if (yyss + yystacksize - 1 <= yyssp)
|
955 karl 1.14 {
|
956 karl 1.12 /* Get the current used size of the three stacks, in elements. */
|
957 karl 1.15 YYSIZE_T yysize = yyssp - yyss + 1;
|
958 karl 1.12
959 #ifdef yyoverflow
|
960 karl 1.15 {
961 /* Give user a chance to reallocate the stack. Use copies of
962 these so that the &'s don't force the real ones into
963 memory. */
964 YYSTYPE *yyvs1 = yyvs;
965 short *yyss1 = yyss;
966
967
968 /* Each stack pointer address is followed by the size of the
969 data in use in that stack, in bytes. This used to be a
970 conditional around just the two extra args, but that might
971 be undefined if yyoverflow is a macro. */
972 yyoverflow ("parser stack overflow",
973 &yyss1, yysize * sizeof (*yyssp),
974 &yyvs1, yysize * sizeof (*yyvsp),
975
976 &yystacksize);
977
978 yyss = yyss1;
979 yyvs = yyvs1;
980 }
|
981 karl 1.12 #else /* no yyoverflow */
|
982 karl 1.15 # ifndef YYSTACK_RELOCATE
983 goto yyoverflowlab;
984 # else
|
985 karl 1.12 /* Extend the stack our own way. */
|
986 karl 1.15 if (YYMAXDEPTH <= yystacksize)
987 goto yyoverflowlab;
|
988 karl 1.12 yystacksize *= 2;
|
989 karl 1.15 if (YYMAXDEPTH < yystacksize)
|
990 karl 1.12 yystacksize = YYMAXDEPTH;
|
991 karl 1.15
992 {
993 short *yyss1 = yyss;
994 union yyalloc *yyptr =
995 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
996 if (! yyptr)
997 goto yyoverflowlab;
998 YYSTACK_RELOCATE (yyss);
999 YYSTACK_RELOCATE (yyvs);
1000
1001 # undef YYSTACK_RELOCATE
1002 if (yyss1 != yyssa)
1003 YYSTACK_FREE (yyss1);
1004 }
1005 # endif
|
1006 karl 1.12 #endif /* no yyoverflow */
1007
|
1008 karl 1.15 yyssp = yyss + yysize - 1;
1009 yyvsp = yyvs + yysize - 1;
1010
|
1011 karl 1.13
|
1012 karl 1.15 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1013 (unsigned long int) yystacksize));
|
1014 karl 1.12
|
1015 karl 1.15 if (yyss + yystacksize - 1 <= yyssp)
|
1016 karl 1.12 YYABORT;
1017 }
1018
|
1019 karl 1.15 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
1020 karl 1.12
1021 goto yybackup;
|
1022 karl 1.15
1023 /*-----------.
1024 | yybackup. |
1025 `-----------*/
1026 yybackup:
|
1027 karl 1.12
1028 /* Do appropriate processing given the current state. */
1029 /* Read a lookahead token if we need one and don't already have one. */
1030 /* yyresume: */
1031
1032 /* First try to decide what to do without reference to lookahead token. */
1033
1034 yyn = yypact[yystate];
|
1035 karl 1.15 if (yyn == YYPACT_NINF)
|
1036 karl 1.12 goto yydefault;
1037
1038 /* Not known => get a lookahead token if don't already have one. */
1039
|
1040 karl 1.15 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
|
1041 karl 1.12 if (yychar == YYEMPTY)
1042 {
|
1043 karl 1.15 YYDPRINTF ((stderr, "Reading a token: "));
|
1044 karl 1.12 yychar = YYLEX;
1045 }
1046
|
1047 karl 1.15 if (yychar <= YYEOF)
|
1048 karl 1.12 {
|
1049 karl 1.15 yychar = yytoken = YYEOF;
1050 YYDPRINTF ((stderr, "Now at end of input.\n"));
|
1051 karl 1.12 }
1052 else
1053 {
|
1054 karl 1.15 yytoken = YYTRANSLATE (yychar);
1055 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
|
1056 karl 1.12 }
1057
|
1058 karl 1.15 /* If the proper action on seeing token YYTOKEN is to reduce or to
1059 detect an error, take that action. */
1060 yyn += yytoken;
1061 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
|
1062 karl 1.12 goto yydefault;
1063 yyn = yytable[yyn];
|
1064 karl 1.15 if (yyn <= 0)
|
1065 karl 1.12 {
|
1066 karl 1.15 if (yyn == 0 || yyn == YYTABLE_NINF)
|
1067 karl 1.12 goto yyerrlab;
1068 yyn = -yyn;
1069 goto yyreduce;
1070 }
1071
1072 if (yyn == YYFINAL)
1073 YYACCEPT;
1074
1075 /* Shift the lookahead token. */
|
1076 karl 1.15 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
|
1077 karl 1.12
1078 /* Discard the token being shifted unless it is eof. */
1079 if (yychar != YYEOF)
1080 yychar = YYEMPTY;
1081
1082 *++yyvsp = yylval;
1083
|
1084 karl 1.15
1085 /* Count tokens shifted since error; after three, turn off error
1086 status. */
1087 if (yyerrstatus)
1088 yyerrstatus--;
|
1089 karl 1.12
1090 yystate = yyn;
1091 goto yynewstate;
1092
|
1093 karl 1.15
1094 /*-----------------------------------------------------------.
1095 | yydefault -- do the default action for the current state. |
1096 `-----------------------------------------------------------*/
|
1097 karl 1.14 yydefault:
|
1098 karl 1.12 yyn = yydefact[yystate];
1099 if (yyn == 0)
1100 goto yyerrlab;
|
1101 karl 1.15 goto yyreduce;
1102
|
1103 karl 1.12
|
1104 karl 1.15 /*-----------------------------.
1105 | yyreduce -- Do a reduction. |
1106 `-----------------------------*/
|
1107 mike 1.2 yyreduce:
|
1108 karl 1.15 /* yyn is the number of a rule to reduce with. */
|
1109 karl 1.12 yylen = yyr2[yyn];
1110
|
1111 karl 1.15 /* If YYLEN is nonzero, implement the default value of the action:
1112 `$$ = $1'.
|
1113 karl 1.12
|
1114 karl 1.15 Otherwise, the following line sets YYVAL to garbage.
1115 This behavior is undocumented and Bison
1116 users should not rely upon it. Assigning to YYVAL
1117 unconditionally makes the parser a bit smaller, and it avoids a
1118 GCC warning that YYVAL may be used uninitialized. */
1119 yyval = yyvsp[1-yylen];
|
1120 karl 1.12
1121
|
1122 karl 1.15 YY_REDUCE_PRINT (yyn);
1123 switch (yyn)
1124 {
1125 case 2:
1126 #line 161 "WQL.y"
1127 {
1128 WQL_TRACE(("YACC: start\n"));
1129 ;}
1130 break;
|
1131 karl 1.12
|
1132 karl 1.15 case 3:
1133 #line 167 "WQL.y"
1134 {
|
1135 karl 1.12
|
1136 karl 1.15 ;}
1137 break;
|
1138 mike 1.2
|
1139 karl 1.15 case 4:
1140 #line 173 "WQL.y"
1141 {
|
1142 kumpf 1.4 globalParserState->statement->setAllProperties(true);
|
1143 karl 1.15 ;}
1144 break;
1145
1146 case 5:
1147 #line 177 "WQL.y"
1148 {
1149
1150 ;}
1151 break;
|
1152 karl 1.13
|
1153 karl 1.15 case 6:
1154 #line 183 "WQL.y"
1155 {
|
1156 kumpf 1.4 globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));
|
1157 karl 1.15 ;}
1158 break;
1159
1160 case 7:
1161 #line 187 "WQL.y"
1162 {
|
1163 kumpf 1.4 globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));
|
1164 karl 1.15 ;}
1165 break;
1166
1167 case 8:
1168 #line 193 "WQL.y"
1169 {
1170
1171 ;}
1172 break;
1173
1174 case 9:
1175 #line 197 "WQL.y"
1176 {
1177
1178 ;}
1179 break;
1180
1181 case 10:
1182 #line 203 "WQL.y"
1183 {
|
1184 mike 1.2 WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));
|
1185 kumpf 1.4 globalParserState->statement->setClassName(CIMName(yyvsp[0].strValue));
|
1186 karl 1.15 ;}
1187 break;
1188
1189 case 11:
1190 #line 210 "WQL.y"
1191 {
1192
1193 ;}
1194 break;
|
1195 karl 1.13
|
1196 karl 1.15 case 12:
1197 #line 216 "WQL.y"
1198 {
|
1199 mike 1.2 WQL_TRACE(("YACC: TOK_OR\n"));
1200 globalParserState->statement->appendOperation(WQL_OR);
|
1201 karl 1.15 ;}
1202 break;
1203
1204 case 13:
1205 #line 221 "WQL.y"
1206 {
|
1207 mike 1.2 WQL_TRACE(("YACC: TOK_AND\n"));
1208 globalParserState->statement->appendOperation(WQL_AND);
|
1209 karl 1.15 ;}
1210 break;
1211
1212 case 14:
1213 #line 226 "WQL.y"
1214 {
|
1215 mike 1.2 WQL_TRACE(("YACC: TOK_NOT\n"));
1216
1217 globalParserState->statement->appendOperation(WQL_NOT);
|
1218 karl 1.15 ;}
1219 break;
1220
1221 case 15:
1222 #line 232 "WQL.y"
1223 {
1224
1225 ;}
1226 break;
1227
1228 case 16:
1229 #line 236 "WQL.y"
1230 {
1231
1232 ;}
1233 break;
1234
1235 case 17:
1236 #line 240 "WQL.y"
1237 {
|
1238 mike 1.2 WQLOperation op = yyvsp[0].intValue ? WQL_IS_TRUE : WQL_IS_FALSE;
1239 globalParserState->statement->appendOperation(op);
|
1240 karl 1.15 ;}
1241 break;
1242
1243 case 18:
1244 #line 245 "WQL.y"
1245 {
|
1246 mike 1.2 WQLOperation op = yyvsp[0].intValue ? WQL_IS_NOT_TRUE : WQL_IS_NOT_FALSE;
1247 globalParserState->statement->appendOperation(op);
|
1248 karl 1.15 ;}
1249 break;
1250
1251 case 19:
1252 #line 254 "WQL.y"
1253 {
1254
1255 ;}
1256 break;
1257
1258 case 20:
1259 #line 258 "WQL.y"
1260 {
1261
1262 ;}
1263 break;
1264
1265 case 21:
1266 #line 264 "WQL.y"
1267 {
|
1268 mike 1.2 WQL_TRACE(("YACC: TOK_LT\n"));
1269 globalParserState->statement->appendOperation(WQL_LT);
|
1270 karl 1.15 ;}
1271 break;
1272
1273 case 22:
1274 #line 269 "WQL.y"
1275 {
|
1276 mike 1.2 WQL_TRACE(("YACC: TOK_GT\n"));
1277 globalParserState->statement->appendOperation(WQL_GT);
|
1278 karl 1.15 ;}
1279 break;
1280
1281 case 23:
1282 #line 274 "WQL.y"
1283 {
|
1284 mike 1.2 WQL_TRACE(("YACC: TOK_LE\n"));
1285 globalParserState->statement->appendOperation(WQL_LE);
|
1286 karl 1.15 ;}
1287 break;
1288
1289 case 24:
1290 #line 279 "WQL.y"
1291 {
|
1292 mike 1.2 WQL_TRACE(("YACC: TOK_GE\n"));
1293 globalParserState->statement->appendOperation(WQL_GE);
|
1294 karl 1.15 ;}
1295 break;
1296
1297 case 25:
1298 #line 284 "WQL.y"
1299 {
|
1300 mike 1.2 WQL_TRACE(("YACC: TOK_EQ\n"));
1301 globalParserState->statement->appendOperation(WQL_EQ);
|
1302 karl 1.15 ;}
1303 break;
1304
1305 case 26:
1306 #line 289 "WQL.y"
1307 {
|
1308 mike 1.2 WQL_TRACE(("YACC: TOK_NE\n"));
1309 globalParserState->statement->appendOperation(WQL_NE);
|
1310 karl 1.15 ;}
1311 break;
1312
1313 case 27:
1314 #line 294 "WQL.y"
1315 {
|
1316 karl 1.13 WQL_TRACE(("YACC: TOK_ISA\n"));
|
1317 karl 1.14 #ifndef PEGASUS_SNIA_EXTENSIONS
1318 // If SNIA tests, allow the ISA but do not pass className
|
1319 karl 1.13 yyerror("ISA Token Not Supported");
|
1320 karl 1.14 #endif
|
1321 karl 1.15 ;}
1322 break;
1323
1324 case 28:
1325 #line 304 "WQL.y"
1326 {
|
1327 mike 1.2 WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NULL\n"));
1328 globalParserState->statement->appendOperation(WQL_IS_NULL);
|
1329 karl 1.15 ;}
1330 break;
1331
1332 case 29:
1333 #line 309 "WQL.y"
1334 {
|
1335 mike 1.2 WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NOT NULL\n"));
1336 globalParserState->statement->appendOperation(WQL_IS_NOT_NULL);
|
1337 karl 1.15 ;}
1338 break;
1339
1340 case 30:
1341 #line 316 "WQL.y"
1342 {
|
1343 mike 1.2 yyval.intValue = 1;
|
1344 karl 1.15 ;}
1345 break;
1346
1347 case 31:
1348 #line 320 "WQL.y"
1349 {
|
1350 mike 1.2 yyval.intValue = 0;
|
1351 karl 1.15 ;}
1352 break;
1353
1354 case 32:
1355 #line 333 "WQL.y"
1356 {
|
1357 karl 1.14 WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));
1358 yyval.strValue = yyvsp[0].strValue;
|
1359 karl 1.15 ;}
1360 break;
1361
1362 case 33:
1363 #line 338 "WQL.y"
1364 {
|
1365 karl 1.14 WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s.%s)\n", yyvsp[-2].strValue, yyvsp[0].strValue));
1366 #ifdef PEGASUS_SNIA_EXTENSIONS
1367 // Pass anything as a property name to fool parser for SNIA testing
1368 yyval.strValue = strdup("dummy");
1369 #else
1370 yyerror("Scoped (dotted) property names not supported");
1371 #endif
|
1372 karl 1.15 ;}
1373 break;
1374
1375 case 34:
1376 #line 350 "WQL.y"
1377 {
|
1378 mike 1.2 WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));
1379 yyval.strValue = yyvsp[0].strValue;
|
1380 karl 1.15 ;}
1381 break;
1382
1383 case 35:
1384 #line 357 "WQL.y"
1385 {
|
1386 mike 1.2 globalParserState->statement->appendOperand(
1387 WQLOperand(yyvsp[0].strValue, WQL_PROPERTY_NAME_TAG));
|
1388 kumpf 1.4 globalParserState->statement->appendWherePropertyName(CIMName(yyvsp[0].strValue));
|
1389 karl 1.15 ;}
1390 break;
1391
1392 case 36:
1393 #line 363 "WQL.y"
1394 {
|
1395 mike 1.2 globalParserState->statement->appendOperand(
1396 WQLOperand(yyvsp[0].intValue, WQL_INTEGER_VALUE_TAG));
|
1397 karl 1.15 ;}
1398 break;
1399
1400 case 37:
1401 #line 368 "WQL.y"
1402 {
|
1403 mike 1.2 globalParserState->statement->appendOperand(
1404 WQLOperand(yyvsp[0].doubleValue, WQL_DOUBLE_VALUE_TAG));
|
1405 karl 1.15 ;}
1406 break;
1407
1408 case 38:
1409 #line 373 "WQL.y"
1410 {
|
1411 mike 1.2 globalParserState->statement->appendOperand(
1412 WQLOperand(yyvsp[0].strValue, WQL_STRING_VALUE_TAG));
|
1413 karl 1.15 ;}
1414 break;
1415
1416 case 39:
1417 #line 378 "WQL.y"
1418 {
|
1419 mike 1.2 globalParserState->statement->appendOperand(
1420 WQLOperand(yyvsp[0].intValue != 0, WQL_BOOLEAN_VALUE_TAG));
|
1421 karl 1.15 ;}
1422 break;
1423
1424
1425 }
1426
1427 /* Line 1000 of yacc.c. */
1428 #line 1429 "WQLtemp"
|
1429 karl 1.12
1430 yyvsp -= yylen;
1431 yyssp -= yylen;
1432
|
1433 karl 1.15
1434 YY_STACK_PRINT (yyss, yyssp);
|
1435 karl 1.12
1436 *++yyvsp = yyval;
1437
1438
|
1439 karl 1.15 /* Now `shift' the result of the reduction. Determine what state
1440 that goes to, based on the state we popped back to and the rule
1441 number reduced by. */
|
1442 karl 1.12
1443 yyn = yyr1[yyn];
1444
|
1445 karl 1.15 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1446 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
|
1447 karl 1.12 yystate = yytable[yystate];
1448 else
|
1449 karl 1.15 yystate = yydefgoto[yyn - YYNTOKENS];
|
1450 karl 1.12
1451 goto yynewstate;
1452
1453
|
1454 karl 1.15 /*------------------------------------.
1455 | yyerrlab -- here on detecting error |
1456 `------------------------------------*/
1457 yyerrlab:
1458 /* If not already recovering from an error, report this error. */
1459 if (!yyerrstatus)
|
1460 karl 1.12 {
1461 ++yynerrs;
|
1462 karl 1.15 #if YYERROR_VERBOSE
|
1463 karl 1.12 yyn = yypact[yystate];
1464
|
1465 karl 1.15 if (YYPACT_NINF < yyn && yyn < YYLAST)
|
1466 karl 1.12 {
|
1467 karl 1.15 YYSIZE_T yysize = 0;
1468 int yytype = YYTRANSLATE (yychar);
1469 const char* yyprefix;
1470 char *yymsg;
1471 int yyx;
1472
1473 /* Start YYX at -YYN if negative to avoid negative indexes in
1474 YYCHECK. */
1475 int yyxbegin = yyn < 0 ? -yyn : 0;
1476
1477 /* Stay within bounds of both yycheck and yytname. */
1478 int yychecklim = YYLAST - yyn;
1479 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1480 int yycount = 0;
1481
1482 yyprefix = ", expecting ";
1483 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1484 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1485 {
1486 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1487 yycount += 1;
1488 karl 1.15 if (yycount == 5)
1489 {
1490 yysize = 0;
1491 break;
1492 }
1493 }
1494 yysize += (sizeof ("syntax error, unexpected ")
1495 + yystrlen (yytname[yytype]));
1496 yymsg = (char *) YYSTACK_ALLOC (yysize);
1497 if (yymsg != 0)
|
1498 karl 1.12 {
|
1499 karl 1.15 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1500 yyp = yystpcpy (yyp, yytname[yytype]);
|
1501 karl 1.12
|
1502 karl 1.15 if (yycount < 5)
|
1503 karl 1.12 {
|
1504 karl 1.15 yyprefix = ", expecting ";
1505 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1506 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
1507 karl 1.12 {
|
1508 karl 1.15 yyp = yystpcpy (yyp, yyprefix);
1509 yyp = yystpcpy (yyp, yytname[yyx]);
1510 yyprefix = " or ";
|
1511 karl 1.12 }
1512 }
|
1513 karl 1.15 yyerror (yymsg);
1514 YYSTACK_FREE (yymsg);
|
1515 karl 1.12 }
1516 else
|
1517 karl 1.15 yyerror ("syntax error; also virtual memory exhausted");
|
1518 karl 1.12 }
1519 else
1520 #endif /* YYERROR_VERBOSE */
|
1521 karl 1.15 yyerror ("syntax error");
|
1522 mike 1.2 }
|
1523 karl 1.12
|
1524 karl 1.15
|
1525 karl 1.12
1526 if (yyerrstatus == 3)
1527 {
|
1528 karl 1.15 /* If just tried and failed to reuse lookahead token after an
1529 error, discard it. */
|
1530 karl 1.12
|
1531 karl 1.15 if (yychar <= YYEOF)
1532 {
1533 /* If at end of input, pop the error token,
1534 then the rest of the stack, then return failure. */
1535 if (yychar == YYEOF)
1536 for (;;)
1537 {
1538 YYPOPSTACK;
1539 if (yyssp == yyss)
1540 YYABORT;
1541 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1542 yydestruct (yystos[*yyssp], yyvsp);
1543 }
1544 }
1545 else
1546 {
1547 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1548 yydestruct (yytoken, &yylval);
1549 yychar = YYEMPTY;
|
1550 karl 1.14
|
1551 karl 1.15 }
|
1552 mike 1.2 }
|
1553 karl 1.12
|
1554 karl 1.15 /* Else will try to reuse lookahead token after shifting the error
1555 token. */
1556 goto yyerrlab1;
|
1557 karl 1.14
|
1558 karl 1.12
|
1559 karl 1.15 /*---------------------------------------------------.
1560 | yyerrorlab -- error raised explicitly by YYERROR. |
1561 `---------------------------------------------------*/
1562 yyerrorlab:
|
1563 karl 1.12
|
1564 karl 1.15 #ifdef __GNUC__
1565 /* Pacify GCC when the user code never invokes YYERROR and the label
1566 yyerrorlab therefore never appears in user code. */
1567 if (0)
1568 goto yyerrorlab;
1569 #endif
|
1570 karl 1.12
|
1571 karl 1.15 yyvsp -= yylen;
1572 yyssp -= yylen;
1573 yystate = *yyssp;
1574 goto yyerrlab1;
|
1575 karl 1.12
|
1576 karl 1.14
|
1577 karl 1.15 /*-------------------------------------------------------------.
1578 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1579 `-------------------------------------------------------------*/
1580 yyerrlab1:
1581 yyerrstatus = 3; /* Each real token shifted decrements this. */
|
1582 karl 1.12
|
1583 karl 1.15 for (;;)
|
1584 karl 1.14 {
|
1585 karl 1.15 yyn = yypact[yystate];
1586 if (yyn != YYPACT_NINF)
1587 {
1588 yyn += YYTERROR;
1589 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1590 {
1591 yyn = yytable[yyn];
1592 if (0 < yyn)
1593 break;
1594 }
1595 }
|
1596 karl 1.12
|
1597 karl 1.15 /* Pop the current state because it cannot handle the error token. */
1598 if (yyssp == yyss)
1599 YYABORT;
|
1600 karl 1.12
|
1601 karl 1.15 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1602 yydestruct (yystos[yystate], yyvsp);
1603 YYPOPSTACK;
1604 yystate = *yyssp;
1605 YY_STACK_PRINT (yyss, yyssp);
|
1606 karl 1.12 }
1607
1608 if (yyn == YYFINAL)
1609 YYACCEPT;
1610
|
1611 karl 1.15 YYDPRINTF ((stderr, "Shifting error token, "));
|
1612 karl 1.12
1613 *++yyvsp = yylval;
|
1614 karl 1.15
|
1615 karl 1.12
1616 yystate = yyn;
1617 goto yynewstate;
1618
1619
|
1620 karl 1.15 /*-------------------------------------.
1621 | yyacceptlab -- YYACCEPT comes here. |
1622 `-------------------------------------*/
1623 yyacceptlab:
1624 yyresult = 0;
1625 goto yyreturn;
1626
1627 /*-----------------------------------.
1628 | yyabortlab -- YYABORT comes here. |
1629 `-----------------------------------*/
1630 yyabortlab:
1631 yyresult = 1;
1632 goto yyreturn;
1633
1634 #ifndef yyoverflow
1635 /*----------------------------------------------.
1636 | yyoverflowlab -- parser overflow comes here. |
1637 `----------------------------------------------*/
1638 yyoverflowlab:
1639 yyerror ("parser stack overflow");
1640 yyresult = 2;
1641 karl 1.15 /* Fall through. */
1642 #endif
1643
1644 yyreturn:
1645 #ifndef yyoverflow
1646 if (yyss != yyssa)
1647 YYSTACK_FREE (yyss);
|
1648 karl 1.12 #endif
|
1649 karl 1.15 return yyresult;
|
1650 mike 1.2 }
|
1651 karl 1.15
1652
1653 #line 383 "WQL.y"
1654
|
1655 karl 1.12
|