libnl 3.11.0
ematch_grammar.c
1#line 1 "lib/route/cls/ematch_grammar.c"
2 #include "nl-default.h"
3
4#line 4 "lib/route/cls/ematch_grammar.c"
5
6#define YY_INT_ALIGNED short int
7
8/* A lexical scanner generated by flex */
9
10#define FLEX_SCANNER
11#define YY_FLEX_MAJOR_VERSION 2
12#define YY_FLEX_MINOR_VERSION 6
13#define YY_FLEX_SUBMINOR_VERSION 4
14#if YY_FLEX_SUBMINOR_VERSION > 0
15#define FLEX_BETA
16#endif
17
18#ifdef yy_create_buffer
19#define ematch__create_buffer_ALREADY_DEFINED
20#else
21#define yy_create_buffer ematch__create_buffer
22#endif
23
24#ifdef yy_delete_buffer
25#define ematch__delete_buffer_ALREADY_DEFINED
26#else
27#define yy_delete_buffer ematch__delete_buffer
28#endif
29
30#ifdef yy_scan_buffer
31#define ematch__scan_buffer_ALREADY_DEFINED
32#else
33#define yy_scan_buffer ematch__scan_buffer
34#endif
35
36#ifdef yy_scan_string
37#define ematch__scan_string_ALREADY_DEFINED
38#else
39#define yy_scan_string ematch__scan_string
40#endif
41
42#ifdef yy_scan_bytes
43#define ematch__scan_bytes_ALREADY_DEFINED
44#else
45#define yy_scan_bytes ematch__scan_bytes
46#endif
47
48#ifdef yy_init_buffer
49#define ematch__init_buffer_ALREADY_DEFINED
50#else
51#define yy_init_buffer ematch__init_buffer
52#endif
53
54#ifdef yy_flush_buffer
55#define ematch__flush_buffer_ALREADY_DEFINED
56#else
57#define yy_flush_buffer ematch__flush_buffer
58#endif
59
60#ifdef yy_load_buffer_state
61#define ematch__load_buffer_state_ALREADY_DEFINED
62#else
63#define yy_load_buffer_state ematch__load_buffer_state
64#endif
65
66#ifdef yy_switch_to_buffer
67#define ematch__switch_to_buffer_ALREADY_DEFINED
68#else
69#define yy_switch_to_buffer ematch__switch_to_buffer
70#endif
71
72#ifdef yypush_buffer_state
73#define ematch_push_buffer_state_ALREADY_DEFINED
74#else
75#define yypush_buffer_state ematch_push_buffer_state
76#endif
77
78#ifdef yypop_buffer_state
79#define ematch_pop_buffer_state_ALREADY_DEFINED
80#else
81#define yypop_buffer_state ematch_pop_buffer_state
82#endif
83
84#ifdef yyensure_buffer_stack
85#define ematch_ensure_buffer_stack_ALREADY_DEFINED
86#else
87#define yyensure_buffer_stack ematch_ensure_buffer_stack
88#endif
89
90#ifdef yylex
91#define ematch_lex_ALREADY_DEFINED
92#else
93#define yylex ematch_lex
94#endif
95
96#ifdef yyrestart
97#define ematch_restart_ALREADY_DEFINED
98#else
99#define yyrestart ematch_restart
100#endif
101
102#ifdef yylex_init
103#define ematch_lex_init_ALREADY_DEFINED
104#else
105#define yylex_init ematch_lex_init
106#endif
107
108#ifdef yylex_init_extra
109#define ematch_lex_init_extra_ALREADY_DEFINED
110#else
111#define yylex_init_extra ematch_lex_init_extra
112#endif
113
114#ifdef yylex_destroy
115#define ematch_lex_destroy_ALREADY_DEFINED
116#else
117#define yylex_destroy ematch_lex_destroy
118#endif
119
120#ifdef yyget_debug
121#define ematch_get_debug_ALREADY_DEFINED
122#else
123#define yyget_debug ematch_get_debug
124#endif
125
126#ifdef yyset_debug
127#define ematch_set_debug_ALREADY_DEFINED
128#else
129#define yyset_debug ematch_set_debug
130#endif
131
132#ifdef yyget_extra
133#define ematch_get_extra_ALREADY_DEFINED
134#else
135#define yyget_extra ematch_get_extra
136#endif
137
138#ifdef yyset_extra
139#define ematch_set_extra_ALREADY_DEFINED
140#else
141#define yyset_extra ematch_set_extra
142#endif
143
144#ifdef yyget_in
145#define ematch_get_in_ALREADY_DEFINED
146#else
147#define yyget_in ematch_get_in
148#endif
149
150#ifdef yyset_in
151#define ematch_set_in_ALREADY_DEFINED
152#else
153#define yyset_in ematch_set_in
154#endif
155
156#ifdef yyget_out
157#define ematch_get_out_ALREADY_DEFINED
158#else
159#define yyget_out ematch_get_out
160#endif
161
162#ifdef yyset_out
163#define ematch_set_out_ALREADY_DEFINED
164#else
165#define yyset_out ematch_set_out
166#endif
167
168#ifdef yyget_leng
169#define ematch_get_leng_ALREADY_DEFINED
170#else
171#define yyget_leng ematch_get_leng
172#endif
173
174#ifdef yyget_text
175#define ematch_get_text_ALREADY_DEFINED
176#else
177#define yyget_text ematch_get_text
178#endif
179
180#ifdef yyget_lineno
181#define ematch_get_lineno_ALREADY_DEFINED
182#else
183#define yyget_lineno ematch_get_lineno
184#endif
185
186#ifdef yyset_lineno
187#define ematch_set_lineno_ALREADY_DEFINED
188#else
189#define yyset_lineno ematch_set_lineno
190#endif
191
192#ifdef yyget_column
193#define ematch_get_column_ALREADY_DEFINED
194#else
195#define yyget_column ematch_get_column
196#endif
197
198#ifdef yyset_column
199#define ematch_set_column_ALREADY_DEFINED
200#else
201#define yyset_column ematch_set_column
202#endif
203
204#ifdef yywrap
205#define ematch_wrap_ALREADY_DEFINED
206#else
207#define yywrap ematch_wrap
208#endif
209
210#ifdef yyget_lval
211#define ematch_get_lval_ALREADY_DEFINED
212#else
213#define yyget_lval ematch_get_lval
214#endif
215
216#ifdef yyset_lval
217#define ematch_set_lval_ALREADY_DEFINED
218#else
219#define yyset_lval ematch_set_lval
220#endif
221
222#ifdef yyalloc
223#define ematch_alloc_ALREADY_DEFINED
224#else
225#define yyalloc ematch_alloc
226#endif
227
228#ifdef yyrealloc
229#define ematch_realloc_ALREADY_DEFINED
230#else
231#define yyrealloc ematch_realloc
232#endif
233
234#ifdef yyfree
235#define ematch_free_ALREADY_DEFINED
236#else
237#define yyfree ematch_free
238#endif
239
240/* First, we deal with platform-specific or compiler-specific issues. */
241
242/* begin standard C headers. */
243#include <stdio.h>
244#include <string.h>
245#include <errno.h>
246#include <stdlib.h>
247
248/* end standard C headers. */
249
250/* flex integer type definitions */
251
252#ifndef FLEXINT_H
253#define FLEXINT_H
254
255/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
256
257#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
258
259/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
260 * if you want the limit (max/min) macros for int types.
261 */
262#ifndef __STDC_LIMIT_MACROS
263#define __STDC_LIMIT_MACROS 1
264#endif
265
266#include <inttypes.h>
267typedef int8_t flex_int8_t;
268typedef uint8_t flex_uint8_t;
269typedef int16_t flex_int16_t;
270typedef uint16_t flex_uint16_t;
271typedef int32_t flex_int32_t;
272typedef uint32_t flex_uint32_t;
273#else
274typedef signed char flex_int8_t;
275typedef short int flex_int16_t;
276typedef int flex_int32_t;
277typedef unsigned char flex_uint8_t;
278typedef unsigned short int flex_uint16_t;
279typedef unsigned int flex_uint32_t;
280
281/* Limits of integral types. */
282#ifndef INT8_MIN
283#define INT8_MIN (-128)
284#endif
285#ifndef INT16_MIN
286#define INT16_MIN (-32767-1)
287#endif
288#ifndef INT32_MIN
289#define INT32_MIN (-2147483647-1)
290#endif
291#ifndef INT8_MAX
292#define INT8_MAX (127)
293#endif
294#ifndef INT16_MAX
295#define INT16_MAX (32767)
296#endif
297#ifndef INT32_MAX
298#define INT32_MAX (2147483647)
299#endif
300#ifndef UINT8_MAX
301#define UINT8_MAX (255U)
302#endif
303#ifndef UINT16_MAX
304#define UINT16_MAX (65535U)
305#endif
306#ifndef UINT32_MAX
307#define UINT32_MAX (4294967295U)
308#endif
309
310#ifndef SIZE_MAX
311#define SIZE_MAX (~(size_t)0)
312#endif
313
314#endif /* ! C99 */
315
316#endif /* ! FLEXINT_H */
317
318/* begin standard C++ headers. */
319
320/* TODO: this is always defined, so inline it */
321#define yyconst const
322
323#if defined(__GNUC__) && __GNUC__ >= 3
324#define yynoreturn __attribute__((__noreturn__))
325#else
326#define yynoreturn
327#endif
328
329/* Returned upon end-of-file. */
330#define YY_NULL 0
331
332/* Promotes a possibly negative, possibly signed char to an
333 * integer in range [0..255] for use as an array index.
334 */
335#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
336
337/* An opaque pointer. */
338#ifndef YY_TYPEDEF_YY_SCANNER_T
339#define YY_TYPEDEF_YY_SCANNER_T
340typedef void* yyscan_t;
341#endif
342
343/* For convenience, these vars (plus the bison vars far below)
344 are macros in the reentrant scanner. */
345#define yyin yyg->yyin_r
346#define yyout yyg->yyout_r
347#define yyextra yyg->yyextra_r
348#define yyleng yyg->yyleng_r
349#define yytext yyg->yytext_r
350#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
351#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
352#define yy_flex_debug yyg->yy_flex_debug_r
353
354/* Enter a start condition. This macro really ought to take a parameter,
355 * but we do it the disgusting crufty way forced on us by the ()-less
356 * definition of BEGIN.
357 */
358#define BEGIN yyg->yy_start = 1 + 2 *
359/* Translate the current start state into a value that can be later handed
360 * to BEGIN to return to the state. The YYSTATE alias is for lex
361 * compatibility.
362 */
363#define YY_START ((yyg->yy_start - 1) / 2)
364#define YYSTATE YY_START
365/* Action number for EOF rule of a given start state. */
366#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
367/* Special action meaning "start processing a new file". */
368#define YY_NEW_FILE yyrestart( yyin , yyscanner )
369#define YY_END_OF_BUFFER_CHAR 0
370
371/* Size of default input buffer. */
372#ifndef YY_BUF_SIZE
373#ifdef __ia64__
374/* On IA-64, the buffer size is 16k, not 8k.
375 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
376 * Ditto for the __ia64__ case accordingly.
377 */
378#define YY_BUF_SIZE 32768
379#else
380#define YY_BUF_SIZE 16384
381#endif /* __ia64__ */
382#endif
383
384/* The state buf must be large enough to hold one state per character in the main buffer.
385 */
386#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
387
388#ifndef YY_TYPEDEF_YY_BUFFER_STATE
389#define YY_TYPEDEF_YY_BUFFER_STATE
390typedef struct yy_buffer_state *YY_BUFFER_STATE;
391#endif
392
393#ifndef YY_TYPEDEF_YY_SIZE_T
394#define YY_TYPEDEF_YY_SIZE_T
395typedef size_t yy_size_t;
396#endif
397
398#define EOB_ACT_CONTINUE_SCAN 0
399#define EOB_ACT_END_OF_FILE 1
400#define EOB_ACT_LAST_MATCH 2
401
402 #define YY_LESS_LINENO(n)
403 #define YY_LINENO_REWIND_TO(ptr)
404
405/* Return all but the first "n" matched characters back to the input stream. */
406#define yyless(n) \
407 do \
408 { \
409 /* Undo effects of setting up yytext. */ \
410 int yyless_macro_arg = (n); \
411 YY_LESS_LINENO(yyless_macro_arg);\
412 *yy_cp = yyg->yy_hold_char; \
413 YY_RESTORE_YY_MORE_OFFSET \
414 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
415 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
416 } \
417 while ( 0 )
418#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
419
420#ifndef YY_STRUCT_YY_BUFFER_STATE
421#define YY_STRUCT_YY_BUFFER_STATE
423 {
424 FILE *yy_input_file;
425
426 char *yy_ch_buf; /* input buffer */
427 char *yy_buf_pos; /* current position in input buffer */
428
429 /* Size of input buffer in bytes, not including room for EOB
430 * characters.
431 */
432 int yy_buf_size;
433
434 /* Number of characters read into yy_ch_buf, not including EOB
435 * characters.
436 */
437 int yy_n_chars;
438
439 /* Whether we "own" the buffer - i.e., we know we created it,
440 * and can realloc() it to grow it, and should free() it to
441 * delete it.
442 */
443 int yy_is_our_buffer;
444
445 /* Whether this is an "interactive" input source; if so, and
446 * if we're using stdio for input, then we want to use getc()
447 * instead of fread(), to make sure we stop fetching input after
448 * each newline.
449 */
450 int yy_is_interactive;
451
452 /* Whether we're considered to be at the beginning of a line.
453 * If so, '^' rules will be active on the next match, otherwise
454 * not.
455 */
456 int yy_at_bol;
457
458 int yy_bs_lineno; /**< The line count. */
459 int yy_bs_column; /**< The column count. */
460
461 /* Whether to try to fill the input buffer when we reach the
462 * end of it.
463 */
464 int yy_fill_buffer;
465
466 int yy_buffer_status;
467
468#define YY_BUFFER_NEW 0
469#define YY_BUFFER_NORMAL 1
470 /* When an EOF's been seen but there's still some text to process
471 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
472 * shouldn't try reading from the input source any more. We might
473 * still have a bunch of tokens to match, though, because of
474 * possible backing-up.
475 *
476 * When we actually see the EOF, we change the status to "new"
477 * (via yyrestart()), so that the user can continue scanning by
478 * just pointing yyin at a new input file.
479 */
480#define YY_BUFFER_EOF_PENDING 2
481
482 };
483#endif /* !YY_STRUCT_YY_BUFFER_STATE */
484
485/* We provide macros for accessing buffer states in case in the
486 * future we want to put the buffer states in a more general
487 * "scanner state".
488 *
489 * Returns the top of the stack, or NULL.
490 */
491#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
492 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
493 : NULL)
494/* Same as previous macro, but useful when we know that the buffer stack is not
495 * NULL or when we need an lvalue. For internal use only.
496 */
497#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
498
499void yyrestart ( FILE *input_file , yyscan_t yyscanner );
500void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
501YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
502void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
503void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
504void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
505void yypop_buffer_state ( yyscan_t yyscanner );
506
507static void yyensure_buffer_stack ( yyscan_t yyscanner );
508static void yy_load_buffer_state ( yyscan_t yyscanner );
509static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
510#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
511
512YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
513YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
514YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
515
516void *yyalloc ( yy_size_t , yyscan_t yyscanner );
517void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
518void yyfree ( void * , yyscan_t yyscanner );
519
520#define yy_new_buffer yy_create_buffer
521#define yy_set_interactive(is_interactive) \
522 { \
523 if ( ! YY_CURRENT_BUFFER ){ \
524 yyensure_buffer_stack (yyscanner); \
525 YY_CURRENT_BUFFER_LVALUE = \
526 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
527 } \
528 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
529 }
530#define yy_set_bol(at_bol) \
531 { \
532 if ( ! YY_CURRENT_BUFFER ){\
533 yyensure_buffer_stack (yyscanner); \
534 YY_CURRENT_BUFFER_LVALUE = \
535 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
536 } \
537 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
538 }
539#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
540
541#define ematch_wrap(yyscanner) (/*CONSTCOND*/1)
542#define YY_SKIP_YYWRAP
543typedef flex_uint8_t YY_CHAR;
544
545typedef int yy_state_type;
546
547#define yytext_ptr yytext_r
548
549static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
550static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
551static int yy_get_next_buffer ( yyscan_t yyscanner );
552static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
553
554/* Done after the current pattern has been matched and before the
555 * corresponding action - sets up yytext.
556 */
557#define YY_DO_BEFORE_ACTION \
558 yyg->yytext_ptr = yy_bp; \
559 yyleng = (int) (yy_cp - yy_bp); \
560 yyg->yy_hold_char = *yy_cp; \
561 *yy_cp = '\0'; \
562 yyg->yy_c_buf_p = yy_cp;
563#define YY_NUM_RULES 91
564#define YY_END_OF_BUFFER 92
565/* This struct is not used in this scanner,
566 but its presence is necessary. */
568 {
569 flex_int32_t yy_verify;
570 flex_int32_t yy_nxt;
571 };
572static const flex_int16_t yy_accept[393] =
573 { 0,
574 0, 0, 0, 0, 92, 90, 1, 18, 2, 26,
575 23, 24, 30, 5, 5, 12, 8, 10, 90, 90,
576 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
577 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
578 90, 91, 3, 91, 4, 90, 1, 14, 5, 90,
579 28, 90, 29, 90, 90, 90, 40, 90, 90, 90,
580 90, 90, 15, 90, 90, 90, 90, 32, 90, 90,
581 90, 33, 90, 90, 7, 9, 90, 11, 90, 90,
582 90, 90, 90, 90, 90, 90, 90, 16, 3, 6,
583 13, 19, 37, 90, 39, 90, 90, 90, 38, 17,
584
585 90, 90, 42, 90, 90, 34, 35, 90, 47, 90,
586 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
587 90, 90, 31, 36, 25, 22, 90, 90, 21, 90,
588 90, 90, 90, 90, 54, 90, 90, 48, 90, 90,
589 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
590 90, 90, 90, 90, 90, 90, 86, 90, 27, 90,
591 90, 90, 90, 90, 90, 90, 49, 90, 90, 57,
592 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
593 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
594 90, 90, 90, 90, 90, 90, 90, 90, 53, 51,
595
596 90, 43, 90, 87, 90, 90, 90, 90, 90, 90,
597 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
598 90, 90, 90, 90, 90, 90, 90, 90, 20, 90,
599 52, 88, 90, 50, 90, 90, 90, 90, 90, 90,
600 90, 76, 90, 90, 80, 90, 90, 90, 90, 90,
601 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
602 66, 90, 90, 55, 90, 90, 90, 90, 90, 90,
603 90, 90, 90, 90, 90, 65, 90, 90, 90, 90,
604 90, 60, 90, 90, 90, 90, 90, 90, 90, 59,
605 90, 90, 41, 44, 45, 46, 56, 90, 74, 90,
606
607 90, 58, 90, 90, 90, 90, 62, 90, 90, 61,
608 90, 90, 90, 90, 90, 63, 90, 90, 90, 90,
609 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
610 90, 90, 90, 90, 90, 90, 90, 90, 90, 89,
611 72, 90, 90, 90, 70, 81, 82, 90, 90, 90,
612 64, 71, 83, 90, 90, 90, 90, 90, 90, 90,
613 90, 90, 90, 90, 90, 90, 90, 90, 77, 90,
614 67, 75, 90, 68, 90, 90, 78, 90, 90, 84,
615 69, 90, 90, 90, 90, 90, 90, 85, 73, 90,
616 79, 0
617
618 } ;
619
620static const YY_CHAR yy_ec[256] =
621 { 0,
622 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
623 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
625 1, 2, 4, 5, 1, 1, 1, 6, 1, 7,
626 8, 1, 9, 1, 1, 1, 1, 10, 11, 12,
627 13, 14, 14, 15, 14, 16, 14, 1, 1, 17,
628 18, 19, 1, 1, 20, 21, 22, 23, 24, 25,
629 1, 26, 27, 1, 28, 29, 30, 31, 32, 33,
630 1, 34, 35, 36, 37, 1, 1, 38, 1, 1,
631 1, 39, 1, 1, 40, 1, 41, 42, 43, 44,
632
633 45, 46, 47, 48, 49, 1, 50, 51, 52, 53,
634 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
635 64, 1, 1, 65, 1, 1, 1, 1, 1, 1,
636 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
637 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
638 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
639 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
640 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
641 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
643
644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
649 1, 1, 1, 1, 1
650 } ;
651
652static const YY_CHAR yy_meta[66] =
653 { 0,
654 1, 2, 3, 1, 3, 2, 2, 2, 2, 1,
655 1, 1, 1, 1, 1, 1, 2, 2, 2, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660 1, 1, 1, 1, 2
661 } ;
662
663static const flex_int16_t yy_base[396] =
664 { 0,
665 0, 0, 63, 64, 537, 0, 68, 0, 538, 530,
666 538, 538, 538, 62, 69, 538, 538, 516, 55, 57,
667 52, 55, 60, 67, 72, 73, 64, 79, 75, 100,
668 115, 65, 83, 475, 102, 117, 118, 89, 121, 131,
669 482, 467, 0, 538, 538, 0, 133, 538, 167, 179,
670 538, 123, 0, 111, 124, 132, 516, 153, 138, 151,
671 169, 171, 0, 172, 170, 178, 171, 0, 129, 515,
672 517, 0, 469, 466, 0, 0, 485, 0, 183, 466,
673 41, 471, 186, 475, 482, 183, 480, 538, 0, 0,
674 0, 0, 0, 184, 0, 187, 189, 207, 0, 0,
675
676 206, 218, 0, 208, 215, 0, 0, 479, 466, 474,
677 466, 466, 194, 461, 455, 469, 461, 462, 469, 228,
678 456, 455, 0, 0, 0, 0, 226, 213, 0, 217,
679 456, 465, 464, 459, 0, 458, 438, 0, 447, 446,
680 458, 452, 439, 204, 442, 438, 237, 453, 444, 451,
681 434, 249, 236, 426, 199, 445, 0, 220, 0, 227,
682 443, 435, 425, 432, 431, 428, 0, 430, 423, 0,
683 432, 429, 427, 417, 419, 423, 417, 415, 419, 408,
684 208, 409, 152, 424, 408, 414, 406, 421, 423, 408,
685 417, 412, 415, 235, 261, 406, 413, 410, 0, 0,
686
687 411, 0, 397, 0, 414, 399, 399, 411, 401, 387,
688 400, 400, 406, 391, 385, 257, 400, 384, 389, 381,
689 395, 379, 258, 378, 391, 383, 375, 370, 0, 262,
690 0, 0, 392, 0, 382, 388, 386, 384, 371, 375,
691 384, 0, 379, 382, 0, 368, 365, 360, 365, 369,
692 364, 371, 375, 369, 361, 368, 355, 350, 360, 363,
693 0, 367, 361, 0, 266, 294, 361, 363, 345, 362,
694 350, 336, 342, 341, 354, 0, 345, 349, 332, 341,
695 333, 0, 350, 350, 331, 334, 336, 340, 333, 0,
696 266, 344, 0, 0, 0, 0, 0, 340, 0, 333,
697
698 336, 0, 336, 320, 328, 332, 0, 335, 330, 0,
699 323, 330, 325, 309, 325, 0, 324, 317, 307, 311,
700 315, 318, 310, 322, 312, 320, 306, 299, 303, 305,
701 314, 314, 300, 299, 297, 299, 304, 303, 296, 0,
702 0, 305, 293, 302, 0, 0, 0, 289, 287, 287,
703 0, 0, 0, 286, 279, 285, 283, 285, 287, 290,
704 281, 265, 275, 277, 273, 270, 266, 261, 0, 268,
705 0, 0, 264, 0, 265, 214, 0, 207, 209, 0,
706 0, 205, 170, 109, 93, 75, 53, 0, 0, 57,
707 0, 538, 325, 329, 333
708
709 } ;
710
711static const flex_int16_t yy_def[396] =
712 { 0,
713 392, 1, 393, 393, 392, 394, 392, 394, 392, 392,
714 392, 392, 392, 394, 394, 392, 392, 392, 394, 394,
715 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
716 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
717 394, 392, 395, 392, 392, 394, 392, 392, 394, 394,
718 392, 394, 394, 394, 394, 394, 394, 394, 394, 394,
719 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
720 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
721 394, 394, 394, 394, 394, 394, 394, 392, 395, 50,
722 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
723
724 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
725 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
726 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
727 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
728 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
729 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
730 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
731 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
732 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
733 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
734
735 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
736 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
737 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
738 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
739 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
740 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
741 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
742 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
743 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
744 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
745
746 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
747 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
748 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
749 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
750 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
751 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
752 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
753 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
754 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
755 394, 0, 392, 392, 392
756
757 } ;
758
759static const flex_int16_t yy_nxt[604] =
760 { 0,
761 6, 7, 7, 8, 9, 10, 11, 12, 13, 14,
762 15, 15, 15, 15, 15, 15, 16, 17, 18, 19,
763 6, 20, 6, 21, 22, 6, 23, 6, 24, 25,
764 26, 27, 28, 6, 29, 30, 31, 6, 6, 6,
765 19, 6, 20, 32, 33, 22, 34, 6, 23, 6,
766 35, 36, 26, 27, 37, 6, 38, 39, 40, 31,
767 41, 6, 6, 6, 42, 44, 44, 45, 45, 47,
768 47, 49, 49, 49, 49, 49, 49, 49, 49, 49,
769 49, 49, 49, 49, 49, 52, 54, 55, 56, 114,
770 53, 59, 57, 58, 115, 60, 61, 63, 64, 50,
771
772 65, 44, 44, 391, 62, 73, 390, 52, 54, 74,
773 55, 56, 59, 53, 57, 58, 60, 61, 55, 64,
774 63, 66, 65, 67, 50, 70, 62, 71, 58, 82,
775 72, 68, 389, 69, 47, 47, 59, 64, 75, 388,
776 60, 55, 66, 92, 67, 91, 65, 83, 105, 93,
777 58, 84, 66, 68, 67, 77, 69, 79, 64, 387,
778 78, 60, 68, 94, 69, 92, 91, 80, 65, 105,
779 85, 93, 97, 86, 81, 67, 49, 49, 49, 49,
780 49, 49, 49, 96, 68, 94, 98, 69, 90, 90,
781 90, 90, 90, 90, 90, 97, 102, 217, 90, 90,
782
783 90, 90, 90, 90, 99, 96, 100, 101, 104, 98,
784 103, 218, 386, 123, 124, 103, 125, 97, 102, 90,
785 90, 90, 90, 90, 90, 111, 126, 99, 117, 100,
786 101, 121, 103, 104, 118, 123, 124, 103, 125, 112,
787 97, 127, 128, 129, 136, 130, 172, 126, 159, 158,
788 191, 160, 137, 194, 173, 192, 214, 385, 384, 195,
789 383, 215, 382, 128, 127, 229, 129, 130, 144, 145,
790 158, 159, 146, 147, 160, 148, 194, 176, 149, 150,
791 186, 195, 151, 187, 152, 153, 154, 229, 188, 155,
792 177, 182, 230, 183, 189, 265, 247, 257, 248, 258,
793
794 184, 293, 185, 294, 295, 296, 318, 249, 381, 380,
795 379, 378, 377, 376, 230, 250, 259, 375, 265, 374,
796 373, 319, 372, 371, 293, 43, 43, 43, 43, 46,
797 370, 369, 46, 89, 89, 368, 367, 366, 365, 364,
798 363, 362, 361, 360, 359, 358, 357, 356, 355, 354,
799 353, 352, 351, 350, 349, 348, 347, 346, 345, 344,
800 343, 342, 341, 340, 339, 338, 337, 336, 335, 334,
801 333, 332, 331, 330, 329, 328, 327, 326, 325, 324,
802 323, 322, 321, 320, 317, 316, 315, 314, 313, 312,
803 311, 310, 309, 308, 307, 306, 305, 304, 303, 302,
804
805 301, 300, 299, 298, 297, 292, 291, 290, 289, 288,
806 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
807 277, 276, 275, 274, 273, 272, 271, 270, 269, 268,
808 267, 266, 264, 263, 262, 261, 260, 256, 255, 254,
809 253, 252, 251, 246, 245, 244, 243, 242, 241, 240,
810 239, 238, 237, 236, 235, 234, 233, 232, 231, 228,
811 227, 226, 225, 224, 223, 222, 221, 220, 219, 216,
812 213, 212, 211, 210, 209, 208, 207, 206, 205, 204,
813 203, 202, 201, 200, 199, 198, 197, 196, 193, 190,
814 181, 180, 179, 178, 175, 174, 171, 170, 169, 168,
815
816 167, 166, 165, 164, 163, 162, 161, 157, 156, 143,
817 142, 141, 140, 139, 138, 135, 134, 133, 132, 131,
818 122, 120, 119, 116, 113, 110, 109, 108, 107, 106,
819 95, 88, 87, 76, 51, 48, 392, 5, 392, 392,
820 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
821 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
822 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
823 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
824 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
825 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
826
827 392, 392, 392
828 } ;
829
830static const flex_int16_t yy_chk[604] =
831 { 0,
832 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
833 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
834 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
835 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
836 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
837 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
838 1, 1, 1, 1, 1, 3, 4, 3, 4, 7,
839 7, 14, 14, 14, 14, 14, 14, 14, 15, 15,
840 15, 15, 15, 15, 15, 19, 20, 21, 22, 81,
841 19, 25, 23, 24, 81, 25, 26, 27, 28, 14,
842
843 29, 3, 4, 390, 26, 32, 387, 19, 20, 32,
844 21, 22, 25, 19, 23, 24, 25, 26, 33, 28,
845 27, 30, 29, 30, 14, 31, 26, 31, 35, 38,
846 31, 30, 386, 30, 47, 47, 36, 37, 33, 385,
847 36, 33, 30, 54, 30, 52, 39, 38, 69, 55,
848 35, 38, 40, 30, 40, 35, 30, 36, 37, 384,
849 35, 36, 40, 56, 40, 54, 52, 37, 39, 69,
850 39, 55, 59, 40, 37, 40, 49, 49, 49, 49,
851 49, 49, 49, 58, 40, 56, 60, 40, 50, 50,
852 50, 50, 50, 50, 50, 59, 65, 183, 50, 50,
853
854 50, 50, 50, 50, 61, 58, 62, 64, 67, 60,
855 66, 183, 383, 94, 96, 86, 97, 79, 65, 50,
856 50, 50, 50, 50, 50, 79, 98, 61, 83, 62,
857 64, 86, 66, 67, 83, 94, 96, 86, 97, 79,
858 79, 101, 102, 104, 113, 105, 144, 98, 128, 127,
859 155, 130, 113, 158, 144, 155, 181, 382, 379, 160,
860 378, 181, 376, 102, 101, 194, 104, 105, 120, 120,
861 127, 128, 120, 120, 130, 120, 158, 147, 120, 120,
862 153, 160, 120, 153, 120, 120, 120, 194, 153, 120,
863 147, 152, 195, 152, 153, 230, 216, 223, 216, 223,
864
865 152, 265, 152, 266, 266, 266, 291, 216, 375, 373,
866 370, 368, 367, 366, 195, 216, 223, 365, 230, 364,
867 363, 291, 362, 361, 265, 393, 393, 393, 393, 394,
868 360, 359, 394, 395, 395, 358, 357, 356, 355, 354,
869 350, 349, 348, 344, 343, 342, 339, 338, 337, 336,
870 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
871 325, 324, 323, 322, 321, 320, 319, 318, 317, 315,
872 314, 313, 312, 311, 309, 308, 306, 305, 304, 303,
873 301, 300, 298, 292, 289, 288, 287, 286, 285, 284,
874 283, 281, 280, 279, 278, 277, 275, 274, 273, 272,
875
876 271, 270, 269, 268, 267, 263, 262, 260, 259, 258,
877 257, 256, 255, 254, 253, 252, 251, 250, 249, 248,
878 247, 246, 244, 243, 241, 240, 239, 238, 237, 236,
879 235, 233, 228, 227, 226, 225, 224, 222, 221, 220,
880 219, 218, 217, 215, 214, 213, 212, 211, 210, 209,
881 208, 207, 206, 205, 203, 201, 198, 197, 196, 193,
882 192, 191, 190, 189, 188, 187, 186, 185, 184, 182,
883 180, 179, 178, 177, 176, 175, 174, 173, 172, 171,
884 169, 168, 166, 165, 164, 163, 162, 161, 156, 154,
885 151, 150, 149, 148, 146, 145, 143, 142, 141, 140,
886
887 139, 137, 136, 134, 133, 132, 131, 122, 121, 119,
888 118, 117, 116, 115, 114, 112, 111, 110, 109, 108,
889 87, 85, 84, 82, 80, 77, 74, 73, 71, 70,
890 57, 42, 41, 34, 18, 10, 5, 392, 392, 392,
891 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
892 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
893 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
894 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
895 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
896 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
897
898 392, 392, 392
899 } ;
900
901/* The intent behind this definition is that it'll catch
902 * any uses of REJECT which flex missed.
903 */
904#define REJECT reject_used_but_not_detected
905#define yymore() yymore_used_but_not_detected
906#define YY_MORE_ADJ 0
907#define YY_RESTORE_YY_MORE_OFFSET
908#line 1 "lib/route/cls/ematch_grammar.l"
909/* SPDX-License-Identifier: LGPL-2.1-only */
910/*
911 * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch>
912 */
913
914#line 10 "lib/route/cls/ematch_grammar.l"
915 #include <linux/tc_ematch/tc_em_cmp.h>
916
917 #include <netlink/netlink.h>
918 #include <netlink/route/cls/ematch.h>
919 #include <netlink/route/cls/ematch/cmp.h>
920
921 #include "nl-route.h"
922
923 #include "ematch_syntax.h"
924
925 int ematch_get_column(yyscan_t);
926 void ematch_set_column(int, yyscan_t);
927#line 927 "lib/route/cls/ematch_grammar.c"
928#define YY_NO_INPUT 1
929
930#line 930 "lib/route/cls/ematch_grammar.c"
931
932#define INITIAL 0
933#define QUOTE 1
934
935#ifndef YY_NO_UNISTD_H
936/* Special case for "unistd.h", since it is non-ANSI. We include it way
937 * down here because we want the user's section 1 to have been scanned first.
938 * The user has a chance to override it with an option.
939 */
940#include <unistd.h>
941#endif
942
943#ifndef YY_EXTRA_TYPE
944#define YY_EXTRA_TYPE void *
945#endif
946
947/* Holds the entire state of the reentrant scanner. */
949 {
950
951 /* User-defined. Not touched by flex. */
952 YY_EXTRA_TYPE yyextra_r;
953
954 /* The rest are the same as the globals declared in the non-reentrant scanner. */
955 FILE *yyin_r, *yyout_r;
956 size_t yy_buffer_stack_top; /**< index of top of stack. */
957 size_t yy_buffer_stack_max; /**< capacity of stack. */
958 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
959 char yy_hold_char;
960 int yy_n_chars;
961 int yyleng_r;
962 char *yy_c_buf_p;
963 int yy_init;
964 int yy_start;
965 int yy_did_buffer_switch_on_eof;
966 int yy_start_stack_ptr;
967 int yy_start_stack_depth;
968 int *yy_start_stack;
969 yy_state_type yy_last_accepting_state;
970 char* yy_last_accepting_cpos;
971
972 int yylineno_r;
973 int yy_flex_debug_r;
974
975 char *yytext_r;
976 int yy_more_flag;
977 int yy_more_len;
978
979 YYSTYPE * yylval_r;
980
981 }; /* end struct yyguts_t */
982
983static int yy_init_globals ( yyscan_t yyscanner );
984
985 /* This must go here because YYSTYPE and YYLTYPE are included
986 * from bison output in section 1.*/
987 # define yylval yyg->yylval_r
988
989int yylex_init (yyscan_t* scanner);
990
991int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
992
993/* Accessor methods to globals.
994 These are made visible to non-reentrant scanners for convenience. */
995
996int yylex_destroy ( yyscan_t yyscanner );
997
998int yyget_debug ( yyscan_t yyscanner );
999
1000void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1001
1002YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1003
1004void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1005
1006FILE *yyget_in ( yyscan_t yyscanner );
1007
1008void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
1009
1010FILE *yyget_out ( yyscan_t yyscanner );
1011
1012void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
1013
1014 int yyget_leng ( yyscan_t yyscanner );
1015
1016char *yyget_text ( yyscan_t yyscanner );
1017
1018int yyget_lineno ( yyscan_t yyscanner );
1019
1020void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1021
1022int yyget_column ( yyscan_t yyscanner );
1023
1024void yyset_column ( int _column_no , yyscan_t yyscanner );
1025
1026YYSTYPE * yyget_lval ( yyscan_t yyscanner );
1027
1028void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
1029
1030/* Macros after this point can all be overridden by user definitions in
1031 * section 1.
1032 */
1033
1034#ifndef YY_SKIP_YYWRAP
1035#ifdef __cplusplus
1036extern "C" int yywrap ( yyscan_t yyscanner );
1037#else
1038extern int yywrap ( yyscan_t yyscanner );
1039#endif
1040#endif
1041
1042#ifndef YY_NO_UNPUT
1043
1044#endif
1045
1046#ifndef yytext_ptr
1047static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1048#endif
1049
1050#ifdef YY_NEED_STRLEN
1051static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1052#endif
1053
1054#ifndef YY_NO_INPUT
1055#ifdef __cplusplus
1056static int yyinput ( yyscan_t yyscanner );
1057#else
1058static int input ( yyscan_t yyscanner );
1059#endif
1060
1061#endif
1062
1063/* Amount of stuff to slurp up with each read. */
1064#ifndef YY_READ_BUF_SIZE
1065#ifdef __ia64__
1066/* On IA-64, the buffer size is 16k, not 8k */
1067#define YY_READ_BUF_SIZE 16384
1068#else
1069#define YY_READ_BUF_SIZE 8192
1070#endif /* __ia64__ */
1071#endif
1072
1073/* Copy whatever the last rule matched to the standard output. */
1074#ifndef ECHO
1075/* This used to be an fputs(), but since the string might contain NUL's,
1076 * we now use fwrite().
1077 */
1078#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1079#endif
1080
1081/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1082 * is returned in "result".
1083 */
1084#ifndef YY_INPUT
1085#define YY_INPUT(buf,result,max_size) \
1086 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1087 { \
1088 int c = '*'; \
1089 int n; \
1090 for ( n = 0; n < max_size && \
1091 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1092 buf[n] = (char) c; \
1093 if ( c == '\n' ) \
1094 buf[n++] = (char) c; \
1095 if ( c == EOF && ferror( yyin ) ) \
1096 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1097 result = n; \
1098 } \
1099 else \
1100 { \
1101 errno=0; \
1102 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1103 { \
1104 if( errno != EINTR) \
1105 { \
1106 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1107 break; \
1108 } \
1109 errno=0; \
1110 clearerr(yyin); \
1111 } \
1112 }\
1113\
1114
1115#endif
1116
1117/* No semi-colon after return; correct usage is to write "yyterminate();" -
1118 * we don't want an extra ';' after the "return" because that will cause
1119 * some compilers to complain about unreachable statements.
1120 */
1121#ifndef yyterminate
1122#define yyterminate() return YY_NULL
1123#endif
1124
1125/* Number of entries by which start-condition stack grows. */
1126#ifndef YY_START_STACK_INCR
1127#define YY_START_STACK_INCR 25
1128#endif
1129
1130/* Report a fatal error. */
1131#ifndef YY_FATAL_ERROR
1132#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1133#endif
1134
1135/* end tables serialization structures and prototypes */
1136
1137/* Default declaration of generated scanner - a define so the user can
1138 * easily add parameters.
1139 */
1140#ifndef YY_DECL
1141#define YY_DECL_IS_OURS 1
1142
1143extern int yylex \
1144 (YYSTYPE * yylval_param , yyscan_t yyscanner);
1145
1146#define YY_DECL int yylex \
1147 (YYSTYPE * yylval_param , yyscan_t yyscanner)
1148#endif /* !YY_DECL */
1149
1150/* Code executed at the beginning of each rule, after yytext and yyleng
1151 * have been set up.
1152 */
1153#ifndef YY_USER_ACTION
1154#define YY_USER_ACTION
1155#endif
1156
1157/* Code executed at the end of each rule. */
1158#ifndef YY_BREAK
1159#define YY_BREAK /*LINTED*/break;
1160#endif
1161
1162#define YY_RULE_SETUP \
1163 YY_USER_ACTION
1164
1165/** The main scanner function which does all the work.
1166 */
1167YY_DECL
1168{
1169 yy_state_type yy_current_state;
1170 char *yy_cp, *yy_bp;
1171 int yy_act;
1172 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1173
1174 yylval = yylval_param;
1175
1176 if ( !yyg->yy_init )
1177 {
1178 yyg->yy_init = 1;
1179
1180#ifdef YY_USER_INIT
1181 YY_USER_INIT;
1182#endif
1183
1184 if ( ! yyg->yy_start )
1185 yyg->yy_start = 1; /* first start state */
1186
1187 if ( ! yyin )
1188 yyin = stdin;
1189
1190 if ( ! yyout )
1191 yyout = stdout;
1192
1193 if ( ! YY_CURRENT_BUFFER ) {
1194 yyensure_buffer_stack (yyscanner);
1195 YY_CURRENT_BUFFER_LVALUE =
1196 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1197 }
1198
1199 yy_load_buffer_state( yyscanner );
1200 }
1201
1202 {
1203#line 35 "lib/route/cls/ematch_grammar.l"
1204
1205
1206#line 1206 "lib/route/cls/ematch_grammar.c"
1207
1208 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1209 {
1210 yy_cp = yyg->yy_c_buf_p;
1211
1212 /* Support of yytext. */
1213 *yy_cp = yyg->yy_hold_char;
1214
1215 /* yy_bp points to the position in yy_ch_buf of the start of
1216 * the current run.
1217 */
1218 yy_bp = yy_cp;
1219
1220 yy_current_state = yyg->yy_start;
1221yy_match:
1222 do
1223 {
1224 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1225 if ( yy_accept[yy_current_state] )
1226 {
1227 yyg->yy_last_accepting_state = yy_current_state;
1228 yyg->yy_last_accepting_cpos = yy_cp;
1229 }
1230 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1231 {
1232 yy_current_state = (int) yy_def[yy_current_state];
1233 if ( yy_current_state >= 393 )
1234 yy_c = yy_meta[yy_c];
1235 }
1236 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1237 ++yy_cp;
1238 }
1239 while ( yy_base[yy_current_state] != 538 );
1240
1241yy_find_action:
1242 yy_act = yy_accept[yy_current_state];
1243 if ( yy_act == 0 )
1244 { /* have to back up */
1245 yy_cp = yyg->yy_last_accepting_cpos;
1246 yy_current_state = yyg->yy_last_accepting_state;
1247 yy_act = yy_accept[yy_current_state];
1248 }
1249
1250 YY_DO_BEFORE_ACTION;
1251
1252do_action: /* This label is used only to access EOF actions. */
1253
1254 switch ( yy_act )
1255 { /* beginning of action switch */
1256 case 0: /* must back up */
1257 /* undo the effects of YY_DO_BEFORE_ACTION */
1258 *yy_cp = yyg->yy_hold_char;
1259 yy_cp = yyg->yy_last_accepting_cpos;
1260 yy_current_state = yyg->yy_last_accepting_state;
1261 goto yy_find_action;
1262
1263case 1:
1264/* rule 1 can match eol */
1265YY_RULE_SETUP
1266#line 37 "lib/route/cls/ematch_grammar.l"
1267
1268 YY_BREAK
1269case 2:
1270YY_RULE_SETUP
1271#line 39 "lib/route/cls/ematch_grammar.l"
1272{
1273 NL_DBG(4, "Beginning of quote\n");
1274 yylval->q.len = 32;
1275 if (!(yylval->q.data = calloc(1, yylval->q.len)))
1276 return ERROR;
1277
1278 yylval->q.index = 0;
1279 BEGIN(QUOTE);
1280 }
1281 YY_BREAK
1282case 3:
1283YY_RULE_SETUP
1284#line 49 "lib/route/cls/ematch_grammar.l"
1285{
1286 memcpy(yylval->q.data + yylval->q.index, yytext,
1287 strlen(yytext));
1288 yylval->q.index += strlen(yytext);
1289 }
1290 YY_BREAK
1291case 4:
1292YY_RULE_SETUP
1293#line 55 "lib/route/cls/ematch_grammar.l"
1294{
1295 BEGIN(0);
1296 return QUOTED;
1297 }
1298 YY_BREAK
1299case 5:
1300#line 62 "lib/route/cls/ematch_grammar.l"
1301case 6:
1302YY_RULE_SETUP
1303#line 62 "lib/route/cls/ematch_grammar.l"
1304{
1305 yylval->i = strtoul(yytext, NULL, 0);
1306 return NUMBER;
1307 }
1308 YY_BREAK
1309case 7:
1310#line 68 "lib/route/cls/ematch_grammar.l"
1311case 8:
1312YY_RULE_SETUP
1313#line 68 "lib/route/cls/ematch_grammar.l"
1314return KW_EQ;
1315 YY_BREAK
1316case 9:
1317#line 70 "lib/route/cls/ematch_grammar.l"
1318case 10:
1319YY_RULE_SETUP
1320#line 70 "lib/route/cls/ematch_grammar.l"
1321return KW_GT;
1322 YY_BREAK
1323case 11:
1324#line 72 "lib/route/cls/ematch_grammar.l"
1325case 12:
1326YY_RULE_SETUP
1327#line 72 "lib/route/cls/ematch_grammar.l"
1328return KW_LT;
1329 YY_BREAK
1330case 13:
1331#line 75 "lib/route/cls/ematch_grammar.l"
1332case 14:
1333YY_RULE_SETUP
1334#line 75 "lib/route/cls/ematch_grammar.l"
1335{ yylval->i = TCF_EM_REL_AND; return LOGIC; }
1336 YY_BREAK
1337case 15:
1338#line 77 "lib/route/cls/ematch_grammar.l"
1339case 16:
1340YY_RULE_SETUP
1341#line 77 "lib/route/cls/ematch_grammar.l"
1342{ yylval->i = TCF_EM_REL_OR; return LOGIC; }
1343 YY_BREAK
1344case 17:
1345#line 79 "lib/route/cls/ematch_grammar.l"
1346case 18:
1347YY_RULE_SETUP
1348#line 79 "lib/route/cls/ematch_grammar.l"
1349return NOT;
1350 YY_BREAK
1351case 19:
1352YY_RULE_SETUP
1353#line 81 "lib/route/cls/ematch_grammar.l"
1354{ yylval->i = TCF_EM_CMP; return EMATCH_CMP; }
1355 YY_BREAK
1356case 20:
1357YY_RULE_SETUP
1358#line 82 "lib/route/cls/ematch_grammar.l"
1359{ yylval->i = TCF_EM_NBYTE; return EMATCH_NBYTE; }
1360 YY_BREAK
1361case 21:
1362YY_RULE_SETUP
1363#line 83 "lib/route/cls/ematch_grammar.l"
1364{ yylval->i = TCF_EM_TEXT; return EMATCH_TEXT; }
1365 YY_BREAK
1366case 22:
1367YY_RULE_SETUP
1368#line 84 "lib/route/cls/ematch_grammar.l"
1369{ yylval->i = TCF_EM_META; return EMATCH_META; }
1370 YY_BREAK
1371case 23:
1372YY_RULE_SETUP
1373#line 86 "lib/route/cls/ematch_grammar.l"
1374return KW_OPEN;
1375 YY_BREAK
1376case 24:
1377YY_RULE_SETUP
1378#line 87 "lib/route/cls/ematch_grammar.l"
1379return KW_CLOSE;
1380 YY_BREAK
1381case 25:
1382#line 89 "lib/route/cls/ematch_grammar.l"
1383case 26:
1384YY_RULE_SETUP
1385#line 89 "lib/route/cls/ematch_grammar.l"
1386return KW_MASK;
1387 YY_BREAK
1388case 27:
1389#line 91 "lib/route/cls/ematch_grammar.l"
1390case 28:
1391YY_RULE_SETUP
1392#line 91 "lib/route/cls/ematch_grammar.l"
1393return KW_SHIFT;
1394 YY_BREAK
1395case 29:
1396YY_RULE_SETUP
1397#line 92 "lib/route/cls/ematch_grammar.l"
1398return KW_AT;
1399 YY_BREAK
1400case 30:
1401YY_RULE_SETUP
1402#line 93 "lib/route/cls/ematch_grammar.l"
1403return KW_PLUS;
1404 YY_BREAK
1405case 31:
1406YY_RULE_SETUP
1407#line 94 "lib/route/cls/ematch_grammar.l"
1408return KW_FROM;
1409 YY_BREAK
1410case 32:
1411YY_RULE_SETUP
1412#line 95 "lib/route/cls/ematch_grammar.l"
1413return KW_TO;
1414 YY_BREAK
1415case 33:
1416YY_RULE_SETUP
1417#line 97 "lib/route/cls/ematch_grammar.l"
1418{ yylval->i = TCF_EM_ALIGN_U8; return ALIGN; }
1419 YY_BREAK
1420case 34:
1421YY_RULE_SETUP
1422#line 98 "lib/route/cls/ematch_grammar.l"
1423{ yylval->i = TCF_EM_ALIGN_U16; return ALIGN; }
1424 YY_BREAK
1425case 35:
1426YY_RULE_SETUP
1427#line 99 "lib/route/cls/ematch_grammar.l"
1428{ yylval->i = TCF_EM_ALIGN_U32; return ALIGN; }
1429 YY_BREAK
1430case 36:
1431#line 102 "lib/route/cls/ematch_grammar.l"
1432case 37:
1433YY_RULE_SETUP
1434#line 102 "lib/route/cls/ematch_grammar.l"
1435{ yylval->i = TCF_LAYER_LINK; return LAYER; }
1436 YY_BREAK
1437case 38:
1438#line 104 "lib/route/cls/ematch_grammar.l"
1439case 39:
1440#line 105 "lib/route/cls/ematch_grammar.l"
1441case 40:
1442YY_RULE_SETUP
1443#line 105 "lib/route/cls/ematch_grammar.l"
1444{ yylval->i = TCF_LAYER_NETWORK; return LAYER; }
1445 YY_BREAK
1446case 41:
1447#line 107 "lib/route/cls/ematch_grammar.l"
1448case 42:
1449YY_RULE_SETUP
1450#line 107 "lib/route/cls/ematch_grammar.l"
1451{ yylval->i = TCF_LAYER_TRANSPORT; return LAYER; }
1452 YY_BREAK
1453case 43:
1454YY_RULE_SETUP
1455#line 109 "lib/route/cls/ematch_grammar.l"
1456return META_RANDOM;
1457 YY_BREAK
1458case 44:
1459YY_RULE_SETUP
1460#line 110 "lib/route/cls/ematch_grammar.l"
1461return META_LOADAVG_0;
1462 YY_BREAK
1463case 45:
1464YY_RULE_SETUP
1465#line 111 "lib/route/cls/ematch_grammar.l"
1466return META_LOADAVG_1;
1467 YY_BREAK
1468case 46:
1469YY_RULE_SETUP
1470#line 112 "lib/route/cls/ematch_grammar.l"
1471return META_LOADAVG_2;
1472 YY_BREAK
1473case 47:
1474YY_RULE_SETUP
1475#line 113 "lib/route/cls/ematch_grammar.l"
1476return META_DEV;
1477 YY_BREAK
1478case 48:
1479YY_RULE_SETUP
1480#line 114 "lib/route/cls/ematch_grammar.l"
1481return META_PRIO;
1482 YY_BREAK
1483case 49:
1484YY_RULE_SETUP
1485#line 115 "lib/route/cls/ematch_grammar.l"
1486return META_PROTO;
1487 YY_BREAK
1488case 50:
1489YY_RULE_SETUP
1490#line 116 "lib/route/cls/ematch_grammar.l"
1491return META_PKTTYPE;
1492 YY_BREAK
1493case 51:
1494YY_RULE_SETUP
1495#line 117 "lib/route/cls/ematch_grammar.l"
1496return META_PKTLEN;
1497 YY_BREAK
1498case 52:
1499YY_RULE_SETUP
1500#line 118 "lib/route/cls/ematch_grammar.l"
1501return META_DATALEN;
1502 YY_BREAK
1503case 53:
1504YY_RULE_SETUP
1505#line 119 "lib/route/cls/ematch_grammar.l"
1506return META_MACLEN;
1507 YY_BREAK
1508case 54:
1509YY_RULE_SETUP
1510#line 120 "lib/route/cls/ematch_grammar.l"
1511return META_MARK;
1512 YY_BREAK
1513case 55:
1514YY_RULE_SETUP
1515#line 121 "lib/route/cls/ematch_grammar.l"
1516return META_TCINDEX;
1517 YY_BREAK
1518case 56:
1519YY_RULE_SETUP
1520#line 122 "lib/route/cls/ematch_grammar.l"
1521return META_RTCLASSID;
1522 YY_BREAK
1523case 57:
1524YY_RULE_SETUP
1525#line 123 "lib/route/cls/ematch_grammar.l"
1526return META_RTIIF;
1527 YY_BREAK
1528case 58:
1529YY_RULE_SETUP
1530#line 124 "lib/route/cls/ematch_grammar.l"
1531return META_SK_FAMILY;
1532 YY_BREAK
1533case 59:
1534YY_RULE_SETUP
1535#line 125 "lib/route/cls/ematch_grammar.l"
1536return META_SK_STATE;
1537 YY_BREAK
1538case 60:
1539YY_RULE_SETUP
1540#line 126 "lib/route/cls/ematch_grammar.l"
1541return META_SK_REUSE;
1542 YY_BREAK
1543case 61:
1544YY_RULE_SETUP
1545#line 127 "lib/route/cls/ematch_grammar.l"
1546return META_SK_REFCNT;
1547 YY_BREAK
1548case 62:
1549YY_RULE_SETUP
1550#line 128 "lib/route/cls/ematch_grammar.l"
1551return META_SK_RCVBUF;
1552 YY_BREAK
1553case 63:
1554YY_RULE_SETUP
1555#line 129 "lib/route/cls/ematch_grammar.l"
1556return META_SK_SNDBUF;
1557 YY_BREAK
1558case 64:
1559YY_RULE_SETUP
1560#line 130 "lib/route/cls/ematch_grammar.l"
1561return META_SK_SHUTDOWN;
1562 YY_BREAK
1563case 65:
1564YY_RULE_SETUP
1565#line 131 "lib/route/cls/ematch_grammar.l"
1566return META_SK_PROTO;
1567 YY_BREAK
1568case 66:
1569YY_RULE_SETUP
1570#line 132 "lib/route/cls/ematch_grammar.l"
1571return META_SK_TYPE;
1572 YY_BREAK
1573case 67:
1574YY_RULE_SETUP
1575#line 133 "lib/route/cls/ematch_grammar.l"
1576return META_SK_RMEM_ALLOC;
1577 YY_BREAK
1578case 68:
1579YY_RULE_SETUP
1580#line 134 "lib/route/cls/ematch_grammar.l"
1581return META_SK_WMEM_ALLOC;
1582 YY_BREAK
1583case 69:
1584YY_RULE_SETUP
1585#line 135 "lib/route/cls/ematch_grammar.l"
1586return META_SK_WMEM_QUEUED;
1587 YY_BREAK
1588case 70:
1589YY_RULE_SETUP
1590#line 136 "lib/route/cls/ematch_grammar.l"
1591return META_SK_RCV_QLEN;
1592 YY_BREAK
1593case 71:
1594YY_RULE_SETUP
1595#line 137 "lib/route/cls/ematch_grammar.l"
1596return META_SK_SND_QLEN;
1597 YY_BREAK
1598case 72:
1599YY_RULE_SETUP
1600#line 138 "lib/route/cls/ematch_grammar.l"
1601return META_SK_ERR_QLEN;
1602 YY_BREAK
1603case 73:
1604YY_RULE_SETUP
1605#line 139 "lib/route/cls/ematch_grammar.l"
1606return META_SK_FORWARD_ALLOCS;
1607 YY_BREAK
1608case 74:
1609YY_RULE_SETUP
1610#line 140 "lib/route/cls/ematch_grammar.l"
1611return META_SK_ALLOCS;
1612 YY_BREAK
1613case 75:
1614YY_RULE_SETUP
1615#line 141 "lib/route/cls/ematch_grammar.l"
1616return META_SK_ROUTE_CAPS;
1617 YY_BREAK
1618case 76:
1619YY_RULE_SETUP
1620#line 142 "lib/route/cls/ematch_grammar.l"
1621return META_SK_HASH;
1622 YY_BREAK
1623case 77:
1624YY_RULE_SETUP
1625#line 143 "lib/route/cls/ematch_grammar.l"
1626return META_SK_LINGERTIME;
1627 YY_BREAK
1628case 78:
1629YY_RULE_SETUP
1630#line 144 "lib/route/cls/ematch_grammar.l"
1631return META_SK_ACK_BACKLOG;
1632 YY_BREAK
1633case 79:
1634YY_RULE_SETUP
1635#line 145 "lib/route/cls/ematch_grammar.l"
1636return META_SK_MAX_ACK_BACKLOG;
1637 YY_BREAK
1638case 80:
1639YY_RULE_SETUP
1640#line 146 "lib/route/cls/ematch_grammar.l"
1641return META_SK_PRIO;
1642 YY_BREAK
1643case 81:
1644YY_RULE_SETUP
1645#line 147 "lib/route/cls/ematch_grammar.l"
1646return META_SK_RCVLOWAT;
1647 YY_BREAK
1648case 82:
1649YY_RULE_SETUP
1650#line 148 "lib/route/cls/ematch_grammar.l"
1651return META_SK_RCVTIMEO;
1652 YY_BREAK
1653case 83:
1654YY_RULE_SETUP
1655#line 149 "lib/route/cls/ematch_grammar.l"
1656return META_SK_SNDTIMEO;
1657 YY_BREAK
1658case 84:
1659YY_RULE_SETUP
1660#line 150 "lib/route/cls/ematch_grammar.l"
1661return META_SK_SENDMSG_OFF;
1662 YY_BREAK
1663case 85:
1664YY_RULE_SETUP
1665#line 151 "lib/route/cls/ematch_grammar.l"
1666return META_SK_WRITE_PENDING;
1667 YY_BREAK
1668case 86:
1669YY_RULE_SETUP
1670#line 152 "lib/route/cls/ematch_grammar.l"
1671return META_VLAN;
1672 YY_BREAK
1673case 87:
1674YY_RULE_SETUP
1675#line 153 "lib/route/cls/ematch_grammar.l"
1676return META_RXHASH;
1677 YY_BREAK
1678case 88:
1679YY_RULE_SETUP
1680#line 155 "lib/route/cls/ematch_grammar.l"
1681return META_DEVNAME;
1682 YY_BREAK
1683case 89:
1684YY_RULE_SETUP
1685#line 156 "lib/route/cls/ematch_grammar.l"
1686return META_SK_BOUND_IF;
1687 YY_BREAK
1688case 90:
1689YY_RULE_SETUP
1690#line 159 "lib/route/cls/ematch_grammar.l"
1691{
1692 yylval->s = strdup(yytext);
1693 if (yylval->s == NULL)
1694 return ERROR;
1695 NL_DBG(4, "lex STR=%s\n", yylval->s);
1696 return STR;
1697 }
1698 YY_BREAK
1699case 91:
1700YY_RULE_SETUP
1701#line 166 "lib/route/cls/ematch_grammar.l"
1702ECHO;
1703 YY_BREAK
1704#line 1704 "lib/route/cls/ematch_grammar.c"
1705case YY_STATE_EOF(INITIAL):
1706case YY_STATE_EOF(QUOTE):
1707 yyterminate();
1708
1709 case YY_END_OF_BUFFER:
1710 {
1711 /* Amount of text matched not including the EOB char. */
1712 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1713
1714 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1715 *yy_cp = yyg->yy_hold_char;
1716 YY_RESTORE_YY_MORE_OFFSET
1717
1718 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1719 {
1720 /* We're scanning a new file or input source. It's
1721 * possible that this happened because the user
1722 * just pointed yyin at a new source and called
1723 * yylex(). If so, then we have to assure
1724 * consistency between YY_CURRENT_BUFFER and our
1725 * globals. Here is the right place to do so, because
1726 * this is the first action (other than possibly a
1727 * back-up) that will match for the new input source.
1728 */
1729 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1730 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1731 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1732 }
1733
1734 /* Note that here we test for yy_c_buf_p "<=" to the position
1735 * of the first EOB in the buffer, since yy_c_buf_p will
1736 * already have been incremented past the NUL character
1737 * (since all states make transitions on EOB to the
1738 * end-of-buffer state). Contrast this with the test
1739 * in input().
1740 */
1741 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1742 { /* This was really a NUL. */
1743 yy_state_type yy_next_state;
1744
1745 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1746
1747 yy_current_state = yy_get_previous_state( yyscanner );
1748
1749 /* Okay, we're now positioned to make the NUL
1750 * transition. We couldn't have
1751 * yy_get_previous_state() go ahead and do it
1752 * for us because it doesn't know how to deal
1753 * with the possibility of jamming (and we don't
1754 * want to build jamming into it because then it
1755 * will run more slowly).
1756 */
1757
1758 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1759
1760 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1761
1762 if ( yy_next_state )
1763 {
1764 /* Consume the NUL. */
1765 yy_cp = ++yyg->yy_c_buf_p;
1766 yy_current_state = yy_next_state;
1767 goto yy_match;
1768 }
1769
1770 else
1771 {
1772 yy_cp = yyg->yy_c_buf_p;
1773 goto yy_find_action;
1774 }
1775 }
1776
1777 else switch ( yy_get_next_buffer( yyscanner ) )
1778 {
1779 case EOB_ACT_END_OF_FILE:
1780 {
1781 yyg->yy_did_buffer_switch_on_eof = 0;
1782
1783 if ( yywrap( yyscanner ) )
1784 {
1785 /* Note: because we've taken care in
1786 * yy_get_next_buffer() to have set up
1787 * yytext, we can now set up
1788 * yy_c_buf_p so that if some total
1789 * hoser (like flex itself) wants to
1790 * call the scanner after we return the
1791 * YY_NULL, it'll still work - another
1792 * YY_NULL will get returned.
1793 */
1794 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1795
1796 yy_act = YY_STATE_EOF(YY_START);
1797 goto do_action;
1798 }
1799
1800 else
1801 {
1802 if ( ! yyg->yy_did_buffer_switch_on_eof )
1803 YY_NEW_FILE;
1804 }
1805 break;
1806 }
1807
1808 case EOB_ACT_CONTINUE_SCAN:
1809 yyg->yy_c_buf_p =
1810 yyg->yytext_ptr + yy_amount_of_matched_text;
1811
1812 yy_current_state = yy_get_previous_state( yyscanner );
1813
1814 yy_cp = yyg->yy_c_buf_p;
1815 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1816 goto yy_match;
1817
1818 case EOB_ACT_LAST_MATCH:
1819 yyg->yy_c_buf_p =
1820 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1821
1822 yy_current_state = yy_get_previous_state( yyscanner );
1823
1824 yy_cp = yyg->yy_c_buf_p;
1825 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1826 goto yy_find_action;
1827 }
1828 break;
1829 }
1830
1831 default:
1832 YY_FATAL_ERROR(
1833 "fatal flex scanner internal error--no action found" );
1834 } /* end of action switch */
1835 } /* end of scanning one token */
1836 } /* end of user's declarations */
1837} /* end of yylex */
1838
1839/* yy_get_next_buffer - try to read in a new buffer
1840 *
1841 * Returns a code representing an action:
1842 * EOB_ACT_LAST_MATCH -
1843 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1844 * EOB_ACT_END_OF_FILE - end of file
1845 */
1846static int yy_get_next_buffer (yyscan_t yyscanner)
1847{
1848 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1849 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1850 char *source = yyg->yytext_ptr;
1851 int number_to_move, i;
1852 int ret_val;
1853
1854 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1855 YY_FATAL_ERROR(
1856 "fatal flex scanner internal error--end of buffer missed" );
1857
1858 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1859 { /* Don't try to fill the buffer, so this is an EOF. */
1860 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1861 {
1862 /* We matched a single character, the EOB, so
1863 * treat this as a final EOF.
1864 */
1865 return EOB_ACT_END_OF_FILE;
1866 }
1867
1868 else
1869 {
1870 /* We matched some text prior to the EOB, first
1871 * process it.
1872 */
1873 return EOB_ACT_LAST_MATCH;
1874 }
1875 }
1876
1877 /* Try to read more data. */
1878
1879 /* First move last chars to start of buffer. */
1880 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1881
1882 for ( i = 0; i < number_to_move; ++i )
1883 *(dest++) = *(source++);
1884
1885 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1886 /* don't do the read, it's not guaranteed to return an EOF,
1887 * just force an EOF
1888 */
1889 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1890
1891 else
1892 {
1893 int num_to_read =
1894 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1895
1896 while ( num_to_read <= 0 )
1897 { /* Not enough room in the buffer - grow it. */
1898
1899 /* just a shorter name for the current buffer */
1900 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1901
1902 int yy_c_buf_p_offset =
1903 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1904
1905 if ( b->yy_is_our_buffer )
1906 {
1907 int new_size = b->yy_buf_size * 2;
1908
1909 if ( new_size <= 0 )
1910 b->yy_buf_size += b->yy_buf_size / 8;
1911 else
1912 b->yy_buf_size *= 2;
1913
1914 b->yy_ch_buf = (char *)
1915 /* Include room in for 2 EOB chars. */
1916 yyrealloc( (void *) b->yy_ch_buf,
1917 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1918 }
1919 else
1920 /* Can't grow it, we don't own it. */
1921 b->yy_ch_buf = NULL;
1922
1923 if ( ! b->yy_ch_buf )
1924 YY_FATAL_ERROR(
1925 "fatal error - scanner input buffer overflow" );
1926
1927 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1928
1929 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1930 number_to_move - 1;
1931
1932 }
1933
1934 if ( num_to_read > YY_READ_BUF_SIZE )
1935 num_to_read = YY_READ_BUF_SIZE;
1936
1937 /* Read in more data. */
1938 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1939 yyg->yy_n_chars, num_to_read );
1940
1941 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1942 }
1943
1944 if ( yyg->yy_n_chars == 0 )
1945 {
1946 if ( number_to_move == YY_MORE_ADJ )
1947 {
1948 ret_val = EOB_ACT_END_OF_FILE;
1949 yyrestart( yyin , yyscanner);
1950 }
1951
1952 else
1953 {
1954 ret_val = EOB_ACT_LAST_MATCH;
1955 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1956 YY_BUFFER_EOF_PENDING;
1957 }
1958 }
1959
1960 else
1961 ret_val = EOB_ACT_CONTINUE_SCAN;
1962
1963 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1964 /* Extend the array by 50%, plus the number we really need. */
1965 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1966 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1967 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1968 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1969 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1970 /* "- 2" to take care of EOB's */
1971 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1972 }
1973
1974 yyg->yy_n_chars += number_to_move;
1975 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1976 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1977
1978 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1979
1980 return ret_val;
1981}
1982
1983/* yy_get_previous_state - get the state just before the EOB char was reached */
1984
1985 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1986{
1987 yy_state_type yy_current_state;
1988 char *yy_cp;
1989 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1990
1991 yy_current_state = yyg->yy_start;
1992
1993 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1994 {
1995 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1996 if ( yy_accept[yy_current_state] )
1997 {
1998 yyg->yy_last_accepting_state = yy_current_state;
1999 yyg->yy_last_accepting_cpos = yy_cp;
2000 }
2001 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2002 {
2003 yy_current_state = (int) yy_def[yy_current_state];
2004 if ( yy_current_state >= 393 )
2005 yy_c = yy_meta[yy_c];
2006 }
2007 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2008 }
2009
2010 return yy_current_state;
2011}
2012
2013/* yy_try_NUL_trans - try to make a transition on the NUL character
2014 *
2015 * synopsis
2016 * next_state = yy_try_NUL_trans( current_state );
2017 */
2018 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2019{
2020 int yy_is_jam;
2021 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2022 char *yy_cp = yyg->yy_c_buf_p;
2023
2024 YY_CHAR yy_c = 1;
2025 if ( yy_accept[yy_current_state] )
2026 {
2027 yyg->yy_last_accepting_state = yy_current_state;
2028 yyg->yy_last_accepting_cpos = yy_cp;
2029 }
2030 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2031 {
2032 yy_current_state = (int) yy_def[yy_current_state];
2033 if ( yy_current_state >= 393 )
2034 yy_c = yy_meta[yy_c];
2035 }
2036 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2037 yy_is_jam = (yy_current_state == 392);
2038
2039 (void)yyg;
2040 return yy_is_jam ? 0 : yy_current_state;
2041}
2042
2043#ifndef YY_NO_UNPUT
2044
2045#endif
2046
2047#ifndef YY_NO_INPUT
2048#ifdef __cplusplus
2049 static int yyinput (yyscan_t yyscanner)
2050#else
2051 static int input (yyscan_t yyscanner)
2052#endif
2053
2054{
2055 int c;
2056 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2057
2058 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2059
2060 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2061 {
2062 /* yy_c_buf_p now points to the character we want to return.
2063 * If this occurs *before* the EOB characters, then it's a
2064 * valid NUL; if not, then we've hit the end of the buffer.
2065 */
2066 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2067 /* This was really a NUL. */
2068 *yyg->yy_c_buf_p = '\0';
2069
2070 else
2071 { /* need more input */
2072 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2073 ++yyg->yy_c_buf_p;
2074
2075 switch ( yy_get_next_buffer( yyscanner ) )
2076 {
2077 case EOB_ACT_LAST_MATCH:
2078 /* This happens because yy_g_n_b()
2079 * sees that we've accumulated a
2080 * token and flags that we need to
2081 * try matching the token before
2082 * proceeding. But for input(),
2083 * there's no matching to consider.
2084 * So convert the EOB_ACT_LAST_MATCH
2085 * to EOB_ACT_END_OF_FILE.
2086 */
2087
2088 /* Reset buffer status. */
2089 yyrestart( yyin , yyscanner);
2090
2091 /*FALLTHROUGH*/
2092
2093 case EOB_ACT_END_OF_FILE:
2094 {
2095 if ( yywrap( yyscanner ) )
2096 return 0;
2097
2098 if ( ! yyg->yy_did_buffer_switch_on_eof )
2099 YY_NEW_FILE;
2100#ifdef __cplusplus
2101 return yyinput(yyscanner);
2102#else
2103 return input(yyscanner);
2104#endif
2105 }
2106
2107 case EOB_ACT_CONTINUE_SCAN:
2108 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2109 break;
2110 }
2111 }
2112 }
2113
2114 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2115 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2116 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2117
2118 return c;
2119}
2120#endif /* ifndef YY_NO_INPUT */
2121
2122/** Immediately switch to a different input stream.
2123 * @param input_file A readable stream.
2124 * @param yyscanner The scanner object.
2125 * @note This function does not reset the start condition to @c INITIAL .
2126 */
2127 void yyrestart (FILE * input_file , yyscan_t yyscanner)
2128{
2129 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2130
2131 if ( ! YY_CURRENT_BUFFER ){
2132 yyensure_buffer_stack (yyscanner);
2133 YY_CURRENT_BUFFER_LVALUE =
2134 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2135 }
2136
2137 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2138 yy_load_buffer_state( yyscanner );
2139}
2140
2141/** Switch to a different input buffer.
2142 * @param new_buffer The new input buffer.
2143 * @param yyscanner The scanner object.
2144 */
2145 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2146{
2147 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2148
2149 /* TODO. We should be able to replace this entire function body
2150 * with
2151 * yypop_buffer_state();
2152 * yypush_buffer_state(new_buffer);
2153 */
2154 yyensure_buffer_stack (yyscanner);
2155 if ( YY_CURRENT_BUFFER == new_buffer )
2156 return;
2157
2158 if ( YY_CURRENT_BUFFER )
2159 {
2160 /* Flush out information for old buffer. */
2161 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2162 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2163 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2164 }
2165
2166 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2167 yy_load_buffer_state( yyscanner );
2168
2169 /* We don't actually know whether we did this switch during
2170 * EOF (yywrap()) processing, but the only time this flag
2171 * is looked at is after yywrap() is called, so it's safe
2172 * to go ahead and always set it.
2173 */
2174 yyg->yy_did_buffer_switch_on_eof = 1;
2175}
2176
2177static void yy_load_buffer_state (yyscan_t yyscanner)
2178{
2179 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2180 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2181 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2182 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2183 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2184}
2185
2186/** Allocate and initialize an input buffer state.
2187 * @param file A readable stream.
2188 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2189 * @param yyscanner The scanner object.
2190 * @return the allocated buffer state.
2191 */
2192 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2193{
2195
2196 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2197 if ( ! b )
2198 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2199
2200 b->yy_buf_size = size;
2201
2202 /* yy_ch_buf has to be 2 characters longer than the size given because
2203 * we need to put in 2 end-of-buffer characters.
2204 */
2205 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2206 if ( ! b->yy_ch_buf )
2207 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2208
2209 b->yy_is_our_buffer = 1;
2210
2211 yy_init_buffer( b, file , yyscanner);
2212
2213 return b;
2214}
2215
2216/** Destroy the buffer.
2217 * @param b a buffer created with yy_create_buffer()
2218 * @param yyscanner The scanner object.
2219 */
2220 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2221{
2222 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2223
2224 if ( ! b )
2225 return;
2226
2227 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2228 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2229
2230 if ( b->yy_is_our_buffer )
2231 yyfree( (void *) b->yy_ch_buf , yyscanner );
2232
2233 yyfree( (void *) b , yyscanner );
2234}
2235
2236/* Initializes or reinitializes a buffer.
2237 * This function is sometimes called more than once on the same buffer,
2238 * such as during a yyrestart() or at EOF.
2239 */
2240 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2241
2242{
2243 int oerrno = errno;
2244 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2245
2246 yy_flush_buffer( b , yyscanner);
2247
2248 b->yy_input_file = file;
2249 b->yy_fill_buffer = 1;
2250
2251 /* If b is the current buffer, then yy_init_buffer was _probably_
2252 * called from yyrestart() or through yy_get_next_buffer.
2253 * In that case, we don't want to reset the lineno or column.
2254 */
2255 if (b != YY_CURRENT_BUFFER){
2256 b->yy_bs_lineno = 1;
2257 b->yy_bs_column = 0;
2258 }
2259
2260 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2261
2262 errno = oerrno;
2263}
2264
2265/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2266 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2267 * @param yyscanner The scanner object.
2268 */
2269 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2270{
2271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2272 if ( ! b )
2273 return;
2274
2275 b->yy_n_chars = 0;
2276
2277 /* We always need two end-of-buffer characters. The first causes
2278 * a transition to the end-of-buffer state. The second causes
2279 * a jam in that state.
2280 */
2281 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2282 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2283
2284 b->yy_buf_pos = &b->yy_ch_buf[0];
2285
2286 b->yy_at_bol = 1;
2287 b->yy_buffer_status = YY_BUFFER_NEW;
2288
2289 if ( b == YY_CURRENT_BUFFER )
2290 yy_load_buffer_state( yyscanner );
2291}
2292
2293/** Pushes the new state onto the stack. The new state becomes
2294 * the current state. This function will allocate the stack
2295 * if necessary.
2296 * @param new_buffer The new state.
2297 * @param yyscanner The scanner object.
2298 */
2299void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2300{
2301 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2302 if (new_buffer == NULL)
2303 return;
2304
2305 yyensure_buffer_stack(yyscanner);
2306
2307 /* This block is copied from yy_switch_to_buffer. */
2308 if ( YY_CURRENT_BUFFER )
2309 {
2310 /* Flush out information for old buffer. */
2311 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2312 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2313 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2314 }
2315
2316 /* Only push if top exists. Otherwise, replace top. */
2317 if (YY_CURRENT_BUFFER)
2318 yyg->yy_buffer_stack_top++;
2319 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2320
2321 /* copied from yy_switch_to_buffer. */
2322 yy_load_buffer_state( yyscanner );
2323 yyg->yy_did_buffer_switch_on_eof = 1;
2324}
2325
2326/** Removes and deletes the top of the stack, if present.
2327 * The next element becomes the new top.
2328 * @param yyscanner The scanner object.
2329 */
2330void yypop_buffer_state (yyscan_t yyscanner)
2331{
2332 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2333 if (!YY_CURRENT_BUFFER)
2334 return;
2335
2336 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2337 YY_CURRENT_BUFFER_LVALUE = NULL;
2338 if (yyg->yy_buffer_stack_top > 0)
2339 --yyg->yy_buffer_stack_top;
2340
2341 if (YY_CURRENT_BUFFER) {
2342 yy_load_buffer_state( yyscanner );
2343 yyg->yy_did_buffer_switch_on_eof = 1;
2344 }
2345}
2346
2347/* Allocates the stack if it does not exist.
2348 * Guarantees space for at least one push.
2349 */
2350static void yyensure_buffer_stack (yyscan_t yyscanner)
2351{
2352 yy_size_t num_to_alloc;
2353 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2354
2355 if (!yyg->yy_buffer_stack) {
2356
2357 /* First allocation is just for 2 elements, since we don't know if this
2358 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2359 * immediate realloc on the next call.
2360 */
2361 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2362 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2363 (num_to_alloc * sizeof(struct yy_buffer_state*)
2364 , yyscanner);
2365 if ( ! yyg->yy_buffer_stack )
2366 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2367
2368 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2369
2370 yyg->yy_buffer_stack_max = num_to_alloc;
2371 yyg->yy_buffer_stack_top = 0;
2372 return;
2373 }
2374
2375 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2376
2377 /* Increase the buffer to prepare for a possible push. */
2378 yy_size_t grow_size = 8 /* arbitrary grow size */;
2379
2380 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2381 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2382 (yyg->yy_buffer_stack,
2383 num_to_alloc * sizeof(struct yy_buffer_state*)
2384 , yyscanner);
2385 if ( ! yyg->yy_buffer_stack )
2386 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2387
2388 /* zero only the new slots.*/
2389 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2390 yyg->yy_buffer_stack_max = num_to_alloc;
2391 }
2392}
2393
2394/** Setup the input buffer state to scan directly from a user-specified character buffer.
2395 * @param base the character buffer
2396 * @param size the size in bytes of the character buffer
2397 * @param yyscanner The scanner object.
2398 * @return the newly allocated buffer state object.
2399 */
2400YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2401{
2403
2404 if ( size < 2 ||
2405 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2406 base[size-1] != YY_END_OF_BUFFER_CHAR )
2407 /* They forgot to leave room for the EOB's. */
2408 return NULL;
2409
2410 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2411 if ( ! b )
2412 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2413
2414 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2415 b->yy_buf_pos = b->yy_ch_buf = base;
2416 b->yy_is_our_buffer = 0;
2417 b->yy_input_file = NULL;
2418 b->yy_n_chars = b->yy_buf_size;
2419 b->yy_is_interactive = 0;
2420 b->yy_at_bol = 1;
2421 b->yy_fill_buffer = 0;
2422 b->yy_buffer_status = YY_BUFFER_NEW;
2423
2424 yy_switch_to_buffer( b , yyscanner );
2425
2426 return b;
2427}
2428
2429/** Setup the input buffer state to scan a string. The next call to yylex() will
2430 * scan from a @e copy of @a str.
2431 * @param yystr a NUL-terminated string to scan
2432 * @param yyscanner The scanner object.
2433 * @return the newly allocated buffer state object.
2434 * @note If you want to scan bytes that may contain NUL values, then use
2435 * yy_scan_bytes() instead.
2436 */
2437YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2438{
2439
2440 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2441}
2442
2443/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2444 * scan from a @e copy of @a bytes.
2445 * @param yybytes the byte buffer to scan
2446 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2447 * @param yyscanner The scanner object.
2448 * @return the newly allocated buffer state object.
2449 */
2450YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2451{
2453 char *buf;
2454 yy_size_t n;
2455 int i;
2456
2457 /* Get memory for full buffer, including space for trailing EOB's. */
2458 n = (yy_size_t) (_yybytes_len + 2);
2459 buf = (char *) yyalloc( n , yyscanner );
2460 if ( ! buf )
2461 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2462
2463 for ( i = 0; i < _yybytes_len; ++i )
2464 buf[i] = yybytes[i];
2465
2466 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2467
2468 b = yy_scan_buffer( buf, n , yyscanner);
2469 if ( ! b )
2470 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2471
2472 /* It's okay to grow etc. this buffer, and we should throw it
2473 * away when we're done.
2474 */
2475 b->yy_is_our_buffer = 1;
2476
2477 return b;
2478}
2479
2480#ifndef YY_EXIT_FAILURE
2481#define YY_EXIT_FAILURE 2
2482#endif
2483
2484static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2485{
2486 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2487 (void)yyg;
2488 fprintf( stderr, "%s\n", msg );
2489 exit( YY_EXIT_FAILURE );
2490}
2491
2492/* Redefine yyless() so it works in section 3 code. */
2493
2494#undef yyless
2495#define yyless(n) \
2496 do \
2497 { \
2498 /* Undo effects of setting up yytext. */ \
2499 int yyless_macro_arg = (n); \
2500 YY_LESS_LINENO(yyless_macro_arg);\
2501 yytext[yyleng] = yyg->yy_hold_char; \
2502 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2503 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2504 *yyg->yy_c_buf_p = '\0'; \
2505 yyleng = yyless_macro_arg; \
2506 } \
2507 while ( 0 )
2508
2509/* Accessor methods (get/set functions) to struct members. */
2510
2511/** Get the user-defined data for this scanner.
2512 * @param yyscanner The scanner object.
2513 */
2514YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
2515{
2516 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2517 return yyextra;
2518}
2519
2520/** Get the current line number.
2521 * @param yyscanner The scanner object.
2522 */
2523int yyget_lineno (yyscan_t yyscanner)
2524{
2525 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2526
2527 if (! YY_CURRENT_BUFFER)
2528 return 0;
2529
2530 return yylineno;
2531}
2532
2533/** Get the current column number.
2534 * @param yyscanner The scanner object.
2535 */
2536int yyget_column (yyscan_t yyscanner)
2537{
2538 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2539
2540 if (! YY_CURRENT_BUFFER)
2541 return 0;
2542
2543 return yycolumn;
2544}
2545
2546/** Get the input stream.
2547 * @param yyscanner The scanner object.
2548 */
2549FILE *yyget_in (yyscan_t yyscanner)
2550{
2551 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2552 return yyin;
2553}
2554
2555/** Get the output stream.
2556 * @param yyscanner The scanner object.
2557 */
2558FILE *yyget_out (yyscan_t yyscanner)
2559{
2560 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2561 return yyout;
2562}
2563
2564/** Get the length of the current token.
2565 * @param yyscanner The scanner object.
2566 */
2567int yyget_leng (yyscan_t yyscanner)
2568{
2569 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2570 return yyleng;
2571}
2572
2573/** Get the current token.
2574 * @param yyscanner The scanner object.
2575 */
2576
2577char *yyget_text (yyscan_t yyscanner)
2578{
2579 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2580 return yytext;
2581}
2582
2583/** Set the user-defined data. This data is never touched by the scanner.
2584 * @param user_defined The data to be associated with this scanner.
2585 * @param yyscanner The scanner object.
2586 */
2587void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2588{
2589 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2590 yyextra = user_defined ;
2591}
2592
2593/** Set the current line number.
2594 * @param _line_number line number
2595 * @param yyscanner The scanner object.
2596 */
2597void yyset_lineno (int _line_number , yyscan_t yyscanner)
2598{
2599 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2600
2601 /* lineno is only valid if an input buffer exists. */
2602 if (! YY_CURRENT_BUFFER )
2603 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2604
2605 yylineno = _line_number;
2606}
2607
2608/** Set the current column.
2609 * @param _column_no column number
2610 * @param yyscanner The scanner object.
2611 */
2612void yyset_column (int _column_no , yyscan_t yyscanner)
2613{
2614 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2615
2616 /* column is only valid if an input buffer exists. */
2617 if (! YY_CURRENT_BUFFER )
2618 YY_FATAL_ERROR( "yyset_column called with no buffer" );
2619
2620 yycolumn = _column_no;
2621}
2622
2623/** Set the input stream. This does not discard the current
2624 * input buffer.
2625 * @param _in_str A readable stream.
2626 * @param yyscanner The scanner object.
2627 * @see yy_switch_to_buffer
2628 */
2629void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2630{
2631 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2632 yyin = _in_str ;
2633}
2634
2635void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2636{
2637 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2638 yyout = _out_str ;
2639}
2640
2641int yyget_debug (yyscan_t yyscanner)
2642{
2643 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2644 return yy_flex_debug;
2645}
2646
2647void yyset_debug (int _bdebug , yyscan_t yyscanner)
2648{
2649 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2650 yy_flex_debug = _bdebug ;
2651}
2652
2653/* Accessor methods for yylval and yylloc */
2654
2655YYSTYPE * yyget_lval (yyscan_t yyscanner)
2656{
2657 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2658 return yylval;
2659}
2660
2661void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2662{
2663 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2664 yylval = yylval_param;
2665}
2666
2667/* User-visible API */
2668
2669/* yylex_init is special because it creates the scanner itself, so it is
2670 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2671 * That's why we explicitly handle the declaration, instead of using our macros.
2672 */
2673int yylex_init(yyscan_t* ptr_yy_globals)
2674{
2675 if (ptr_yy_globals == NULL){
2676 errno = EINVAL;
2677 return 1;
2678 }
2679
2680 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2681
2682 if (*ptr_yy_globals == NULL){
2683 errno = ENOMEM;
2684 return 1;
2685 }
2686
2687 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2688 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2689
2690 return yy_init_globals ( *ptr_yy_globals );
2691}
2692
2693/* yylex_init_extra has the same functionality as yylex_init, but follows the
2694 * convention of taking the scanner as the last argument. Note however, that
2695 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2696 * is the reason, too, why this function also must handle its own declaration).
2697 * The user defined value in the first argument will be available to yyalloc in
2698 * the yyextra field.
2699 */
2700int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2701{
2702 struct yyguts_t dummy_yyguts;
2703
2704 yyset_extra (yy_user_defined, &dummy_yyguts);
2705
2706 if (ptr_yy_globals == NULL){
2707 errno = EINVAL;
2708 return 1;
2709 }
2710
2711 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2712
2713 if (*ptr_yy_globals == NULL){
2714 errno = ENOMEM;
2715 return 1;
2716 }
2717
2718 /* By setting to 0xAA, we expose bugs in
2719 yy_init_globals. Leave at 0x00 for releases. */
2720 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2721
2722 yyset_extra (yy_user_defined, *ptr_yy_globals);
2723
2724 return yy_init_globals ( *ptr_yy_globals );
2725}
2726
2727static int yy_init_globals (yyscan_t yyscanner)
2728{
2729 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2730 /* Initialization is the same as for the non-reentrant scanner.
2731 * This function is called from yylex_destroy(), so don't allocate here.
2732 */
2733
2734 yyg->yy_buffer_stack = NULL;
2735 yyg->yy_buffer_stack_top = 0;
2736 yyg->yy_buffer_stack_max = 0;
2737 yyg->yy_c_buf_p = NULL;
2738 yyg->yy_init = 0;
2739 yyg->yy_start = 0;
2740
2741 yyg->yy_start_stack_ptr = 0;
2742 yyg->yy_start_stack_depth = 0;
2743 yyg->yy_start_stack = NULL;
2744
2745/* Defined in main.c */
2746#ifdef YY_STDINIT
2747 yyin = stdin;
2748 yyout = stdout;
2749#else
2750 yyin = NULL;
2751 yyout = NULL;
2752#endif
2753
2754 /* For future reference: Set errno on error, since we are called by
2755 * yylex_init()
2756 */
2757 return 0;
2758}
2759
2760/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2761int yylex_destroy (yyscan_t yyscanner)
2762{
2763 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2764
2765 /* Pop the buffer stack, destroying each element. */
2766 while(YY_CURRENT_BUFFER){
2767 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2768 YY_CURRENT_BUFFER_LVALUE = NULL;
2769 yypop_buffer_state(yyscanner);
2770 }
2771
2772 /* Destroy the stack itself. */
2773 yyfree(yyg->yy_buffer_stack , yyscanner);
2774 yyg->yy_buffer_stack = NULL;
2775
2776 /* Destroy the start condition stack. */
2777 yyfree( yyg->yy_start_stack , yyscanner );
2778 yyg->yy_start_stack = NULL;
2779
2780 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2781 * yylex() is called, initialization will occur. */
2782 yy_init_globals( yyscanner);
2783
2784 /* Destroy the main struct (reentrant only). */
2785 yyfree ( yyscanner , yyscanner );
2786 yyscanner = NULL;
2787 return 0;
2788}
2789
2790/*
2791 * Internal utility routines.
2792 */
2793
2794#ifndef yytext_ptr
2795static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2796{
2797 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2798 (void)yyg;
2799
2800 int i;
2801 for ( i = 0; i < n; ++i )
2802 s1[i] = s2[i];
2803}
2804#endif
2805
2806#ifdef YY_NEED_STRLEN
2807static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2808{
2809 int n;
2810 for ( n = 0; s[n]; ++n )
2811 ;
2812
2813 return n;
2814}
2815#endif
2816
2817void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2818{
2819 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2820 (void)yyg;
2821 return malloc(size);
2822}
2823
2824void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2825{
2826 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2827 (void)yyg;
2828
2829 /* The cast to (char *) in the following accommodates both
2830 * implementations that use char* generic pointers, and those
2831 * that use void* generic pointers. It works with the latter
2832 * because both ANSI C and C++ allow castless assignment from
2833 * any pointer type to void*, and deal with argument conversions
2834 * as though doing an assignment.
2835 */
2836 return realloc(ptr, size);
2837}
2838
2839void yyfree (void * ptr , yyscan_t yyscanner)
2840{
2841 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2842 (void)yyg;
2843 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2844}
2845
2846#define YYTABLES_NAME "yytables"
2847
2848#line 166 "lib/route/cls/ematch_grammar.l"
int yy_bs_column
The column count.
int yy_bs_lineno
The line count.
size_t yy_buffer_stack_max
capacity of stack.
YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
size_t yy_buffer_stack_top
index of top of stack.