1 karl 1.15 //%2006////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
13 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 karl 1.15 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
|
31 chuck 1.2 #define yy_create_buffer CQL__create_buffer
32 #define yy_delete_buffer CQL__delete_buffer
33 #define yy_scan_buffer CQL__scan_buffer
34 #define yy_scan_string CQL__scan_string
35 #define yy_scan_bytes CQL__scan_bytes
36 #define yy_flex_debug CQL__flex_debug
37 #define yy_init_buffer CQL__init_buffer
38 #define yy_flush_buffer CQL__flush_buffer
39 #define yy_load_buffer_state CQL__load_buffer_state
40 #define yy_switch_to_buffer CQL__switch_to_buffer
41 #define yyin CQL_in
42 #define yyleng CQL_leng
43 #define yylex CQL_lex
44 #define yyout CQL_out
45 #define yyrestart CQL_restart
46 #define yytext CQL_text
47 #define yywrap CQL_wrap
48
49 /* A lexical scanner generated by flex */
50
51 /* Scanner skeleton version:
|
52 karl 1.15 * $Header: /cvs/MSB/pegasus/src/Pegasus/CQL/CQLLEX.cpp,v 1.14 2005/12/09 20:13:08 lucier Exp $
|
53 chuck 1.2 */
54
55 #define FLEX_SCANNER
56 #define YY_FLEX_MAJOR_VERSION 2
57 #define YY_FLEX_MINOR_VERSION 5
58
59 #include <stdio.h>
60 #include <unistd.h>
61
62
63 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
64 #ifdef c_plusplus
65 #ifndef __cplusplus
66 #define __cplusplus
67 #endif
68 #endif
69
70
71 #ifdef __cplusplus
72
73 #include <stdlib.h>
74 chuck 1.2
75 /* Use prototypes in function declarations. */
76 #define YY_USE_PROTOS
77
78 /* The "const" storage-class-modifier is valid. */
79 #define YY_USE_CONST
80
81 #else /* ! __cplusplus */
82
83 #if __STDC__
84
85 #define YY_USE_PROTOS
86 #define YY_USE_CONST
87
88 #endif /* __STDC__ */
89 #endif /* ! __cplusplus */
90
91 #ifdef __TURBOC__
92 #pragma warn -rch
93 #pragma warn -use
94 #include <io.h>
95 chuck 1.2 #include <stdlib.h>
96 #define YY_USE_CONST
97 #define YY_USE_PROTOS
98 #endif
99
100 #ifdef YY_USE_CONST
101 #define yyconst const
102 #else
103 #define yyconst
104 #endif
105
106
107 #ifdef YY_USE_PROTOS
108 #define YY_PROTO(proto) proto
109 #else
110 #define YY_PROTO(proto) ()
111 #endif
112
113 /* Returned upon end-of-file. */
114 #define YY_NULL 0
115
116 chuck 1.2 /* Promotes a possibly negative, possibly signed char to an unsigned
117 * integer for use as an array index. If the signed char is negative,
118 * we want to instead treat it as an 8-bit unsigned char, hence the
119 * double cast.
120 */
121 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122
123 /* Enter a start condition. This macro really ought to take a parameter,
124 * but we do it the disgusting crufty way forced on us by the ()-less
125 * definition of BEGIN.
126 */
127 #define BEGIN yy_start = 1 + 2 *
128
129 /* Translate the current start state into a value that can be later handed
130 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 * compatibility.
132 */
133 #define YY_START ((yy_start - 1) / 2)
134 #define YYSTATE YY_START
135
136 /* Action number for EOF rule of a given start state. */
137 chuck 1.2 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
138
139 /* Special action meaning "start processing a new file". */
140 #define YY_NEW_FILE yyrestart( yyin )
141
142 #define YY_END_OF_BUFFER_CHAR 0
143
144 /* Size of default input buffer. */
145 #define YY_BUF_SIZE 16384
146
147 typedef struct yy_buffer_state *YY_BUFFER_STATE;
148
149 extern int yyleng;
150 extern FILE *yyin, *yyout;
151
152 #define EOB_ACT_CONTINUE_SCAN 0
153 #define EOB_ACT_END_OF_FILE 1
154 #define EOB_ACT_LAST_MATCH 2
155
156 /* The funky do-while in the following #define is used to turn the definition
157 * int a single C statement (which needs a semi-colon terminator). This
158 chuck 1.2 * avoids problems with code like:
159 *
160 * if ( condition_holds )
161 * yyless( 5 );
162 * else
163 * do_something_else();
164 *
165 * Prior to using the do-while the compiler would get upset at the
166 * "else" because it interpreted the "if" statement as being all
167 * done when it reached the ';' after the yyless() call.
168 */
169
170 /* Return all but the first 'n' matched characters back to the input stream. */
171
172 #define yyless(n) \
173 do \
174 { \
175 /* Undo effects of setting up yytext. */ \
176 *yy_cp = yy_hold_char; \
177 YY_RESTORE_YY_MORE_OFFSET \
178 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
179 chuck 1.2 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 } \
181 while ( 0 )
182
183 #define unput(c) yyunput( c, yytext_ptr )
184
185 /* The following is because we cannot portably get our hands on size_t
186 * (without autoconf's help, which isn't available because we want
187 * flex-generated scanners to compile on their own).
188 */
189 typedef unsigned int yy_size_t;
190
191
192 struct yy_buffer_state
193 {
194 FILE *yy_input_file;
195
196 char *yy_ch_buf; /* input buffer */
197 char *yy_buf_pos; /* current position in input buffer */
198
199 /* Size of input buffer in bytes, not including room for EOB
200 chuck 1.2 * characters.
201 */
202 yy_size_t yy_buf_size;
203
204 /* Number of characters read into yy_ch_buf, not including EOB
205 * characters.
206 */
207 int yy_n_chars;
208
209 /* Whether we "own" the buffer - i.e., we know we created it,
210 * and can realloc() it to grow it, and should free() it to
211 * delete it.
212 */
213 int yy_is_our_buffer;
214
215 /* Whether this is an "interactive" input source; if so, and
216 * if we're using stdio for input, then we want to use getc()
217 * instead of fread(), to make sure we stop fetching input after
218 * each newline.
219 */
220 int yy_is_interactive;
221 chuck 1.2
222 /* Whether we're considered to be at the beginning of a line.
223 * If so, '^' rules will be active on the next match, otherwise
224 * not.
225 */
226 int yy_at_bol;
227
228 /* Whether to try to fill the input buffer when we reach the
229 * end of it.
230 */
231 int yy_fill_buffer;
232
233 int yy_buffer_status;
234 #define YY_BUFFER_NEW 0
235 #define YY_BUFFER_NORMAL 1
236 /* When an EOF's been seen but there's still some text to process
237 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
238 * shouldn't try reading from the input source any more. We might
239 * still have a bunch of tokens to match, though, because of
240 * possible backing-up.
241 *
242 chuck 1.2 * When we actually see the EOF, we change the status to "new"
243 * (via yyrestart()), so that the user can continue scanning by
244 * just pointing yyin at a new input file.
245 */
246 #define YY_BUFFER_EOF_PENDING 2
247 };
248
249 static YY_BUFFER_STATE yy_current_buffer = 0;
250
251 /* We provide macros for accessing buffer states in case in the
252 * future we want to put the buffer states in a more general
253 * "scanner state".
254 */
255 #define YY_CURRENT_BUFFER yy_current_buffer
256
257
258 /* yy_hold_char holds the character lost when yytext is formed. */
259 static char yy_hold_char;
260
261 static int yy_n_chars; /* number of characters read into yy_ch_buf */
262
263 chuck 1.2
264 int yyleng;
265
266 /* Points to current character in buffer. */
267 static char *yy_c_buf_p = (char *) 0;
268 static int yy_init = 1; /* whether we need to initialize */
269 static int yy_start = 0; /* start state number */
270
271 /* Flag which is used to allow yywrap()'s to do buffer switches
272 * instead of setting up a fresh yyin. A bit of a hack ...
273 */
274 static int yy_did_buffer_switch_on_eof;
275
276 void yyrestart YY_PROTO(( FILE *input_file ));
277
278 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
279 void yy_load_buffer_state YY_PROTO(( void ));
280 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
281 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
282 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
283 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
284 chuck 1.2 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
285
286 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
287 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
288 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
289
290 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
291 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
292 static void yy_flex_free YY_PROTO(( void * ));
293
294 #define yy_new_buffer yy_create_buffer
295
296 #define yy_set_interactive(is_interactive) \
297 { \
298 if ( ! yy_current_buffer ) \
299 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
300 yy_current_buffer->yy_is_interactive = is_interactive; \
301 }
302
303 #define yy_set_bol(at_bol) \
304 { \
305 chuck 1.2 if ( ! yy_current_buffer ) \
306 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
307 yy_current_buffer->yy_at_bol = at_bol; \
308 }
309
310 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
311
312 typedef unsigned char YY_CHAR;
313 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
314 typedef int yy_state_type;
315 extern char *yytext;
316 #define yytext_ptr yytext
317
318 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
319 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
320 static int yy_get_next_buffer YY_PROTO(( void ));
321 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
322
323 /* Done after the current pattern has been matched and before the
324 * corresponding action - sets up yytext.
325 */
326 chuck 1.2 #define YY_DO_BEFORE_ACTION \
327 yytext_ptr = yy_bp; \
328 yyleng = (int) (yy_cp - yy_bp); \
329 yy_hold_char = *yy_cp; \
330 *yy_cp = '\0'; \
331 yy_c_buf_p = yy_cp;
332
|
333 humberto 1.11 #define YY_NUM_RULES 59
334 #define YY_END_OF_BUFFER 60
|
335 humberto 1.9 static yyconst short int yy_accept[170] =
|
336 chuck 1.2 { 0,
|
337 humberto 1.11 0, 0, 60, 58, 56, 57, 41, 58, 45, 46,
338 35, 37, 39, 38, 42, 36, 30, 30, 30, 52,
339 49, 54, 55, 55, 55, 55, 55, 55, 55, 55,
340 55, 55, 55, 55, 55, 43, 44, 48, 58, 56,
341 0, 34, 33, 0, 0, 0, 30, 30, 30, 0,
342 0, 29, 29, 40, 32, 32, 30, 28, 0, 51,
343 50, 53, 55, 0, 55, 5, 7, 55, 55, 55,
344 55, 55, 55, 12, 13, 55, 55, 55, 23, 55,
345 55, 55, 55, 47, 0, 0, 34, 31, 0, 0,
346 27, 0, 29, 29, 0, 32, 0, 26, 0, 22,
347
348 4, 6, 55, 55, 55, 55, 55, 55, 14, 55,
349 21, 55, 55, 55, 55, 55, 55, 0, 25, 0,
350 32, 0, 0, 32, 26, 24, 8, 55, 55, 55,
351 55, 2, 15, 20, 55, 55, 55, 18, 55, 0,
352 31, 25, 0, 32, 0, 24, 0, 55, 10, 19,
353 11, 16, 55, 55, 3, 0, 0, 24, 55, 55,
354 1, 0, 24, 55, 55, 9, 55, 17, 0
|
355 chuck 1.2 } ;
356
357 static yyconst int yy_ec[256] =
358 { 0,
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
362 humberto 1.9 1, 2, 1, 1, 4, 1, 1, 1, 5, 6,
363 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
364 16, 16, 16, 16, 16, 16, 16, 17, 1, 18,
365 19, 20, 1, 1, 21, 22, 23, 24, 25, 26,
366 27, 28, 29, 27, 30, 31, 32, 33, 34, 27,
367 27, 35, 36, 37, 38, 39, 40, 41, 42, 27,
368 43, 44, 45, 1, 46, 1, 21, 22, 23, 24,
369
370 25, 26, 27, 28, 29, 27, 30, 31, 32, 33,
371 34, 27, 27, 35, 36, 37, 38, 39, 40, 41,
|
372 humberto 1.11 42, 27, 1, 47, 1, 1, 1, 27, 27, 27,
373 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
374 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
375 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
376 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
377 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
378 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
379 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
380
381 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
382 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
383 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
384 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
385 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
386 27, 27, 27, 27, 27
|
387 chuck 1.2 } ;
388
|
389 humberto 1.11 static yyconst int yy_meta[48] =
|
390 chuck 1.2 { 0,
|
391 humberto 1.11 1, 1, 2, 3, 4, 5, 5, 1, 1, 1,
392 1, 1, 1, 6, 6, 6, 7, 1, 1, 1,
393 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
394 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
395 9, 9, 3, 1, 1, 9, 1
|
396 chuck 1.2 } ;
397
|
398 humberto 1.11 static yyconst short int yy_base[182] =
|
399 chuck 1.2 { 0,
|
400 humberto 1.11 0, 0, 438, 439, 435, 439, 439, 45, 439, 439,
401 439, 41, 439, 46, 51, 439, 56, 61, 70, 60,
402 439, 417, 57, 52, 418, 70, 42, 71, 74, 79,
403 81, 85, 84, 86, 94, 439, 439, 417, 386, 430,
404 111, 99, 439, 421, 120, 112, 117, 122, 133, 126,
405 138, 147, 156, 439, 151, 159, 166, 439, 0, 439,
406 439, 439, 398, 394, 166, 107, 392, 160, 168, 169,
407 170, 172, 175, 391, 174, 176, 180, 181, 186, 182,
408 183, 118, 188, 439, 107, 197, 439, 206, 211, 220,
409 439, 0, 228, 233, 242, 214, 250, 0, 0, 388,
410
411 383, 380, 201, 235, 220, 237, 243, 32, 377, 221,
412 370, 245, 246, 251, 250, 252, 253, 275, 0, 267,
413 278, 286, 289, 292, 0, 270, 362, 270, 268, 292,
414 261, 343, 341, 340, 279, 294, 295, 337, 298, 305,
415 310, 0, 313, 317, 348, 312, 307, 305, 334, 333,
416 330, 329, 317, 319, 328, 339, 171, 170, 318, 320,
417 194, 152, 141, 322, 323, 96, 325, 37, 439, 361,
418 365, 374, 383, 387, 390, 393, 394, 398, 404, 413,
419 422
|
420 chuck 1.2 } ;
421
|
422 humberto 1.11 static yyconst short int yy_def[182] =
|
423 chuck 1.2 { 0,
|
424 humberto 1.9 169, 1, 169, 169, 169, 169, 169, 170, 169, 169,
|
425 humberto 1.11 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
426 169, 169, 171, 171, 171, 171, 171, 171, 171, 171,
427 171, 171, 171, 171, 171, 169, 169, 171, 169, 169,
428 170, 172, 169, 173, 173, 169, 169, 169, 169, 169,
429 169, 169, 169, 169, 169, 169, 169, 169, 174, 169,
430 169, 169, 171, 169, 171, 171, 171, 171, 171, 171,
431 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
432 171, 171, 171, 169, 172, 169, 169, 169, 169, 169,
433 169, 175, 169, 169, 169, 169, 169, 176, 177, 171,
434
435 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
436 171, 171, 171, 171, 171, 171, 171, 169, 178, 169,
437 169, 169, 169, 169, 176, 179, 171, 171, 171, 171,
438 171, 171, 171, 171, 171, 171, 171, 171, 171, 169,
439 169, 178, 169, 169, 169, 179, 180, 171, 171, 171,
440 171, 171, 171, 171, 171, 181, 180, 180, 171, 171,
441 171, 181, 181, 171, 171, 171, 171, 171, 0, 169,
442 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
443 169
|
444 chuck 1.2 } ;
445
|
446 humberto 1.11 static yyconst short int yy_nxt[487] =
|
447 chuck 1.2 { 0,
448 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
449 humberto 1.11 14, 15, 16, 17, 18, 19, 4, 20, 21, 22,
450 23, 24, 25, 26, 27, 28, 25, 25, 29, 25,
451 30, 25, 31, 32, 25, 33, 34, 25, 25, 35,
452 25, 25, 36, 4, 37, 38, 39, 42, 64, 43,
453 44, 44, 46, 64, 47, 48, 49, 50, 64, 51,
454 52, 53, 54, 132, 55, 55, 55, 56, 64, 57,
455 57, 49, 56, 64, 57, 57, 49, 58, 60, 61,
456 70, 56, 58, 49, 49, 49, 64, 64, 45, 65,
457 64, 71, 66, 67, 68, 64, 59, 64, 69, 72,
458
459 64, 64, 64, 43, 80, 73, 74, 76, 81, 75,
460 64, 43, 64, 42, 77, 43, 44, 44, 78, 79,
461 82, 83, 87, 64, 85, 55, 55, 55, 56, 102,
462 57, 57, 49, 56, 64, 57, 57, 49, 58, 88,
463 88, 88, 86, 58, 56, 163, 49, 49, 49, 50,
464 86, 89, 89, 90, 45, 116, 163, 59, 50, 91,
465 93, 93, 94, 41, 55, 55, 55, 50, 91, 94,
466 94, 94, 96, 96, 96, 95, 64, 56, 92, 57,
467 57, 49, 64, 97, 64, 64, 64, 58, 64, 100,
468 64, 64, 64, 105, 109, 103, 64, 64, 64, 64,
469
470 humberto 1.11 106, 85, 64, 104, 64, 110, 107, 101, 108, 113,
471 64, 112, 117, 115, 158, 158, 111, 64, 114, 88,
472 88, 88, 50, 127, 89, 89, 90, 96, 96, 96,
473 118, 50, 91, 90, 90, 90, 64, 64, 122, 50,
474 85, 93, 93, 94, 50, 133, 94, 94, 94, 91,
475 120, 64, 120, 64, 129, 121, 121, 121, 123, 64,
476 123, 64, 64, 124, 124, 124, 64, 64, 64, 64,
477 135, 128, 130, 145, 137, 134, 138, 64, 131, 136,
478 121, 121, 121, 140, 64, 140, 64, 139, 141, 141,
479 141, 121, 121, 121, 143, 64, 143, 151, 148, 144,
480
481 144, 144, 124, 124, 124, 124, 124, 124, 64, 149,
482 64, 64, 147, 152, 64, 145, 150, 154, 141, 141,
483 141, 64, 155, 141, 141, 141, 144, 144, 144, 153,
484 144, 144, 144, 64, 64, 64, 64, 159, 64, 64,
485 164, 64, 160, 163, 64, 64, 64, 167, 165, 64,
486 64, 158, 156, 64, 147, 161, 64, 64, 166, 64,
487 168, 41, 41, 41, 41, 41, 41, 41, 41, 41,
488 63, 63, 63, 63, 85, 85, 85, 85, 64, 85,
489 85, 85, 85, 44, 44, 44, 64, 44, 44, 44,
490 44, 44, 98, 64, 98, 119, 64, 119, 125, 64,
491 humberto 1.11
492 125, 126, 126, 142, 64, 142, 146, 64, 64, 146,
493 99, 146, 146, 157, 64, 157, 157, 157, 157, 157,
494 157, 157, 162, 87, 162, 162, 162, 162, 162, 162,
495 162, 40, 84, 64, 64, 62, 40, 169, 3, 169,
|
496 humberto 1.9 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
497 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
498 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
499 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
500 169, 169, 169, 169, 169, 169
|
501 chuck 1.2 } ;
502
|
503 humberto 1.11 static yyconst short int yy_chk[487] =
|
504 chuck 1.2 { 0,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
509 humberto 1.11 1, 1, 1, 1, 1, 1, 1, 8, 108, 8,
510 8, 8, 12, 168, 12, 12, 12, 14, 27, 14,
511 14, 14, 15, 108, 15, 15, 15, 17, 24, 17,
512 17, 17, 18, 23, 18, 18, 18, 17, 20, 20,
513 27, 19, 18, 19, 19, 19, 26, 28, 8, 23,
514 29, 28, 23, 24, 26, 30, 17, 31, 26, 28,
515
516 33, 32, 34, 42, 33, 28, 29, 30, 33, 29,
517 35, 85, 166, 41, 31, 41, 41, 41, 31, 32,
518 34, 35, 45, 66, 45, 46, 46, 46, 47, 66,
519 47, 47, 47, 48, 82, 48, 48, 48, 47, 50,
520 50, 50, 42, 48, 49, 163, 49, 49, 49, 51,
521 85, 51, 51, 51, 41, 82, 162, 47, 52, 51,
522 52, 52, 52, 45, 55, 55, 55, 53, 52, 53,
523 53, 53, 56, 56, 56, 55, 68, 57, 51, 57,
524 57, 57, 65, 56, 69, 70, 71, 57, 72, 65,
525 75, 73, 76, 70, 75, 68, 77, 78, 80, 81,
526
527 71, 86, 79, 69, 83, 76, 72, 65, 73, 79,
528 161, 78, 83, 81, 158, 157, 77, 103, 80, 88,
529 88, 88, 89, 103, 89, 89, 89, 96, 96, 96,
530 humberto 1.11 88, 90, 89, 90, 90, 90, 105, 110, 96, 93,
531 86, 93, 93, 93, 94, 110, 94, 94, 94, 93,
532 95, 104, 95, 106, 105, 95, 95, 95, 97, 107,
533 97, 112, 113, 97, 97, 97, 115, 114, 116, 117,
534 113, 104, 106, 126, 115, 112, 116, 131, 107, 114,
535 120, 120, 120, 118, 129, 118, 128, 117, 118, 118,
536 118, 121, 121, 121, 122, 135, 122, 131, 128, 122,
537
538 122, 122, 123, 123, 123, 124, 124, 124, 130, 129,
539 136, 137, 126, 135, 139, 146, 130, 137, 140, 140,
540 140, 148, 139, 141, 141, 141, 143, 143, 143, 136,
541 144, 144, 144, 153, 159, 154, 160, 148, 164, 165,
542 159, 167, 153, 156, 155, 152, 151, 165, 160, 150,
543 149, 147, 145, 138, 146, 154, 134, 133, 164, 132,
544 167, 170, 170, 170, 170, 170, 170, 170, 170, 170,
545 171, 171, 171, 171, 172, 172, 172, 172, 127, 172,
546 172, 172, 172, 173, 173, 173, 111, 173, 173, 173,
547 173, 173, 174, 109, 174, 175, 102, 175, 176, 101,
548
549 176, 177, 177, 178, 100, 178, 179, 74, 67, 179,
550 64, 179, 179, 180, 63, 180, 180, 180, 180, 180,
551 humberto 1.11 180, 180, 181, 44, 181, 181, 181, 181, 181, 181,
552 181, 40, 39, 38, 25, 22, 5, 3, 169, 169,
|
553 humberto 1.9 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
554 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
555 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
556 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
557 169, 169, 169, 169, 169, 169
|
558 chuck 1.2 } ;
559
560 static yy_state_type yy_last_accepting_state;
561 static char *yy_last_accepting_cpos;
562
563 /* The intent behind this definition is that it'll catch
564 * any uses of REJECT which flex missed.
565 */
566 #define REJECT reject_used_but_not_detected
567 #define yymore() yymore_used_but_not_detected
568 #define YY_MORE_ADJ 0
569 #define YY_RESTORE_YY_MORE_OFFSET
570 char *yytext;
571 #line 1 "CQL.l"
572 #define INITIAL 0
|
573 chuck 1.13 /*
574 */
|
575 humberto 1.11 /*
576 This file describes the language tokens possible for CQL. When a token is matched,
577 the token postion is updated in the CQL_globalParserState, copying from the lex buffer
578 to a shared buffer (shared with the lexer and parser) may happen, then a token identifier
579 is returned to the parser.
580
581 */
|
582 chuck 1.2 #define YY_NEVER_INTERACTIVE 1
|
583 chuck 1.13 #line 41 "CQL.l"
|
584 chuck 1.2 extern int CQLInput(char* buffer, int& numRead, int numRequested);
585 extern int CQL_error(const char*);
586
587 #ifdef CQLINPUT
588 #define YY_INPUT(BUF, NREAD, NREQUESTED) CQLInput(BUF, NREAD, NREQUESTED)
589 #endif
590
591 #ifdef CQL_DEBUG_LEXER
592 #define DEBUG_LEX 1
593 #else
594 #define DEBUG_LEX 0
595 #endif
596
597 #include <Pegasus/Common/Config.h>
|
598 chuck 1.13 #include <Pegasus/Common/CommonUTF.h>
599 #include <Pegasus/Common/MessageLoader.h>
|
600 chuck 1.2 #include "CQLParserState.h"
601 #include <stdlib.h>
602 #include <stdio.h>
603 #include <cstring>
604 #include "CQLObjects.h"
605 #include "CQLYACC.h"
606 PEGASUS_NAMESPACE_BEGIN
607
|
608 humberto 1.10 extern CQLParserState* CQL_globalParserState;
|
609 chuck 1.2
610 PEGASUS_NAMESPACE_END
|
611 lucier 1.14 static char msg_[100];
|
612 chuck 1.2 void printf__(char * msg){
|
613 humberto 1.8 if(DEBUG_LEX == 1)
|
614 chuck 1.2 printf("%s\n",msg);
615 }
616
617 int lineno;
618
|
619 chuck 1.13 #line 618 "lex.CQL_.c"
|
620 chuck 1.2
621 /* Macros after this point can all be overridden by user definitions in
622 * section 1.
623 */
624
625 #ifndef YY_SKIP_YYWRAP
626 #ifdef __cplusplus
627 extern "C" int yywrap YY_PROTO(( void ));
628 #else
629 extern int yywrap YY_PROTO(( void ));
630 #endif
631 #endif
632
633 #ifndef YY_NO_UNPUT
634 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
635 #endif
636
637 #ifndef yytext_ptr
638 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
639 #endif
640
641 chuck 1.2 #ifdef YY_NEED_STRLEN
642 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
643 #endif
644
645 #ifndef YY_NO_INPUT
646 #ifdef __cplusplus
647 static int yyinput YY_PROTO(( void ));
648 #else
649 static int input YY_PROTO(( void ));
650 #endif
651 #endif
652
653 #if YY_STACK_USED
654 static int yy_start_stack_ptr = 0;
655 static int yy_start_stack_depth = 0;
656 static int *yy_start_stack = 0;
657 #ifndef YY_NO_PUSH_STATE
658 static void yy_push_state YY_PROTO(( int new_state ));
659 #endif
660 #ifndef YY_NO_POP_STATE
661 static void yy_pop_state YY_PROTO(( void ));
662 chuck 1.2 #endif
663 #ifndef YY_NO_TOP_STATE
664 static int yy_top_state YY_PROTO(( void ));
665 #endif
666
667 #else
668 #define YY_NO_PUSH_STATE 1
669 #define YY_NO_POP_STATE 1
670 #define YY_NO_TOP_STATE 1
671 #endif
672
673 #ifdef YY_MALLOC_DECL
674 YY_MALLOC_DECL
675 #else
676 #if __STDC__
677 #ifndef __cplusplus
678 #include <stdlib.h>
679 #endif
680 #else
681 /* Just try to get by without declaring the routines. This will fail
682 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
683 chuck 1.2 * or sizeof(void*) != sizeof(int).
684 */
685 #endif
686 #endif
687
688 /* Amount of stuff to slurp up with each read. */
689 #ifndef YY_READ_BUF_SIZE
690 #define YY_READ_BUF_SIZE 8192
691 #endif
692
693 /* Copy whatever the last rule matched to the standard output. */
694
695 #ifndef ECHO
696 /* This used to be an fputs(), but since the string might contain NUL's,
697 * we now use fwrite().
698 */
699 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
700 #endif
701
702 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
703 * is returned in "result".
704 chuck 1.2 */
705 #ifndef YY_INPUT
706 #define YY_INPUT(buf,result,max_size) \
707 if ( yy_current_buffer->yy_is_interactive ) \
708 { \
709 int c = '*', n; \
710 for ( n = 0; n < max_size && \
711 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
712 buf[n] = (char) c; \
713 if ( c == '\n' ) \
714 buf[n++] = (char) c; \
715 if ( c == EOF && ferror( yyin ) ) \
716 YY_FATAL_ERROR( "input in flex scanner failed" ); \
717 result = n; \
718 } \
719 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
720 && ferror( yyin ) ) \
721 YY_FATAL_ERROR( "input in flex scanner failed" );
722 #endif
723
724 /* No semi-colon after return; correct usage is to write "yyterminate();" -
725 chuck 1.2 * we don't want an extra ';' after the "return" because that will cause
726 * some compilers to complain about unreachable statements.
727 */
728 #ifndef yyterminate
729 #define yyterminate() return YY_NULL
730 #endif
731
732 /* Number of entries by which start-condition stack grows. */
733 #ifndef YY_START_STACK_INCR
734 #define YY_START_STACK_INCR 25
735 #endif
736
737 /* Report a fatal error. */
738 #ifndef YY_FATAL_ERROR
739 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
740 #endif
741
742 /* Default declaration of generated scanner - a define so the user can
743 * easily add parameters.
744 */
745 #ifndef YY_DECL
746 chuck 1.2 #define YY_DECL int yylex YY_PROTO(( void ))
747 #endif
748
749 /* Code executed at the beginning of each rule, after yytext and yyleng
750 * have been set up.
751 */
752 #ifndef YY_USER_ACTION
753 #define YY_USER_ACTION
754 #endif
755
756 /* Code executed at the end of each rule. */
757 #ifndef YY_BREAK
758 #define YY_BREAK break;
759 #endif
760
761 #define YY_RULE_SETUP \
762 YY_USER_ACTION
763
764 YY_DECL
765 {
766 register yy_state_type yy_current_state;
767 chuck 1.2 register char *yy_cp = NULL, *yy_bp = NULL;
768 register int yy_act;
769
|
770 chuck 1.13 #line 116 "CQL.l"
|
771 chuck 1.2
772
|
773 chuck 1.13 #line 772 "lex.CQL_.c"
|
774 chuck 1.2
775 if ( yy_init )
776 {
777 yy_init = 0;
778
779 #ifdef YY_USER_INIT
780 YY_USER_INIT;
781 #endif
782
783 if ( ! yy_start )
784 yy_start = 1; /* first start state */
785
786 if ( ! yyin )
787 yyin = stdin;
788
789 if ( ! yyout )
790 yyout = stdout;
791
792 if ( ! yy_current_buffer )
793 yy_current_buffer =
794 yy_create_buffer( yyin, YY_BUF_SIZE );
795 chuck 1.2
796 yy_load_buffer_state();
797 }
798
799 while ( 1 ) /* loops until end-of-file is reached */
800 {
801 yy_cp = yy_c_buf_p;
802
803 /* Support of yytext. */
804 *yy_cp = yy_hold_char;
805
806 /* yy_bp points to the position in yy_ch_buf of the start of
807 * the current run.
808 */
809 yy_bp = yy_cp;
810
811 yy_current_state = yy_start;
812 yy_match:
813 do
814 {
815 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
816 chuck 1.2 if ( yy_accept[yy_current_state] )
817 {
818 yy_last_accepting_state = yy_current_state;
819 yy_last_accepting_cpos = yy_cp;
820 }
821 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
822 {
823 yy_current_state = (int) yy_def[yy_current_state];
|
824 humberto 1.9 if ( yy_current_state >= 170 )
|
825 chuck 1.2 yy_c = yy_meta[(unsigned int) yy_c];
826 }
827 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
828 ++yy_cp;
829 }
|
830 humberto 1.11 while ( yy_base[yy_current_state] != 439 );
|
831 chuck 1.2
832 yy_find_action:
833 yy_act = yy_accept[yy_current_state];
834 if ( yy_act == 0 )
835 { /* have to back up */
836 yy_cp = yy_last_accepting_cpos;
837 yy_current_state = yy_last_accepting_state;
838 yy_act = yy_accept[yy_current_state];
839 }
840
841 YY_DO_BEFORE_ACTION;
842
843
844 do_action: /* This label is used only to access EOF actions. */
845
846
847 switch ( yy_act )
848 { /* beginning of action switch */
849 case 0: /* must back up */
850 /* undo the effects of YY_DO_BEFORE_ACTION */
851 *yy_cp = yy_hold_char;
852 chuck 1.2 yy_cp = yy_last_accepting_cpos;
853 yy_current_state = yy_last_accepting_state;
854 goto yy_find_action;
855
856 case 1:
857 YY_RULE_SETUP
|
858 chuck 1.13 #line 118 "CQL.l"
|
859 chuck 1.2 {
860
861 sprintf(msg_,"LEX: %s [SELECT] ", yytext);
862 printf__(msg_);
|
863 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
864 CQL_globalParserState->tokenCount++;
|
865 chuck 1.2 return SELECT;
866 }
867 YY_BREAK
868 case 2:
869 YY_RULE_SETUP
|
870 chuck 1.13 #line 127 "CQL.l"
|
871 chuck 1.2 {
872
873 sprintf(msg_,"LEX: %s [FROM] ", yytext);
874 printf__(msg_);
|
875 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
876 CQL_globalParserState->tokenCount++;
|
877 chuck 1.2 return FROM;
878 }
879 YY_BREAK
880 case 3:
881 YY_RULE_SETUP
|
882 chuck 1.13 #line 136 "CQL.l"
|
883 chuck 1.2 {
884
885 sprintf(msg_,"LEX: %s [WHERE] ", yytext);
886 printf__(msg_);
|
887 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
888 CQL_globalParserState->tokenCount++;
|
889 chuck 1.2 return WHERE;
890 }
891 YY_BREAK
892 case 4:
893 YY_RULE_SETUP
|
894 chuck 1.13 #line 145 "CQL.l"
|
895 chuck 1.2 {
896
897 sprintf(msg_,"LEX: %s [ANY] ", yytext);
898 printf__(msg_);
|
899 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
900 CQL_globalParserState->tokenCount++;
|
901 chuck 1.2 return ANY;
902 }
903 YY_BREAK
904 case 5:
905 YY_RULE_SETUP
|
906 chuck 1.13 #line 154 "CQL.l"
|
907 chuck 1.2 {
908 sprintf(msg_,"LEX: %s [AS] ", yytext);
909 printf__(msg_);
|
910 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
911 CQL_globalParserState->tokenCount++;
|
912 chuck 1.2 return AS;
913 }
914 YY_BREAK
915 case 6:
916 YY_RULE_SETUP
|
917 chuck 1.13 #line 162 "CQL.l"
|
918 chuck 1.2 {
919 sprintf(msg_,"LEX: %s [ASC] ", yytext);
920 printf__(msg_);
|
921 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
922 CQL_globalParserState->tokenCount++;
|
923 chuck 1.2 return ASC;
924 }
925 YY_BREAK
926 case 7:
927 YY_RULE_SETUP
|
928 chuck 1.13 #line 170 "CQL.l"
|
929 chuck 1.2 {
930 sprintf(msg_,"LEX: %s [BY] ", yytext);
931 printf__(msg_);
|
932 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
933 CQL_globalParserState->tokenCount++;
|
934 chuck 1.2 return BY;
935 }
936 YY_BREAK
937 case 8:
938 YY_RULE_SETUP
|
939 chuck 1.13 #line 178 "CQL.l"
|
940 chuck 1.2 {
941 sprintf(msg_,"LEX: %s [DESC] ", yytext);
942 printf__(msg_);
|
943 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
944 CQL_globalParserState->tokenCount++;
|
945 chuck 1.2 return DESC;
946 }
947 YY_BREAK
948 case 9:
949 YY_RULE_SETUP
|
950 chuck 1.13 #line 187 "CQL.l"
|
951 chuck 1.2 {
952 sprintf(msg_,"LEX: %s [DISTINCT] ", yytext);
953 printf__(msg_);
|
954 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
955 CQL_globalParserState->tokenCount++;
|
956 chuck 1.2 return DISTINCT;
957 }
958 YY_BREAK
959 case 10:
960 YY_RULE_SETUP
|
961 chuck 1.13 #line 195 "CQL.l"
|
962 chuck 1.2 {
963 sprintf(msg_,"LEX: %s [EVERY] ", yytext);
964 printf__(msg_);
|
965 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
966 CQL_globalParserState->tokenCount++;
|
967 chuck 1.2 return EVERY;
968 }
969 YY_BREAK
970 case 11:
971 YY_RULE_SETUP
|
972 chuck 1.13 #line 203 "CQL.l"
|
973 chuck 1.2 {
974 sprintf(msg_,"LEX: %s [FIRST] ", yytext);
975 printf__(msg_);
|
976 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
977 CQL_globalParserState->tokenCount++;
|
978 chuck 1.2 return FIRST;
979 }
980 YY_BREAK
981 case 12:
982 YY_RULE_SETUP
|
983 chuck 1.13 #line 211 "CQL.l"
|
984 chuck 1.2 {
985 sprintf(msg_,"LEX: %s [IN] ", yytext);
986 printf__(msg_);
|
987 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
988 CQL_globalParserState->tokenCount++;
|
989 chuck 1.2 return IN;
990 }
991 YY_BREAK
992 case 13:
993 YY_RULE_SETUP
|
994 chuck 1.13 #line 219 "CQL.l"
|
995 chuck 1.2 {
996 sprintf(msg_,"LEX: %s [IS] ", yytext);
997 printf__(msg_);
|
998 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
999 CQL_globalParserState->tokenCount++;
|
1000 chuck 1.2 return IS;
1001 }
1002 YY_BREAK
1003 case 14:
1004 YY_RULE_SETUP
|
1005 chuck 1.13 #line 227 "CQL.l"
|
1006 chuck 1.2 {
1007 sprintf(msg_,"LEX: %s [ISA] ", yytext);
1008 printf__(msg_);
|
1009 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1010 CQL_globalParserState->tokenCount++;
|
1011 chuck 1.2 return _ISA;
1012 }
1013 YY_BREAK
1014 case 15:
1015 YY_RULE_SETUP
|
1016 chuck 1.13 #line 235 "CQL.l"
|
1017 chuck 1.2 {
1018 sprintf(msg_,"LEX: %s [LIKE] ", yytext);
1019 printf__(msg_);
|
1020 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1021 CQL_globalParserState->tokenCount++;
|
1022 chuck 1.2 return _LIKE;
1023 }
1024 YY_BREAK
1025 case 16:
1026 YY_RULE_SETUP
|
1027 chuck 1.13 #line 243 "CQL.l"
|
1028 chuck 1.2 {
1029 sprintf(msg_,"LEX: %s [ORDER] ", yytext);
1030 printf__(msg_);
|
1031 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1032 CQL_globalParserState->tokenCount++;
|
1033 chuck 1.2 return ORDER;
1034 }
1035 YY_BREAK
1036 case 17:
1037 YY_RULE_SETUP
|
1038 chuck 1.13 #line 251 "CQL.l"
|
1039 chuck 1.2 {
1040 sprintf(msg_,"LEX: %s [SATISFIES] ", yytext);
1041 printf__(msg_);
|
1042 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1043 CQL_globalParserState->tokenCount++;
|
1044 chuck 1.2 return SATISFIES;
1045 }
1046 YY_BREAK
1047 case 18:
1048 YY_RULE_SETUP
|
1049 chuck 1.13 #line 259 "CQL.l"
|
1050 chuck 1.2 {
1051 sprintf(msg_,"LEX: %s [_TRUE] ", yytext);
1052 printf__(msg_);
|
1053 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1054 CQL_globalParserState->tokenCount++;
|
1055 chuck 1.2 return _TRUE;
1056 }
1057 YY_BREAK
1058 case 19:
1059 YY_RULE_SETUP
|
1060 chuck 1.13 #line 267 "CQL.l"
|
1061 chuck 1.2 {
1062 sprintf(msg_,"LEX: %s [_FALSE] ", yytext);
1063 printf__(msg_);
|
1064 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1065 CQL_globalParserState->tokenCount++;
|
1066 chuck 1.2 return _FALSE;
1067 }
1068 YY_BREAK
1069 case 20:
1070 YY_RULE_SETUP
|
1071 chuck 1.13 #line 275 "CQL.l"
|
1072 chuck 1.2 {
1073 sprintf(msg_,"LEX: %s [_NULL] ", yytext);
1074 printf__(msg_);
|
1075 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1076 CQL_globalParserState->tokenCount++;
|
1077 chuck 1.2 return _NULL;
1078 }
1079 YY_BREAK
1080 case 21:
1081 YY_RULE_SETUP
|
1082 chuck 1.13 #line 283 "CQL.l"
|
1083 chuck 1.2 {
1084 sprintf(msg_,"LEX: %s [NOT] ", yytext);
1085 printf__(msg_);
|
1086 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1087 CQL_globalParserState->tokenCount++;
|
1088 chuck 1.2 return NOT;
1089 }
1090 YY_BREAK
1091 case 22:
1092 YY_RULE_SETUP
|
1093 chuck 1.13 #line 291 "CQL.l"
|
1094 chuck 1.2 {
1095 sprintf(msg_,"LEX: %s [AND] ", yytext);
1096 printf__(msg_);
|
1097 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1098 CQL_globalParserState->tokenCount++;
|
1099 chuck 1.2 return _AND;
1100 }
1101 YY_BREAK
1102 case 23:
1103 YY_RULE_SETUP
|
1104 chuck 1.13 #line 299 "CQL.l"
|
1105 chuck 1.2 {
1106 sprintf(msg_,"LEX: %s [OR] ", yytext);
1107 printf__(msg_);
|
1108 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1109 CQL_globalParserState->tokenCount++;
|
1110 chuck 1.2 return _OR;
1111 }
1112 YY_BREAK
1113 case 24:
1114 YY_RULE_SETUP
|
1115 chuck 1.13 #line 307 "CQL.l"
|
1116 chuck 1.2 {
|
1117 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1118 CQL_globalParserState->tokenCount++;
|
1119 humberto 1.4 /* remove any single quotes surrounding embedded literals */
|
1120 humberto 1.5 size_t n;
1121 if(CQL_lval.strValue)
1122 delete [] CQL_lval.strValue;
|
1123 chuck 1.13
1124 // chuck
1125 if (!isUTF8Str(yytext))
1126 {
1127 sprintf(msg_,"LEX: [STRING]-> BAD UTF\n");
1128 printf__(msg_);
1129 throw CQLSyntaxErrorException(
1130 MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
1131 String("Bad UTF8 encountered parsing rule $0 in position $1."),
1132 String("identifier"),
1133 CQL_globalParserState->currentTokenPos));
1134 }
|
1135 humberto 1.5
|
1136 humberto 1.4 String s(yytext);
|
1137 humberto 1.5 Uint32 index = s.find("'");
|
1138 humberto 1.4 if(index != PEG_NOT_FOUND){
1139 s.remove(index,1);
1140 s.remove(s.size()-1,1);
1141 CString cstr = s.getCString();
|
1142 humberto 1.5 const char* string = (const char*)cstr;
1143 n = strlen(string);
1144 CQL_lval.strValue = new char[n+1];
1145 memcpy(CQL_lval.strValue, string, n);
1146 }else{
1147 n = strlen(yytext);
1148 CQL_lval.strValue = new char[n+1];
1149 memcpy(CQL_lval.strValue, yytext, n);
|
1150 humberto 1.4 }
|
1151 chuck 1.2 CQL_lval.strValue[n] = '\0';
1152 sprintf(msg_,"LEX: %s [SCOPED_PROPERTY] ", CQL_lval.strValue);
1153 printf__(msg_);
1154
1155 return SCOPED_PROPERTY;
1156 }
1157 YY_BREAK
1158 case 25:
1159 YY_RULE_SETUP
|
1160 chuck 1.13 #line 349 "CQL.l"
|
1161 chuck 1.2 {
1162 sprintf(msg_,"LEX: %s [NEGATIVE_HEXADECIMAL] ", yytext);
1163 printf__(msg_);
|
1164 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1165 CQL_globalParserState->tokenCount++;
|
1166 chuck 1.2 /* copy the hex value */
1167 {
1168 size_t n = strlen(yytext);
1169 if(CQL_lval.strValue)
1170 delete [] CQL_lval.strValue;
1171 CQL_lval.strValue = new char[n + 1];
1172 memcpy(CQL_lval.strValue, yytext, n);
1173 CQL_lval.strValue[n] = '\0';
1174 }
1175 return NEGATIVE_HEXADECIMAL;
1176 }
1177 YY_BREAK
1178 case 26:
1179 YY_RULE_SETUP
|
1180 chuck 1.13 #line 366 "CQL.l"
|
1181 chuck 1.2 {
1182 sprintf(msg_,"LEX: %s [HEXADECIMAL] ", yytext);
1183 printf__(msg_);
|
1184 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1185 CQL_globalParserState->tokenCount++;
|
1186 chuck 1.2 /* copy the hex value */
1187 {
1188 size_t n = strlen(yytext);
1189 if(CQL_lval.strValue)
1190 delete [] CQL_lval.strValue;
1191 CQL_lval.strValue = new char[n + 1];
1192 memcpy(CQL_lval.strValue, yytext, n);
1193 CQL_lval.strValue[n] = '\0';
1194 }
1195 return HEXADECIMAL;
1196 }
1197 YY_BREAK
1198 case 27:
1199 YY_RULE_SETUP
|
1200 chuck 1.13 #line 383 "CQL.l"
|
1201 chuck 1.2 {
1202 sprintf(msg_,"LEX: %s [NEGATIVE_BINARY] ", yytext);
1203 printf__(msg_);
|
1204 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1205 CQL_globalParserState->tokenCount++;
|
1206 chuck 1.2 /* copy the bin value */
1207 {
1208 size_t n = strlen(yytext);
1209 if(CQL_lval.strValue)
1210 delete [] CQL_lval.strValue;
1211 CQL_lval.strValue = new char[n + 1];
1212 memcpy(CQL_lval.strValue, yytext, n);
1213 CQL_lval.strValue[n] = '\0';
1214 }
1215 return NEGATIVE_BINARY;
1216 }
1217 YY_BREAK
1218 case 28:
1219 YY_RULE_SETUP
|
1220 chuck 1.13 #line 400 "CQL.l"
|
1221 chuck 1.2 {
1222 sprintf(msg_,"LEX: %s [BINARY] ", yytext);
1223 printf__(msg_);
|
1224 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1225 CQL_globalParserState->tokenCount++;
|
1226 chuck 1.2 /* copy the bin value */
1227 {
1228 size_t n = strlen(yytext);
1229 if(CQL_lval.strValue)
1230 delete [] CQL_lval.strValue;
1231 CQL_lval.strValue = new char[n + 1];
1232 memcpy(CQL_lval.strValue, yytext, n);
1233 CQL_lval.strValue[n] = '\0';
1234 }
1235 return BINARY;
1236 }
1237 YY_BREAK
1238 case 29:
1239 YY_RULE_SETUP
|
1240 chuck 1.13 #line 418 "CQL.l"
|
1241 chuck 1.2 {
1242
1243 sprintf(msg_,"LEX: %s [NEGATIVE_INTEGER] ", yytext);
1244 printf__(msg_);
|
1245 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1246 CQL_globalParserState->tokenCount++;
|
1247 chuck 1.2 size_t n = strlen(yytext);
1248 if(CQL_lval.strValue)
1249 delete [] CQL_lval.strValue;
1250 CQL_lval.strValue = new char[n + 1];
1251 memcpy(CQL_lval.strValue, yytext, n);
1252 CQL_lval.strValue[n] = '\0';
1253
1254 /*CQL_lval.intValue = strtol(yytext, (char**)0, 10);*/
1255 return NEGATIVE_INTEGER;
1256 }
1257 YY_BREAK
1258 case 30:
1259 YY_RULE_SETUP
|
1260 chuck 1.13 #line 435 "CQL.l"
|
1261 chuck 1.2 {
1262
1263 sprintf(msg_,"LEX: %s [INTEGER] ", yytext);
1264 printf__(msg_);
|
1265 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1266 CQL_globalParserState->tokenCount++;
|
1267 chuck 1.2 size_t n = strlen(yytext);
1268 if(CQL_lval.strValue)
1269 delete [] CQL_lval.strValue;
1270 CQL_lval.strValue = new char[n + 1];
1271 memcpy(CQL_lval.strValue, yytext, n);
1272 CQL_lval.strValue[n] = '\0';
1273
1274 /*CQL_lval.intValue = strtol(yytext, (char**)0, 10);*/
1275 return INTEGER;
1276 }
1277 YY_BREAK
1278 case 31:
1279 YY_RULE_SETUP
|
1280 chuck 1.13 #line 452 "CQL.l"
|
1281 chuck 1.2 {
1282
1283 sprintf(msg_,"LEX: %s [NEGATIVE_REAL] ", yytext);
1284 printf__(msg_);
|
1285 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1286 CQL_globalParserState->tokenCount++;
|
1287 chuck 1.2 size_t n = strlen(yytext);
1288 if(CQL_lval.strValue)
1289 delete [] CQL_lval.strValue;
1290 CQL_lval.strValue = new char[n + 1];
1291 memcpy(CQL_lval.strValue, yytext, n);
1292 CQL_lval.strValue[n] = '\0';
1293
1294 /*CQL_lval.realValue = strtod((char*)yytext, (char**)0);*/
1295 return NEGATIVE_REAL;
1296 }
1297 YY_BREAK
|
1298 humberto 1.11 case 32:
|
1299 chuck 1.2 YY_RULE_SETUP
|
1300 chuck 1.13 #line 469 "CQL.l"
|
1301 chuck 1.2 {
1302
1303 sprintf(msg_,"LEX: %s [REAL] ", yytext);
1304 printf__(msg_);
|
1305 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1306 CQL_globalParserState->tokenCount++;
|
1307 chuck 1.2 size_t n = strlen(yytext);
1308 if(CQL_lval.strValue)
1309 delete [] CQL_lval.strValue;
1310 CQL_lval.strValue = new char[n + 1];
1311 memcpy(CQL_lval.strValue, yytext, n);
1312 CQL_lval.strValue[n] = '\0';
1313
1314 /*CQL_lval.realValue = strtod((char*)yytext, (char**)0);*/
1315 return REAL;
1316 }
1317 YY_BREAK
|
1318 humberto 1.11 case 33:
|
1319 chuck 1.2 YY_RULE_SETUP
|
1320 chuck 1.13 #line 486 "CQL.l"
|
1321 chuck 1.2 {
1322 /* \'[^\'\n]*\' */
1323 /* ATTN-B: handle long literals by using yyinput(). */
1324 /* ATTN-B: Handle expansion of special characters */
1325
1326 sprintf(msg_,"LEX: %s [STRING] ", yytext);
1327 printf__(msg_);
|
1328 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1329 CQL_globalParserState->tokenCount++;
|
1330 chuck 1.2 /* remove any escaped \ OR escaped ' */
1331
1332 String _esc_doubleslash = "\\\\";
1333 String _esc_singlequote = "\\'";
|
1334 chuck 1.13
1335 // chuck
1336 if (!isUTF8Str(yytext))
1337 {
1338 sprintf(msg_,"LEX: [STRING]-> BAD UTF\n");
1339 printf__(msg_);
1340 throw CQLSyntaxErrorException(
1341 MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
1342 String("Bad UTF8 encountered parsing rule $0 in position $1."),
1343 String("literal_string"),
1344 CQL_globalParserState->currentTokenPos));
1345 }
1346
|
1347 chuck 1.2 String s(yytext);
1348
1349 Uint32 index = 1;
|
1350 humberto 1.6 while((index = s.find(_esc_doubleslash)) != PEG_NOT_FOUND ||
|
1351 humberto 1.11 (index = s.find(_esc_singlequote)) != PEG_NOT_FOUND)
|
1352 humberto 1.6 {
1353 if(index == s.size() - 2) // make sure we dont remove the slash from say 'abc\'
1354 break;
1355 s.remove(index,1);
|
1356 chuck 1.2 }
1357 CString cstr = s.getCString();
1358 const char* string = (const char*)cstr;
1359
1360 /* Copy the string (but remove the surrounding quotes */
1361
1362 {
1363 size_t n = strlen(string) - 2;
1364 if(CQL_lval.strValue)
1365 delete [] CQL_lval.strValue;
1366 CQL_lval.strValue = new char[n + 1];
1367 memcpy(CQL_lval.strValue, string + 1, n);
1368 CQL_lval.strValue[n] = '\0';
1369 }
1370 return STRING_LITERAL;
1371 }
1372 YY_BREAK
|
1373 humberto 1.11 case 34:
|
1374 chuck 1.2 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1375 yy_c_buf_p = yy_cp -= 1;
1376 YY_DO_BEFORE_ACTION; /* set up yytext again */
1377 YY_RULE_SETUP
|
1378 chuck 1.13 #line 538 "CQL.l"
|
1379 chuck 1.2 {
1380
1381 sprintf(msg_,"Unterminated string");
1382 printf__(msg_);
|
1383 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1384 CQL_globalParserState->tokenCount++;
|
1385 chuck 1.2 }
1386 YY_BREAK
|
1387 humberto 1.11 case 35:
|
1388 chuck 1.2 YY_RULE_SETUP
|
1389 chuck 1.13 #line 546 "CQL.l"
|
1390 chuck 1.2 {
1391 sprintf(msg_,"LEX: [STAR] ");
1392 printf__(msg_);
|
1393 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1394 CQL_globalParserState->tokenCount++;
|
1395 chuck 1.2 return STAR;
1396 }
1397 YY_BREAK
|
1398 humberto 1.11 case 36:
|
1399 chuck 1.2 YY_RULE_SETUP
|
1400 chuck 1.13 #line 554 "CQL.l"
|
1401 chuck 1.2 {
1402 sprintf(msg_,"LEX: [DIV] ");
1403 printf__(msg_);
|
1404 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1405 CQL_globalParserState->tokenCount++;
|
1406 chuck 1.2 return DIV;
1407 }
1408 YY_BREAK
|
1409 humberto 1.11 case 37:
|
1410 chuck 1.2 YY_RULE_SETUP
|
1411 chuck 1.13 #line 562 "CQL.l"
|
1412 chuck 1.2 {
1413 sprintf(msg_,"LEX: [PLUS] ");
1414 printf__(msg_);
|
1415 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1416 CQL_globalParserState->tokenCount++;
|
1417 chuck 1.2 return PLUS;
1418 }
1419 YY_BREAK
|
1420 humberto 1.11 case 38:
|
1421 chuck 1.2 YY_RULE_SETUP
|
1422 chuck 1.13 #line 570 "CQL.l"
|
1423 chuck 1.2 {
1424 sprintf(msg_,"LEX: [MINUS] ");
1425 printf__(msg_);
|
1426 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1427 CQL_globalParserState->tokenCount++;
|
1428 chuck 1.2 return MINUS;
1429 }
1430 YY_BREAK
|
1431 humberto 1.11 case 39:
|
1432 chuck 1.2 YY_RULE_SETUP
|
1433 chuck 1.13 #line 578 "CQL.l"
|
1434 chuck 1.2 {
1435 sprintf(msg_,"LEX: [COMMA] ");
1436 printf__(msg_);
|
1437 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1438 CQL_globalParserState->tokenCount++;
|
1439 chuck 1.2 return COMMA;
1440 }
1441 YY_BREAK
|
1442 humberto 1.11 case 40:
|
1443 chuck 1.2 YY_RULE_SETUP
|
1444 chuck 1.13 #line 586 "CQL.l"
|
1445 chuck 1.2 {
1446 sprintf(msg_,"LEX: [DOTDOT] ");
1447 printf__(msg_);
|
1448 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1449 CQL_globalParserState->tokenCount++;
|
1450 chuck 1.2 return DOTDOT;
1451 }
1452 YY_BREAK
|
1453 humberto 1.11 case 41:
|
1454 chuck 1.2 YY_RULE_SETUP
|
1455 chuck 1.13 #line 594 "CQL.l"
|
1456 chuck 1.2 {
1457 sprintf(msg_,"LEX: [HASH] ");
1458 printf__(msg_);
|
1459 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1460 CQL_globalParserState->tokenCount++;
|
1461 chuck 1.2 return HASH;
1462 }
1463 YY_BREAK
|
1464 humberto 1.11 case 42:
|
1465 chuck 1.2 YY_RULE_SETUP
|
1466 chuck 1.13 #line 602 "CQL.l"
|
1467 chuck 1.2 {
1468 sprintf(msg_,"LEX: [DOT] ");
1469 printf__(msg_);
|
1470 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1471 CQL_globalParserState->tokenCount++;
|
1472 chuck 1.2 return DOT;
1473 }
1474 YY_BREAK
|
1475 humberto 1.11 case 43:
|
1476 chuck 1.2 YY_RULE_SETUP
|
1477 chuck 1.13 #line 610 "CQL.l"
|
1478 chuck 1.2 {
1479 sprintf(msg_,"LEX: [LBRKT] ");
1480 printf__(msg_);
|
1481 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1482 CQL_globalParserState->tokenCount++;
|
1483 chuck 1.2 return LBRKT;
1484 }
1485 YY_BREAK
|
1486 humberto 1.11 case 44:
|
1487 chuck 1.2 YY_RULE_SETUP
|
1488 chuck 1.13 #line 618 "CQL.l"
|
1489 chuck 1.2 {
1490 sprintf(msg_,"LEX: [RBRKT] ");
1491 printf__(msg_);
|
1492 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1493 CQL_globalParserState->tokenCount++;
|
1494 chuck 1.2 return RBRKT;
1495 }
1496 YY_BREAK
|
1497 humberto 1.11 case 45:
|
1498 chuck 1.2 YY_RULE_SETUP
|
1499 chuck 1.13 #line 626 "CQL.l"
|
1500 chuck 1.2 {
1501 sprintf(msg_,"LEX: [LPAR] ");
1502 printf__(msg_);
|
1503 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1504 CQL_globalParserState->tokenCount++;
|
1505 chuck 1.2 return LPAR;
1506 }
1507 YY_BREAK
|
1508 humberto 1.11 case 46:
|
1509 chuck 1.2 YY_RULE_SETUP
|
1510 chuck 1.13 #line 634 "CQL.l"
|
1511 chuck 1.2 {
1512 sprintf(msg_,"LEX: [RPAR] ");
1513 printf__(msg_);
|
1514 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1515 CQL_globalParserState->tokenCount++;
|
1516 chuck 1.2 return RPAR;
1517 }
1518 YY_BREAK
|
1519 humberto 1.11 case 47:
|
1520 chuck 1.2 YY_RULE_SETUP
|
1521 chuck 1.13 #line 642 "CQL.l"
|
1522 chuck 1.2 {
1523 sprintf(msg_,"LEX: %s [DBL_PIPE] ", yytext);
1524 printf__(msg_);
|
1525 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1526 CQL_globalParserState->tokenCount++;
|
1527 chuck 1.2 return DBL_PIPE;
1528 }
1529 YY_BREAK
|
1530 humberto 1.11 case 48:
|
1531 chuck 1.2 YY_RULE_SETUP
|
1532 chuck 1.13 #line 650 "CQL.l"
|
1533 chuck 1.2 {
1534 sprintf(msg_,"LEX: %s [UNDERSCORE] ", yytext);
1535 printf__(msg_);
|
1536 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1537 CQL_globalParserState->tokenCount++;
|
1538 chuck 1.2 return UNDERSCORE;
1539 }
1540 YY_BREAK
|
1541 humberto 1.11 case 49:
|
1542 chuck 1.2 YY_RULE_SETUP
|
1543 chuck 1.13 #line 658 "CQL.l"
|
1544 chuck 1.2 {
1545 sprintf(msg_,"LEX: %s [_EQ] ", yytext);
1546 printf__(msg_);
|
1547 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1548 CQL_globalParserState->tokenCount++;
|
1549 chuck 1.2 return _EQ;
1550 }
1551 YY_BREAK
|
1552 humberto 1.11 case 50:
|
1553 chuck 1.2 YY_RULE_SETUP
|
1554 chuck 1.13 #line 667 "CQL.l"
|
1555 chuck 1.2 {
1556
1557 sprintf(msg_,"LEX: %s [_NE] ", yytext);
1558 printf__(msg_);
|
1559 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1560 CQL_globalParserState->tokenCount++;
|
1561 chuck 1.2 return _NE;
1562 }
1563 YY_BREAK
|
1564 humberto 1.11 case 51:
|
1565 chuck 1.2 YY_RULE_SETUP
|
1566 chuck 1.13 #line 677 "CQL.l"
|
1567 chuck 1.2 {
1568
1569 sprintf(msg_,"LEX: %s [_LE] ", yytext);
1570 printf__(msg_);
|
1571 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1572 CQL_globalParserState->tokenCount++;
|
1573 chuck 1.2 return _LE;
1574 }
1575 YY_BREAK
|
1576 humberto 1.11 case 52:
|
1577 chuck 1.2 YY_RULE_SETUP
|
1578 chuck 1.13 #line 686 "CQL.l"
|
1579 chuck 1.2 {
1580
1581 sprintf(msg_,"LEX: %s [_LT] ", yytext);
1582 printf__(msg_);
|
1583 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1584 CQL_globalParserState->tokenCount++;
|
1585 chuck 1.2 return _LT;
1586 }
1587 YY_BREAK
|
1588 humberto 1.11 case 53:
|
1589 chuck 1.2 YY_RULE_SETUP
|
1590 chuck 1.13 #line 695 "CQL.l"
|
1591 chuck 1.2 {
1592
1593 sprintf(msg_,"LEX: %s [_GE] ", yytext);
1594 printf__(msg_);
|
1595 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1596 CQL_globalParserState->tokenCount++;
|
1597 chuck 1.2 return _GE;
1598 }
1599 YY_BREAK
|
1600 humberto 1.11 case 54:
|
1601 chuck 1.2 YY_RULE_SETUP
|
1602 chuck 1.13 #line 704 "CQL.l"
|
1603 chuck 1.2 {
1604
1605 sprintf(msg_,"LEX: %s [_GT] ", yytext);
1606 printf__(msg_);
|
1607 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1608 CQL_globalParserState->tokenCount++;
|
1609 chuck 1.2 return _GT;
1610 }
1611 YY_BREAK
|
1612 humberto 1.11 case 55:
|
1613 chuck 1.2 YY_RULE_SETUP
|
1614 chuck 1.13 #line 713 "CQL.l"
|
1615 chuck 1.2 {
1616
1617 sprintf(msg_,"LEX: %s [IDENTIFIER] ", yytext);
1618 printf__(msg_);
|
1619 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
1620 CQL_globalParserState->tokenCount++;
|
1621 chuck 1.2 {
1622 size_t n = strlen(yytext);
1623 if(CQL_lval.strValue)
1624 delete [] CQL_lval.strValue;
1625 CQL_lval.strValue = new char[n + 1];
1626 memcpy(CQL_lval.strValue, yytext, n);
1627 CQL_lval.strValue[n] = '\0';
1628 }
1629
1630 return IDENTIFIER;
1631 }
1632 YY_BREAK
|
1633 humberto 1.11 case 56:
|
1634 chuck 1.2 YY_RULE_SETUP
|
1635 chuck 1.13 #line 731 "CQL.l"
|
1636 chuck 1.2 {
1637
1638 /* Ignore blanks */
|
1639 humberto 1.10 CQL_globalParserState->currentTokenPos+=yyleng;
|
1640 chuck 1.2 }
1641 YY_BREAK
|
1642 humberto 1.11 case 57:
|
1643 chuck 1.2 YY_RULE_SETUP
|
1644 chuck 1.13 #line 737 "CQL.l"
|
1645 chuck 1.2 {
|
1646 humberto 1.10 CQL_globalParserState->currentTokenPos=0;
|
1647 chuck 1.2 return 0;
1648 }
1649 YY_BREAK
1650 case YY_STATE_EOF(INITIAL):
|
1651 chuck 1.13 #line 742 "CQL.l"
|
1652 chuck 1.2 {
1653 return 0;
1654 }
1655 YY_BREAK
|
1656 humberto 1.11 case 58:
|
1657 chuck 1.2 YY_RULE_SETUP
|
1658 chuck 1.13 #line 746 "CQL.l"
|
1659 chuck 1.2 {
1660 CQL_lval.strValue = 0;
1661 sprintf(msg_,"LEX::UNEXPECTED_CHAR\n");
1662 printf__(msg_);
1663
1664 return UNEXPECTED_CHAR;
1665 }
1666 YY_BREAK
|
1667 humberto 1.11 case 59:
|
1668 chuck 1.2 YY_RULE_SETUP
|
1669 chuck 1.13 #line 754 "CQL.l"
|
1670 chuck 1.2 ECHO;
1671 YY_BREAK
|
1672 chuck 1.13 #line 1671 "lex.CQL_.c"
|
1673 chuck 1.2
1674 case YY_END_OF_BUFFER:
1675 {
1676 /* Amount of text matched not including the EOB char. */
1677 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1678
1679 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1680 *yy_cp = yy_hold_char;
1681 YY_RESTORE_YY_MORE_OFFSET
1682
1683 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1684 {
1685 /* We're scanning a new file or input source. It's
1686 * possible that this happened because the user
1687 * just pointed yyin at a new source and called
1688 * yylex(). If so, then we have to assure
1689 * consistency between yy_current_buffer and our
1690 * globals. Here is the right place to do so, because
1691 * this is the first action (other than possibly a
1692 * back-up) that will match for the new input source.
1693 */
1694 chuck 1.2 yy_n_chars = yy_current_buffer->yy_n_chars;
1695 yy_current_buffer->yy_input_file = yyin;
1696 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1697 }
1698
1699 /* Note that here we test for yy_c_buf_p "<=" to the position
1700 * of the first EOB in the buffer, since yy_c_buf_p will
1701 * already have been incremented past the NUL character
1702 * (since all states make transitions on EOB to the
1703 * end-of-buffer state). Contrast this with the test
1704 * in input().
1705 */
1706 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1707 { /* This was really a NUL. */
1708 yy_state_type yy_next_state;
1709
1710 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1711
1712 yy_current_state = yy_get_previous_state();
1713
1714 /* Okay, we're now positioned to make the NUL
1715 chuck 1.2 * transition. We couldn't have
1716 * yy_get_previous_state() go ahead and do it
1717 * for us because it doesn't know how to deal
1718 * with the possibility of jamming (and we don't
1719 * want to build jamming into it because then it
1720 * will run more slowly).
1721 */
1722
1723 yy_next_state = yy_try_NUL_trans( yy_current_state );
1724
1725 yy_bp = yytext_ptr + YY_MORE_ADJ;
1726
1727 if ( yy_next_state )
1728 {
1729 /* Consume the NUL. */
1730 yy_cp = ++yy_c_buf_p;
1731 yy_current_state = yy_next_state;
1732 goto yy_match;
1733 }
1734
1735 else
1736 chuck 1.2 {
1737 yy_cp = yy_c_buf_p;
1738 goto yy_find_action;
1739 }
1740 }
1741
1742 else switch ( yy_get_next_buffer() )
1743 {
1744 case EOB_ACT_END_OF_FILE:
1745 {
1746 yy_did_buffer_switch_on_eof = 0;
1747
1748 if ( yywrap() )
1749 {
1750 /* Note: because we've taken care in
1751 * yy_get_next_buffer() to have set up
1752 * yytext, we can now set up
1753 * yy_c_buf_p so that if some total
1754 * hoser (like flex itself) wants to
1755 * call the scanner after we return the
1756 * YY_NULL, it'll still work - another
1757 chuck 1.2 * YY_NULL will get returned.
1758 */
1759 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1760
1761 yy_act = YY_STATE_EOF(YY_START);
1762 goto do_action;
1763 }
1764
1765 else
1766 {
1767 if ( ! yy_did_buffer_switch_on_eof )
1768 YY_NEW_FILE;
1769 }
1770 break;
1771 }
1772
1773 case EOB_ACT_CONTINUE_SCAN:
1774 yy_c_buf_p =
1775 yytext_ptr + yy_amount_of_matched_text;
1776
1777 yy_current_state = yy_get_previous_state();
1778 chuck 1.2
1779 yy_cp = yy_c_buf_p;
1780 yy_bp = yytext_ptr + YY_MORE_ADJ;
1781 goto yy_match;
1782
1783 case EOB_ACT_LAST_MATCH:
1784 yy_c_buf_p =
1785 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1786
1787 yy_current_state = yy_get_previous_state();
1788
1789 yy_cp = yy_c_buf_p;
1790 yy_bp = yytext_ptr + YY_MORE_ADJ;
1791 goto yy_find_action;
1792 }
1793 break;
1794 }
1795
1796 default:
1797 YY_FATAL_ERROR(
1798 "fatal flex scanner internal error--no action found" );
1799 chuck 1.2 } /* end of action switch */
1800 } /* end of scanning one token */
1801 } /* end of yylex */
1802
1803
1804 /* yy_get_next_buffer - try to read in a new buffer
1805 *
1806 * Returns a code representing an action:
1807 * EOB_ACT_LAST_MATCH -
1808 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1809 * EOB_ACT_END_OF_FILE - end of file
1810 */
1811
1812 static int yy_get_next_buffer()
1813 {
1814 register char *dest = yy_current_buffer->yy_ch_buf;
1815 register char *source = yytext_ptr;
1816 register int number_to_move, i;
1817 int ret_val;
1818
1819 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1820 chuck 1.2 YY_FATAL_ERROR(
1821 "fatal flex scanner internal error--end of buffer missed" );
1822
1823 if ( yy_current_buffer->yy_fill_buffer == 0 )
1824 { /* Don't try to fill the buffer, so this is an EOF. */
1825 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1826 {
1827 /* We matched a single character, the EOB, so
1828 * treat this as a final EOF.
1829 */
1830 return EOB_ACT_END_OF_FILE;
1831 }
1832
1833 else
1834 {
1835 /* We matched some text prior to the EOB, first
1836 * process it.
1837 */
1838 return EOB_ACT_LAST_MATCH;
1839 }
1840 }
1841 chuck 1.2
1842 /* Try to read more data. */
1843
1844 /* First move last chars to start of buffer. */
1845 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1846
1847 for ( i = 0; i < number_to_move; ++i )
1848 *(dest++) = *(source++);
1849
1850 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1851 /* don't do the read, it's not guaranteed to return an EOF,
1852 * just force an EOF
1853 */
1854 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1855
1856 else
1857 {
1858 int num_to_read =
1859 yy_current_buffer->yy_buf_size - number_to_move - 1;
1860
1861 while ( num_to_read <= 0 )
1862 chuck 1.2 { /* Not enough room in the buffer - grow it. */
1863 #ifdef YY_USES_REJECT
1864 YY_FATAL_ERROR(
1865 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1866 #else
1867
1868 /* just a shorter name for the current buffer */
1869 YY_BUFFER_STATE b = yy_current_buffer;
1870
1871 int yy_c_buf_p_offset =
1872 (int) (yy_c_buf_p - b->yy_ch_buf);
1873
1874 if ( b->yy_is_our_buffer )
1875 {
1876 int new_size = b->yy_buf_size * 2;
1877
1878 if ( new_size <= 0 )
1879 b->yy_buf_size += b->yy_buf_size / 8;
1880 else
1881 b->yy_buf_size *= 2;
1882
1883 chuck 1.2 b->yy_ch_buf = (char *)
1884 /* Include room in for 2 EOB chars. */
1885 yy_flex_realloc( (void *) b->yy_ch_buf,
1886 b->yy_buf_size + 2 );
1887 }
1888 else
1889 /* Can't grow it, we don't own it. */
1890 b->yy_ch_buf = 0;
1891
1892 if ( ! b->yy_ch_buf )
1893 YY_FATAL_ERROR(
1894 "fatal error - scanner input buffer overflow" );
1895
1896 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1897
1898 num_to_read = yy_current_buffer->yy_buf_size -
1899 number_to_move - 1;
1900 #endif
1901 }
1902
1903 if ( num_to_read > YY_READ_BUF_SIZE )
1904 chuck 1.2 num_to_read = YY_READ_BUF_SIZE;
1905
1906 /* Read in more data. */
1907 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1908 yy_n_chars, num_to_read );
1909
1910 yy_current_buffer->yy_n_chars = yy_n_chars;
1911 }
1912
1913 if ( yy_n_chars == 0 )
1914 {
1915 if ( number_to_move == YY_MORE_ADJ )
1916 {
1917 ret_val = EOB_ACT_END_OF_FILE;
1918 yyrestart( yyin );
1919 }
1920
1921 else
1922 {
1923 ret_val = EOB_ACT_LAST_MATCH;
1924 yy_current_buffer->yy_buffer_status =
1925 chuck 1.2 YY_BUFFER_EOF_PENDING;
1926 }
1927 }
1928
1929 else
1930 ret_val = EOB_ACT_CONTINUE_SCAN;
1931
1932 yy_n_chars += number_to_move;
1933 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1934 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1935
1936 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1937
1938 return ret_val;
1939 }
1940
1941
1942 /* yy_get_previous_state - get the state just before the EOB char was reached */
1943
1944 static yy_state_type yy_get_previous_state()
1945 {
1946 chuck 1.2 register yy_state_type yy_current_state;
1947 register char *yy_cp;
1948
1949 yy_current_state = yy_start;
1950
1951 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1952 {
1953 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1954 if ( yy_accept[yy_current_state] )
1955 {
1956 yy_last_accepting_state = yy_current_state;
1957 yy_last_accepting_cpos = yy_cp;
1958 }
1959 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1960 {
1961 yy_current_state = (int) yy_def[yy_current_state];
|
1962 humberto 1.9 if ( yy_current_state >= 170 )
|
1963 chuck 1.2 yy_c = yy_meta[(unsigned int) yy_c];
1964 }
1965 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1966 }
1967
1968 return yy_current_state;
1969 }
1970
1971
1972 /* yy_try_NUL_trans - try to make a transition on the NUL character
1973 *
1974 * synopsis
1975 * next_state = yy_try_NUL_trans( current_state );
1976 */
1977
1978 #ifdef YY_USE_PROTOS
1979 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1980 #else
1981 static yy_state_type yy_try_NUL_trans( yy_current_state )
1982 yy_state_type yy_current_state;
1983 #endif
1984 chuck 1.2 {
1985 register int yy_is_jam;
1986 register char *yy_cp = yy_c_buf_p;
1987
1988 register YY_CHAR yy_c = 1;
1989 if ( yy_accept[yy_current_state] )
1990 {
1991 yy_last_accepting_state = yy_current_state;
1992 yy_last_accepting_cpos = yy_cp;
1993 }
1994 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1995 {
1996 yy_current_state = (int) yy_def[yy_current_state];
|
1997 humberto 1.9 if ( yy_current_state >= 170 )
|
1998 chuck 1.2 yy_c = yy_meta[(unsigned int) yy_c];
1999 }
2000 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
2001 humberto 1.9 yy_is_jam = (yy_current_state == 169);
|
2002 chuck 1.2
2003 return yy_is_jam ? 0 : yy_current_state;
2004 }
2005
2006
2007 #ifndef YY_NO_UNPUT
2008 #ifdef YY_USE_PROTOS
2009 static void yyunput( int c, register char *yy_bp )
2010 #else
2011 static void yyunput( c, yy_bp )
2012 int c;
2013 register char *yy_bp;
2014 #endif
2015 {
2016 register char *yy_cp = yy_c_buf_p;
2017
2018 /* undo effects of setting up yytext */
2019 *yy_cp = yy_hold_char;
2020
2021 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2022 { /* need to shift things up to make room */
2023 chuck 1.2 /* +2 for EOB chars. */
2024 register int number_to_move = yy_n_chars + 2;
2025 register char *dest = &yy_current_buffer->yy_ch_buf[
2026 yy_current_buffer->yy_buf_size + 2];
2027 register char *source =
2028 &yy_current_buffer->yy_ch_buf[number_to_move];
2029
2030 while ( source > yy_current_buffer->yy_ch_buf )
2031 *--dest = *--source;
2032
2033 yy_cp += (int) (dest - source);
2034 yy_bp += (int) (dest - source);
2035 yy_current_buffer->yy_n_chars =
2036 yy_n_chars = yy_current_buffer->yy_buf_size;
2037
2038 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2039 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2040 }
2041
2042 *--yy_cp = (char) c;
2043
2044 chuck 1.2
2045 yytext_ptr = yy_bp;
2046 yy_hold_char = *yy_cp;
2047 yy_c_buf_p = yy_cp;
2048 }
2049 #endif /* ifndef YY_NO_UNPUT */
2050
2051
2052 #ifndef YY_NO_INPUT
2053 #ifdef __cplusplus
2054 static int yyinput()
2055 #else
2056 static int input()
2057 #endif
2058 {
2059 int c;
2060
2061 *yy_c_buf_p = yy_hold_char;
2062
2063 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2064 {
2065 chuck 1.2 /* yy_c_buf_p now points to the character we want to return.
2066 * If this occurs *before* the EOB characters, then it's a
2067 * valid NUL; if not, then we've hit the end of the buffer.
2068 */
2069 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2070 /* This was really a NUL. */
2071 *yy_c_buf_p = '\0';
2072
2073 else
2074 { /* need more input */
2075 int offset = yy_c_buf_p - yytext_ptr;
2076 ++yy_c_buf_p;
2077
2078 switch ( yy_get_next_buffer() )
2079 {
2080 case EOB_ACT_LAST_MATCH:
2081 /* This happens because yy_g_n_b()
2082 * sees that we've accumulated a
2083 * token and flags that we need to
2084 * try matching the token before
2085 * proceeding. But for input(),
2086 chuck 1.2 * there's no matching to consider.
2087 * So convert the EOB_ACT_LAST_MATCH
2088 * to EOB_ACT_END_OF_FILE.
2089 */
2090
2091 /* Reset buffer status. */
2092 yyrestart( yyin );
2093
2094 /* fall through */
2095
2096 case EOB_ACT_END_OF_FILE:
2097 {
2098 if ( yywrap() )
2099 return EOF;
2100
2101 if ( ! yy_did_buffer_switch_on_eof )
2102 YY_NEW_FILE;
2103 #ifdef __cplusplus
2104 return yyinput();
2105 #else
2106 return input();
2107 chuck 1.2 #endif
2108 }
2109
2110 case EOB_ACT_CONTINUE_SCAN:
2111 yy_c_buf_p = yytext_ptr + offset;
2112 break;
2113 }
2114 }
2115 }
2116
2117 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2118 *yy_c_buf_p = '\0'; /* preserve yytext */
2119 yy_hold_char = *++yy_c_buf_p;
2120
2121
2122 return c;
2123 }
2124 #endif /* YY_NO_INPUT */
2125
2126 #ifdef YY_USE_PROTOS
2127 void yyrestart( FILE *input_file )
2128 chuck 1.2 #else
2129 void yyrestart( input_file )
2130 FILE *input_file;
2131 #endif
2132 {
2133 if ( ! yy_current_buffer )
2134 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2135
2136 yy_init_buffer( yy_current_buffer, input_file );
2137 yy_load_buffer_state();
2138 }
2139
2140
2141 #ifdef YY_USE_PROTOS
2142 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2143 #else
2144 void yy_switch_to_buffer( new_buffer )
2145 YY_BUFFER_STATE new_buffer;
2146 #endif
2147 {
2148 if ( yy_current_buffer == new_buffer )
2149 chuck 1.2 return;
2150
2151 if ( yy_current_buffer )
2152 {
2153 /* Flush out information for old buffer. */
2154 *yy_c_buf_p = yy_hold_char;
2155 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2156 yy_current_buffer->yy_n_chars = yy_n_chars;
2157 }
2158
2159 yy_current_buffer = new_buffer;
2160 yy_load_buffer_state();
2161
2162 /* We don't actually know whether we did this switch during
2163 * EOF (yywrap()) processing, but the only time this flag
2164 * is looked at is after yywrap() is called, so it's safe
2165 * to go ahead and always set it.
2166 */
2167 yy_did_buffer_switch_on_eof = 1;
2168 }
2169
2170 chuck 1.2
2171 #ifdef YY_USE_PROTOS
2172 void yy_load_buffer_state( void )
2173 #else
2174 void yy_load_buffer_state()
2175 #endif
2176 {
2177 yy_n_chars = yy_current_buffer->yy_n_chars;
2178 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2179 yyin = yy_current_buffer->yy_input_file;
2180 yy_hold_char = *yy_c_buf_p;
2181 }
2182
2183
2184 #ifdef YY_USE_PROTOS
2185 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2186 #else
2187 YY_BUFFER_STATE yy_create_buffer( file, size )
2188 FILE *file;
2189 int size;
2190 #endif
2191 chuck 1.2 {
2192 YY_BUFFER_STATE b;
2193
2194 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2195 if ( ! b )
2196 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2197
2198 b->yy_buf_size = size;
2199
2200 /* yy_ch_buf has to be 2 characters longer than the size given because
2201 * we need to put in 2 end-of-buffer characters.
2202 */
2203 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2204 if ( ! b->yy_ch_buf )
2205 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2206
2207 b->yy_is_our_buffer = 1;
2208
2209 yy_init_buffer( b, file );
2210
2211 return b;
2212 chuck 1.2 }
2213
2214
2215 #ifdef YY_USE_PROTOS
2216 void yy_delete_buffer( YY_BUFFER_STATE b )
2217 #else
2218 void yy_delete_buffer( b )
2219 YY_BUFFER_STATE b;
2220 #endif
2221 {
2222 if ( ! b )
2223 return;
2224
2225 if ( b == yy_current_buffer )
2226 yy_current_buffer = (YY_BUFFER_STATE) 0;
2227
2228 if ( b->yy_is_our_buffer )
2229 yy_flex_free( (void *) b->yy_ch_buf );
2230
2231 yy_flex_free( (void *) b );
2232 }
2233 chuck 1.2
2234
2235
2236 #ifdef YY_USE_PROTOS
2237 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2238 #else
2239 void yy_init_buffer( b, file )
2240 YY_BUFFER_STATE b;
2241 FILE *file;
2242 #endif
2243
2244
2245 {
2246 yy_flush_buffer( b );
2247
2248 b->yy_input_file = file;
2249 b->yy_fill_buffer = 1;
2250
2251 #if YY_ALWAYS_INTERACTIVE
2252 b->yy_is_interactive = 1;
2253 #else
2254 chuck 1.2 #if YY_NEVER_INTERACTIVE
2255 b->yy_is_interactive = 0;
2256 #else
2257 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2258 #endif
2259 #endif
2260 }
2261
2262
2263 #ifdef YY_USE_PROTOS
2264 void yy_flush_buffer( YY_BUFFER_STATE b )
2265 #else
2266 void yy_flush_buffer( b )
2267 YY_BUFFER_STATE b;
2268 #endif
2269
2270 {
2271 if ( ! b )
2272 return;
2273
2274 b->yy_n_chars = 0;
2275 chuck 1.2
2276 /* We always need two end-of-buffer characters. The first causes
2277 * a transition to the end-of-buffer state. The second causes
2278 * a jam in that state.
2279 */
2280 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2281 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2282
2283 b->yy_buf_pos = &b->yy_ch_buf[0];
2284
2285 b->yy_at_bol = 1;
2286 b->yy_buffer_status = YY_BUFFER_NEW;
2287
2288 if ( b == yy_current_buffer )
2289 yy_load_buffer_state();
2290 }
2291
2292
2293 #ifndef YY_NO_SCAN_BUFFER
2294 #ifdef YY_USE_PROTOS
2295 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2296 chuck 1.2 #else
2297 YY_BUFFER_STATE yy_scan_buffer( base, size )
2298 char *base;
2299 yy_size_t size;
2300 #endif
2301 {
2302 YY_BUFFER_STATE b;
2303
2304 if ( size < 2 ||
2305 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2306 base[size-1] != YY_END_OF_BUFFER_CHAR )
2307 /* They forgot to leave room for the EOB's. */
2308 return 0;
2309
2310 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2311 if ( ! b )
2312 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2313
2314 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2315 b->yy_buf_pos = b->yy_ch_buf = base;
2316 b->yy_is_our_buffer = 0;
2317 chuck 1.2 b->yy_input_file = 0;
2318 b->yy_n_chars = b->yy_buf_size;
2319 b->yy_is_interactive = 0;
2320 b->yy_at_bol = 1;
2321 b->yy_fill_buffer = 0;
2322 b->yy_buffer_status = YY_BUFFER_NEW;
2323
2324 yy_switch_to_buffer( b );
2325
2326 return b;
2327 }
2328 #endif
2329
2330
2331 #ifndef YY_NO_SCAN_STRING
2332 #ifdef YY_USE_PROTOS
2333 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2334 #else
2335 YY_BUFFER_STATE yy_scan_string( yy_str )
2336 yyconst char *yy_str;
2337 #endif
2338 chuck 1.2 {
2339 int len;
2340 for ( len = 0; yy_str[len]; ++len )
2341 ;
2342
2343 return yy_scan_bytes( yy_str, len );
2344 }
2345 #endif
2346
2347
2348 #ifndef YY_NO_SCAN_BYTES
2349 #ifdef YY_USE_PROTOS
2350 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2351 #else
2352 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2353 yyconst char *bytes;
2354 int len;
2355 #endif
2356 {
2357 YY_BUFFER_STATE b;
2358 char *buf;
2359 chuck 1.2 yy_size_t n;
2360 int i;
2361
2362 /* Get memory for full buffer, including space for trailing EOB's. */
2363 n = len + 2;
2364 buf = (char *) yy_flex_alloc( n );
2365 if ( ! buf )
2366 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2367
2368 for ( i = 0; i < len; ++i )
2369 buf[i] = bytes[i];
2370
2371 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2372
2373 b = yy_scan_buffer( buf, n );
2374 if ( ! b )
2375 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2376
2377 /* It's okay to grow etc. this buffer, and we should throw it
2378 * away when we're done.
2379 */
2380 chuck 1.2 b->yy_is_our_buffer = 1;
2381
2382 return b;
2383 }
2384 #endif
2385
2386
2387 #ifndef YY_NO_PUSH_STATE
2388 #ifdef YY_USE_PROTOS
2389 static void yy_push_state( int new_state )
2390 #else
2391 static void yy_push_state( new_state )
2392 int new_state;
2393 #endif
2394 {
2395 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2396 {
2397 yy_size_t new_size;
2398
2399 yy_start_stack_depth += YY_START_STACK_INCR;
2400 new_size = yy_start_stack_depth * sizeof( int );
2401 chuck 1.2
2402 if ( ! yy_start_stack )
2403 yy_start_stack = (int *) yy_flex_alloc( new_size );
2404
2405 else
2406 yy_start_stack = (int *) yy_flex_realloc(
2407 (void *) yy_start_stack, new_size );
2408
2409 if ( ! yy_start_stack )
2410 YY_FATAL_ERROR(
2411 "out of memory expanding start-condition stack" );
2412 }
2413
2414 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2415
2416 BEGIN(new_state);
2417 }
2418 #endif
2419
2420
2421 #ifndef YY_NO_POP_STATE
2422 chuck 1.2 static void yy_pop_state()
2423 {
2424 if ( --yy_start_stack_ptr < 0 )
2425 YY_FATAL_ERROR( "start-condition stack underflow" );
2426
2427 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2428 }
2429 #endif
2430
2431
2432 #ifndef YY_NO_TOP_STATE
2433 static int yy_top_state()
2434 {
2435 return yy_start_stack[yy_start_stack_ptr - 1];
2436 }
2437 #endif
2438
2439 #ifndef YY_EXIT_FAILURE
2440 #define YY_EXIT_FAILURE 2
2441 #endif
2442
2443 chuck 1.2 #ifdef YY_USE_PROTOS
2444 static void yy_fatal_error( yyconst char msg[] )
2445 #else
2446 static void yy_fatal_error( msg )
2447 char msg[];
2448 #endif
2449 {
2450 (void) fprintf( stderr, "%s\n", msg );
2451 exit( YY_EXIT_FAILURE );
2452 }
2453
2454
2455
2456 /* Redefine yyless() so it works in section 3 code. */
2457
2458 #undef yyless
2459 #define yyless(n) \
2460 do \
2461 { \
2462 /* Undo effects of setting up yytext. */ \
2463 yytext[yyleng] = yy_hold_char; \
2464 chuck 1.2 yy_c_buf_p = yytext + n; \
2465 yy_hold_char = *yy_c_buf_p; \
2466 *yy_c_buf_p = '\0'; \
2467 yyleng = n; \
2468 } \
2469 while ( 0 )
2470
2471
2472 /* Internal utility routines. */
2473
2474 #ifndef yytext_ptr
2475 #ifdef YY_USE_PROTOS
2476 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2477 #else
2478 static void yy_flex_strncpy( s1, s2, n )
2479 char *s1;
2480 yyconst char *s2;
2481 int n;
2482 #endif
2483 {
2484 register int i;
2485 chuck 1.2 for ( i = 0; i < n; ++i )
2486 s1[i] = s2[i];
2487 }
2488 #endif
2489
2490 #ifdef YY_NEED_STRLEN
2491 #ifdef YY_USE_PROTOS
2492 static int yy_flex_strlen( yyconst char *s )
2493 #else
2494 static int yy_flex_strlen( s )
2495 yyconst char *s;
2496 #endif
2497 {
2498 register int n;
2499 for ( n = 0; s[n]; ++n )
2500 ;
2501
2502 return n;
2503 }
2504 #endif
2505
2506 chuck 1.2
2507 #ifdef YY_USE_PROTOS
2508 static void *yy_flex_alloc( yy_size_t size )
2509 #else
2510 static void *yy_flex_alloc( size )
2511 yy_size_t size;
2512 #endif
2513 {
2514 return (void *) malloc( size );
2515 }
2516
2517 #ifdef YY_USE_PROTOS
2518 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2519 #else
2520 static void *yy_flex_realloc( ptr, size )
2521 void *ptr;
2522 yy_size_t size;
2523 #endif
2524 {
2525 /* The cast to (char *) in the following accommodates both
2526 * implementations that use char* generic pointers, and those
2527 chuck 1.2 * that use void* generic pointers. It works with the latter
2528 * because both ANSI C and C++ allow castless assignment from
2529 * any pointer type to void*, and deal with argument conversions
2530 * as though doing an assignment.
2531 */
2532 return (void *) realloc( (char *) ptr, size );
2533 }
2534
2535 #ifdef YY_USE_PROTOS
2536 static void yy_flex_free( void *ptr )
2537 #else
2538 static void yy_flex_free( ptr )
2539 void *ptr;
2540 #endif
2541 {
2542 free( ptr );
2543 }
2544
2545 #if YY_MAIN
2546 int main()
2547 {
2548 chuck 1.2 yylex();
2549 return 0;
2550 }
2551 #endif
|
2552 chuck 1.13 #line 754 "CQL.l"
|
2553 chuck 1.2
2554 extern "C" int CQL_wrap()
2555 {
2556 return 1;
2557 }
2558
2559
|