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