libnl: /data/src/libnl/lib/route/pktloc_grammar.c Source File

libnl 3.12.0

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