Debian Codegraph @

src/Gui/Selection/SelectionFilter.lex.cpp

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