1 #line 2 "surveytargetexpressionlexer.cpp"
2
3 #line 4 "surveytargetexpressionlexer.cpp"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 6
12 #define YY_FLEX_SUBMINOR_VERSION 1
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 /* First, we deal with platform-specific or compiler-specific issues. */
18
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24
25 /* end standard C headers. */
26
27 /* flex integer type definitions */
28
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 #else
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
57
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
86
87 #endif /* ! C99 */
88
89 #endif /* ! FLEXINT_H */
90
91 /* TODO: this is always defined, so inline it */
92 #define yyconst const
93
94 #if defined(__GNUC__) && __GNUC__ >= 3
95 #define yynoreturn __attribute__((__noreturn__))
96 #else
97 #define yynoreturn
98 #endif
99
100 /* Returned upon end-of-file. */
101 #define YY_NULL 0
102
103 /* Promotes a possibly negative, possibly signed char to an unsigned
104 * integer for use as an array index. If the signed char is negative,
105 * we want to instead treat it as an 8-bit unsigned char, hence the
106 * double cast.
107 */
108 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
109
110 /* An opaque pointer. */
111 #ifndef YY_TYPEDEF_YY_SCANNER_T
112 #define YY_TYPEDEF_YY_SCANNER_T
113 typedef void* yyscan_t;
114 #endif
115
116 /* For convenience, these vars (plus the bison vars far below)
117 are macros in the reentrant scanner. */
118 #define yyin yyg->yyin_r
119 #define yyout yyg->yyout_r
120 #define yyextra yyg->yyextra_r
121 #define yyleng yyg->yyleng_r
122 #define yytext yyg->yytext_r
123 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
124 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
125 #define yy_flex_debug yyg->yy_flex_debug_r
126
127 /* Enter a start condition. This macro really ought to take a parameter,
128 * but we do it the disgusting crufty way forced on us by the ()-less
129 * definition of BEGIN.
130 */
131 #define BEGIN yyg->yy_start = 1 + 2 *
132
133 /* Translate the current start state into a value that can be later handed
134 * to BEGIN to return to the state. The YYSTATE alias is for lex
135 * compatibility.
136 */
137 #define YY_START ((yyg->yy_start - 1) / 2)
138 #define YYSTATE YY_START
139
140 /* Action number for EOF rule of a given start state. */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
142
143 /* Special action meaning "start processing a new file". */
144 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
145
146 #define YY_END_OF_BUFFER_CHAR 0
147
148 /* Size of default input buffer. */
149 #ifndef YY_BUF_SIZE
150 #ifdef __ia64__
151 /* On IA-64, the buffer size is 16k, not 8k.
152 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
153 * Ditto for the __ia64__ case accordingly.
154 */
155 #define YY_BUF_SIZE 32768
156 #else
157 #define YY_BUF_SIZE 16384
158 #endif /* __ia64__ */
159 #endif
160
161 /* The state buf must be large enough to hold one state per character in the main buffer.
162 */
163 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
164
165 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
166 #define YY_TYPEDEF_YY_BUFFER_STATE
167 typedef struct yy_buffer_state *YY_BUFFER_STATE;
168 #endif
169
170 #ifndef YY_TYPEDEF_YY_SIZE_T
171 #define YY_TYPEDEF_YY_SIZE_T
172 typedef size_t yy_size_t;
173 #endif
174
175 #define EOB_ACT_CONTINUE_SCAN 0
176 #define EOB_ACT_END_OF_FILE 1
177 #define EOB_ACT_LAST_MATCH 2
178
179 #define YY_LESS_LINENO(n)
180 #define YY_LINENO_REWIND_TO(ptr)
181
182 /* Return all but the first "n" matched characters back to the input stream. */
183 #define yyless(n) \
184 do \
185 { \
186 /* Undo effects of setting up yytext. */ \
187 int yyless_macro_arg = (n); \
188 YY_LESS_LINENO(yyless_macro_arg);\
189 *yy_cp = yyg->yy_hold_char; \
190 YY_RESTORE_YY_MORE_OFFSET \
191 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
192 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
193 } \
194 while ( 0 )
195
196 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
197
198 #ifndef YY_STRUCT_YY_BUFFER_STATE
199 #define YY_STRUCT_YY_BUFFER_STATE
200 struct yy_buffer_state
201 {
202 FILE *yy_input_file;
203
204 char *yy_ch_buf; /* input buffer */
205 char *yy_buf_pos; /* current position in input buffer */
206
207 /* Size of input buffer in bytes, not including room for EOB
208 * characters.
209 */
210 int yy_buf_size;
211
212 /* Number of characters read into yy_ch_buf, not including EOB
213 * characters.
214 */
215 int yy_n_chars;
216
217 /* Whether we "own" the buffer - i.e., we know we created it,
218 * and can realloc() it to grow it, and should free() it to
219 * delete it.
220 */
221 int yy_is_our_buffer;
222
223 /* Whether this is an "interactive" input source; if so, and
224 * if we're using stdio for input, then we want to use getc()
225 * instead of fread(), to make sure we stop fetching input after
226 * each newline.
227 */
228 int yy_is_interactive;
229
230 /* Whether we're considered to be at the beginning of a line.
231 * If so, '^' rules will be active on the next match, otherwise
232 * not.
233 */
234 int yy_at_bol;
235
236 int yy_bs_lineno; /**< The line count. */
237 int yy_bs_column; /**< The column count. */
238
239 /* Whether to try to fill the input buffer when we reach the
240 * end of it.
241 */
242 int yy_fill_buffer;
243
244 int yy_buffer_status;
245
246 #define YY_BUFFER_NEW 0
247 #define YY_BUFFER_NORMAL 1
248 /* When an EOF's been seen but there's still some text to process
249 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
250 * shouldn't try reading from the input source any more. We might
251 * still have a bunch of tokens to match, though, because of
252 * possible backing-up.
253 *
254 * When we actually see the EOF, we change the status to "new"
255 * (via yyrestart()), so that the user can continue scanning by
256 * just pointing yyin at a new input file.
257 */
258 #define YY_BUFFER_EOF_PENDING 2
259
260 };
261 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
262
263 /* We provide macros for accessing buffer states in case in the
264 * future we want to put the buffer states in a more general
265 * "scanner state".
266 *
267 * Returns the top of the stack, or NULL.
268 */
269 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
270 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
271 : NULL)
272
273 /* Same as previous macro, but useful when we know that the buffer stack is not
274 * NULL or when we need an lvalue. For internal use only.
275 */
276 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
277
278 void yyrestart (FILE *input_file ,yyscan_t yyscanner );
279 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
280 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
281 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
282 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
283 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
284 void yypop_buffer_state (yyscan_t yyscanner );
285
286 static void yyensure_buffer_stack (yyscan_t yyscanner );
287 static void yy_load_buffer_state (yyscan_t yyscanner );
288 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
289
290 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
291
292 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
293 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
294 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
295
296 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
297 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
298 void yyfree (void * ,yyscan_t yyscanner );
299
300 #define yy_new_buffer yy_create_buffer
301
302 #define yy_set_interactive(is_interactive) \
303 { \
304 if ( ! YY_CURRENT_BUFFER ){ \
305 yyensure_buffer_stack (yyscanner); \
306 YY_CURRENT_BUFFER_LVALUE = \
307 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
308 } \
309 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
310 }
311
312 #define yy_set_bol(at_bol) \
313 { \
314 if ( ! YY_CURRENT_BUFFER ){\
315 yyensure_buffer_stack (yyscanner); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
318 } \
319 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
320 }
321
322 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
323
324 /* Begin user sect3 */
325
326 #define yywrap(yyscanner) (/*CONSTCOND*/1)
327 #define YY_SKIP_YYWRAP
328
329 typedef unsigned char YY_CHAR;
330
331 typedef int yy_state_type;
332
333 #define yytext_ptr yytext_r
334
335 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
336 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
337 static int yy_get_next_buffer (yyscan_t yyscanner );
338 static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
339
340 /* Done after the current pattern has been matched and before the
341 * corresponding action - sets up yytext.
342 */
343 #define YY_DO_BEFORE_ACTION \
344 yyg->yytext_ptr = yy_bp; \
345 yyleng = (int) (yy_cp - yy_bp); \
346 yyg->yy_hold_char = *yy_cp; \
347 *yy_cp = '\0'; \
348 yyg->yy_c_buf_p = yy_cp;
349
350 #define YY_NUM_RULES 22
351 #define YY_END_OF_BUFFER 23
352 /* This struct is not used in this scanner,
353 but its presence is necessary. */
354 struct yy_trans_info
355 {
356 flex_int32_t yy_verify;
357 flex_int32_t yy_nxt;
358 };
359 static yyconst flex_int16_t yy_accept[51] =
360 { 0,
361 0, 0, 23, 21, 1, 1, 21, 21, 21, 2,
362 3, 21, 4, 8, 19, 21, 17, 12, 5, 6,
363 12, 12, 21, 1, 16, 0, 9, 0, 13, 0,
364 8, 7, 7, 20, 15, 18, 12, 12, 12, 14,
365 0, 7, 12, 12, 0, 7, 12, 10, 11, 0
366 } ;
367
368 static yyconst YY_CHAR yy_ec[256] =
369 { 0,
370 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
371 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 2, 4, 5, 1, 1, 1, 6, 1, 7,
374 8, 1, 9, 1, 9, 10, 1, 11, 11, 11,
375 11, 11, 11, 11, 11, 11, 11, 1, 1, 12,
376 13, 14, 1, 1, 15, 15, 15, 15, 16, 15,
377 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
378 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
379 17, 18, 19, 1, 20, 1, 21, 15, 15, 15,
380
381 22, 23, 15, 15, 15, 15, 15, 24, 15, 25,
382 15, 15, 15, 26, 27, 28, 29, 15, 15, 15,
383 15, 15, 1, 30, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1
398 } ;
399
400 static yyconst YY_CHAR yy_meta[31] =
401 { 0,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 2, 1, 1, 1, 2, 2, 1, 1, 1, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
405 } ;
406
407 static yyconst flex_uint16_t yy_base[53] =
408 { 0,
409 0, 0, 82, 83, 29, 31, 68, 30, 74, 83,
410 83, 26, 68, 28, 65, 64, 63, 0, 83, 83,
411 54, 48, 43, 38, 83, 37, 83, 38, 83, 61,
412 34, 35, 36, 83, 83, 83, 0, 47, 41, 83,
413 50, 38, 42, 43, 53, 51, 31, 0, 0, 83,
414 66, 48
415 } ;
416
417 static yyconst flex_int16_t yy_def[53] =
418 { 0,
419 50, 1, 50, 50, 50, 50, 50, 51, 50, 50,
420 50, 50, 50, 50, 50, 50, 50, 52, 50, 50,
421 52, 52, 50, 50, 50, 51, 50, 50, 50, 50,
422 50, 50, 50, 50, 50, 50, 52, 52, 52, 50,
423 50, 50, 52, 52, 50, 50, 52, 52, 52, 0,
424 50, 50
425 } ;
426
427 static yyconst flex_uint16_t yy_nxt[114] =
428 { 0,
429 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
430 14, 15, 16, 17, 18, 18, 19, 4, 20, 18,
431 18, 18, 21, 18, 18, 18, 18, 22, 18, 23,
432 24, 24, 24, 24, 27, 30, 31, 33, 31, 24,
433 24, 27, 26, 33, 31, 32, 42, 28, 42, 37,
434 41, 41, 49, 41, 28, 26, 41, 41, 45, 41,
435 46, 46, 26, 46, 48, 26, 26, 26, 47, 44,
436 43, 32, 40, 39, 38, 36, 35, 34, 32, 29,
437 25, 50, 3, 50, 50, 50, 50, 50, 50, 50,
438 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
439
440 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
441 50, 50, 50
442 } ;
443
444 static yyconst flex_int16_t yy_chk[114] =
445 { 0,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 5, 5, 6, 6, 8, 12, 12, 14, 14, 24,
450 24, 26, 28, 31, 31, 32, 33, 8, 42, 52,
451 32, 33, 47, 42, 26, 28, 32, 33, 41, 42,
452 41, 46, 28, 45, 44, 28, 51, 51, 43, 39,
453 38, 30, 23, 22, 21, 17, 16, 15, 13, 9,
454 7, 3, 50, 50, 50, 50, 50, 50, 50, 50,
455 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
456
457 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
458 50, 50, 50
459 } ;
460
461 /* The intent behind this definition is that it'll catch
462 * any uses of REJECT which flex missed.
463 */
464 #define REJECT reject_used_but_not_detected
465 #define yymore() yymore_used_but_not_detected
466 #define YY_MORE_ADJ 0
467 #define YY_RESTORE_YY_MORE_OFFSET
468 #line 1 "surveytargetexpressionlexer.l"
469 #line 2 "surveytargetexpressionlexer.l"
470 /*
471 Copyright (C) 2017 Volker Krause <vkrause@kde.org>
472
473 This program is free software; you can redistribute it and/or modify it
474 under the terms of the GNU Library General Public License as published by
475 the Free Software Foundation; either version 2 of the License, or (at your
476 option) any later version.
477
478 This program is distributed in the hope that it will be useful, but WITHOUT
479 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
480 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
481 License for more details.
482
483 You should have received a copy of the GNU General Public License
484 along with this program. If not, see <http://www.gnu.org/licenses/>.
485 */
486
487 #include "surveytargetexpression.h"
488 #include "surveytargetexpressionparser_p.h"
489
490 extern char* unquoteString(const char *str);
491
492 #line 493 "surveytargetexpressionlexer.cpp"
493
494 #define INITIAL 0
495
496 #ifndef YY_NO_UNISTD_H
497 /* Special case for "unistd.h", since it is non-ANSI. We include it way
498 * down here because we want the user's section 1 to have been scanned first.
499 * The user has a chance to override it with an option.
500 */
501 #include <unistd.h>
502 #endif
503
504 #ifndef YY_EXTRA_TYPE
505 #define YY_EXTRA_TYPE void *
506 #endif
507
508 /* Holds the entire state of the reentrant scanner. */
509 struct yyguts_t
510 {
511
512 /* User-defined. Not touched by flex. */
513 YY_EXTRA_TYPE yyextra_r;
514
515 /* The rest are the same as the globals declared in the non-reentrant scanner. */
516 FILE *yyin_r, *yyout_r;
517 size_t yy_buffer_stack_top; /**< index of top of stack. */
518 size_t yy_buffer_stack_max; /**< capacity of stack. */
519 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
520 char yy_hold_char;
521 int yy_n_chars;
522 int yyleng_r;
523 char *yy_c_buf_p;
524 int yy_init;
525 int yy_start;
526 int yy_did_buffer_switch_on_eof;
527 int yy_start_stack_ptr;
528 int yy_start_stack_depth;
529 int *yy_start_stack;
530 yy_state_type yy_last_accepting_state;
531 char* yy_last_accepting_cpos;
532
533 int yylineno_r;
534 int yy_flex_debug_r;
535
536 char *yytext_r;
537 int yy_more_flag;
538 int yy_more_len;
539
540 YYSTYPE * yylval_r;
541
542 }; /* end struct yyguts_t */
543
544 static int yy_init_globals (yyscan_t yyscanner );
545
546 /* This must go here because YYSTYPE and YYLTYPE are included
547 * from bison output in section 1.*/
548 # define yylval yyg->yylval_r
549
550 int yylex_init (yyscan_t* scanner);
551
552 int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
553
554 /* Accessor methods to globals.
555 These are made visible to non-reentrant scanners for convenience. */
556
557 int yylex_destroy (yyscan_t yyscanner );
558
559 int yyget_debug (yyscan_t yyscanner );
560
561 void yyset_debug (int debug_flag ,yyscan_t yyscanner );
562
563 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
564
565 void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
566
567 FILE *yyget_in (yyscan_t yyscanner );
568
569 void yyset_in (FILE * _in_str ,yyscan_t yyscanner );
570
571 FILE *yyget_out (yyscan_t yyscanner );
572
573 void yyset_out (FILE * _out_str ,yyscan_t yyscanner );
574
575 int yyget_leng (yyscan_t yyscanner );
576
577 char *yyget_text (yyscan_t yyscanner );
578
579 int yyget_lineno (yyscan_t yyscanner );
580
581 void yyset_lineno (int _line_number ,yyscan_t yyscanner );
582
583 int yyget_column (yyscan_t yyscanner );
584
585 void yyset_column (int _column_no ,yyscan_t yyscanner );
586
587 YYSTYPE * yyget_lval (yyscan_t yyscanner );
588
589 void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
590
591 /* Macros after this point can all be overridden by user definitions in
592 * section 1.
593 */
594
595 #ifndef YY_SKIP_YYWRAP
596 #ifdef __cplusplus
597 extern "C" int yywrap (yyscan_t yyscanner );
598 #else
599 extern int yywrap (yyscan_t yyscanner );
600 #endif
601 #endif
602
603 #ifndef YY_NO_UNPUT
604
605 #endif
606
607 #ifndef yytext_ptr
608 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
609 #endif
610
611 #ifdef YY_NEED_STRLEN
612 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
613 #endif
614
615 #ifndef YY_NO_INPUT
616
617 #ifdef __cplusplus
618 static int yyinput (yyscan_t yyscanner );
619 #else
620 static int input (yyscan_t yyscanner );
621 #endif
622
623 #endif
624
625 /* Amount of stuff to slurp up with each read. */
626 #ifndef YY_READ_BUF_SIZE
627 #ifdef __ia64__
628 /* On IA-64, the buffer size is 16k, not 8k */
629 #define YY_READ_BUF_SIZE 16384
630 #else
631 #define YY_READ_BUF_SIZE 8192
632 #endif /* __ia64__ */
633 #endif
634
635 /* Copy whatever the last rule matched to the standard output. */
636 #ifndef ECHO
637 /* This used to be an fputs(), but since the string might contain NUL's,
638 * we now use fwrite().
639 */
640 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
641 #endif
642
643 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
644 * is returned in "result".
645 */
646 #ifndef YY_INPUT
647 #define YY_INPUT(buf,result,max_size) \
648 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
649 { \
650 int c = '*'; \
651 size_t n; \
652 for ( n = 0; n < max_size && \
653 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
654 buf[n] = (char) c; \
655 if ( c == '\n' ) \
656 buf[n++] = (char) c; \
657 if ( c == EOF && ferror( yyin ) ) \
658 YY_FATAL_ERROR( "input in flex scanner failed" ); \
659 result = n; \
660 } \
661 else \
662 { \
663 errno=0; \
664 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
665 { \
666 if( errno != EINTR) \
667 { \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
669 break; \
670 } \
671 errno=0; \
672 clearerr(yyin); \
673 } \
674 }\
675 \
676
677 #endif
678
679 /* No semi-colon after return; correct usage is to write "yyterminate();" -
680 * we don't want an extra ';' after the "return" because that will cause
681 * some compilers to complain about unreachable statements.
682 */
683 #ifndef yyterminate
684 #define yyterminate() return YY_NULL
685 #endif
686
687 /* Number of entries by which start-condition stack grows. */
688 #ifndef YY_START_STACK_INCR
689 #define YY_START_STACK_INCR 25
690 #endif
691
692 /* Report a fatal error. */
693 #ifndef YY_FATAL_ERROR
694 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
695 #endif
696
697 /* end tables serialization structures and prototypes */
698
699 /* Default declaration of generated scanner - a define so the user can
700 * easily add parameters.
701 */
702 #ifndef YY_DECL
703 #define YY_DECL_IS_OURS 1
704
705 extern int yylex \
706 (YYSTYPE * yylval_param ,yyscan_t yyscanner);
707
708 #define YY_DECL int yylex \
709 (YYSTYPE * yylval_param , yyscan_t yyscanner)
710 #endif /* !YY_DECL */
711
712 /* Code executed at the beginning of each rule, after yytext and yyleng
713 * have been set up.
714 */
715 #ifndef YY_USER_ACTION
716 #define YY_USER_ACTION
717 #endif
718
719 /* Code executed at the end of each rule. */
720 #ifndef YY_BREAK
721 #define YY_BREAK /*LINTED*/break;
722 #endif
723
724 #define YY_RULE_SETUP \
725 YY_USER_ACTION
726
727 /** The main scanner function which does all the work.
728 */
729 YY_DECL
730 {
731 yy_state_type yy_current_state;
732 char *yy_cp, *yy_bp;
733 int yy_act;
734 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
735
736 yylval = yylval_param;
737
738 if ( !yyg->yy_init )
739 {
740 yyg->yy_init = 1;
741
742 #ifdef YY_USER_INIT
743 YY_USER_INIT;
744 #endif
745
746 if ( ! yyg->yy_start )
747 yyg->yy_start = 1; /* first start state */
748
749 if ( ! yyin )
750 yyin = stdin;
751
752 if ( ! yyout )
753 yyout = stdout;
754
755 if ( ! YY_CURRENT_BUFFER ) {
756 yyensure_buffer_stack (yyscanner);
757 YY_CURRENT_BUFFER_LVALUE =
758 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
759 }
760
761 yy_load_buffer_state(yyscanner );
762 }
763
764 {
765 #line 45 "surveytargetexpressionlexer.l"
766
767
768 #line 769 "surveytargetexpressionlexer.cpp"
769
770 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
771 {
772 yy_cp = yyg->yy_c_buf_p;
773
774 /* Support of yytext. */
775 *yy_cp = yyg->yy_hold_char;
776
777 /* yy_bp points to the position in yy_ch_buf of the start of
778 * the current run.
779 */
780 yy_bp = yy_cp;
781
782 yy_current_state = yyg->yy_start;
783 yy_match:
784 do
785 {
786 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
787 if ( yy_accept[yy_current_state] )
788 {
789 yyg->yy_last_accepting_state = yy_current_state;
790 yyg->yy_last_accepting_cpos = yy_cp;
791 }
792 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
793 {
794 yy_current_state = (int) yy_def[yy_current_state];
795 if ( yy_current_state >= 51 )
796 yy_c = yy_meta[(unsigned int) yy_c];
797 }
798 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
799 ++yy_cp;
800 }
801 while ( yy_current_state != 50 );
802 yy_cp = yyg->yy_last_accepting_cpos;
803 yy_current_state = yyg->yy_last_accepting_state;
804
805 yy_find_action:
806 yy_act = yy_accept[yy_current_state];
807
808 YY_DO_BEFORE_ACTION;
809
810 do_action: /* This label is used only to access EOF actions. */
811
812 switch ( yy_act )
813 { /* beginning of action switch */
814 case 0: /* must back up */
815 /* undo the effects of YY_DO_BEFORE_ACTION */
816 *yy_cp = yyg->yy_hold_char;
817 yy_cp = yyg->yy_last_accepting_cpos;
818 yy_current_state = yyg->yy_last_accepting_state;
819 goto yy_find_action;
820
821 case 1:
822 /* rule 1 can match eol */
823 YY_RULE_SETUP
824 #line 47 "surveytargetexpressionlexer.l"
825 {}
826 YY_BREAK
827 case 2:
828 YY_RULE_SETUP
829 #line 49 "surveytargetexpressionlexer.l"
830 { return T_LPAREN; }
831 YY_BREAK
832 case 3:
833 YY_RULE_SETUP
834 #line 50 "surveytargetexpressionlexer.l"
835 { return T_RPAREN; }
836 YY_BREAK
837 case 4:
838 YY_RULE_SETUP
839 #line 51 "surveytargetexpressionlexer.l"
840 { return T_DOT; }
841 YY_BREAK
842 case 5:
843 YY_RULE_SETUP
844 #line 52 "surveytargetexpressionlexer.l"
845 { return T_LBRACKET; }
846 YY_BREAK
847 case 6:
848 YY_RULE_SETUP
849 #line 53 "surveytargetexpressionlexer.l"
850 { return T_RBRACKET; }
851 YY_BREAK
852 case 7:
853 YY_RULE_SETUP
854 #line 55 "surveytargetexpressionlexer.l"
855 {
856 yylval->doubleVal = atof(yytext);
857 return T_DOUBLE;
858 }
859 YY_BREAK
860 case 8:
861 YY_RULE_SETUP
862 #line 59 "surveytargetexpressionlexer.l"
863 {
864 yylval->intVal = atoi(yytext);
865 return T_INTEGER;
866 }
867 YY_BREAK
868 case 9:
869 /* rule 9 can match eol */
870 YY_RULE_SETUP
871 #line 63 "surveytargetexpressionlexer.l"
872 {
873 yylval->str = unquoteString(yytext);
874 return T_STRING;
875 }
876 YY_BREAK
877 case 10:
878 YY_RULE_SETUP
879 #line 67 "surveytargetexpressionlexer.l"
880 { yylval->boolVal = true; return T_BOOLEAN; }
881 YY_BREAK
882 case 11:
883 YY_RULE_SETUP
884 #line 68 "surveytargetexpressionlexer.l"
885 { yylval->boolVal = false; return T_BOOLEAN; }
886 YY_BREAK
887 case 12:
888 YY_RULE_SETUP
889 #line 70 "surveytargetexpressionlexer.l"
890 {
891 yylval->str = strdup(yytext);
892 return T_IDENTIFIER;
893 }
894 YY_BREAK
895 case 13:
896 YY_RULE_SETUP
897 #line 75 "surveytargetexpressionlexer.l"
898 { return T_OP_AND; }
899 YY_BREAK
900 case 14:
901 YY_RULE_SETUP
902 #line 76 "surveytargetexpressionlexer.l"
903 { return T_OP_OR; }
904 YY_BREAK
905 case 15:
906 YY_RULE_SETUP
907 #line 77 "surveytargetexpressionlexer.l"
908 { return T_OP_EQ; }
909 YY_BREAK
910 case 16:
911 YY_RULE_SETUP
912 #line 78 "surveytargetexpressionlexer.l"
913 { return T_OP_NEQ; }
914 YY_BREAK
915 case 17:
916 YY_RULE_SETUP
917 #line 79 "surveytargetexpressionlexer.l"
918 { return T_OP_GT; }
919 YY_BREAK
920 case 18:
921 YY_RULE_SETUP
922 #line 80 "surveytargetexpressionlexer.l"
923 { return T_OP_GE; }
924 YY_BREAK
925 case 19:
926 YY_RULE_SETUP
927 #line 81 "surveytargetexpressionlexer.l"
928 { return T_OP_LT; }
929 YY_BREAK
930 case 20:
931 YY_RULE_SETUP
932 #line 82 "surveytargetexpressionlexer.l"
933 { return T_OP_LE; }
934 YY_BREAK
935 case 21:
936 YY_RULE_SETUP
937 #line 84 "surveytargetexpressionlexer.l"
938 {
939 printf("unexpected character: %s\n", yytext);
940 }
941 YY_BREAK
942 case 22:
943 YY_RULE_SETUP
944 #line 88 "surveytargetexpressionlexer.l"
945 YY_FATAL_ERROR( "flex scanner jammed" );
946 YY_BREAK
947 #line 948 "surveytargetexpressionlexer.cpp"
948 case YY_STATE_EOF(INITIAL):
949 yyterminate();
950
951 case YY_END_OF_BUFFER:
952 {
953 /* Amount of text matched not including the EOB char. */
954 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
955
956 /* Undo the effects of YY_DO_BEFORE_ACTION. */
957 *yy_cp = yyg->yy_hold_char;
958 YY_RESTORE_YY_MORE_OFFSET
959
960 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
961 {
962 /* We're scanning a new file or input source. It's
963 * possible that this happened because the user
964 * just pointed yyin at a new source and called
965 * yylex(). If so, then we have to assure
966 * consistency between YY_CURRENT_BUFFER and our
967 * globals. Here is the right place to do so, because
968 * this is the first action (other than possibly a
969 * back-up) that will match for the new input source.
970 */
971 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
972 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
973 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
974 }
975
976 /* Note that here we test for yy_c_buf_p "<=" to the position
977 * of the first EOB in the buffer, since yy_c_buf_p will
978 * already have been incremented past the NUL character
979 * (since all states make transitions on EOB to the
980 * end-of-buffer state). Contrast this with the test
981 * in input().
982 */
983 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
984 { /* This was really a NUL. */
985 yy_state_type yy_next_state;
986
987 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
988
989 yy_current_state = yy_get_previous_state( yyscanner );
990
991 /* Okay, we're now positioned to make the NUL
992 * transition. We couldn't have
993 * yy_get_previous_state() go ahead and do it
994 * for us because it doesn't know how to deal
995 * with the possibility of jamming (and we don't
996 * want to build jamming into it because then it
997 * will run more slowly).
998 */
999
1000 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1001
1002 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1003
1004 if ( yy_next_state )
1005 {
1006 /* Consume the NUL. */
1007 yy_cp = ++yyg->yy_c_buf_p;
1008 yy_current_state = yy_next_state;
1009 goto yy_match;
1010 }
1011
1012 else
1013 {
1014 yy_cp = yyg->yy_last_accepting_cpos;
1015 yy_current_state = yyg->yy_last_accepting_state;
1016 goto yy_find_action;
1017 }
1018 }
1019
1020 else switch ( yy_get_next_buffer( yyscanner ) )
1021 {
1022 case EOB_ACT_END_OF_FILE:
1023 {
1024 yyg->yy_did_buffer_switch_on_eof = 0;
1025
1026 if ( yywrap(yyscanner ) )
1027 {
1028 /* Note: because we've taken care in
1029 * yy_get_next_buffer() to have set up
1030 * yytext, we can now set up
1031 * yy_c_buf_p so that if some total
1032 * hoser (like flex itself) wants to
1033 * call the scanner after we return the
1034 * YY_NULL, it'll still work - another
1035 * YY_NULL will get returned.
1036 */
1037 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1038
1039 yy_act = YY_STATE_EOF(YY_START);
1040 goto do_action;
1041 }
1042
1043 else
1044 {
1045 if ( ! yyg->yy_did_buffer_switch_on_eof )
1046 YY_NEW_FILE;
1047 }
1048 break;
1049 }
1050
1051 case EOB_ACT_CONTINUE_SCAN:
1052 yyg->yy_c_buf_p =
1053 yyg->yytext_ptr + yy_amount_of_matched_text;
1054
1055 yy_current_state = yy_get_previous_state( yyscanner );
1056
1057 yy_cp = yyg->yy_c_buf_p;
1058 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1059 goto yy_match;
1060
1061 case EOB_ACT_LAST_MATCH:
1062 yyg->yy_c_buf_p =
1063 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1064
1065 yy_current_state = yy_get_previous_state( yyscanner );
1066
1067 yy_cp = yyg->yy_c_buf_p;
1068 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1069 goto yy_find_action;
1070 }
1071 break;
1072 }
1073
1074 default:
1075 YY_FATAL_ERROR(
1076 "fatal flex scanner internal error--no action found" );
1077 } /* end of action switch */
1078 } /* end of scanning one token */
1079 } /* end of user's declarations */
1080 } /* end of yylex */
1081
1082 /* yy_get_next_buffer - try to read in a new buffer
1083 *
1084 * Returns a code representing an action:
1085 * EOB_ACT_LAST_MATCH -
1086 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1087 * EOB_ACT_END_OF_FILE - end of file
1088 */
1089 static int yy_get_next_buffer (yyscan_t yyscanner)
1090 {
1091 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1092 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1093 char *source = yyg->yytext_ptr;
1094 yy_size_t number_to_move, i;
1095 int ret_val;
1096
1097 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1098 YY_FATAL_ERROR(
1099 "fatal flex scanner internal error--end of buffer missed" );
1100
1101 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1102 { /* Don't try to fill the buffer, so this is an EOF. */
1103 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1104 {
1105 /* We matched a single character, the EOB, so
1106 * treat this as a final EOF.
1107 */
1108 return EOB_ACT_END_OF_FILE;
1109 }
1110
1111 else
1112 {
1113 /* We matched some text prior to the EOB, first
1114 * process it.
1115 */
1116 return EOB_ACT_LAST_MATCH;
1117 }
1118 }
1119
1120 /* Try to read more data. */
1121
1122 /* First move last chars to start of buffer. */
1123 number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1124
1125 for ( i = 0; i < number_to_move; ++i )
1126 *(dest++) = *(source++);
1127
1128 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1129 /* don't do the read, it's not guaranteed to return an EOF,
1130 * just force an EOF
1131 */
1132 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1133
1134 else
1135 {
1136 int num_to_read =
1137 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1138
1139 while ( num_to_read <= 0 )
1140 { /* Not enough room in the buffer - grow it. */
1141
1142 /* just a shorter name for the current buffer */
1143 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1144
1145 int yy_c_buf_p_offset =
1146 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1147
1148 if ( b->yy_is_our_buffer )
1149 {
1150 int new_size = b->yy_buf_size * 2;
1151
1152 if ( new_size <= 0 )
1153 b->yy_buf_size += b->yy_buf_size / 8;
1154 else
1155 b->yy_buf_size *= 2;
1156
1157 b->yy_ch_buf = (char *)
1158 /* Include room in for 2 EOB chars. */
1159 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1160 }
1161 else
1162 /* Can't grow it, we don't own it. */
1163 b->yy_ch_buf = NULL;
1164
1165 if ( ! b->yy_ch_buf )
1166 YY_FATAL_ERROR(
1167 "fatal error - scanner input buffer overflow" );
1168
1169 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1170
1171 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1172 number_to_move - 1;
1173
1174 }
1175
1176 if ( num_to_read > YY_READ_BUF_SIZE )
1177 num_to_read = YY_READ_BUF_SIZE;
1178
1179 /* Read in more data. */
1180 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1181 yyg->yy_n_chars, num_to_read );
1182
1183 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1184 }
1185
1186 if ( yyg->yy_n_chars == 0 )
1187 {
1188 if ( number_to_move == YY_MORE_ADJ )
1189 {
1190 ret_val = EOB_ACT_END_OF_FILE;
1191 yyrestart(yyin ,yyscanner);
1192 }
1193
1194 else
1195 {
1196 ret_val = EOB_ACT_LAST_MATCH;
1197 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1198 YY_BUFFER_EOF_PENDING;
1199 }
1200 }
1201
1202 else
1203 ret_val = EOB_ACT_CONTINUE_SCAN;
1204
1205 if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1206 /* Extend the array by 50%, plus the number we really need. */
1207 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1208 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1209 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1210 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1211 }
1212
1213 yyg->yy_n_chars += number_to_move;
1214 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1215 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1216
1217 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1218
1219 return ret_val;
1220 }
1221
1222 /* yy_get_previous_state - get the state just before the EOB char was reached */
1223
yy_get_previous_state(yyscan_t yyscanner)1224 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1225 {
1226 yy_state_type yy_current_state;
1227 char *yy_cp;
1228 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1229
1230 yy_current_state = yyg->yy_start;
1231
1232 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1233 {
1234 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1235 if ( yy_accept[yy_current_state] )
1236 {
1237 yyg->yy_last_accepting_state = yy_current_state;
1238 yyg->yy_last_accepting_cpos = yy_cp;
1239 }
1240 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1241 {
1242 yy_current_state = (int) yy_def[yy_current_state];
1243 if ( yy_current_state >= 51 )
1244 yy_c = yy_meta[(unsigned int) yy_c];
1245 }
1246 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1247 }
1248
1249 return yy_current_state;
1250 }
1251
1252 /* yy_try_NUL_trans - try to make a transition on the NUL character
1253 *
1254 * synopsis
1255 * next_state = yy_try_NUL_trans( current_state );
1256 */
yy_try_NUL_trans(yy_state_type yy_current_state,yyscan_t yyscanner)1257 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1258 {
1259 int yy_is_jam;
1260 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1261 char *yy_cp = yyg->yy_c_buf_p;
1262
1263 YY_CHAR yy_c = 1;
1264 if ( yy_accept[yy_current_state] )
1265 {
1266 yyg->yy_last_accepting_state = yy_current_state;
1267 yyg->yy_last_accepting_cpos = yy_cp;
1268 }
1269 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1270 {
1271 yy_current_state = (int) yy_def[yy_current_state];
1272 if ( yy_current_state >= 51 )
1273 yy_c = yy_meta[(unsigned int) yy_c];
1274 }
1275 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1276 yy_is_jam = (yy_current_state == 50);
1277
1278 (void)yyg;
1279 return yy_is_jam ? 0 : yy_current_state;
1280 }
1281
1282 #ifndef YY_NO_UNPUT
1283
1284 #endif
1285
1286 #ifndef YY_NO_INPUT
1287 #ifdef __cplusplus
yyinput(yyscan_t yyscanner)1288 static int yyinput (yyscan_t yyscanner)
1289 #else
1290 static int input (yyscan_t yyscanner)
1291 #endif
1292
1293 {
1294 int c;
1295 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1296
1297 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1298
1299 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1300 {
1301 /* yy_c_buf_p now points to the character we want to return.
1302 * If this occurs *before* the EOB characters, then it's a
1303 * valid NUL; if not, then we've hit the end of the buffer.
1304 */
1305 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1306 /* This was really a NUL. */
1307 *yyg->yy_c_buf_p = '\0';
1308
1309 else
1310 { /* need more input */
1311 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1312 ++yyg->yy_c_buf_p;
1313
1314 switch ( yy_get_next_buffer( yyscanner ) )
1315 {
1316 case EOB_ACT_LAST_MATCH:
1317 /* This happens because yy_g_n_b()
1318 * sees that we've accumulated a
1319 * token and flags that we need to
1320 * try matching the token before
1321 * proceeding. But for input(),
1322 * there's no matching to consider.
1323 * So convert the EOB_ACT_LAST_MATCH
1324 * to EOB_ACT_END_OF_FILE.
1325 */
1326
1327 /* Reset buffer status. */
1328 yyrestart(yyin ,yyscanner);
1329
1330 /*FALLTHROUGH*/
1331
1332 case EOB_ACT_END_OF_FILE:
1333 {
1334 if ( yywrap(yyscanner ) )
1335 return 0;
1336
1337 if ( ! yyg->yy_did_buffer_switch_on_eof )
1338 YY_NEW_FILE;
1339 #ifdef __cplusplus
1340 return yyinput(yyscanner);
1341 #else
1342 return input(yyscanner);
1343 #endif
1344 }
1345
1346 case EOB_ACT_CONTINUE_SCAN:
1347 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1348 break;
1349 }
1350 }
1351 }
1352
1353 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1354 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1355 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1356
1357 return c;
1358 }
1359 #endif /* ifndef YY_NO_INPUT */
1360
1361 /** Immediately switch to a different input stream.
1362 * @param input_file A readable stream.
1363 * @param yyscanner The scanner object.
1364 * @note This function does not reset the start condition to @c INITIAL .
1365 */
yyrestart(FILE * input_file,yyscan_t yyscanner)1366 void yyrestart (FILE * input_file , yyscan_t yyscanner)
1367 {
1368 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1369
1370 if ( ! YY_CURRENT_BUFFER ){
1371 yyensure_buffer_stack (yyscanner);
1372 YY_CURRENT_BUFFER_LVALUE =
1373 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1374 }
1375
1376 yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1377 yy_load_buffer_state(yyscanner );
1378 }
1379
1380 /** Switch to a different input buffer.
1381 * @param new_buffer The new input buffer.
1382 * @param yyscanner The scanner object.
1383 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)1384 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1385 {
1386 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1387
1388 /* TODO. We should be able to replace this entire function body
1389 * with
1390 * yypop_buffer_state();
1391 * yypush_buffer_state(new_buffer);
1392 */
1393 yyensure_buffer_stack (yyscanner);
1394 if ( YY_CURRENT_BUFFER == new_buffer )
1395 return;
1396
1397 if ( YY_CURRENT_BUFFER )
1398 {
1399 /* Flush out information for old buffer. */
1400 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1401 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1402 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1403 }
1404
1405 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1406 yy_load_buffer_state(yyscanner );
1407
1408 /* We don't actually know whether we did this switch during
1409 * EOF (yywrap()) processing, but the only time this flag
1410 * is looked at is after yywrap() is called, so it's safe
1411 * to go ahead and always set it.
1412 */
1413 yyg->yy_did_buffer_switch_on_eof = 1;
1414 }
1415
yy_load_buffer_state(yyscan_t yyscanner)1416 static void yy_load_buffer_state (yyscan_t yyscanner)
1417 {
1418 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1419 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1420 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1421 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1422 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1423 }
1424
1425 /** Allocate and initialize an input buffer state.
1426 * @param file A readable stream.
1427 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1428 * @param yyscanner The scanner object.
1429 * @return the allocated buffer state.
1430 */
yy_create_buffer(FILE * file,int size,yyscan_t yyscanner)1431 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1432 {
1433 YY_BUFFER_STATE b;
1434
1435 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1436 if ( ! b )
1437 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1438
1439 b->yy_buf_size = (yy_size_t)size;
1440
1441 /* yy_ch_buf has to be 2 characters longer than the size given because
1442 * we need to put in 2 end-of-buffer characters.
1443 */
1444 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
1445 if ( ! b->yy_ch_buf )
1446 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1447
1448 b->yy_is_our_buffer = 1;
1449
1450 yy_init_buffer(b,file ,yyscanner);
1451
1452 return b;
1453 }
1454
1455 /** Destroy the buffer.
1456 * @param b a buffer created with yy_create_buffer()
1457 * @param yyscanner The scanner object.
1458 */
yy_delete_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)1459 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1460 {
1461 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1462
1463 if ( ! b )
1464 return;
1465
1466 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1467 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1468
1469 if ( b->yy_is_our_buffer )
1470 yyfree((void *) b->yy_ch_buf ,yyscanner );
1471
1472 yyfree((void *) b ,yyscanner );
1473 }
1474
1475 /* Initializes or reinitializes a buffer.
1476 * This function is sometimes called more than once on the same buffer,
1477 * such as during a yyrestart() or at EOF.
1478 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file,yyscan_t yyscanner)1479 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1480
1481 {
1482 int oerrno = errno;
1483 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1484
1485 yy_flush_buffer(b ,yyscanner);
1486
1487 b->yy_input_file = file;
1488 b->yy_fill_buffer = 1;
1489
1490 /* If b is the current buffer, then yy_init_buffer was _probably_
1491 * called from yyrestart() or through yy_get_next_buffer.
1492 * In that case, we don't want to reset the lineno or column.
1493 */
1494 if (b != YY_CURRENT_BUFFER){
1495 b->yy_bs_lineno = 1;
1496 b->yy_bs_column = 0;
1497 }
1498
1499 b->yy_is_interactive = 0;
1500
1501 errno = oerrno;
1502 }
1503
1504 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1505 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1506 * @param yyscanner The scanner object.
1507 */
yy_flush_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)1508 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1509 {
1510 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1511 if ( ! b )
1512 return;
1513
1514 b->yy_n_chars = 0;
1515
1516 /* We always need two end-of-buffer characters. The first causes
1517 * a transition to the end-of-buffer state. The second causes
1518 * a jam in that state.
1519 */
1520 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1521 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1522
1523 b->yy_buf_pos = &b->yy_ch_buf[0];
1524
1525 b->yy_at_bol = 1;
1526 b->yy_buffer_status = YY_BUFFER_NEW;
1527
1528 if ( b == YY_CURRENT_BUFFER )
1529 yy_load_buffer_state(yyscanner );
1530 }
1531
1532 /** Pushes the new state onto the stack. The new state becomes
1533 * the current state. This function will allocate the stack
1534 * if necessary.
1535 * @param new_buffer The new state.
1536 * @param yyscanner The scanner object.
1537 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)1538 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1539 {
1540 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1541 if (new_buffer == NULL)
1542 return;
1543
1544 yyensure_buffer_stack(yyscanner);
1545
1546 /* This block is copied from yy_switch_to_buffer. */
1547 if ( YY_CURRENT_BUFFER )
1548 {
1549 /* Flush out information for old buffer. */
1550 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1551 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1552 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1553 }
1554
1555 /* Only push if top exists. Otherwise, replace top. */
1556 if (YY_CURRENT_BUFFER)
1557 yyg->yy_buffer_stack_top++;
1558 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1559
1560 /* copied from yy_switch_to_buffer. */
1561 yy_load_buffer_state(yyscanner );
1562 yyg->yy_did_buffer_switch_on_eof = 1;
1563 }
1564
1565 /** Removes and deletes the top of the stack, if present.
1566 * The next element becomes the new top.
1567 * @param yyscanner The scanner object.
1568 */
yypop_buffer_state(yyscan_t yyscanner)1569 void yypop_buffer_state (yyscan_t yyscanner)
1570 {
1571 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1572 if (!YY_CURRENT_BUFFER)
1573 return;
1574
1575 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1576 YY_CURRENT_BUFFER_LVALUE = NULL;
1577 if (yyg->yy_buffer_stack_top > 0)
1578 --yyg->yy_buffer_stack_top;
1579
1580 if (YY_CURRENT_BUFFER) {
1581 yy_load_buffer_state(yyscanner );
1582 yyg->yy_did_buffer_switch_on_eof = 1;
1583 }
1584 }
1585
1586 /* Allocates the stack if it does not exist.
1587 * Guarantees space for at least one push.
1588 */
yyensure_buffer_stack(yyscan_t yyscanner)1589 static void yyensure_buffer_stack (yyscan_t yyscanner)
1590 {
1591 int num_to_alloc;
1592 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1593
1594 if (!yyg->yy_buffer_stack) {
1595
1596 /* First allocation is just for 2 elements, since we don't know if this
1597 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1598 * immediate realloc on the next call.
1599 */
1600 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1601 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
1602 (num_to_alloc * sizeof(struct yy_buffer_state*)
1603 , yyscanner);
1604 if ( ! yyg->yy_buffer_stack )
1605 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1606
1607 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1608
1609 yyg->yy_buffer_stack_max = num_to_alloc;
1610 yyg->yy_buffer_stack_top = 0;
1611 return;
1612 }
1613
1614 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1615
1616 /* Increase the buffer to prepare for a possible push. */
1617 yy_size_t grow_size = 8 /* arbitrary grow size */;
1618
1619 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1620 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
1621 (yyg->yy_buffer_stack,
1622 num_to_alloc * sizeof(struct yy_buffer_state*)
1623 , yyscanner);
1624 if ( ! yyg->yy_buffer_stack )
1625 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1626
1627 /* zero only the new slots.*/
1628 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1629 yyg->yy_buffer_stack_max = num_to_alloc;
1630 }
1631 }
1632
1633 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1634 * @param base the character buffer
1635 * @param size the size in bytes of the character buffer
1636 * @param yyscanner The scanner object.
1637 * @return the newly allocated buffer state object.
1638 */
yy_scan_buffer(char * base,yy_size_t size,yyscan_t yyscanner)1639 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1640 {
1641 YY_BUFFER_STATE b;
1642
1643 if ( size < 2 ||
1644 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1645 base[size-1] != YY_END_OF_BUFFER_CHAR )
1646 /* They forgot to leave room for the EOB's. */
1647 return NULL;
1648
1649 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1650 if ( ! b )
1651 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1652
1653 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1654 b->yy_buf_pos = b->yy_ch_buf = base;
1655 b->yy_is_our_buffer = 0;
1656 b->yy_input_file = NULL;
1657 b->yy_n_chars = b->yy_buf_size;
1658 b->yy_is_interactive = 0;
1659 b->yy_at_bol = 1;
1660 b->yy_fill_buffer = 0;
1661 b->yy_buffer_status = YY_BUFFER_NEW;
1662
1663 yy_switch_to_buffer(b ,yyscanner );
1664
1665 return b;
1666 }
1667
1668 /** Setup the input buffer state to scan a string. The next call to yylex() will
1669 * scan from a @e copy of @a str.
1670 * @param yystr a NUL-terminated string to scan
1671 * @param yyscanner The scanner object.
1672 * @return the newly allocated buffer state object.
1673 * @note If you want to scan bytes that may contain NUL values, then use
1674 * yy_scan_bytes() instead.
1675 */
yy_scan_string(yyconst char * yystr,yyscan_t yyscanner)1676 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1677 {
1678
1679 return yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
1680 }
1681
1682 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1683 * scan from a @e copy of @a bytes.
1684 * @param yybytes the byte buffer to scan
1685 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1686 * @param yyscanner The scanner object.
1687 * @return the newly allocated buffer state object.
1688 */
yy_scan_bytes(yyconst char * yybytes,int _yybytes_len,yyscan_t yyscanner)1689 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1690 {
1691 YY_BUFFER_STATE b;
1692 char *buf;
1693 yy_size_t n;
1694 yy_size_t i;
1695
1696 /* Get memory for full buffer, including space for trailing EOB's. */
1697 n = (yy_size_t) _yybytes_len + 2;
1698 buf = (char *) yyalloc(n ,yyscanner );
1699 if ( ! buf )
1700 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1701
1702 for ( i = 0; i < _yybytes_len; ++i )
1703 buf[i] = yybytes[i];
1704
1705 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1706
1707 b = yy_scan_buffer(buf,n ,yyscanner);
1708 if ( ! b )
1709 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1710
1711 /* It's okay to grow etc. this buffer, and we should throw it
1712 * away when we're done.
1713 */
1714 b->yy_is_our_buffer = 1;
1715
1716 return b;
1717 }
1718
1719 #ifndef YY_EXIT_FAILURE
1720 #define YY_EXIT_FAILURE 2
1721 #endif
1722
yy_fatal_error(yyconst char * msg,yyscan_t yyscanner)1723 static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1724 {
1725 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1726 (void)yyg;
1727 (void) fprintf( stderr, "%s\n", msg );
1728 exit( YY_EXIT_FAILURE );
1729 }
1730
1731 /* Redefine yyless() so it works in section 3 code. */
1732
1733 #undef yyless
1734 #define yyless(n) \
1735 do \
1736 { \
1737 /* Undo effects of setting up yytext. */ \
1738 int yyless_macro_arg = (n); \
1739 YY_LESS_LINENO(yyless_macro_arg);\
1740 yytext[yyleng] = yyg->yy_hold_char; \
1741 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1742 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1743 *yyg->yy_c_buf_p = '\0'; \
1744 yyleng = yyless_macro_arg; \
1745 } \
1746 while ( 0 )
1747
1748 /* Accessor methods (get/set functions) to struct members. */
1749
1750 /** Get the user-defined data for this scanner.
1751 * @param yyscanner The scanner object.
1752 */
yyget_extra(yyscan_t yyscanner)1753 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
1754 {
1755 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1756 return yyextra;
1757 }
1758
1759 /** Get the current line number.
1760 * @param yyscanner The scanner object.
1761 */
yyget_lineno(yyscan_t yyscanner)1762 int yyget_lineno (yyscan_t yyscanner)
1763 {
1764 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1765
1766 if (! YY_CURRENT_BUFFER)
1767 return 0;
1768
1769 return yylineno;
1770 }
1771
1772 /** Get the current column number.
1773 * @param yyscanner The scanner object.
1774 */
yyget_column(yyscan_t yyscanner)1775 int yyget_column (yyscan_t yyscanner)
1776 {
1777 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1778
1779 if (! YY_CURRENT_BUFFER)
1780 return 0;
1781
1782 return yycolumn;
1783 }
1784
1785 /** Get the input stream.
1786 * @param yyscanner The scanner object.
1787 */
yyget_in(yyscan_t yyscanner)1788 FILE *yyget_in (yyscan_t yyscanner)
1789 {
1790 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1791 return yyin;
1792 }
1793
1794 /** Get the output stream.
1795 * @param yyscanner The scanner object.
1796 */
yyget_out(yyscan_t yyscanner)1797 FILE *yyget_out (yyscan_t yyscanner)
1798 {
1799 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1800 return yyout;
1801 }
1802
1803 /** Get the length of the current token.
1804 * @param yyscanner The scanner object.
1805 */
yyget_leng(yyscan_t yyscanner)1806 int yyget_leng (yyscan_t yyscanner)
1807 {
1808 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1809 return yyleng;
1810 }
1811
1812 /** Get the current token.
1813 * @param yyscanner The scanner object.
1814 */
1815
yyget_text(yyscan_t yyscanner)1816 char *yyget_text (yyscan_t yyscanner)
1817 {
1818 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1819 return yytext;
1820 }
1821
1822 /** Set the user-defined data. This data is never touched by the scanner.
1823 * @param user_defined The data to be associated with this scanner.
1824 * @param yyscanner The scanner object.
1825 */
yyset_extra(YY_EXTRA_TYPE user_defined,yyscan_t yyscanner)1826 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1827 {
1828 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1829 yyextra = user_defined ;
1830 }
1831
1832 /** Set the current line number.
1833 * @param _line_number line number
1834 * @param yyscanner The scanner object.
1835 */
yyset_lineno(int _line_number,yyscan_t yyscanner)1836 void yyset_lineno (int _line_number , yyscan_t yyscanner)
1837 {
1838 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1839
1840 /* lineno is only valid if an input buffer exists. */
1841 if (! YY_CURRENT_BUFFER )
1842 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
1843
1844 yylineno = _line_number;
1845 }
1846
1847 /** Set the current column.
1848 * @param _column_no column number
1849 * @param yyscanner The scanner object.
1850 */
yyset_column(int _column_no,yyscan_t yyscanner)1851 void yyset_column (int _column_no , yyscan_t yyscanner)
1852 {
1853 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1854
1855 /* column is only valid if an input buffer exists. */
1856 if (! YY_CURRENT_BUFFER )
1857 YY_FATAL_ERROR( "yyset_column called with no buffer" );
1858
1859 yycolumn = _column_no;
1860 }
1861
1862 /** Set the input stream. This does not discard the current
1863 * input buffer.
1864 * @param _in_str A readable stream.
1865 * @param yyscanner The scanner object.
1866 * @see yy_switch_to_buffer
1867 */
yyset_in(FILE * _in_str,yyscan_t yyscanner)1868 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
1869 {
1870 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1871 yyin = _in_str ;
1872 }
1873
yyset_out(FILE * _out_str,yyscan_t yyscanner)1874 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
1875 {
1876 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1877 yyout = _out_str ;
1878 }
1879
yyget_debug(yyscan_t yyscanner)1880 int yyget_debug (yyscan_t yyscanner)
1881 {
1882 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1883 return yy_flex_debug;
1884 }
1885
yyset_debug(int _bdebug,yyscan_t yyscanner)1886 void yyset_debug (int _bdebug , yyscan_t yyscanner)
1887 {
1888 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1889 yy_flex_debug = _bdebug ;
1890 }
1891
1892 /* Accessor methods for yylval and yylloc */
1893
yyget_lval(yyscan_t yyscanner)1894 YYSTYPE * yyget_lval (yyscan_t yyscanner)
1895 {
1896 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1897 return yylval;
1898 }
1899
yyset_lval(YYSTYPE * yylval_param,yyscan_t yyscanner)1900 void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
1901 {
1902 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1903 yylval = yylval_param;
1904 }
1905
1906 /* User-visible API */
1907
1908 /* yylex_init is special because it creates the scanner itself, so it is
1909 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1910 * That's why we explicitly handle the declaration, instead of using our macros.
1911 */
1912
yylex_init(yyscan_t * ptr_yy_globals)1913 int yylex_init(yyscan_t* ptr_yy_globals)
1914
1915 {
1916 if (ptr_yy_globals == NULL){
1917 errno = EINVAL;
1918 return 1;
1919 }
1920
1921 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
1922
1923 if (*ptr_yy_globals == NULL){
1924 errno = ENOMEM;
1925 return 1;
1926 }
1927
1928 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1929 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1930
1931 return yy_init_globals ( *ptr_yy_globals );
1932 }
1933
1934 /* yylex_init_extra has the same functionality as yylex_init, but follows the
1935 * convention of taking the scanner as the last argument. Note however, that
1936 * this is a *pointer* to a scanner, as it will be allocated by this call (and
1937 * is the reason, too, why this function also must handle its own declaration).
1938 * The user defined value in the first argument will be available to yyalloc in
1939 * the yyextra field.
1940 */
1941
yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t * ptr_yy_globals)1942 int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
1943
1944 {
1945 struct yyguts_t dummy_yyguts;
1946
1947 yyset_extra (yy_user_defined, &dummy_yyguts);
1948
1949 if (ptr_yy_globals == NULL){
1950 errno = EINVAL;
1951 return 1;
1952 }
1953
1954 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
1955
1956 if (*ptr_yy_globals == NULL){
1957 errno = ENOMEM;
1958 return 1;
1959 }
1960
1961 /* By setting to 0xAA, we expose bugs in
1962 yy_init_globals. Leave at 0x00 for releases. */
1963 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1964
1965 yyset_extra (yy_user_defined, *ptr_yy_globals);
1966
1967 return yy_init_globals ( *ptr_yy_globals );
1968 }
1969
yy_init_globals(yyscan_t yyscanner)1970 static int yy_init_globals (yyscan_t yyscanner)
1971 {
1972 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1973 /* Initialization is the same as for the non-reentrant scanner.
1974 * This function is called from yylex_destroy(), so don't allocate here.
1975 */
1976
1977 yyg->yy_buffer_stack = NULL;
1978 yyg->yy_buffer_stack_top = 0;
1979 yyg->yy_buffer_stack_max = 0;
1980 yyg->yy_c_buf_p = NULL;
1981 yyg->yy_init = 0;
1982 yyg->yy_start = 0;
1983
1984 yyg->yy_start_stack_ptr = 0;
1985 yyg->yy_start_stack_depth = 0;
1986 yyg->yy_start_stack = NULL;
1987
1988 /* Defined in main.c */
1989 #ifdef YY_STDINIT
1990 yyin = stdin;
1991 yyout = stdout;
1992 #else
1993 yyin = NULL;
1994 yyout = NULL;
1995 #endif
1996
1997 /* For future reference: Set errno on error, since we are called by
1998 * yylex_init()
1999 */
2000 return 0;
2001 }
2002
2003 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(yyscan_t yyscanner)2004 int yylex_destroy (yyscan_t yyscanner)
2005 {
2006 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2007
2008 /* Pop the buffer stack, destroying each element. */
2009 while(YY_CURRENT_BUFFER){
2010 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2011 YY_CURRENT_BUFFER_LVALUE = NULL;
2012 yypop_buffer_state(yyscanner);
2013 }
2014
2015 /* Destroy the stack itself. */
2016 yyfree(yyg->yy_buffer_stack ,yyscanner);
2017 yyg->yy_buffer_stack = NULL;
2018
2019 /* Destroy the start condition stack. */
2020 yyfree(yyg->yy_start_stack ,yyscanner );
2021 yyg->yy_start_stack = NULL;
2022
2023 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2024 * yylex() is called, initialization will occur. */
2025 yy_init_globals( yyscanner);
2026
2027 /* Destroy the main struct (reentrant only). */
2028 yyfree ( yyscanner , yyscanner );
2029 yyscanner = NULL;
2030 return 0;
2031 }
2032
2033 /*
2034 * Internal utility routines.
2035 */
2036
2037 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n,yyscan_t yyscanner)2038 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2039 {
2040 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2041 (void)yyg;
2042
2043 int i;
2044 for ( i = 0; i < n; ++i )
2045 s1[i] = s2[i];
2046 }
2047 #endif
2048
2049 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s,yyscan_t yyscanner)2050 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2051 {
2052 int n;
2053 for ( n = 0; s[n]; ++n )
2054 ;
2055
2056 return n;
2057 }
2058 #endif
2059
yyalloc(yy_size_t size,yyscan_t yyscanner)2060 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2061 {
2062 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2063 (void)yyg;
2064 return malloc(size);
2065 }
2066
yyrealloc(void * ptr,yy_size_t size,yyscan_t yyscanner)2067 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2068 {
2069 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2070 (void)yyg;
2071
2072 /* The cast to (char *) in the following accommodates both
2073 * implementations that use char* generic pointers, and those
2074 * that use void* generic pointers. It works with the latter
2075 * because both ANSI C and C++ allow castless assignment from
2076 * any pointer type to void*, and deal with argument conversions
2077 * as though doing an assignment.
2078 */
2079 return realloc(ptr, size);
2080 }
2081
yyfree(void * ptr,yyscan_t yyscanner)2082 void yyfree (void * ptr , yyscan_t yyscanner)
2083 {
2084 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2085 (void)yyg;
2086 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2087 }
2088
2089 #define YYTABLES_NAME "yytables"
2090
2091 #line 88 "surveytargetexpressionlexer.l"
2092
2093
2094
yyerror(char const * s)2095 void yyerror(char const* s)
2096 {
2097 printf("ERROR: %s\n", s);
2098 }
2099
2100