1 chuck 1.2 #ifndef lint
2 static char const
3 yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
4 #endif
5 #include <stdlib.h>
6 #define YYBYACC 1
7 #define YYMAJOR 1
8 #define YYMINOR 9
9 #define YYLEX yylex()
10 #define YYEMPTY -1
11 #define yyclearin (yychar=(YYEMPTY))
12 #define yyerrok (yyerrflag=0)
13 #define YYRECOVERING() (yyerrflag!=0)
14 static int yygrowstack();
15 #define yyparse CQL_parse
16 #define yylex CQL_lex
17 #define yyerror CQL_error
18 #define yychar CQL_char
19 #define yyval CQL_val
20 #define yylval CQL_lval
21 #define yydebug CQL_debug
22 chuck 1.2 #define yynerrs CQL_nerrs
23 #define yyerrflag CQL_errflag
24 #define yyss CQL_ss
25 #define yyssp CQL_ssp
26 #define yyvs CQL_vs
27 #define yyvsp CQL_vsp
28 #define yylhs CQL_lhs
29 #define yylen CQL_len
30 #define yydefred CQL_defred
31 #define yydgoto CQL_dgoto
32 #define yysindex CQL_sindex
33 #define yyrindex CQL_rindex
34 #define yygindex CQL_gindex
35 #define yytable CQL_table
36 #define yycheck CQL_check
37 #define yyname CQL_name
38 #define yyrule CQL_rule
39 #define yysslim CQL_sslim
40 #define yystacksize CQL_stacksize
41 #define YYPREFIX "CQL_"
|
42 lucier 1.13 #line 30 "CQL.y"
|
43 chuck 1.2 #include <Pegasus/Common/Config.h>
44 #include <Pegasus/Common/String.h>
45 #include <Pegasus/Common/CommonUTF.h>
46 #include <Pegasus/Query/QueryCommon/QueryException.h>
47 #include <Pegasus/Common/MessageLoader.h>
48 #include <Pegasus/CQL/CQLFactory.h>
49 #include "CQLObjects.h"
50 #include <stdio.h>
51
52 #define yyparse CQL_parse
53 #define CQLPREDICATE 0
54 #define CQLVALUE 1
55 #define CQLIDENTIFIER 2
56 #define CQLFUNCTION 3
57 #define CQLCHAINEDIDENTIFIER 4
58
59 #ifdef CQL_DEBUG_GRAMMAR
60 #define DEBUG_GRAMMAR 1
61 #else
62 #define DEBUG_GRAMMAR 0
63 #endif
64 chuck 1.2
65 int yylex();
|
66 lucier 1.13 static char msg[100];
|
67 chuck 1.2 void printf_(char * msg){
|
68 humberto 1.7 if(DEBUG_GRAMMAR == 1)
|
69 chuck 1.2 printf("%s\n",msg);
70 }
71 extern char * yytext;
72 int chain_state;
73 CQLFactory _factory = CQLFactory();
74 extern int CQL_error(const char *err);
|
75 humberto 1.8
76 enum CQLType { Id, CId, Val, Func, Fact, Trm, Expr, SPred, Pred, Str };
77
78 typedef struct CQLObjPtr {
79 void* _ptr;
80 CQLType type;
81 } CQLOBJPTR;
82
83 Array<CQLObjPtr> _ptrs;
84 CQLOBJPTR _ObjPtr;
85
|
86 humberto 1.10
87 void CQL_Bison_Cleanup(){
|
88 humberto 1.8 for(Uint32 i = 0; i < _ptrs.size(); i++){
89 if(_ptrs[i]._ptr){
90 switch(_ptrs[i].type){
91 case Id:
92 delete (CQLIdentifier*)_ptrs[i]._ptr;
93 break;
94 case CId:
95 delete (CQLChainedIdentifier*)_ptrs[i]._ptr;
96 break;
97 case Val:
98 delete (CQLValue*)_ptrs[i]._ptr;
99 break;
100 case Func:
101 delete (CQLFunction*)_ptrs[i]._ptr;
102 break;
103 case Fact:
104 delete (CQLFactor*)_ptrs[i]._ptr;
105 break;
106 case Trm:
107 delete (CQLTerm*)_ptrs[i]._ptr;
108 break;
109 humberto 1.8 case Expr:
110 delete (CQLExpression*)_ptrs[i]._ptr;
111 break;
112 case SPred:
113 delete (CQLSimplePredicate*)_ptrs[i]._ptr;
114 break;
115 case Pred:
116 delete (CQLPredicate*)_ptrs[i]._ptr;
117 break;
118 case Str:
119 delete (String*)_ptrs[i]._ptr;
120 }
121 }
122 }
123 _ptrs.clear();
124 _factory.cleanup();
|
125 humberto 1.10 _factory = CQLFactory();
|
126 humberto 1.8 }
127
|
128 humberto 1.10 PEGASUS_NAMESPACE_BEGIN
129
130 extern CQLParserState* CQL_globalParserState;
131 Array<CQLPredicate> _arglist;
132
133
|
134 chuck 1.2 PEGASUS_NAMESPACE_END
135
136
|
137 lucier 1.13 #line 125 "CQL.y"
|
138 chuck 1.2 typedef union {
139 char * strValue;
140 String * _string;
141 CQLValue * _value;
142 CQLIdentifier * _identifier;
143 CQLChainedIdentifier * _chainedIdentifier;
144 CQLPredicate * _predicate;
145 ExpressionOpType _opType;
146 void * _node;
147 } YYSTYPE;
|
148 humberto 1.10 #line 149 "y.tab.c"
|
149 chuck 1.2 #define YYERRCODE 256
150 #define IDENTIFIER 257
151 #define STRING_LITERAL 258
152 #define BINARY 259
153 #define NEGATIVE_BINARY 260
154 #define HEXADECIMAL 261
155 #define NEGATIVE_HEXADECIMAL 262
156 #define INTEGER 263
157 #define NEGATIVE_INTEGER 264
158 #define REAL 265
159 #define NEGATIVE_REAL 266
160 #define _TRUE 267
161 #define _FALSE 268
162 #define SCOPED_PROPERTY 269
163 #define LPAR 270
164 #define RPAR 271
165 #define HASH 272
166 #define DOT 273
167 #define LBRKT 274
168 #define RBRKT 275
169 #define UNDERSCORE 276
170 chuck 1.2 #define COMMA 277
171 #define CONCAT 278
172 #define DBL_PIPE 279
173 #define PLUS 280
174 #define MINUS 281
175 #define TIMES 282
176 #define DIV 283
177 #define IS 284
178 #define _NULL 285
179 #define _EQ 286
180 #define _NE 287
181 #define _GT 288
182 #define _LT 289
183 #define _GE 290
184 #define _LE 291
185 #define _ISA 292
186 #define _LIKE 293
187 #define NOT 294
188 #define _AND 295
189 #define _OR 296
190 #define SCOPE 297
191 chuck 1.2 #define ANY 298
192 #define EVERY 299
193 #define IN 300
194 #define SATISFIES 301
195 #define STAR 302
196 #define DOTDOT 303
197 #define SHARP 304
198 #define DISTINCT 305
199 #define SELECT 306
200 #define FIRST 307
201 #define FROM 308
202 #define WHERE 309
203 #define ORDER 310
204 #define BY 311
205 #define ASC 312
206 #define DESC 313
207 #define AS 314
208 #define UNEXPECTED_CHAR 315
209 const short CQL_lhs[] = { -1,
210 1, 2, 3, 4, 5, 6, 6, 7, 7, 8,
211 8, 9, 9, 10, 10, 10, 10, 10, 10, 10,
212 chuck 1.2 11, 12, 13, 13, 13, 13, 13, 13, 13, 13,
213 13, 13, 14, 14, 15, 16, 17, 18, 19, 19,
214 20, 20, 20, 20, 20, 20, 21, 21, 21, 21,
|
215 humberto 1.10 21, 21, 21, 22, 22, 23, 23, 24, 24, 25,
216 25, 26, 26, 26, 27, 28, 28, 29, 29, 30,
217 31, 31, 32, 33, 33, 0,
|
218 chuck 1.2 };
219 const short CQL_len[] = { 2,
220 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
221 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
222 1, 1, 1, 3, 1, 3, 1, 4, 3, 3,
223 5, 4, 1, 3, 1, 1, 1, 2, 1, 1,
224 1, 1, 1, 1, 1, 1, 1, 4, 3, 3,
|
225 humberto 1.10 3, 3, 3, 1, 2, 1, 3, 1, 3, 0,
226 1, 1, 3, 2, 1, 1, 3, 1, 1, 2,
227 0, 3, 1, 0, 2, 5,
|
228 chuck 1.2 };
229 const short CQL_defred[] = { 0,
230 0, 0, 1, 5, 6, 7, 8, 9, 10, 11,
|
231 humberto 1.10 12, 13, 19, 20, 4, 0, 0, 0, 66, 0,
|
232 chuck 1.2 27, 14, 16, 17, 15, 18, 23, 0, 0, 36,
|
233 humberto 1.10 37, 0, 0, 54, 56, 0, 0, 69, 0, 0,
234 0, 0, 38, 55, 0, 0, 0, 0, 0, 0,
|
235 chuck 1.2 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
|
236 humberto 1.10 0, 0, 0, 70, 0, 0, 24, 0, 0, 26,
237 67, 0, 29, 22, 0, 0, 34, 49, 0, 52,
238 53, 39, 40, 50, 51, 57, 0, 0, 2, 3,
239 0, 65, 0, 28, 0, 32, 48, 72, 0, 64,
240 0, 76, 31, 63, 0, 75,
|
241 chuck 1.2 };
242 const short CQL_dgoto[] = { 2,
|
243 humberto 1.10 20, 90, 91, 21, 22, 23, 24, 25, 26, 27,
244 74, 75, 41, 29, 30, 31, 32, 33, 84, 59,
245 34, 35, 36, 37, 69, 92, 93, 38, 39, 40,
246 64, 106, 102,
|
247 chuck 1.2 };
248 const short CQL_sindex[] = { -295,
|
249 humberto 1.10 -152, 0, 0, 0, 0, 0, 0, 0, 0, 0,
250 0, 0, 0, 0, 0, -136, -241, -98, 0, -256,
|
251 chuck 1.2 0, 0, 0, 0, 0, 0, 0, -255, -257, 0,
|
252 humberto 1.10 0, -196, -247, 0, 0, -265, -264, 0, -240, -260,
253 -227, -261, 0, 0, -136, -241, -249, -136, -241, -273,
254 0, 0, 0, 0, 0, 0, -207, -241, -98, -82,
255 -136, -136, -152, 0, -207, -244, 0, -264, -220, 0,
256 0, -218, 0, 0, -216, -264, 0, 0, -230, 0,
257 0, 0, 0, 0, 0, 0, -265, -240, 0, 0,
258 -251, 0, -253, 0, -241, 0, 0, 0, -207, 0,
259 -136, 0, 0, 0, -264, 0,
|
260 chuck 1.2 };
261 const short CQL_rindex[] = { 0,
262 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
263 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
|
264 humberto 1.10 0, 0, 0, 0, 0, 0, 0, -219, 75, 0,
265 0, 78, 0, 0, 0, 101, -270, 0, -242, 0,
266 52, 0, 0, 0, -210, 0, 0, 0, 0, 0,
|
267 chuck 1.2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
268 humberto 1.10 0, 0, 0, 0, 0, 0, 0, -192, 0, 0,
269 0, 29, 0, 0, 0, -211, 0, 0, 0, 0,
270 0, 0, 0, 0, 0, 0, 104, -242, 0, 0,
271 1, 0, 80, 0, 0, 0, 0, 0, 0, 0,
272 0, 0, 0, 0, 81, 0,
|
273 chuck 1.2 };
274 const short CQL_gindex[] = { 0,
275 -42, 0, 0, -38, -13, 0, 0, 0, 0, 0,
|
276 humberto 1.10 0, 0, -1, 0, 0, 0, -33, 24, 0, 51,
277 67, 25, 36, -14, 0, 0, 0, 0, 37, 0,
278 11, 0, 0,
|
279 chuck 1.2 };
|
280 humberto 1.10 #define YYTABLESIZE 412
|
281 chuck 1.2 const short CQL_table[] = { 28,
|
282 humberto 1.10 62, 42, 25, 43, 72, 3, 68, 3, 73, 67,
283 1, 78, 3, 45, 80, 46, 4, 47, 48, 15,
284 79, 49, 89, 72, 15, 82, 85, 73, 30, 61,
285 68, 62, 70, 76, 62, 77, 63, 68, 51, 52,
286 53, 54, 55, 56, 81, 66, 48, 65, 100, 3,
287 94, 33, 71, 95, 97, 101, 104, 33, 96, 33,
288 60, 28, 99, 21, 33, 71, 33, 33, 33, 33,
289 33, 33, 33, 33, 35, 33, 33, 47, 61, 74,
290 73, 103, 83, 60, 44, 86, 105, 50, 33, 51,
291 52, 53, 54, 55, 56, 57, 58, 87, 98, 88,
292 58, 0, 0, 59, 3, 4, 5, 6, 7, 8,
293 9, 10, 11, 12, 13, 14, 15, 16, 0, 17,
294 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
295 13, 14, 15, 16, 0, 17, 0, 0, 0, 0,
296 0, 18, 0, 0, 0, 0, 0, 0, 0, 19,
297 0, 0, 0, 0, 0, 0, 0, 18, 3, 4,
298 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
299 15, 16, 0, 17, 3, 4, 5, 6, 7, 8,
|
300 chuck 1.2 9, 10, 11, 12, 13, 14, 15, 16, 0, 0,
301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
302 humberto 1.10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
303 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
304 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
306 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
309 chuck 1.2 0, 0, 0, 25, 0, 25, 25, 25, 0, 25,
310 0, 25, 0, 0, 0, 0, 25, 0, 25, 25,
311 25, 25, 25, 25, 25, 25, 0, 25, 25, 30,
|
312 humberto 1.10 0, 30, 30, 30, 0, 30, 0, 30, 0, 62,
|
313 chuck 1.2 25, 0, 30, 0, 30, 30, 30, 30, 30, 30,
314 30, 30, 33, 30, 30, 0, 33, 0, 33, 0,
315 33, 0, 0, 0, 0, 33, 30, 33, 33, 33,
|
316 humberto 1.10 33, 33, 33, 33, 33, 35, 33, 33, 47, 35,
317 0, 35, 47, 0, 47, 0, 0, 0, 35, 33,
318 35, 35, 35, 35, 35, 35, 35, 35, 0, 35,
319 35, 58, 47, 47, 59, 58, 0, 58, 59, 0,
320 59, 0, 35, 0, 0, 47, 0, 0, 0, 0,
321 0, 0, 0, 0, 0, 0, 58, 0, 0, 59,
322 0, 0, 0, 0, 0, 0, 0, 0, 58, 0,
323 0, 59,
|
324 chuck 1.2 };
325 const short CQL_check[] = { 1,
326 0, 16, 0, 17, 47, 257, 277, 257, 47, 271,
327 306, 285, 257, 270, 57, 272, 258, 273, 274, 269,
328 294, 279, 65, 66, 269, 59, 60, 66, 0, 295,
|
329 humberto 1.10 45, 296, 46, 48, 296, 49, 277, 308, 286, 287,
330 288, 289, 290, 291, 58, 273, 274, 308, 91, 257,
331 271, 0, 302, 272, 285, 309, 99, 277, 275, 279,
332 271, 63, 314, 275, 284, 308, 286, 287, 288, 289,
333 290, 291, 292, 293, 0, 295, 296, 0, 271, 0,
334 0, 95, 59, 33, 18, 61, 101, 284, 308, 286,
335 287, 288, 289, 290, 291, 292, 293, 62, 88, 63,
336 0, -1, -1, 0, 257, 258, 259, 260, 261, 262,
337 263, 264, 265, 266, 267, 268, 269, 270, -1, 272,
338 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
339 267, 268, 269, 270, -1, 272, -1, -1, -1, -1,
340 -1, 294, -1, -1, -1, -1, -1, -1, -1, 302,
341 -1, -1, -1, -1, -1, -1, -1, 294, 257, 258,
342 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
343 269, 270, -1, 272, 257, 258, 259, 260, 261, 262,
|
344 chuck 1.2 263, 264, 265, 266, 267, 268, 269, 270, -1, -1,
345 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
346 humberto 1.10 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
347 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
348 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
349 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
350 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
351 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
353 chuck 1.2 -1, -1, -1, 271, -1, 273, 274, 275, -1, 277,
354 -1, 279, -1, -1, -1, -1, 284, -1, 286, 287,
355 288, 289, 290, 291, 292, 293, -1, 295, 296, 271,
356 -1, 273, 274, 275, -1, 277, -1, 279, -1, 309,
357 308, -1, 284, -1, 286, 287, 288, 289, 290, 291,
358 292, 293, 271, 295, 296, -1, 275, -1, 277, -1,
359 279, -1, -1, -1, -1, 284, 308, 286, 287, 288,
|
360 humberto 1.10 289, 290, 291, 292, 293, 271, 295, 296, 271, 275,
361 -1, 277, 275, -1, 277, -1, -1, -1, 284, 308,
362 286, 287, 288, 289, 290, 291, 292, 293, -1, 295,
363 296, 271, 295, 296, 271, 275, -1, 277, 275, -1,
364 277, -1, 308, -1, -1, 308, -1, -1, -1, -1,
365 -1, -1, -1, -1, -1, -1, 296, -1, -1, 296,
366 -1, -1, -1, -1, -1, -1, -1, -1, 308, -1,
367 -1, 308,
|
368 chuck 1.2 };
369 #define YYFINAL 2
370 #ifndef YYDEBUG
371 #define YYDEBUG 0
372 #endif
373 #define YYMAXTOKEN 315
374 #if YYDEBUG
375 const char * const CQL_name[] = {
376 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
377 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
378 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
379 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
380 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
381 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
382 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"IDENTIFIER","STRING_LITERAL",
383 "BINARY","NEGATIVE_BINARY","HEXADECIMAL","NEGATIVE_HEXADECIMAL","INTEGER",
384 "NEGATIVE_INTEGER","REAL","NEGATIVE_REAL","_TRUE","_FALSE","SCOPED_PROPERTY",
385 "LPAR","RPAR","HASH","DOT","LBRKT","RBRKT","UNDERSCORE","COMMA","CONCAT",
386 "DBL_PIPE","PLUS","MINUS","TIMES","DIV","IS","_NULL","_EQ","_NE","_GT","_LT",
387 "_GE","_LE","_ISA","_LIKE","NOT","_AND","_OR","SCOPE","ANY","EVERY","IN",
388 "SATISFIES","STAR","DOTDOT","SHARP","DISTINCT","SELECT","FIRST","FROM","WHERE",
389 chuck 1.2 "ORDER","BY","ASC","DESC","AS","UNEXPECTED_CHAR",
390 };
391 const char * const CQL_rule[] = {
392 "$accept : select_statement",
393 "identifier : IDENTIFIER",
394 "class_name : identifier",
395 "class_path : class_name",
396 "scoped_property : SCOPED_PROPERTY",
397 "literal_string : STRING_LITERAL",
398 "binary_value : BINARY",
399 "binary_value : NEGATIVE_BINARY",
400 "hex_value : HEXADECIMAL",
401 "hex_value : NEGATIVE_HEXADECIMAL",
402 "decimal_value : INTEGER",
403 "decimal_value : NEGATIVE_INTEGER",
404 "real_value : REAL",
405 "real_value : NEGATIVE_REAL",
406 "literal : literal_string",
407 "literal : decimal_value",
408 "literal : binary_value",
409 "literal : hex_value",
410 chuck 1.2 "literal : real_value",
411 "literal : _TRUE",
412 "literal : _FALSE",
413 "array_index : expr",
414 "array_index_list : array_index",
415 "chain : literal",
416 "chain : LPAR expr RPAR",
417 "chain : identifier",
418 "chain : identifier HASH literal_string",
419 "chain : scoped_property",
420 "chain : identifier LPAR arg_list RPAR",
421 "chain : chain DOT scoped_property",
422 "chain : chain DOT identifier",
423 "chain : chain DOT identifier HASH literal_string",
424 "chain : chain LBRKT array_index_list RBRKT",
425 "concat : chain",
|
426 humberto 1.10 "concat : concat DBL_PIPE literal_string",
|
427 chuck 1.2 "factor : concat",
428 "term : factor",
429 "arith : term",
430 "value_symbol : HASH literal_string",
431 "arith_or_value_symbol : arith",
432 "arith_or_value_symbol : value_symbol",
433 "comp_op : _EQ",
434 "comp_op : _NE",
435 "comp_op : _GT",
436 "comp_op : _LT",
437 "comp_op : _GE",
438 "comp_op : _LE",
439 "comp : arith",
440 "comp : arith IS NOT _NULL",
441 "comp : arith IS _NULL",
442 "comp : arith comp_op arith_or_value_symbol",
443 "comp : value_symbol comp_op arith",
444 "comp : arith _ISA identifier",
445 "comp : arith _LIKE literal_string",
446 "expr_factor : comp",
447 "expr_factor : NOT comp",
448 chuck 1.2 "expr_term : expr_factor",
449 "expr_term : expr_term _AND expr_factor",
450 "expr : expr_term",
451 "expr : expr _OR expr_term",
452 "arg_list :",
453 "arg_list : expr",
454 "from_specifier : class_path",
455 "from_specifier : class_path AS identifier",
456 "from_specifier : class_path identifier",
457 "from_criteria : from_specifier",
458 "star_expr : STAR",
459 "star_expr : chain DOT STAR",
460 "selected_entry : expr",
461 "selected_entry : star_expr",
462 "select_list : selected_entry select_list_tail",
463 "select_list_tail :",
464 "select_list_tail : COMMA selected_entry select_list_tail",
465 "search_condition : expr",
466 "optional_where :",
467 "optional_where : WHERE search_condition",
468 "select_statement : SELECT select_list FROM from_criteria optional_where",
469 chuck 1.2 };
470 #endif
471 #if YYDEBUG
472 #include <stdio.h>
473 #endif
474 #ifdef YYSTACKSIZE
475 #undef YYMAXDEPTH
476 #define YYMAXDEPTH YYSTACKSIZE
477 #else
478 #ifdef YYMAXDEPTH
479 #define YYSTACKSIZE YYMAXDEPTH
480 #else
481 #define YYSTACKSIZE 10000
482 #define YYMAXDEPTH 10000
483 #endif
484 #endif
485 #define YYINITSTACKSIZE 200
486 int yydebug;
487 int yynerrs;
488 int yyerrflag;
489 int yychar;
490 chuck 1.2 short *yyssp;
491 YYSTYPE *yyvsp;
492 YYSTYPE yyval;
493 YYSTYPE yylval;
494 short *yyss;
495 short *yysslim;
496 YYSTYPE *yyvs;
497 int yystacksize;
|
498 lucier 1.13 #line 1372 "CQL.y"
|
499 chuck 1.2
500 /*int yyerror(char * err){yyclearin; yyerrok;throw Exception(String(err));return 1;}*/
|
501 humberto 1.10 #line 502 "y.tab.c"
|
502 chuck 1.2 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
503 static int yygrowstack()
504 {
505 int newsize, i;
506 short *newss;
507 YYSTYPE *newvs;
508
509 if ((newsize = yystacksize) == 0)
510 newsize = YYINITSTACKSIZE;
511 else if (newsize >= YYMAXDEPTH)
512 return -1;
513 else if ((newsize *= 2) > YYMAXDEPTH)
514 newsize = YYMAXDEPTH;
515 i = yyssp - yyss;
516 newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
517 (short *)malloc(newsize * sizeof *newss);
518 if (newss == NULL)
519 return -1;
520 yyss = newss;
521 yyssp = newss + i;
522 newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
523 chuck 1.2 (YYSTYPE *)malloc(newsize * sizeof *newvs);
524 if (newvs == NULL)
525 return -1;
526 yyvs = newvs;
527 yyvsp = newvs + i;
528 yystacksize = newsize;
529 yysslim = yyss + newsize - 1;
530 return 0;
531 }
532
533 #define YYABORT goto yyabort
534 #define YYREJECT goto yyabort
535 #define YYACCEPT goto yyaccept
536 #define YYERROR goto yyerrlab
537
538 #ifndef YYPARSE_PARAM
539 #if defined(__cplusplus) || __STDC__
540 #define YYPARSE_PARAM_ARG void
541 #define YYPARSE_PARAM_DECL
542 #else /* ! ANSI-C/C++ */
543 #define YYPARSE_PARAM_ARG
544 chuck 1.2 #define YYPARSE_PARAM_DECL
545 #endif /* ANSI-C/C++ */
546 #else /* YYPARSE_PARAM */
547 #ifndef YYPARSE_PARAM_TYPE
548 #define YYPARSE_PARAM_TYPE void *
549 #endif
550 #if defined(__cplusplus) || __STDC__
551 #define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
552 #define YYPARSE_PARAM_DECL
553 #else /* ! ANSI-C/C++ */
554 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
555 #define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
556 #endif /* ANSI-C/C++ */
557 #endif /* ! YYPARSE_PARAM */
558
559 int
560 yyparse (YYPARSE_PARAM_ARG)
561 YYPARSE_PARAM_DECL
562 {
563 register int yym, yyn, yystate;
564 #if YYDEBUG
565 chuck 1.2 register const char *yys;
566
567 if ((yys = getenv("YYDEBUG")))
568 {
569 yyn = *yys;
570 if (yyn >= '0' && yyn <= '9')
571 yydebug = yyn - '0';
572 }
573 #endif
574
575 yynerrs = 0;
576 yyerrflag = 0;
577 yychar = (-1);
578
579 if (yyss == NULL && yygrowstack()) goto yyoverflow;
580 yyssp = yyss;
581 yyvsp = yyvs;
582 *yyssp = yystate = 0;
583
584 yyloop:
585 if ((yyn = yydefred[yystate])) goto yyreduce;
586 chuck 1.2 if (yychar < 0)
587 {
588 if ((yychar = yylex()) < 0) yychar = 0;
589 #if YYDEBUG
590 if (yydebug)
591 {
592 yys = 0;
593 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
594 if (!yys) yys = "illegal-symbol";
595 printf("%sdebug: state %d, reading %d (%s)\n",
596 YYPREFIX, yystate, yychar, yys);
597 }
598 #endif
599 }
600 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
601 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
602 {
603 #if YYDEBUG
604 if (yydebug)
605 printf("%sdebug: state %d, shifting to state %d\n",
606 YYPREFIX, yystate, yytable[yyn]);
607 chuck 1.2 #endif
608 if (yyssp >= yysslim && yygrowstack())
609 {
610 goto yyoverflow;
611 }
612 *++yyssp = yystate = yytable[yyn];
613 *++yyvsp = yylval;
614 yychar = (-1);
615 if (yyerrflag > 0) --yyerrflag;
616 goto yyloop;
617 }
618 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
619 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
620 {
621 yyn = yytable[yyn];
622 goto yyreduce;
623 }
624 if (yyerrflag) goto yyinrecovery;
625 #if defined(lint) || defined(__GNUC__)
626 goto yynewerror;
627 #endif
628 chuck 1.2 yynewerror:
629 yyerror("syntax error");
630 #if defined(lint) || defined(__GNUC__)
631 goto yyerrlab;
632 #endif
633 yyerrlab:
634 ++yynerrs;
635 yyinrecovery:
636 if (yyerrflag < 3)
637 {
638 yyerrflag = 3;
639 for (;;)
640 {
641 if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
642 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
643 {
644 #if YYDEBUG
645 if (yydebug)
646 printf("%sdebug: state %d, error recovery shifting\
647 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
648 #endif
649 chuck 1.2 if (yyssp >= yysslim && yygrowstack())
650 {
651 goto yyoverflow;
652 }
653 *++yyssp = yystate = yytable[yyn];
654 *++yyvsp = yylval;
655 goto yyloop;
656 }
657 else
658 {
659 #if YYDEBUG
660 if (yydebug)
661 printf("%sdebug: error recovery discarding state %d\n",
662 YYPREFIX, *yyssp);
663 #endif
664 if (yyssp <= yyss) goto yyabort;
665 --yyssp;
666 --yyvsp;
667 }
668 }
669 }
670 chuck 1.2 else
671 {
672 if (yychar == 0) goto yyabort;
673 #if YYDEBUG
674 if (yydebug)
675 {
676 yys = 0;
677 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
678 if (!yys) yys = "illegal-symbol";
679 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
680 YYPREFIX, yystate, yychar, yys);
681 }
682 #endif
683 yychar = (-1);
684 goto yyloop;
685 }
686 yyreduce:
687 #if YYDEBUG
688 if (yydebug)
689 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
690 YYPREFIX, yystate, yyn, yyrule[yyn]);
691 chuck 1.2 #endif
692 yym = yylen[yyn];
693 yyval = yyvsp[1-yym];
694 switch (yyn)
695 {
696 case 1:
|
697 lucier 1.13 #line 247 "CQL.y"
|
698 chuck 1.2 {
|
699 humberto 1.9 CQL_globalParserState->currentRule = "identifier";
|
700 chuck 1.2 sprintf(msg,"BISON::identifier\n");
701 printf_(msg);
|
702 humberto 1.10 if(isUTF8Str(CQL_lval.strValue)){
703 yyval._identifier = new CQLIdentifier(String(CQL_lval.strValue));
704 _ObjPtr._ptr = yyval._identifier;
705 _ObjPtr.type = Id;
706 _ptrs.append(_ObjPtr);
707 }else{
708 sprintf(msg,"BISON::identifier-> BAD UTF\n");
709 printf_(msg);
710 throw CQLSyntaxErrorException(
711 MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
712 String("Bad UTF8 encountered parsing rule $0 in position $1."),
713 String("identifier"),
714 CQL_globalParserState->currentTokenPos)
715 );
716 }
|
717 chuck 1.2 }
718 break;
719 case 2:
|
720 lucier 1.13 #line 270 "CQL.y"
|
721 chuck 1.2 {
|
722 humberto 1.9 CQL_globalParserState->currentRule = "class_name";
|
723 chuck 1.2 sprintf(msg,"BISON::class_name = %s\n", (const char *)(yyvsp[0]._identifier->getName().getString().getCString()));
724 printf_(msg);
725 yyval._identifier = yyvsp[0]._identifier;
726 }
727 break;
728 case 3:
|
729 lucier 1.13 #line 279 "CQL.y"
|
730 chuck 1.2 {
|
731 humberto 1.9 CQL_globalParserState->currentRule = "class_path";
|
732 chuck 1.2 sprintf(msg,"BISON::class_path\n");
733 printf_(msg);
734 yyval._identifier = yyvsp[0]._identifier;
735 }
736 break;
737 case 4:
|
738 lucier 1.13 #line 298 "CQL.y"
|
739 chuck 1.2 {
|
740 humberto 1.8 /*
741 SCOPED_PROPERTY can be:
742 - "A::prop"
743 - "A::class.prop"
744 - "A::class.prop#'OK'
745 - "A::class.prop[4]"
746 */
|
747 humberto 1.9 CQL_globalParserState->currentRule = "scoped_property";
|
748 humberto 1.8 sprintf(msg,"BISON::scoped_property = %s\n",CQL_lval.strValue);
749 printf_(msg);
|
750 humberto 1.10 if(isUTF8Str(CQL_lval.strValue)){
751 String tmp(CQL_lval.strValue);
752 yyval._identifier = new CQLIdentifier(tmp);
753 _ObjPtr._ptr = yyval._identifier;
754 _ObjPtr.type = Id;
755 _ptrs.append(_ObjPtr);
756
757 }else{
758 sprintf(msg,"BISON::scoped_property-> BAD UTF\n");
759 printf_(msg);
760 throw CQLSyntaxErrorException(
761 MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
762 String("Bad UTF8 encountered parsing rule $0 in position $1."),
763 String("scoped_property"),
764 CQL_globalParserState->currentTokenPos)
765 );
766 }
767 }
|
768 chuck 1.2 break;
769 case 5:
|
770 lucier 1.13 #line 331 "CQL.y"
|
771 chuck 1.2 {
772 /*
773 We make sure the literal is valid UTF8, then make a String
774 */
|
775 humberto 1.9 CQL_globalParserState->currentRule = "literal_string";
|
776 chuck 1.2 sprintf(msg,"BISON::literal_string-> %s\n",CQL_lval.strValue);
777 printf_(msg);
778
779 if(isUTF8Str(CQL_lval.strValue)){
780 yyval._string = new String(CQL_lval.strValue);
|
781 humberto 1.8 _ObjPtr._ptr = yyval._string;
782 _ObjPtr.type = Str;
783 _ptrs.append(_ObjPtr);
|
784 chuck 1.2 }else{
785 sprintf(msg,"BISON::literal_string-> BAD UTF\n");
786 printf_(msg);
787 throw CQLSyntaxErrorException(
788 MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
789 String("Bad UTF8 encountered parsing rule $0 in position $1."),
790 String("literal_string"),
|
791 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
792 chuck 1.2 );
793 }
794 }
795 break;
796 case 6:
|
797 lucier 1.13 #line 359 "CQL.y"
|
798 chuck 1.2 {
|
799 humberto 1.9 CQL_globalParserState->currentRule = "binary_value->BINARY";
|
800 chuck 1.2 sprintf(msg,"BISON::binary_value-> %s\n",CQL_lval.strValue);
801 printf_(msg);
802
803 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Binary);
|
804 humberto 1.8 _ObjPtr._ptr = yyval._value;
805 _ObjPtr.type = Val;
806 _ptrs.append(_ObjPtr);
|
807 chuck 1.2 }
808 break;
809 case 7:
|
810 lucier 1.13 #line 370 "CQL.y"
|
811 chuck 1.2 {
|
812 humberto 1.9 CQL_globalParserState->currentRule = "binary_value->NEGATIVE_BINARY";
|
813 chuck 1.2 sprintf(msg,"BISON::binary_value-> %s\n",CQL_lval.strValue);
814 printf_(msg);
815
816 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Binary, false);
|
817 humberto 1.8 _ObjPtr._ptr = yyval._value;
818 _ObjPtr.type = Val;
819 _ptrs.append(_ObjPtr);
|
820 chuck 1.2 }
821 break;
822 case 8:
|
823 lucier 1.13 #line 384 "CQL.y"
|
824 chuck 1.2 {
|
825 humberto 1.9 CQL_globalParserState->currentRule = "hex_value->HEXADECIMAL";
|
826 chuck 1.2 sprintf(msg,"BISON::hex_value-> %s\n",CQL_lval.strValue);
827 printf_(msg);
828
829 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Hex);
|
830 humberto 1.8 _ObjPtr._ptr = yyval._value;
831 _ObjPtr.type = Val;
832 _ptrs.append(_ObjPtr);
|
833 chuck 1.2 }
834 break;
835 case 9:
|
836 lucier 1.13 #line 395 "CQL.y"
|
837 chuck 1.2 {
|
838 humberto 1.9 CQL_globalParserState->currentRule = "hex_value->NEGATIVE_HEXADECIMAL";
|
839 chuck 1.2 sprintf(msg,"BISON::hex_value-> %s\n",CQL_lval.strValue);
840 printf_(msg);
841
842 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Hex, false);
|
843 humberto 1.8 _ObjPtr._ptr = yyval._value;
844 _ObjPtr.type = Val;
845 _ptrs.append(_ObjPtr);
|
846 chuck 1.2 }
847 break;
848 case 10:
|
849 lucier 1.13 #line 409 "CQL.y"
|
850 chuck 1.2 {
|
851 humberto 1.9 CQL_globalParserState->currentRule = "decimal_value->INTEGER";
|
852 chuck 1.2 sprintf(msg,"BISON::decimal_value-> %s\n",CQL_lval.strValue);
853 printf_(msg);
854
855 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Decimal);
|
856 humberto 1.8 _ObjPtr._ptr = yyval._value;
857 _ObjPtr.type = Val;
858 _ptrs.append(_ObjPtr);
|
859 chuck 1.2 }
860 break;
861 case 11:
|
862 lucier 1.13 #line 420 "CQL.y"
|
863 chuck 1.2 {
|
864 humberto 1.9 CQL_globalParserState->currentRule = "decimal_value->NEGATIVE_INTEGER";
|
865 chuck 1.2 sprintf(msg,"BISON::decimal_value-> %s\n",CQL_lval.strValue);
866 printf_(msg);
867
868 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Decimal, false);
|
869 humberto 1.8 _ObjPtr._ptr = yyval._value;
870 _ObjPtr.type = Val;
871 _ptrs.append(_ObjPtr);
|
872 chuck 1.2 }
873 break;
874 case 12:
|
875 lucier 1.13 #line 434 "CQL.y"
|
876 chuck 1.2 {
|
877 humberto 1.9 CQL_globalParserState->currentRule = "real_value->REAL";
|
878 chuck 1.2 sprintf(msg,"BISON::real_value-> %s\n",CQL_lval.strValue);
879 printf_(msg);
880 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Real);
|
881 humberto 1.8 _ObjPtr._ptr = yyval._value;
882 _ObjPtr.type = Val;
883 _ptrs.append(_ObjPtr);
|
884 chuck 1.2 }
885 break;
886 case 13:
|
887 lucier 1.13 #line 444 "CQL.y"
|
888 chuck 1.2 {
|
889 humberto 1.9 CQL_globalParserState->currentRule = "real_value->NEGATIVE_REAL";
|
890 chuck 1.2 sprintf(msg,"BISON::real_value-> %s\n",CQL_lval.strValue);
891 printf_(msg);
892 yyval._value = new CQLValue(CQL_lval.strValue, CQLValue::Real, false);
|
893 humberto 1.8 _ObjPtr._ptr = yyval._value;
894 _ObjPtr.type = Val;
895 _ptrs.append(_ObjPtr);
|
896 chuck 1.2 }
897 break;
898 case 14:
|
899 lucier 1.13 #line 457 "CQL.y"
|
900 chuck 1.2 {
|
901 humberto 1.9 CQL_globalParserState->currentRule = "literal->literal_string";
|
902 chuck 1.2 sprintf(msg,"BISON::literal->literal_string\n");
903 printf_(msg);
904 yyval._value = new CQLValue(*yyvsp[0]._string);
|
905 humberto 1.8 _ObjPtr._ptr = yyval._value;
906 _ObjPtr.type = Val;
907 _ptrs.append(_ObjPtr);
|
908 chuck 1.2 }
909 break;
910 case 15:
|
911 lucier 1.13 #line 467 "CQL.y"
|
912 chuck 1.2 {
|
913 humberto 1.9 CQL_globalParserState->currentRule = "literal->decimal_value";
|
914 chuck 1.2 sprintf(msg,"BISON::literal->decimal_value\n");
915 printf_(msg);
916
917 }
918 break;
919 case 16:
|
920 lucier 1.13 #line 474 "CQL.y"
|
921 chuck 1.2 {
|
922 humberto 1.9 CQL_globalParserState->currentRule = "literal->binary_value";
|
923 chuck 1.2 sprintf(msg,"BISON::literal->binary_value\n");
924 printf_(msg);
925
926 }
927 break;
928 case 17:
|
929 lucier 1.13 #line 481 "CQL.y"
|
930 chuck 1.2 {
|
931 humberto 1.9 CQL_globalParserState->currentRule = "literal->hex_value";
|
932 chuck 1.2 sprintf(msg,"BISON::literal->hex_value\n");
933 printf_(msg);
934
935 }
936 break;
937 case 18:
|
938 lucier 1.13 #line 488 "CQL.y"
|
939 chuck 1.2 {
|
940 humberto 1.9 CQL_globalParserState->currentRule = "literal->real_value";
|
941 chuck 1.2 sprintf(msg,"BISON::literal->real_value\n");
942 printf_(msg);
943
944 }
945 break;
946 case 19:
|
947 lucier 1.13 #line 495 "CQL.y"
|
948 chuck 1.2 {
|
949 humberto 1.9 CQL_globalParserState->currentRule = "literal->_TRUE";
|
950 chuck 1.2 sprintf(msg,"BISON::literal->_TRUE\n");
951 printf_(msg);
952
953 yyval._value = new CQLValue(Boolean(true));
|
954 humberto 1.8 _ObjPtr._ptr = yyval._value;
955 _ObjPtr.type = Val;
956 _ptrs.append(_ObjPtr);
|
957 chuck 1.2 }
958 break;
959 case 20:
|
960 lucier 1.13 #line 506 "CQL.y"
|
961 chuck 1.2 {
|
962 humberto 1.9 CQL_globalParserState->currentRule = "literal->_FALSE";
|
963 chuck 1.2 sprintf(msg,"BISON::literal->_FALSE\n");
964 printf_(msg);
965
966 yyval._value = new CQLValue(Boolean(false));
|
967 humberto 1.8 _ObjPtr._ptr = yyval._value;
968 _ObjPtr.type = Val;
969 _ptrs.append(_ObjPtr);
|
970 chuck 1.2 }
971 break;
972 case 21:
|
973 lucier 1.13 #line 520 "CQL.y"
|
974 chuck 1.2 {
|
975 humberto 1.9 CQL_globalParserState->currentRule = "array_index->expr";
|
976 chuck 1.2 sprintf(msg,"BISON::array_index->expr\n");
977 printf_(msg);
978
979 CQLValue* _val = (CQLValue*)_factory.getObject(yyvsp[0]._predicate,Predicate,Value);
980 yyval._string = new String(_val->toString());
|
981 humberto 1.8 _ObjPtr._ptr = yyval._string;
982 _ObjPtr.type = Str;
983 _ptrs.append(_ObjPtr);
|
984 chuck 1.2 }
985 break;
986 case 22:
|
987 lucier 1.13 #line 535 "CQL.y"
|
988 chuck 1.2 {
|
989 humberto 1.9 CQL_globalParserState->currentRule = "array_index_list->array_index";
|
990 chuck 1.2 sprintf(msg,"BISON::array_index_list->array_index\n");
991 printf_(msg);
992 yyval._string = yyvsp[0]._string;
993 }
994 break;
995 case 23:
|
996 lucier 1.13 #line 545 "CQL.y"
|
997 chuck 1.2 {
|
998 humberto 1.9 CQL_globalParserState->currentRule = "chain->literal";
|
999 chuck 1.2 sprintf(msg,"BISON::chain->literal\n");
1000 printf_(msg);
1001
1002 chain_state = CQLVALUE;
1003 yyval._node = _factory.makeObject(yyvsp[0]._value,Predicate);
1004 }
1005 break;
1006 case 24:
|
1007 lucier 1.13 #line 554 "CQL.y"
|
1008 chuck 1.2 {
|
1009 humberto 1.9 CQL_globalParserState->currentRule = "chain-> ( expr )";
|
1010 chuck 1.2 sprintf(msg,"BISON::chain-> ( expr )\n");
1011 printf_(msg);
1012
1013 chain_state = CQLPREDICATE;
1014 yyval._node = yyvsp[-1]._predicate;
1015 }
1016 break;
1017 case 25:
|
1018 lucier 1.13 #line 563 "CQL.y"
|
1019 chuck 1.2 {
|
1020 humberto 1.9 CQL_globalParserState->currentRule = "chain->identifier";
|
1021 chuck 1.2 sprintf(msg,"BISON::chain->identifier\n");
1022 printf_(msg);
1023
1024 chain_state = CQLIDENTIFIER;
1025 yyval._node = _factory.makeObject(yyvsp[0]._identifier,Predicate);
1026 }
1027 break;
1028 case 26:
|
1029 lucier 1.13 #line 572 "CQL.y"
|
1030 chuck 1.2 {
|
1031 humberto 1.9 CQL_globalParserState->currentRule = "chain->identifier#literal_string";
|
1032 chuck 1.2 sprintf(msg,"BISON::chain->identifier#literal_string\n");
1033 printf_(msg);
1034
1035 String tmp = yyvsp[-2]._identifier->getName().getString();
1036 tmp.append("#").append(*yyvsp[0]._string);
1037 CQLIdentifier _id(tmp);
1038 yyval._node = _factory.makeObject(&_id,Predicate);
1039 chain_state = CQLIDENTIFIER;
1040 }
1041 break;
1042 case 27:
|
1043 lucier 1.13 #line 584 "CQL.y"
|
1044 chuck 1.2 {
|
1045 humberto 1.9 CQL_globalParserState->currentRule = "chain->scoped_property";
|
1046 chuck 1.2 sprintf(msg,"BISON::chain-> scoped_property\n");
1047 printf_(msg);
1048
1049 chain_state = CQLIDENTIFIER;
1050 yyval._node = _factory.makeObject(yyvsp[0]._identifier,Predicate);
1051 }
1052 break;
1053 case 28:
|
1054 lucier 1.13 #line 593 "CQL.y"
|
1055 chuck 1.2 {
|
1056 humberto 1.9 CQL_globalParserState->currentRule = "chain->identifier( arg_list )";
|
1057 chuck 1.2 sprintf(msg,"BISON::chain-> identifier( arg_list )\n");
1058 printf_(msg);
1059 chain_state = CQLFUNCTION;
1060 CQLFunction _func(*yyvsp[-3]._identifier,_arglist);
1061 yyval._node = (CQLPredicate*)(_factory.makeObject(&_func,Predicate));
1062 _arglist.clear();
1063 }
1064 break;
1065 case 29:
|
1066 lucier 1.13 #line 603 "CQL.y"
|
1067 chuck 1.2 {
|
1068 humberto 1.9 CQL_globalParserState->currentRule = "chain->chain.scoped_property";
|
1069 chuck 1.2 sprintf(msg,"BISON::chain-> chain DOT scoped_property : chain_state = %d\n",chain_state);
1070 printf_(msg);
1071
1072 CQLIdentifier *_id;
1073 if(chain_state == CQLIDENTIFIER){
1074 _id = ((CQLIdentifier*)(_factory.getObject(yyvsp[-2]._node,Predicate,Identifier)));
1075 CQLChainedIdentifier _cid(*_id);
1076 _cid.append(*yyvsp[0]._identifier);
1077 yyval._node = _factory.makeObject(&_cid,Predicate);
1078 }else if(chain_state == CQLCHAINEDIDENTIFIER){
1079 CQLChainedIdentifier *_cid;
1080 _cid = ((CQLChainedIdentifier*)(_factory.getObject(yyvsp[-2]._node,Predicate,ChainedIdentifier)));
1081 _cid->append(*yyvsp[0]._identifier);
1082 _factory.setObject(((CQLPredicate*)yyvsp[-2]._node),_cid,ChainedIdentifier);
1083 yyval._node = yyvsp[-2]._node;
1084 }else{
1085 /* error */
1086 String _msg("chain-> chain DOT scoped_property : chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
1087 throw CQLSyntaxErrorException(
1088 MessageLoaderParms(String("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER"),
1089 String("Chain state not a CQLIdentifier or a CQLChainedIdentifier while parsing rule $0 in position $1."),
1090 chuck 1.2 String("chain.scoped_property"),
|
1091 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1092 chuck 1.2 );
1093 }
1094
1095 chain_state = CQLCHAINEDIDENTIFIER;
1096 }
1097 break;
1098 case 30:
|
1099 lucier 1.13 #line 634 "CQL.y"
|
1100 chuck 1.2 {
|
1101 humberto 1.9 CQL_globalParserState->currentRule = "chain->chain.identifier";
|
1102 chuck 1.2 sprintf(msg,"BISON::chain->chain.identifier : chain_state = %d\n",chain_state);
1103 printf_(msg);
1104
1105 if(chain_state == CQLIDENTIFIER){
1106 CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(yyvsp[-2]._node,Predicate,Identifier)));
1107 CQLChainedIdentifier _cid(*_id);
1108 _cid.append(*yyvsp[0]._identifier);
1109 yyval._node = _factory.makeObject(&_cid,Predicate);
1110 }else if(chain_state == CQLCHAINEDIDENTIFIER){
1111 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)(_factory.getObject(yyvsp[-2]._node,Predicate,ChainedIdentifier)));
1112 _cid->append(*yyvsp[0]._identifier);
1113 _factory.setObject(((CQLPredicate*)yyvsp[-2]._node),_cid,ChainedIdentifier);
1114 yyval._node = yyvsp[-2]._node;
1115 }else{
1116 /* error */
1117 String _msg("chain-> chain DOT identifier : chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
1118 throw CQLSyntaxErrorException(
1119 MessageLoaderParms(String("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER"),
1120 String("Chain state not a CQLIdentifier or a CQLChainedIdentifier while parsing rule $0 in position $1."),
1121 String("chain.identifier"),
|
1122 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1123 chuck 1.2 );
1124 }
1125 chain_state = CQLCHAINEDIDENTIFIER;
1126
1127 }
1128 break;
1129 case 31:
|
1130 lucier 1.13 #line 663 "CQL.y"
|
1131 chuck 1.2 {
|
1132 humberto 1.9 CQL_globalParserState->currentRule = "chain->chain.identifier#literal_string";
|
1133 chuck 1.2 sprintf(msg,"BISON::chain->chain.identifier#literal_string : chain_state = %d\n",chain_state);
1134 printf_(msg);
1135
1136 if(chain_state == CQLIDENTIFIER){
|
1137 chuck 1.3 CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(yyvsp[-4]._node,Predicate,Identifier)));
1138 CQLChainedIdentifier _cid(*_id);
|
1139 chuck 1.2 String tmp(yyvsp[-2]._identifier->getName().getString());
|
1140 chuck 1.3 tmp.append("#").append(*yyvsp[0]._string);
|
1141 chuck 1.2 CQLIdentifier _id1(tmp);
1142 _cid.append(_id1);
|
1143 chuck 1.3 _factory.setObject(((CQLPredicate*)yyvsp[-4]._node),&_cid,ChainedIdentifier);
|
1144 chuck 1.2 yyval._node = yyvsp[-4]._node;
1145 }else if(chain_state == CQLCHAINEDIDENTIFIER){
|
1146 chuck 1.3 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)(_factory.getObject(yyvsp[-4]._node,Predicate,ChainedIdentifier)));
1147 String tmp(yyvsp[-2]._identifier->getName().getString());
|
1148 chuck 1.2 tmp.append("#").append(*yyvsp[0]._string);
1149 CQLIdentifier _id1(tmp);
1150 _cid->append(_id1);
|
1151 chuck 1.3 _factory.setObject(((CQLPredicate*)yyvsp[-4]._node),_cid,ChainedIdentifier);
1152 yyval._node = yyvsp[-4]._node;
|
1153 chuck 1.2 }else{
1154 /* error */
1155 String _msg("chain->chain.identifier#literal_string : chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER");
1156 throw CQLSyntaxErrorException(
1157 MessageLoaderParms(String("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER"),
1158 String("Chain state not a CQLIdentifier or a CQLChainedIdentifier while parsing rule $0 in position $1."),
1159 String("chain.identifier#literal_string"),
|
1160 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1161 chuck 1.2 );
1162 }
1163
1164 chain_state = CQLCHAINEDIDENTIFIER;
1165
1166 }
1167 break;
1168 case 32:
|
1169 lucier 1.13 #line 700 "CQL.y"
|
1170 chuck 1.2 {
|
1171 humberto 1.9 CQL_globalParserState->currentRule = "chain->chain[ array_index_list ]";
|
1172 chuck 1.2 sprintf(msg,"BISON::chain->chain[ array_index_list ] : chain_state = %d\n",chain_state);
1173 printf_(msg);
1174
1175 if(chain_state == CQLIDENTIFIER){
1176 CQLIdentifier *_id = ((CQLIdentifier*)(_factory.getObject(yyvsp[-3]._node,Predicate,Identifier)));
1177 String tmp = _id->getName().getString();
1178 tmp.append("[").append(*yyvsp[-1]._string).append("]");
1179 CQLIdentifier _id1(tmp);
1180 CQLChainedIdentifier _cid(_id1);
1181 _factory.setObject(((CQLPredicate*)yyvsp[-3]._node),&_cid,ChainedIdentifier);
1182 yyval._node = yyvsp[-3]._node;
1183 }else if(chain_state == CQLCHAINEDIDENTIFIER || chain_state == CQLVALUE){
1184 CQLPredicate* _pred = (CQLPredicate*)yyvsp[-3]._node;
1185 CQLChainedIdentifier *_cid = ((CQLChainedIdentifier*)(_factory.getObject(yyvsp[-3]._node,Predicate,ChainedIdentifier)));
1186 CQLIdentifier tmpid = _cid->getLastIdentifier();
1187 String tmp = tmpid.getName().getString();
1188 tmp.append("[").append(*yyvsp[-1]._string).append("]");
1189 CQLIdentifier _id1(tmp);
1190 CQLChainedIdentifier _tmpcid(_id1);
1191 if(_cid->size() == 1){
1192 _cid = &_tmpcid;
1193 chuck 1.2 }else{
1194 _cid->append(_id1);
1195 }
1196 _factory.setObject(((CQLPredicate*)yyvsp[-3]._node),_cid,ChainedIdentifier);
1197 yyval._node = yyvsp[-3]._node;
1198 }else{
1199 /* error */
1200 String _msg("chain->chain[ array_index_list ] : chain state not CQLIDENTIFIER or CQLCHAINEDIDENTIFIER or CQLVALUE");
1201 throw CQLSyntaxErrorException(
1202 MessageLoaderParms(String("CQL.CQL_y.NOT_CHAINID_OR_IDENTIFIER_OR_VALUE"),
1203 String("Chain state not a CQLIdentifier or a CQLChainedIdentifier or a CQLValue while parsing rule $0 in position $1."),
1204 String("chain->chain[ array_index_list ]"),
|
1205 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1206 chuck 1.2 );
1207 }
1208 }
1209 break;
1210 case 33:
|
1211 lucier 1.13 #line 742 "CQL.y"
|
1212 chuck 1.2 {
|
1213 humberto 1.9 CQL_globalParserState->currentRule = "concat->chain";
|
1214 chuck 1.2 sprintf(msg,"BISON::concat->chain\n");
1215 printf_(msg);
1216
1217 yyval._predicate = ((CQLPredicate*)yyvsp[0]._node);
1218 }
1219 break;
1220 case 34:
|
1221 lucier 1.13 #line 750 "CQL.y"
|
1222 chuck 1.2 {
|
1223 humberto 1.10 CQL_globalParserState->currentRule = "concat->concat || literal_string";
1224 sprintf(msg,"BISON::concat||literal_string\n");
1225 printf_(msg);
1226
1227 CQLValue* tmpval = new CQLValue(*yyvsp[0]._string);
1228 _ObjPtr._ptr = tmpval;
1229 _ObjPtr.type = Val;
1230 _ptrs.append(_ObjPtr);
|
1231 chuck 1.2
|
1232 humberto 1.10 if((CQLPredicate*)yyvsp[-2]._predicate->isSimple())
1233 {
1234 CQLSimplePredicate sp = ((CQLPredicate*)yyvsp[-2]._predicate)->getSimplePredicate();
1235 if(sp.isSimple())
1236 {
1237 CQLExpression exp = sp.getLeftExpression();
1238 if(exp.isSimple())
1239 {
1240 CQLTerm* _term = ((CQLTerm*)(_factory.getObject(yyvsp[-2]._predicate, Predicate, Term)));
1241 /* check for simple literal values*/
1242 Array<CQLFactor> factors = _term->getFactors();
1243 for(Uint32 i = 0; i < factors.size(); i++){
1244 if(!factors[i].isSimpleValue()){
1245 MessageLoaderParms mparms("CQL.CQL_y.CONCAT_PRODUCTION_FACTORS_NOT_SIMPLE",
1246 "The CQLFactors are not simple while processing rule $0.",
1247 CQL_globalParserState->currentRule);
1248 throw CQLSyntaxErrorException(mparms);
1249 }else{
1250 CQLValue val = factors[i].getValue();
1251 if(val.getValueType() != CQLValue::String_type){
1252 MessageLoaderParms mparms("CQL.CQL_y.CONCAT_PRODUCTION_VALUE_NOT_LITERAL",
1253 humberto 1.10 "The CQLValue is not a string literal while processing rule $0.",
1254 CQL_globalParserState->currentRule);
1255 throw CQLSyntaxErrorException(mparms);
1256 }
1257 }
1258 }
1259 CQLFactor* _fctr2 = ((CQLFactor*)(_factory.makeObject(tmpval, Factor)));
1260 _term->appendOperation(concat,*_fctr2);
1261 yyval._predicate = (CQLPredicate*)(_factory.makeObject(_term,Predicate));
1262 }
1263 else
1264 {
1265 MessageLoaderParms mparms("CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
1266 "The $0 is not simple while processing rule $1.",
1267 String("CQLExpression"),
1268 CQL_globalParserState->currentRule);
1269 throw CQLSyntaxErrorException(mparms);
1270 }
1271 }
1272 else
1273 {
1274 humberto 1.10 MessageLoaderParms mparms("CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
1275 "The $0 is not simple while processing rule $1.",
1276 String("CQLSimplePredicate"),
1277 CQL_globalParserState->currentRule);
1278 throw CQLSyntaxErrorException(mparms);
1279 }
1280 }
1281 else
1282 {
1283 MessageLoaderParms mparms("CQL.CQL_y.CONCAT_PRODUCTION_NOT_SIMPLE",
1284 "The $0 is not simple while processing rule $1.",
1285 String("CQLPredicate"),
1286 CQL_globalParserState->currentRule);
1287 throw CQLSyntaxErrorException(mparms);
1288 }
1289 }
|
1290 chuck 1.2 break;
1291 case 35:
|
1292 lucier 1.13 #line 821 "CQL.y"
|
1293 chuck 1.2 {
|
1294 humberto 1.9 CQL_globalParserState->currentRule = "factor->concat";
|
1295 chuck 1.2 sprintf(msg,"BISON::factor->concat\n");
1296 printf_(msg);
1297
1298 yyval._predicate = yyvsp[0]._predicate;
1299 }
1300 break;
1301 case 36:
|
1302 lucier 1.13 #line 848 "CQL.y"
|
1303 chuck 1.2 {
|
1304 humberto 1.9 CQL_globalParserState->currentRule = "term->factor";
|
1305 chuck 1.2 sprintf(msg,"BISON::term->factor\n");
1306 printf_(msg);
1307
1308 yyval._predicate = yyvsp[0]._predicate;
1309 }
1310 break;
1311 case 37:
|
1312 lucier 1.13 #line 874 "CQL.y"
|
1313 chuck 1.2 {
|
1314 humberto 1.9 CQL_globalParserState->currentRule = "arith->term";
|
1315 chuck 1.2 sprintf(msg,"BISON::arith->term\n");
1316 printf_(msg);
1317
1318 /*CQLPredicate* _pred = new CQLPredicate(*$1);*/
1319 /* _factory._predicates.append(_pred);*/
1320 yyval._predicate = yyvsp[0]._predicate;
1321 }
1322 break;
1323 case 38:
|
1324 lucier 1.13 #line 902 "CQL.y"
|
1325 chuck 1.2 {
|
1326 humberto 1.9 CQL_globalParserState->currentRule = "value_symbol->#literal_string";
|
1327 chuck 1.2 sprintf(msg,"BISON::value_symbol->#literal_string\n");
1328 printf_(msg);
1329
1330 String tmp("#");
1331 tmp.append(*yyvsp[0]._string);
1332 CQLIdentifier tmpid(tmp);
1333 yyval._value = new CQLValue(tmpid);
|
1334 humberto 1.8 _ObjPtr._ptr = yyval._value;
1335 _ObjPtr.type = Val;
1336 _ptrs.append(_ObjPtr);
|
1337 chuck 1.2 }
1338 break;
1339 case 39:
|
1340 lucier 1.13 #line 918 "CQL.y"
|
1341 chuck 1.2 {
|
1342 humberto 1.9 CQL_globalParserState->currentRule = "arith_or_value_symbol->arith";
|
1343 chuck 1.2 sprintf(msg,"BISON::arith_or_value_symbol->arith\n");
1344 printf_(msg);
1345
1346 yyval._predicate = yyvsp[0]._predicate;
1347 }
1348 break;
1349 case 40:
|
1350 lucier 1.13 #line 926 "CQL.y"
|
1351 chuck 1.2 {
1352 /* make into predicate */
|
1353 humberto 1.9 CQL_globalParserState->currentRule = "arith_or_value_symbol->value_symbol";
|
1354 chuck 1.2 sprintf(msg,"BISON::arith_or_value_symbol->value_symbol\n");
1355 printf_(msg);
1356
1357 CQLFactor _fctr(*yyvsp[0]._value);
1358 yyval._predicate = (CQLPredicate*)(_factory.makeObject(&_fctr, Predicate));
1359 }
1360 break;
1361 case 41:
|
1362 lucier 1.13 #line 938 "CQL.y"
|
1363 chuck 1.2 {
|
1364 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_EQ";
|
1365 chuck 1.2 sprintf(msg,"BISON::comp_op->_EQ\n");
1366 printf_(msg);
1367 yyval._opType = EQ;
1368 }
1369 break;
1370 case 42:
|
1371 lucier 1.13 #line 945 "CQL.y"
|
1372 chuck 1.2 {
|
1373 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_NE";
|
1374 chuck 1.2 sprintf(msg,"BISON::comp_op->_NE\n");
1375 printf_(msg);
1376 yyval._opType = NE;
1377 }
1378 break;
1379 case 43:
|
1380 lucier 1.13 #line 952 "CQL.y"
|
1381 chuck 1.2 {
|
1382 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_GT";
|
1383 chuck 1.2 sprintf(msg,"BISON::comp_op->_GT\n");
1384 printf_(msg);
1385 yyval._opType = GT;
1386 }
1387 break;
1388 case 44:
|
1389 lucier 1.13 #line 959 "CQL.y"
|
1390 chuck 1.2 {
|
1391 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_LT";
|
1392 chuck 1.2 sprintf(msg,"BISON::comp_op->_LT\n");
1393 printf_(msg);
1394 yyval._opType = LT;
1395 }
1396 break;
1397 case 45:
|
1398 lucier 1.13 #line 966 "CQL.y"
|
1399 chuck 1.2 {
|
1400 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_GE";
|
1401 chuck 1.2 sprintf(msg,"BISON::comp_op->_GE\n");
1402 printf_(msg);
1403 yyval._opType = GE;
1404 }
1405 break;
1406 case 46:
|
1407 lucier 1.13 #line 973 "CQL.y"
|
1408 chuck 1.2 {
|
1409 humberto 1.9 CQL_globalParserState->currentRule = "comp_op->_LE";
|
1410 chuck 1.2 sprintf(msg,"BISON::comp_op->_LE\n");
1411 printf_(msg);
1412 yyval._opType = LE;
1413 }
1414 break;
1415 case 47:
|
1416 lucier 1.13 #line 982 "CQL.y"
|
1417 chuck 1.2 {
|
1418 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith";
|
1419 chuck 1.2 sprintf(msg,"BISON::comp->arith\n");
1420 printf_(msg);
1421
1422 yyval._predicate = yyvsp[0]._predicate;
1423 }
1424 break;
1425 case 48:
|
1426 lucier 1.13 #line 990 "CQL.y"
|
1427 chuck 1.2 {
|
1428 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith IS NOT _NULL";
|
1429 chuck 1.2 sprintf(msg,"BISON::comp->arith IS NOT _NULL\n");
1430 printf_(msg);
1431
1432 CQLExpression *_expr = (CQLExpression*)(_factory.getObject(yyvsp[-3]._predicate,Expression));
1433 CQLSimplePredicate _sp(*_expr, IS_NOT_NULL);
1434 _factory.setObject(yyvsp[-3]._predicate,&_sp,SimplePredicate);
1435 yyval._predicate = yyvsp[-3]._predicate;
1436 }
1437 break;
1438 case 49:
|
1439 lucier 1.13 #line 1001 "CQL.y"
|
1440 chuck 1.2 {
|
1441 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith IS _NULL";
|
1442 chuck 1.2 sprintf(msg,"BISON::comp->arith IS _NULL\n");
1443 printf_(msg);
1444
1445 CQLExpression *_expr = (CQLExpression*)(_factory.getObject(yyvsp[-2]._predicate,Expression));
1446 CQLSimplePredicate _sp(*_expr, IS_NULL);
1447 _factory.setObject(yyvsp[-2]._predicate,&_sp,SimplePredicate);
1448 yyval._predicate = yyvsp[-2]._predicate;
1449 }
1450 break;
1451 case 50:
|
1452 lucier 1.13 #line 1012 "CQL.y"
|
1453 chuck 1.2 {
|
1454 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith comp_op arith_or_value_symbol";
|
1455 chuck 1.2 sprintf(msg,"BISON::comp->arith comp_op arith_or_value_symbol\n");
1456 printf_(msg);
1457 if(yyvsp[-2]._predicate->isSimple() && yyvsp[0]._predicate->isSimple()){
1458 CQLExpression* _exp1 = (CQLExpression*)(_factory.getObject(yyvsp[-2]._predicate,Predicate,Expression));
1459 CQLExpression* _exp2 = (CQLExpression*)(_factory.getObject(yyvsp[0]._predicate,Predicate,Expression));
1460 CQLSimplePredicate _sp(*_exp1, *_exp2, yyvsp[-1]._opType);
1461 yyval._predicate = new CQLPredicate(_sp);
|
1462 humberto 1.8 _ObjPtr._ptr = yyval._predicate;
1463 _ObjPtr.type = Pred;
1464 _ptrs.append(_ObjPtr);
|
1465 chuck 1.2 }else{
1466 /* error */
1467 String _msg("comp->arith comp_op arith_or_value_symbol : $1 is not simple OR $3 is not simple");
1468 throw CQLSyntaxErrorException(
1469 MessageLoaderParms(String("CQL.CQL_y.NOT_SIMPLE"),
1470 String("The CQLSimplePredicate is not simple while parsing rule $0 in position $1."),
1471 String("comp->arith comp_op arith_or_value_symbol"),
|
1472 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1473 chuck 1.2 );
1474 }
1475 }
1476 break;
1477 case 51:
|
1478 lucier 1.13 #line 1036 "CQL.y"
|
1479 chuck 1.2 {
|
1480 humberto 1.9 CQL_globalParserState->currentRule = "comp->value_symbol comp_op arith";
|
1481 chuck 1.2 sprintf(msg,"BISON::comp->value_symbol comp_op arith\n");
1482 printf_(msg);
1483
1484 if(yyvsp[0]._predicate->isSimple()){
1485 CQLExpression* _exp1 = (CQLExpression*)(_factory.makeObject(yyvsp[-2]._value, Expression));
1486 CQLExpression* _exp2 = (CQLExpression*)(_factory.getObject(yyvsp[0]._predicate,Predicate,Expression));
1487 CQLSimplePredicate _sp(*_exp1, *_exp2, yyvsp[-1]._opType);
1488 yyval._predicate = new CQLPredicate(_sp);
|
1489 humberto 1.8 _ObjPtr._ptr = yyval._predicate;
1490 _ObjPtr.type = Pred;
1491 _ptrs.append(_ObjPtr);
|
1492 chuck 1.2 }else{
1493 /* error */
1494 String _msg("comp->value_symbol comp_op arith : $3 is not simple");
1495 throw CQLSyntaxErrorException(
1496 MessageLoaderParms(String("CQL.CQL_y.NOT_SIMPLE"),
1497 String("The CQLSimplePredicate is not simple while parsing rule $0 in position $1."),
1498 String("comp->value_symbol comp_op arith"),
|
1499 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1500 chuck 1.2 );
1501
1502 }
1503 }
1504 break;
1505 case 52:
|
1506 lucier 1.13 #line 1062 "CQL.y"
|
1507 chuck 1.2 {
|
1508 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith _ISA identifier";
|
1509 chuck 1.2 /* make sure $1 isSimple(), get its expression, make simplepred->predicate */
1510 sprintf(msg,"BISON::comp->arith _ISA identifier\n");
1511 printf_(msg);
1512
1513 CQLExpression *_expr1 = (CQLExpression*)(_factory.getObject(yyvsp[-2]._predicate,Predicate,Expression));
1514 CQLChainedIdentifier _cid(*yyvsp[0]._identifier);
1515 CQLExpression *_expr2 = (CQLExpression*)(_factory.makeObject(&_cid,Expression));
1516 CQLSimplePredicate _sp(*_expr1, *_expr2, ISA);
1517 _factory.setObject(yyvsp[-2]._predicate,&_sp,SimplePredicate);
1518 yyval._predicate = yyvsp[-2]._predicate;
1519 }
1520 break;
|
1521 humberto 1.10 case 53:
|
1522 lucier 1.13 #line 1076 "CQL.y"
|
1523 chuck 1.2 {
|
1524 humberto 1.9 CQL_globalParserState->currentRule = "comp->arith _LIKE literal_string";
|
1525 chuck 1.2 sprintf(msg,"BISON::comp->arith _LIKE literal_string\n");
1526 printf_(msg);
1527
1528 CQLExpression *_expr1 = (CQLExpression*)(_factory.getObject(yyvsp[-2]._predicate,Predicate,Expression));
1529 CQLValue _val(*yyvsp[0]._string);
1530 CQLExpression *_expr2 = (CQLExpression*)(_factory.makeObject(&_val,Expression));
1531 CQLSimplePredicate _sp(*_expr1, *_expr2, LIKE);
1532 _factory.setObject(yyvsp[-2]._predicate,&_sp,SimplePredicate);
1533 yyval._predicate = yyvsp[-2]._predicate;
1534 }
1535 break;
|
1536 humberto 1.10 case 54:
|
1537 lucier 1.13 #line 1090 "CQL.y"
|
1538 chuck 1.2 {
|
1539 humberto 1.9 CQL_globalParserState->currentRule = "expr_factor->comp";
|
1540 chuck 1.2 sprintf(msg,"BISON::expr_factor->comp\n");
1541 printf_(msg);
1542
1543 yyval._predicate = yyvsp[0]._predicate;
1544 }
1545 break;
|
1546 humberto 1.10 case 55:
|
1547 lucier 1.13 #line 1098 "CQL.y"
|
1548 chuck 1.2 {
|
1549 humberto 1.11 CQL_globalParserState->currentRule = "expr_factor->NOT comp";
1550 sprintf(msg,"BISON::expr_factor->NOT comp\n");
1551 printf_(msg);
1552
1553 yyvsp[0]._predicate->setInverted(!(yyvsp[0]._predicate->getInverted()));
1554 yyval._predicate = yyvsp[0]._predicate;
|
1555 chuck 1.2 }
1556 break;
|
1557 humberto 1.10 case 56:
|
1558 lucier 1.13 #line 1109 "CQL.y"
|
1559 chuck 1.2 {
|
1560 humberto 1.9 CQL_globalParserState->currentRule = "expr_term->expr_factor";
|
1561 chuck 1.2 sprintf(msg,"BISON::expr_term->expr_factor\n");
1562 printf_(msg);
1563
1564 yyval._predicate = yyvsp[0]._predicate;
1565 }
1566 break;
|
1567 humberto 1.10 case 57:
|
1568 lucier 1.13 #line 1117 "CQL.y"
|
1569 chuck 1.2 {
|
1570 humberto 1.9 CQL_globalParserState->currentRule = "expr_term->expr_term AND expr_factor";
|
1571 chuck 1.2 sprintf(msg,"BISON::expr_term->expr_term AND expr_factor\n");
1572 printf_(msg);
1573
1574 yyval._predicate = new CQLPredicate();
1575 yyval._predicate->appendPredicate(*yyvsp[-2]._predicate);
1576 yyval._predicate->appendPredicate(*yyvsp[0]._predicate, AND);
|
1577 humberto 1.8 _ObjPtr._ptr = yyval._predicate;
1578 _ObjPtr.type = Pred;
1579 _ptrs.append(_ObjPtr);
|
1580 chuck 1.2 }
1581 break;
|
1582 humberto 1.10 case 58:
|
1583 lucier 1.13 #line 1132 "CQL.y"
|
1584 chuck 1.2 {
|
1585 humberto 1.9 CQL_globalParserState->currentRule = "expr->expr_term";
|
1586 chuck 1.2 sprintf(msg,"BISON::expr->expr_term\n");
1587 printf_(msg);
1588
1589 yyval._predicate = yyvsp[0]._predicate;
1590 }
1591 break;
|
1592 humberto 1.10 case 59:
|
1593 lucier 1.13 #line 1140 "CQL.y"
|
1594 chuck 1.2 {
|
1595 humberto 1.9 CQL_globalParserState->currentRule = "expr->expr OR expr_term";
|
1596 chuck 1.2 sprintf(msg,"BISON::expr->expr OR expr_term\n");
1597 printf_(msg);
1598 yyval._predicate = new CQLPredicate();
1599 yyval._predicate->appendPredicate(*yyvsp[-2]._predicate);
1600 yyval._predicate->appendPredicate(*yyvsp[0]._predicate, OR);
|
1601 humberto 1.8 _ObjPtr._ptr = yyval._predicate;
1602 _ObjPtr.type = Pred;
1603 _ptrs.append(_ObjPtr);
|
1604 chuck 1.2 }
1605 break;
|
1606 humberto 1.10 case 60:
|
1607 lucier 1.13 #line 1153 "CQL.y"
|
1608 chuck 1.2 {;}
1609 break;
|
1610 humberto 1.10 case 61:
|
1611 lucier 1.13 #line 1171 "CQL.y"
|
1612 chuck 1.2 {
|
1613 humberto 1.9 CQL_globalParserState->currentRule = "arg_list->arg_list_sub->expr";
|
1614 chuck 1.2 sprintf(msg,"BISON::arg_list_sub->expr\n");
1615 printf_(msg);
1616
|
1617 humberto 1.5 _arglist.append(*yyvsp[0]._predicate);/*
1618 since arg_list can loop back on itself,
1619 we need to store away previous solutions
1620 production. We keep track of previous productions
1621 in the _arglist array and later pass that to CQLFunction
1622 as part of chain: identifier LPAR arg_list RPAR
1623 */
|
1624 chuck 1.2 }
1625 break;
|
1626 humberto 1.10 case 62:
|
1627 lucier 1.13 #line 1232 "CQL.y"
|
1628 chuck 1.2 {
|
1629 humberto 1.9 CQL_globalParserState->currentRule = "from_specifier->class_path";
|
1630 chuck 1.2 sprintf(msg,"BISON::from_specifier->class_path\n");
1631 printf_(msg);
1632
|
1633 humberto 1.9 CQL_globalParserState->statement->appendClassPath(*yyvsp[0]._identifier);
|
1634 chuck 1.2 }
1635 break;
|
1636 humberto 1.10 case 63:
|
1637 lucier 1.13 #line 1241 "CQL.y"
|
1638 chuck 1.2 {
|
1639 humberto 1.9 CQL_globalParserState->currentRule = "from_specifier->class_path AS identifier";
|
1640 chuck 1.2 sprintf(msg,"BISON::from_specifier->class_path AS identifier\n");
1641 printf_(msg);
1642
1643 CQLIdentifier _class(*yyvsp[-2]._identifier);
1644 String _alias(yyvsp[0]._identifier->getName().getString());
|
1645 humberto 1.9 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
1646 CQL_globalParserState->statement->appendClassPath(_class);
|
1647 chuck 1.2 }
1648 break;
|
1649 humberto 1.10 case 64:
|
1650 lucier 1.13 #line 1252 "CQL.y"
|
1651 chuck 1.2 {
|
1652 humberto 1.9 CQL_globalParserState->currentRule = "from_specifier->class_path identifier";
|
1653 chuck 1.2 sprintf(msg,"BISON::from_specifier->class_path identifier\n");
1654 printf_(msg);
1655
1656 CQLIdentifier _class(*yyvsp[-1]._identifier);
1657 String _alias(yyvsp[0]._identifier->getName().getString());
|
1658 humberto 1.9 CQL_globalParserState->statement->insertClassPathAlias(_class,_alias);
1659 CQL_globalParserState->statement->appendClassPath(_class);
|
1660 chuck 1.2 }
1661 break;
|
1662 humberto 1.10 case 65:
|
1663 lucier 1.13 #line 1265 "CQL.y"
|
1664 chuck 1.2 {
|
1665 humberto 1.9 CQL_globalParserState->currentRule = "from_criteria->from_specifier";
|
1666 chuck 1.2 sprintf(msg,"BISON::from_criteria->from_specifier\n");
1667 printf_(msg);
1668 }
1669 break;
|
1670 humberto 1.10 case 66:
|
1671 lucier 1.13 #line 1273 "CQL.y"
|
1672 chuck 1.2 {
|
1673 humberto 1.9 CQL_globalParserState->currentRule = "star_expr->STAR";
|
1674 chuck 1.2 sprintf(msg,"BISON::star_expr->STAR\n");
1675 printf_(msg);
1676
1677 CQLIdentifier _id("*");
1678 yyval._chainedIdentifier = (CQLChainedIdentifier*)(_factory.makeObject(&_id,ChainedIdentifier));
1679 }
1680 break;
|
1681 humberto 1.10 case 67:
|
1682 lucier 1.13 #line 1282 "CQL.y"
|
1683 chuck 1.2 {
|
1684 humberto 1.9 CQL_globalParserState->currentRule = "star_expr->chain.*";
|
1685 chuck 1.2 sprintf(msg,"BISON::star_expr->chain.*\n");
1686 printf_(msg);
1687 CQLChainedIdentifier* _tmp = (CQLChainedIdentifier*)(_factory.getObject(yyvsp[-2]._node,Predicate,ChainedIdentifier));
1688 CQLChainedIdentifier* _cid = new CQLChainedIdentifier(*_tmp);
1689 CQLIdentifier _id("*");
1690 _cid->append(_id);
1691 yyval._chainedIdentifier = _cid;
|
1692 humberto 1.8 _ObjPtr._ptr = yyval._chainedIdentifier;
1693 _ObjPtr.type = CId;
1694 _ptrs.append(_ObjPtr);
|
1695 chuck 1.2 }
1696 break;
|
1697 humberto 1.10 case 68:
|
1698 lucier 1.13 #line 1298 "CQL.y"
|
1699 chuck 1.2 {
|
1700 humberto 1.9 CQL_globalParserState->currentRule = "selected_entry->expr";
|
1701 chuck 1.2 sprintf(msg,"BISON::selected_entry->expr\n");
1702 printf_(msg);
1703 if(yyvsp[0]._predicate->isSimpleValue()){
1704 CQLChainedIdentifier *_cid = (CQLChainedIdentifier*)(_factory.getObject(yyvsp[0]._predicate,Predicate,ChainedIdentifier));
|
1705 humberto 1.9 CQL_globalParserState->statement->appendSelectIdentifier(*_cid);
|
1706 chuck 1.2 }else{
1707 /* error */
1708 String _msg("selected_entry->expr : $1 is not a simple value");
1709 throw CQLSyntaxErrorException(
1710 MessageLoaderParms(String("CQL.CQL_y.NOT_SIMPLE_VALUE"),
1711 String("The CQLPredicate is not a simple value while parsing rule $0 in position $1."),
1712 String("selected_entry->expr"),
|
1713 humberto 1.9 CQL_globalParserState->currentTokenPos)
|
1714 chuck 1.2 );
1715 }
1716 }
1717 break;
|
1718 humberto 1.10 case 69:
|
1719 lucier 1.13 #line 1317 "CQL.y"
|
1720 chuck 1.2 {
|
1721 humberto 1.9 CQL_globalParserState->currentRule = "selected_entry->star_expr";
|
1722 chuck 1.2 sprintf(msg,"BISON::selected_entry->star_expr\n");
1723 printf_(msg);
|
1724 humberto 1.9 CQL_globalParserState->statement->appendSelectIdentifier(*yyvsp[0]._chainedIdentifier);
|
1725 chuck 1.2 }
1726 break;
|
1727 humberto 1.10 case 70:
|
1728 lucier 1.13 #line 1326 "CQL.y"
|
1729 chuck 1.2 {
|
1730 humberto 1.9 CQL_globalParserState->currentRule = "select_list->selected_entry select_list_tail";
|
1731 chuck 1.2 sprintf(msg,"BISON::select_list->selected_entry select_list_tail\n");
1732 printf_(msg);
1733 }
1734 break;
|
1735 humberto 1.10 case 71:
|
1736 lucier 1.13 #line 1333 "CQL.y"
|
1737 chuck 1.2 {;}
1738 break;
|
1739 humberto 1.10 case 72:
|
1740 lucier 1.13 #line 1335 "CQL.y"
|
1741 chuck 1.2 {
|
1742 humberto 1.9 CQL_globalParserState->currentRule = "select_list_tail->COMMA selected_entry select_list_tail";
|
1743 chuck 1.2 sprintf(msg,"BISON::select_list_tail->COMMA selected_entry select_list_tail\n");
1744 printf_(msg);
1745 }
1746 break;
|
1747 humberto 1.10 case 73:
|
1748 lucier 1.13 #line 1343 "CQL.y"
|
1749 chuck 1.2 {
|
1750 humberto 1.9 CQL_globalParserState->currentRule = "search_condition->expr";
|
1751 chuck 1.2 sprintf(msg,"BISON::search_condition->expr\n");
1752 printf_(msg);
|
1753 humberto 1.9 CQL_globalParserState->statement->setPredicate(*yyvsp[0]._predicate);
|
1754 chuck 1.2 }
1755 break;
|
1756 humberto 1.10 case 74:
|
1757 lucier 1.13 #line 1351 "CQL.y"
|
1758 humberto 1.8 {}
|
1759 chuck 1.2 break;
|
1760 humberto 1.10 case 75:
|
1761 lucier 1.13 #line 1353 "CQL.y"
|
1762 chuck 1.2 {
|
1763 humberto 1.9 CQL_globalParserState->currentRule = "optional_where->WHERE search_condition";
|
1764 chuck 1.2 sprintf(msg,"BISON::optional_where->WHERE search_condition\n");
1765 printf_(msg);
|
1766 humberto 1.9 CQL_globalParserState->statement->setHasWhereClause();
|
1767 chuck 1.2 }
1768 break;
|
1769 humberto 1.10 case 76:
|
1770 lucier 1.13 #line 1362 "CQL.y"
|
1771 chuck 1.2 {
|
1772 humberto 1.9 CQL_globalParserState->currentRule = "select_statement";
|
1773 chuck 1.2 sprintf(msg,"select_statement\n\n");
1774 printf_(msg);
|
1775 humberto 1.10 CQL_Bison_Cleanup();
|
1776 chuck 1.2 }
1777 break;
|
1778 humberto 1.10 #line 1779 "y.tab.c"
|
1779 chuck 1.2 }
1780 yyssp -= yym;
1781 yystate = *yyssp;
1782 yyvsp -= yym;
1783 yym = yylhs[yyn];
1784 if (yystate == 0 && yym == 0)
1785 {
1786 #if YYDEBUG
1787 if (yydebug)
1788 printf("%sdebug: after reduction, shifting from state 0 to\
1789 state %d\n", YYPREFIX, YYFINAL);
1790 #endif
1791 yystate = YYFINAL;
1792 *++yyssp = YYFINAL;
1793 *++yyvsp = yyval;
1794 if (yychar < 0)
1795 {
1796 if ((yychar = yylex()) < 0) yychar = 0;
1797 #if YYDEBUG
1798 if (yydebug)
1799 {
1800 chuck 1.2 yys = 0;
1801 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
1802 if (!yys) yys = "illegal-symbol";
1803 printf("%sdebug: state %d, reading %d (%s)\n",
1804 YYPREFIX, YYFINAL, yychar, yys);
1805 }
1806 #endif
1807 }
1808 if (yychar == 0) goto yyaccept;
1809 goto yyloop;
1810 }
1811 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
1812 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
1813 yystate = yytable[yyn];
1814 else
1815 yystate = yydgoto[yym];
1816 #if YYDEBUG
1817 if (yydebug)
1818 printf("%sdebug: after reduction, shifting from state %d \
1819 to state %d\n", YYPREFIX, *yyssp, yystate);
1820 #endif
1821 chuck 1.2 if (yyssp >= yysslim && yygrowstack())
1822 {
1823 goto yyoverflow;
1824 }
1825 *++yyssp = yystate;
1826 *++yyvsp = yyval;
1827 goto yyloop;
1828 yyoverflow:
1829 yyerror("yacc stack overflow");
1830 yyabort:
1831 return (1);
1832 yyaccept:
1833 return (0);
1834 }
|