Debian Codegraph @

libsmartcols/src/filter-scanner.c

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