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