libnl  3.2.29-rc1
ematch_grammar.c
1 #line 2 "route/cls/ematch_grammar.c"
2 
3 #line 4 "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 "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 "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 "ematch_syntax.h"
726 #define YY_NO_INPUT 1
727 
728 #line 729 "route/cls/ematch_grammar.c"
729 
730 #define INITIAL 0
731 #define QUOTE 1
732 
733 #ifndef YY_NO_UNISTD_H
734 /* Special case for "unistd.h", since it is non-ANSI. We include it way
735  * down here because we want the user's section 1 to have been scanned first.
736  * The user has a chance to override it with an option.
737  */
738 #include <unistd.h>
739 #endif
740 
741 #ifndef YY_EXTRA_TYPE
742 #define YY_EXTRA_TYPE void *
743 #endif
744 
745 /* Holds the entire state of the reentrant scanner. */
746 struct yyguts_t
747  {
748 
749  /* User-defined. Not touched by flex. */
750  YY_EXTRA_TYPE yyextra_r;
751 
752  /* The rest are the same as the globals declared in the non-reentrant scanner. */
753  FILE *yyin_r, *yyout_r;
754  size_t yy_buffer_stack_top; /**< index of top of stack. */
755  size_t yy_buffer_stack_max; /**< capacity of stack. */
756  YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
757  char yy_hold_char;
758  yy_size_t yy_n_chars;
759  yy_size_t yyleng_r;
760  char *yy_c_buf_p;
761  int yy_init;
762  int yy_start;
763  int yy_did_buffer_switch_on_eof;
764  int yy_start_stack_ptr;
765  int yy_start_stack_depth;
766  int *yy_start_stack;
767  yy_state_type yy_last_accepting_state;
768  char* yy_last_accepting_cpos;
769 
770  int yylineno_r;
771  int yy_flex_debug_r;
772 
773  char *yytext_r;
774  int yy_more_flag;
775  int yy_more_len;
776 
777  YYSTYPE * yylval_r;
778 
779  }; /* end struct yyguts_t */
780 
781 static int yy_init_globals (yyscan_t yyscanner );
782 
783  /* This must go here because YYSTYPE and YYLTYPE are included
784  * from bison output in section 1.*/
785  # define yylval yyg->yylval_r
786 
787 int ematch_lex_init (yyscan_t* scanner);
788 
789 int ematch_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
790 
791 /* Accessor methods to globals.
792  These are made visible to non-reentrant scanners for convenience. */
793 
794 int ematch_lex_destroy (yyscan_t yyscanner );
795 
796 int ematch_get_debug (yyscan_t yyscanner );
797 
798 void ematch_set_debug (int debug_flag ,yyscan_t yyscanner );
799 
800 YY_EXTRA_TYPE ematch_get_extra (yyscan_t yyscanner );
801 
802 void ematch_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
803 
804 FILE *ematch_get_in (yyscan_t yyscanner );
805 
806 void ematch_set_in (FILE * _in_str ,yyscan_t yyscanner );
807 
808 FILE *ematch_get_out (yyscan_t yyscanner );
809 
810 void ematch_set_out (FILE * _out_str ,yyscan_t yyscanner );
811 
812 yy_size_t ematch_get_leng (yyscan_t yyscanner );
813 
814 char *ematch_get_text (yyscan_t yyscanner );
815 
816 int ematch_get_lineno (yyscan_t yyscanner );
817 
818 void ematch_set_lineno (int _line_number ,yyscan_t yyscanner );
819 
820 int ematch_get_column (yyscan_t yyscanner );
821 
822 void ematch_set_column (int _column_no ,yyscan_t yyscanner );
823 
824 YYSTYPE * ematch_get_lval (yyscan_t yyscanner );
825 
826 void ematch_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
827 
828 /* Macros after this point can all be overridden by user definitions in
829  * section 1.
830  */
831 
832 #ifndef YY_SKIP_YYWRAP
833 #ifdef __cplusplus
834 extern "C" int ematch_wrap (yyscan_t yyscanner );
835 #else
836 extern int ematch_wrap (yyscan_t yyscanner );
837 #endif
838 #endif
839 
840 #ifndef YY_NO_UNPUT
841 
842 #endif
843 
844 #ifndef yytext_ptr
845 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
846 #endif
847 
848 #ifdef YY_NEED_STRLEN
849 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
850 #endif
851 
852 #ifndef YY_NO_INPUT
853 
854 #ifdef __cplusplus
855 static int yyinput (yyscan_t yyscanner );
856 #else
857 static int input (yyscan_t yyscanner );
858 #endif
859 
860 #endif
861 
862 /* Amount of stuff to slurp up with each read. */
863 #ifndef YY_READ_BUF_SIZE
864 #ifdef __ia64__
865 /* On IA-64, the buffer size is 16k, not 8k */
866 #define YY_READ_BUF_SIZE 16384
867 #else
868 #define YY_READ_BUF_SIZE 8192
869 #endif /* __ia64__ */
870 #endif
871 
872 /* Copy whatever the last rule matched to the standard output. */
873 #ifndef ECHO
874 /* This used to be an fputs(), but since the string might contain NUL's,
875  * we now use fwrite().
876  */
877 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
878 #endif
879 
880 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
881  * is returned in "result".
882  */
883 #ifndef YY_INPUT
884 #define YY_INPUT(buf,result,max_size) \
885  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
886  { \
887  int c = '*'; \
888  size_t n; \
889  for ( n = 0; n < max_size && \
890  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
891  buf[n] = (char) c; \
892  if ( c == '\n' ) \
893  buf[n++] = (char) c; \
894  if ( c == EOF && ferror( yyin ) ) \
895  YY_FATAL_ERROR( "input in flex scanner failed" ); \
896  result = n; \
897  } \
898  else \
899  { \
900  errno=0; \
901  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
902  { \
903  if( errno != EINTR) \
904  { \
905  YY_FATAL_ERROR( "input in flex scanner failed" ); \
906  break; \
907  } \
908  errno=0; \
909  clearerr(yyin); \
910  } \
911  }\
912 \
913 
914 #endif
915 
916 /* No semi-colon after return; correct usage is to write "yyterminate();" -
917  * we don't want an extra ';' after the "return" because that will cause
918  * some compilers to complain about unreachable statements.
919  */
920 #ifndef yyterminate
921 #define yyterminate() return YY_NULL
922 #endif
923 
924 /* Number of entries by which start-condition stack grows. */
925 #ifndef YY_START_STACK_INCR
926 #define YY_START_STACK_INCR 25
927 #endif
928 
929 /* Report a fatal error. */
930 #ifndef YY_FATAL_ERROR
931 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
932 #endif
933 
934 /* end tables serialization structures and prototypes */
935 
936 /* Default declaration of generated scanner - a define so the user can
937  * easily add parameters.
938  */
939 #ifndef YY_DECL
940 #define YY_DECL_IS_OURS 1
941 
942 extern int ematch_lex \
943  (YYSTYPE * yylval_param ,yyscan_t yyscanner);
944 
945 #define YY_DECL int ematch_lex \
946  (YYSTYPE * yylval_param , yyscan_t yyscanner)
947 #endif /* !YY_DECL */
948 
949 /* Code executed at the beginning of each rule, after yytext and yyleng
950  * have been set up.
951  */
952 #ifndef YY_USER_ACTION
953 #define YY_USER_ACTION
954 #endif
955 
956 /* Code executed at the end of each rule. */
957 #ifndef YY_BREAK
958 #define YY_BREAK /*LINTED*/break;
959 #endif
960 
961 #define YY_RULE_SETUP \
962  YY_USER_ACTION
963 
964 /** The main scanner function which does all the work.
965  */
966 YY_DECL
967 {
968  yy_state_type yy_current_state;
969  char *yy_cp, *yy_bp;
970  int yy_act;
971  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
972 
973  yylval = yylval_param;
974 
975  if ( !yyg->yy_init )
976  {
977  yyg->yy_init = 1;
978 
979 #ifdef YY_USER_INIT
980  YY_USER_INIT;
981 #endif
982 
983  if ( ! yyg->yy_start )
984  yyg->yy_start = 1; /* first start state */
985 
986  if ( ! yyin )
987  yyin = stdin;
988 
989  if ( ! yyout )
990  yyout = stdout;
991 
992  if ( ! YY_CURRENT_BUFFER ) {
993  ematch_ensure_buffer_stack (yyscanner);
994  YY_CURRENT_BUFFER_LVALUE =
995  ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
996  }
997 
998  ematch__load_buffer_state(yyscanner );
999  }
1000 
1001  {
1002 #line 32 "route/cls/ematch_grammar.l"
1003 
1004 
1005 #line 1006 "route/cls/ematch_grammar.c"
1006 
1007  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1008  {
1009  yy_cp = yyg->yy_c_buf_p;
1010 
1011  /* Support of yytext. */
1012  *yy_cp = yyg->yy_hold_char;
1013 
1014  /* yy_bp points to the position in yy_ch_buf of the start of
1015  * the current run.
1016  */
1017  yy_bp = yy_cp;
1018 
1019  yy_current_state = yyg->yy_start;
1020 yy_match:
1021  do
1022  {
1023  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1024  if ( yy_accept[yy_current_state] )
1025  {
1026  yyg->yy_last_accepting_state = yy_current_state;
1027  yyg->yy_last_accepting_cpos = yy_cp;
1028  }
1029  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1030  {
1031  yy_current_state = (int) yy_def[yy_current_state];
1032  if ( yy_current_state >= 393 )
1033  yy_c = yy_meta[(unsigned int) yy_c];
1034  }
1035  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1036  ++yy_cp;
1037  }
1038  while ( yy_base[yy_current_state] != 538 );
1039 
1040 yy_find_action:
1041  yy_act = yy_accept[yy_current_state];
1042  if ( yy_act == 0 )
1043  { /* have to back up */
1044  yy_cp = yyg->yy_last_accepting_cpos;
1045  yy_current_state = yyg->yy_last_accepting_state;
1046  yy_act = yy_accept[yy_current_state];
1047  }
1048 
1049  YY_DO_BEFORE_ACTION;
1050 
1051 do_action: /* This label is used only to access EOF actions. */
1052 
1053  switch ( yy_act )
1054  { /* beginning of action switch */
1055  case 0: /* must back up */
1056  /* undo the effects of YY_DO_BEFORE_ACTION */
1057  *yy_cp = yyg->yy_hold_char;
1058  yy_cp = yyg->yy_last_accepting_cpos;
1059  yy_current_state = yyg->yy_last_accepting_state;
1060  goto yy_find_action;
1061 
1062 case 1:
1063 /* rule 1 can match eol */
1064 YY_RULE_SETUP
1065 #line 34 "route/cls/ematch_grammar.l"
1066 
1067  YY_BREAK
1068 case 2:
1069 YY_RULE_SETUP
1070 #line 36 "route/cls/ematch_grammar.l"
1071 {
1072  NL_DBG(4, "Beginning of quote\n");
1073  yylval->q.len = 32;
1074  if (!(yylval->q.data = calloc(1, yylval->q.len)))
1075  return ERROR;
1076 
1077  yylval->q.index = 0;
1078  BEGIN(QUOTE);
1079  }
1080  YY_BREAK
1081 case 3:
1082 YY_RULE_SETUP
1083 #line 46 "route/cls/ematch_grammar.l"
1084 {
1085  memcpy(yylval->q.data + yylval->q.index, yytext,
1086  strlen(yytext));
1087  yylval->q.index += strlen(yytext);
1088  }
1089  YY_BREAK
1090 case 4:
1091 YY_RULE_SETUP
1092 #line 52 "route/cls/ematch_grammar.l"
1093 {
1094  BEGIN(0);
1095  return QUOTED;
1096  }
1097  YY_BREAK
1098 case 5:
1099 #line 59 "route/cls/ematch_grammar.l"
1100 case 6:
1101 YY_RULE_SETUP
1102 #line 59 "route/cls/ematch_grammar.l"
1103 {
1104  yylval->i = strtoul(yytext, NULL, 0);
1105  return NUMBER;
1106  }
1107  YY_BREAK
1108 case 7:
1109 #line 65 "route/cls/ematch_grammar.l"
1110 case 8:
1111 YY_RULE_SETUP
1112 #line 65 "route/cls/ematch_grammar.l"
1113 return KW_EQ;
1114  YY_BREAK
1115 case 9:
1116 #line 67 "route/cls/ematch_grammar.l"
1117 case 10:
1118 YY_RULE_SETUP
1119 #line 67 "route/cls/ematch_grammar.l"
1120 return KW_GT;
1121  YY_BREAK
1122 case 11:
1123 #line 69 "route/cls/ematch_grammar.l"
1124 case 12:
1125 YY_RULE_SETUP
1126 #line 69 "route/cls/ematch_grammar.l"
1127 return KW_LT;
1128  YY_BREAK
1129 case 13:
1130 #line 72 "route/cls/ematch_grammar.l"
1131 case 14:
1132 YY_RULE_SETUP
1133 #line 72 "route/cls/ematch_grammar.l"
1134 { yylval->i = TCF_EM_REL_AND; return LOGIC; }
1135  YY_BREAK
1136 case 15:
1137 #line 74 "route/cls/ematch_grammar.l"
1138 case 16:
1139 YY_RULE_SETUP
1140 #line 74 "route/cls/ematch_grammar.l"
1141 { yylval->i = TCF_EM_REL_OR; return LOGIC; }
1142  YY_BREAK
1143 case 17:
1144 #line 76 "route/cls/ematch_grammar.l"
1145 case 18:
1146 YY_RULE_SETUP
1147 #line 76 "route/cls/ematch_grammar.l"
1148 return NOT;
1149  YY_BREAK
1150 case 19:
1151 YY_RULE_SETUP
1152 #line 78 "route/cls/ematch_grammar.l"
1153 { yylval->i = TCF_EM_CMP; return EMATCH_CMP; }
1154  YY_BREAK
1155 case 20:
1156 YY_RULE_SETUP
1157 #line 79 "route/cls/ematch_grammar.l"
1158 { yylval->i = TCF_EM_NBYTE; return EMATCH_NBYTE; }
1159  YY_BREAK
1160 case 21:
1161 YY_RULE_SETUP
1162 #line 80 "route/cls/ematch_grammar.l"
1163 { yylval->i = TCF_EM_TEXT; return EMATCH_TEXT; }
1164  YY_BREAK
1165 case 22:
1166 YY_RULE_SETUP
1167 #line 81 "route/cls/ematch_grammar.l"
1168 { yylval->i = TCF_EM_META; return EMATCH_META; }
1169  YY_BREAK
1170 case 23:
1171 YY_RULE_SETUP
1172 #line 83 "route/cls/ematch_grammar.l"
1173 return KW_OPEN;
1174  YY_BREAK
1175 case 24:
1176 YY_RULE_SETUP
1177 #line 84 "route/cls/ematch_grammar.l"
1178 return KW_CLOSE;
1179  YY_BREAK
1180 case 25:
1181 #line 86 "route/cls/ematch_grammar.l"
1182 case 26:
1183 YY_RULE_SETUP
1184 #line 86 "route/cls/ematch_grammar.l"
1185 return KW_MASK;
1186  YY_BREAK
1187 case 27:
1188 #line 88 "route/cls/ematch_grammar.l"
1189 case 28:
1190 YY_RULE_SETUP
1191 #line 88 "route/cls/ematch_grammar.l"
1192 return KW_SHIFT;
1193  YY_BREAK
1194 case 29:
1195 YY_RULE_SETUP
1196 #line 89 "route/cls/ematch_grammar.l"
1197 return KW_AT;
1198  YY_BREAK
1199 case 30:
1200 YY_RULE_SETUP
1201 #line 90 "route/cls/ematch_grammar.l"
1202 return KW_PLUS;
1203  YY_BREAK
1204 case 31:
1205 YY_RULE_SETUP
1206 #line 91 "route/cls/ematch_grammar.l"
1207 return KW_FROM;
1208  YY_BREAK
1209 case 32:
1210 YY_RULE_SETUP
1211 #line 92 "route/cls/ematch_grammar.l"
1212 return KW_TO;
1213  YY_BREAK
1214 case 33:
1215 YY_RULE_SETUP
1216 #line 94 "route/cls/ematch_grammar.l"
1217 { yylval->i = TCF_EM_ALIGN_U8; return ALIGN; }
1218  YY_BREAK
1219 case 34:
1220 YY_RULE_SETUP
1221 #line 95 "route/cls/ematch_grammar.l"
1222 { yylval->i = TCF_EM_ALIGN_U16; return ALIGN; }
1223  YY_BREAK
1224 case 35:
1225 YY_RULE_SETUP
1226 #line 96 "route/cls/ematch_grammar.l"
1227 { yylval->i = TCF_EM_ALIGN_U32; return ALIGN; }
1228  YY_BREAK
1229 case 36:
1230 #line 99 "route/cls/ematch_grammar.l"
1231 case 37:
1232 YY_RULE_SETUP
1233 #line 99 "route/cls/ematch_grammar.l"
1234 { yylval->i = TCF_LAYER_LINK; return LAYER; }
1235  YY_BREAK
1236 case 38:
1237 #line 101 "route/cls/ematch_grammar.l"
1238 case 39:
1239 #line 102 "route/cls/ematch_grammar.l"
1240 case 40:
1241 YY_RULE_SETUP
1242 #line 102 "route/cls/ematch_grammar.l"
1243 { yylval->i = TCF_LAYER_NETWORK; return LAYER; }
1244  YY_BREAK
1245 case 41:
1246 #line 104 "route/cls/ematch_grammar.l"
1247 case 42:
1248 YY_RULE_SETUP
1249 #line 104 "route/cls/ematch_grammar.l"
1250 { yylval->i = TCF_LAYER_TRANSPORT; return LAYER; }
1251  YY_BREAK
1252 case 43:
1253 YY_RULE_SETUP
1254 #line 106 "route/cls/ematch_grammar.l"
1255 return META_RANDOM;
1256  YY_BREAK
1257 case 44:
1258 YY_RULE_SETUP
1259 #line 107 "route/cls/ematch_grammar.l"
1260 return META_LOADAVG_0;
1261  YY_BREAK
1262 case 45:
1263 YY_RULE_SETUP
1264 #line 108 "route/cls/ematch_grammar.l"
1265 return META_LOADAVG_1;
1266  YY_BREAK
1267 case 46:
1268 YY_RULE_SETUP
1269 #line 109 "route/cls/ematch_grammar.l"
1270 return META_LOADAVG_2;
1271  YY_BREAK
1272 case 47:
1273 YY_RULE_SETUP
1274 #line 110 "route/cls/ematch_grammar.l"
1275 return META_DEV;
1276  YY_BREAK
1277 case 48:
1278 YY_RULE_SETUP
1279 #line 111 "route/cls/ematch_grammar.l"
1280 return META_PRIO;
1281  YY_BREAK
1282 case 49:
1283 YY_RULE_SETUP
1284 #line 112 "route/cls/ematch_grammar.l"
1285 return META_PROTO;
1286  YY_BREAK
1287 case 50:
1288 YY_RULE_SETUP
1289 #line 113 "route/cls/ematch_grammar.l"
1290 return META_PKTTYPE;
1291  YY_BREAK
1292 case 51:
1293 YY_RULE_SETUP
1294 #line 114 "route/cls/ematch_grammar.l"
1295 return META_PKTLEN;
1296  YY_BREAK
1297 case 52:
1298 YY_RULE_SETUP
1299 #line 115 "route/cls/ematch_grammar.l"
1300 return META_DATALEN;
1301  YY_BREAK
1302 case 53:
1303 YY_RULE_SETUP
1304 #line 116 "route/cls/ematch_grammar.l"
1305 return META_MACLEN;
1306  YY_BREAK
1307 case 54:
1308 YY_RULE_SETUP
1309 #line 117 "route/cls/ematch_grammar.l"
1310 return META_MARK;
1311  YY_BREAK
1312 case 55:
1313 YY_RULE_SETUP
1314 #line 118 "route/cls/ematch_grammar.l"
1315 return META_TCINDEX;
1316  YY_BREAK
1317 case 56:
1318 YY_RULE_SETUP
1319 #line 119 "route/cls/ematch_grammar.l"
1320 return META_RTCLASSID;
1321  YY_BREAK
1322 case 57:
1323 YY_RULE_SETUP
1324 #line 120 "route/cls/ematch_grammar.l"
1325 return META_RTIIF;
1326  YY_BREAK
1327 case 58:
1328 YY_RULE_SETUP
1329 #line 121 "route/cls/ematch_grammar.l"
1330 return META_SK_FAMILY;
1331  YY_BREAK
1332 case 59:
1333 YY_RULE_SETUP
1334 #line 122 "route/cls/ematch_grammar.l"
1335 return META_SK_STATE;
1336  YY_BREAK
1337 case 60:
1338 YY_RULE_SETUP
1339 #line 123 "route/cls/ematch_grammar.l"
1340 return META_SK_REUSE;
1341  YY_BREAK
1342 case 61:
1343 YY_RULE_SETUP
1344 #line 124 "route/cls/ematch_grammar.l"
1345 return META_SK_REFCNT;
1346  YY_BREAK
1347 case 62:
1348 YY_RULE_SETUP
1349 #line 125 "route/cls/ematch_grammar.l"
1350 return META_SK_RCVBUF;
1351  YY_BREAK
1352 case 63:
1353 YY_RULE_SETUP
1354 #line 126 "route/cls/ematch_grammar.l"
1355 return META_SK_SNDBUF;
1356  YY_BREAK
1357 case 64:
1358 YY_RULE_SETUP
1359 #line 127 "route/cls/ematch_grammar.l"
1360 return META_SK_SHUTDOWN;
1361  YY_BREAK
1362 case 65:
1363 YY_RULE_SETUP
1364 #line 128 "route/cls/ematch_grammar.l"
1365 return META_SK_PROTO;
1366  YY_BREAK
1367 case 66:
1368 YY_RULE_SETUP
1369 #line 129 "route/cls/ematch_grammar.l"
1370 return META_SK_TYPE;
1371  YY_BREAK
1372 case 67:
1373 YY_RULE_SETUP
1374 #line 130 "route/cls/ematch_grammar.l"
1375 return META_SK_RMEM_ALLOC;
1376  YY_BREAK
1377 case 68:
1378 YY_RULE_SETUP
1379 #line 131 "route/cls/ematch_grammar.l"
1380 return META_SK_WMEM_ALLOC;
1381  YY_BREAK
1382 case 69:
1383 YY_RULE_SETUP
1384 #line 132 "route/cls/ematch_grammar.l"
1385 return META_SK_WMEM_QUEUED;
1386  YY_BREAK
1387 case 70:
1388 YY_RULE_SETUP
1389 #line 133 "route/cls/ematch_grammar.l"
1390 return META_SK_RCV_QLEN;
1391  YY_BREAK
1392 case 71:
1393 YY_RULE_SETUP
1394 #line 134 "route/cls/ematch_grammar.l"
1395 return META_SK_SND_QLEN;
1396  YY_BREAK
1397 case 72:
1398 YY_RULE_SETUP
1399 #line 135 "route/cls/ematch_grammar.l"
1400 return META_SK_ERR_QLEN;
1401  YY_BREAK
1402 case 73:
1403 YY_RULE_SETUP
1404 #line 136 "route/cls/ematch_grammar.l"
1405 return META_SK_FORWARD_ALLOCS;
1406  YY_BREAK
1407 case 74:
1408 YY_RULE_SETUP
1409 #line 137 "route/cls/ematch_grammar.l"
1410 return META_SK_ALLOCS;
1411  YY_BREAK
1412 case 75:
1413 YY_RULE_SETUP
1414 #line 138 "route/cls/ematch_grammar.l"
1415 return META_SK_ROUTE_CAPS;
1416  YY_BREAK
1417 case 76:
1418 YY_RULE_SETUP
1419 #line 139 "route/cls/ematch_grammar.l"
1420 return META_SK_HASH;
1421  YY_BREAK
1422 case 77:
1423 YY_RULE_SETUP
1424 #line 140 "route/cls/ematch_grammar.l"
1425 return META_SK_LINGERTIME;
1426  YY_BREAK
1427 case 78:
1428 YY_RULE_SETUP
1429 #line 141 "route/cls/ematch_grammar.l"
1430 return META_SK_ACK_BACKLOG;
1431  YY_BREAK
1432 case 79:
1433 YY_RULE_SETUP
1434 #line 142 "route/cls/ematch_grammar.l"
1435 return META_SK_MAX_ACK_BACKLOG;
1436  YY_BREAK
1437 case 80:
1438 YY_RULE_SETUP
1439 #line 143 "route/cls/ematch_grammar.l"
1440 return META_SK_PRIO;
1441  YY_BREAK
1442 case 81:
1443 YY_RULE_SETUP
1444 #line 144 "route/cls/ematch_grammar.l"
1445 return META_SK_RCVLOWAT;
1446  YY_BREAK
1447 case 82:
1448 YY_RULE_SETUP
1449 #line 145 "route/cls/ematch_grammar.l"
1450 return META_SK_RCVTIMEO;
1451  YY_BREAK
1452 case 83:
1453 YY_RULE_SETUP
1454 #line 146 "route/cls/ematch_grammar.l"
1455 return META_SK_SNDTIMEO;
1456  YY_BREAK
1457 case 84:
1458 YY_RULE_SETUP
1459 #line 147 "route/cls/ematch_grammar.l"
1460 return META_SK_SENDMSG_OFF;
1461  YY_BREAK
1462 case 85:
1463 YY_RULE_SETUP
1464 #line 148 "route/cls/ematch_grammar.l"
1465 return META_SK_WRITE_PENDING;
1466  YY_BREAK
1467 case 86:
1468 YY_RULE_SETUP
1469 #line 149 "route/cls/ematch_grammar.l"
1470 return META_VLAN;
1471  YY_BREAK
1472 case 87:
1473 YY_RULE_SETUP
1474 #line 150 "route/cls/ematch_grammar.l"
1475 return META_RXHASH;
1476  YY_BREAK
1477 case 88:
1478 YY_RULE_SETUP
1479 #line 152 "route/cls/ematch_grammar.l"
1480 return META_DEVNAME;
1481  YY_BREAK
1482 case 89:
1483 YY_RULE_SETUP
1484 #line 153 "route/cls/ematch_grammar.l"
1485 return META_SK_BOUND_IF;
1486  YY_BREAK
1487 case 90:
1488 YY_RULE_SETUP
1489 #line 156 "route/cls/ematch_grammar.l"
1490 {
1491  yylval->s = strdup(yytext);
1492  if (yylval->s == NULL)
1493  return ERROR;
1494  NL_DBG(4, "lex STR=%s\n", yylval->s);
1495  return STR;
1496  }
1497  YY_BREAK
1498 case 91:
1499 YY_RULE_SETUP
1500 #line 163 "route/cls/ematch_grammar.l"
1501 ECHO;
1502  YY_BREAK
1503 #line 1504 "route/cls/ematch_grammar.c"
1504 case YY_STATE_EOF(INITIAL):
1505 case YY_STATE_EOF(QUOTE):
1506  yyterminate();
1507 
1508  case YY_END_OF_BUFFER:
1509  {
1510  /* Amount of text matched not including the EOB char. */
1511  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1512 
1513  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1514  *yy_cp = yyg->yy_hold_char;
1515  YY_RESTORE_YY_MORE_OFFSET
1516 
1517  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1518  {
1519  /* We're scanning a new file or input source. It's
1520  * possible that this happened because the user
1521  * just pointed yyin at a new source and called
1522  * ematch_lex(). If so, then we have to assure
1523  * consistency between YY_CURRENT_BUFFER and our
1524  * globals. Here is the right place to do so, because
1525  * this is the first action (other than possibly a
1526  * back-up) that will match for the new input source.
1527  */
1528  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1529  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1530  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1531  }
1532 
1533  /* Note that here we test for yy_c_buf_p "<=" to the position
1534  * of the first EOB in the buffer, since yy_c_buf_p will
1535  * already have been incremented past the NUL character
1536  * (since all states make transitions on EOB to the
1537  * end-of-buffer state). Contrast this with the test
1538  * in input().
1539  */
1540  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1541  { /* This was really a NUL. */
1542  yy_state_type yy_next_state;
1543 
1544  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1545 
1546  yy_current_state = yy_get_previous_state( yyscanner );
1547 
1548  /* Okay, we're now positioned to make the NUL
1549  * transition. We couldn't have
1550  * yy_get_previous_state() go ahead and do it
1551  * for us because it doesn't know how to deal
1552  * with the possibility of jamming (and we don't
1553  * want to build jamming into it because then it
1554  * will run more slowly).
1555  */
1556 
1557  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1558 
1559  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1560 
1561  if ( yy_next_state )
1562  {
1563  /* Consume the NUL. */
1564  yy_cp = ++yyg->yy_c_buf_p;
1565  yy_current_state = yy_next_state;
1566  goto yy_match;
1567  }
1568 
1569  else
1570  {
1571  yy_cp = yyg->yy_c_buf_p;
1572  goto yy_find_action;
1573  }
1574  }
1575 
1576  else switch ( yy_get_next_buffer( yyscanner ) )
1577  {
1578  case EOB_ACT_END_OF_FILE:
1579  {
1580  yyg->yy_did_buffer_switch_on_eof = 0;
1581 
1582  if ( ematch_wrap(yyscanner ) )
1583  {
1584  /* Note: because we've taken care in
1585  * yy_get_next_buffer() to have set up
1586  * yytext, we can now set up
1587  * yy_c_buf_p so that if some total
1588  * hoser (like flex itself) wants to
1589  * call the scanner after we return the
1590  * YY_NULL, it'll still work - another
1591  * YY_NULL will get returned.
1592  */
1593  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1594 
1595  yy_act = YY_STATE_EOF(YY_START);
1596  goto do_action;
1597  }
1598 
1599  else
1600  {
1601  if ( ! yyg->yy_did_buffer_switch_on_eof )
1602  YY_NEW_FILE;
1603  }
1604  break;
1605  }
1606 
1607  case EOB_ACT_CONTINUE_SCAN:
1608  yyg->yy_c_buf_p =
1609  yyg->yytext_ptr + yy_amount_of_matched_text;
1610 
1611  yy_current_state = yy_get_previous_state( yyscanner );
1612 
1613  yy_cp = yyg->yy_c_buf_p;
1614  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1615  goto yy_match;
1616 
1617  case EOB_ACT_LAST_MATCH:
1618  yyg->yy_c_buf_p =
1619  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1620 
1621  yy_current_state = yy_get_previous_state( yyscanner );
1622 
1623  yy_cp = yyg->yy_c_buf_p;
1624  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1625  goto yy_find_action;
1626  }
1627  break;
1628  }
1629 
1630  default:
1631  YY_FATAL_ERROR(
1632  "fatal flex scanner internal error--no action found" );
1633  } /* end of action switch */
1634  } /* end of scanning one token */
1635  } /* end of user's declarations */
1636 } /* end of ematch_lex */
1637 
1638 /* yy_get_next_buffer - try to read in a new buffer
1639  *
1640  * Returns a code representing an action:
1641  * EOB_ACT_LAST_MATCH -
1642  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1643  * EOB_ACT_END_OF_FILE - end of file
1644  */
1645 static int yy_get_next_buffer (yyscan_t yyscanner)
1646 {
1647  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1648  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1649  char *source = yyg->yytext_ptr;
1650  yy_size_t number_to_move, i;
1651  int ret_val;
1652 
1653  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1654  YY_FATAL_ERROR(
1655  "fatal flex scanner internal error--end of buffer missed" );
1656 
1657  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1658  { /* Don't try to fill the buffer, so this is an EOF. */
1659  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1660  {
1661  /* We matched a single character, the EOB, so
1662  * treat this as a final EOF.
1663  */
1664  return EOB_ACT_END_OF_FILE;
1665  }
1666 
1667  else
1668  {
1669  /* We matched some text prior to the EOB, first
1670  * process it.
1671  */
1672  return EOB_ACT_LAST_MATCH;
1673  }
1674  }
1675 
1676  /* Try to read more data. */
1677 
1678  /* First move last chars to start of buffer. */
1679  number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1680 
1681  for ( i = 0; i < number_to_move; ++i )
1682  *(dest++) = *(source++);
1683 
1684  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1685  /* don't do the read, it's not guaranteed to return an EOF,
1686  * just force an EOF
1687  */
1688  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1689 
1690  else
1691  {
1692  int num_to_read =
1693  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1694 
1695  while ( num_to_read <= 0 )
1696  { /* Not enough room in the buffer - grow it. */
1697 
1698  /* just a shorter name for the current buffer */
1699  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1700 
1701  int yy_c_buf_p_offset =
1702  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1703 
1704  if ( b->yy_is_our_buffer )
1705  {
1706  yy_size_t new_size = b->yy_buf_size * 2;
1707 
1708  if ( new_size <= 0 )
1709  b->yy_buf_size += b->yy_buf_size / 8;
1710  else
1711  b->yy_buf_size *= 2;
1712 
1713  b->yy_ch_buf = (char *)
1714  /* Include room in for 2 EOB chars. */
1715  ematch_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1716  }
1717  else
1718  /* Can't grow it, we don't own it. */
1719  b->yy_ch_buf = 0;
1720 
1721  if ( ! b->yy_ch_buf )
1722  YY_FATAL_ERROR(
1723  "fatal error - scanner input buffer overflow" );
1724 
1725  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1726 
1727  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1728  number_to_move - 1;
1729 
1730  }
1731 
1732  if ( num_to_read > YY_READ_BUF_SIZE )
1733  num_to_read = YY_READ_BUF_SIZE;
1734 
1735  /* Read in more data. */
1736  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1737  yyg->yy_n_chars, num_to_read );
1738 
1739  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1740  }
1741 
1742  if ( yyg->yy_n_chars == 0 )
1743  {
1744  if ( number_to_move == YY_MORE_ADJ )
1745  {
1746  ret_val = EOB_ACT_END_OF_FILE;
1747  ematch_restart(yyin ,yyscanner);
1748  }
1749 
1750  else
1751  {
1752  ret_val = EOB_ACT_LAST_MATCH;
1753  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1754  YY_BUFFER_EOF_PENDING;
1755  }
1756  }
1757 
1758  else
1759  ret_val = EOB_ACT_CONTINUE_SCAN;
1760 
1761  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1762  /* Extend the array by 50%, plus the number we really need. */
1763  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1764  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ematch_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1765  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1766  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1767  }
1768 
1769  yyg->yy_n_chars += number_to_move;
1770  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1771  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1772 
1773  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1774 
1775  return ret_val;
1776 }
1777 
1778 /* yy_get_previous_state - get the state just before the EOB char was reached */
1779 
1780  static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1781 {
1782  yy_state_type yy_current_state;
1783  char *yy_cp;
1784  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1785 
1786  yy_current_state = yyg->yy_start;
1787 
1788  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1789  {
1790  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1791  if ( yy_accept[yy_current_state] )
1792  {
1793  yyg->yy_last_accepting_state = yy_current_state;
1794  yyg->yy_last_accepting_cpos = yy_cp;
1795  }
1796  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1797  {
1798  yy_current_state = (int) yy_def[yy_current_state];
1799  if ( yy_current_state >= 393 )
1800  yy_c = yy_meta[(unsigned int) yy_c];
1801  }
1802  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1803  }
1804 
1805  return yy_current_state;
1806 }
1807 
1808 /* yy_try_NUL_trans - try to make a transition on the NUL character
1809  *
1810  * synopsis
1811  * next_state = yy_try_NUL_trans( current_state );
1812  */
1813  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1814 {
1815  int yy_is_jam;
1816  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1817  char *yy_cp = yyg->yy_c_buf_p;
1818 
1819  YY_CHAR yy_c = 1;
1820  if ( yy_accept[yy_current_state] )
1821  {
1822  yyg->yy_last_accepting_state = yy_current_state;
1823  yyg->yy_last_accepting_cpos = yy_cp;
1824  }
1825  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1826  {
1827  yy_current_state = (int) yy_def[yy_current_state];
1828  if ( yy_current_state >= 393 )
1829  yy_c = yy_meta[(unsigned int) yy_c];
1830  }
1831  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1832  yy_is_jam = (yy_current_state == 392);
1833 
1834  (void)yyg;
1835  return yy_is_jam ? 0 : yy_current_state;
1836 }
1837 
1838 #ifndef YY_NO_UNPUT
1839 
1840 #endif
1841 
1842 #ifndef YY_NO_INPUT
1843 #ifdef __cplusplus
1844  static int yyinput (yyscan_t yyscanner)
1845 #else
1846  static int input (yyscan_t yyscanner)
1847 #endif
1848 
1849 {
1850  int c;
1851  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1852 
1853  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1854 
1855  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1856  {
1857  /* yy_c_buf_p now points to the character we want to return.
1858  * If this occurs *before* the EOB characters, then it's a
1859  * valid NUL; if not, then we've hit the end of the buffer.
1860  */
1861  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1862  /* This was really a NUL. */
1863  *yyg->yy_c_buf_p = '\0';
1864 
1865  else
1866  { /* need more input */
1867  yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1868  ++yyg->yy_c_buf_p;
1869 
1870  switch ( yy_get_next_buffer( yyscanner ) )
1871  {
1872  case EOB_ACT_LAST_MATCH:
1873  /* This happens because yy_g_n_b()
1874  * sees that we've accumulated a
1875  * token and flags that we need to
1876  * try matching the token before
1877  * proceeding. But for input(),
1878  * there's no matching to consider.
1879  * So convert the EOB_ACT_LAST_MATCH
1880  * to EOB_ACT_END_OF_FILE.
1881  */
1882 
1883  /* Reset buffer status. */
1884  ematch_restart(yyin ,yyscanner);
1885 
1886  /*FALLTHROUGH*/
1887 
1888  case EOB_ACT_END_OF_FILE:
1889  {
1890  if ( ematch_wrap(yyscanner ) )
1891  return EOF;
1892 
1893  if ( ! yyg->yy_did_buffer_switch_on_eof )
1894  YY_NEW_FILE;
1895 #ifdef __cplusplus
1896  return yyinput(yyscanner);
1897 #else
1898  return input(yyscanner);
1899 #endif
1900  }
1901 
1902  case EOB_ACT_CONTINUE_SCAN:
1903  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1904  break;
1905  }
1906  }
1907  }
1908 
1909  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1910  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1911  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1912 
1913  return c;
1914 }
1915 #endif /* ifndef YY_NO_INPUT */
1916 
1917 /** Immediately switch to a different input stream.
1918  * @param input_file A readable stream.
1919  * @param yyscanner The scanner object.
1920  * @note This function does not reset the start condition to @c INITIAL .
1921  */
1922  void ematch_restart (FILE * input_file , yyscan_t yyscanner)
1923 {
1924  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1925 
1926  if ( ! YY_CURRENT_BUFFER ){
1927  ematch_ensure_buffer_stack (yyscanner);
1928  YY_CURRENT_BUFFER_LVALUE =
1929  ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1930  }
1931 
1932  ematch__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1933  ematch__load_buffer_state(yyscanner );
1934 }
1935 
1936 /** Switch to a different input buffer.
1937  * @param new_buffer The new input buffer.
1938  * @param yyscanner The scanner object.
1939  */
1940  void ematch__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1941 {
1942  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1943 
1944  /* TODO. We should be able to replace this entire function body
1945  * with
1946  * ematch_pop_buffer_state();
1947  * ematch_push_buffer_state(new_buffer);
1948  */
1949  ematch_ensure_buffer_stack (yyscanner);
1950  if ( YY_CURRENT_BUFFER == new_buffer )
1951  return;
1952 
1953  if ( YY_CURRENT_BUFFER )
1954  {
1955  /* Flush out information for old buffer. */
1956  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1957  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1958  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1959  }
1960 
1961  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1962  ematch__load_buffer_state(yyscanner );
1963 
1964  /* We don't actually know whether we did this switch during
1965  * EOF (ematch_wrap()) processing, but the only time this flag
1966  * is looked at is after ematch_wrap() is called, so it's safe
1967  * to go ahead and always set it.
1968  */
1969  yyg->yy_did_buffer_switch_on_eof = 1;
1970 }
1971 
1972 static void ematch__load_buffer_state (yyscan_t yyscanner)
1973 {
1974  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1975  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1976  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1977  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1978  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1979 }
1980 
1981 /** Allocate and initialize an input buffer state.
1982  * @param file A readable stream.
1983  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1984  * @param yyscanner The scanner object.
1985  * @return the allocated buffer state.
1986  */
1987  YY_BUFFER_STATE ematch__create_buffer (FILE * file, int size , yyscan_t yyscanner)
1988 {
1989  YY_BUFFER_STATE b;
1990 
1991  b = (YY_BUFFER_STATE) ematch_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1992  if ( ! b )
1993  YY_FATAL_ERROR( "out of dynamic memory in ematch__create_buffer()" );
1994 
1995  b->yy_buf_size = (yy_size_t)size;
1996 
1997  /* yy_ch_buf has to be 2 characters longer than the size given because
1998  * we need to put in 2 end-of-buffer characters.
1999  */
2000  b->yy_ch_buf = (char *) ematch_alloc(b->yy_buf_size + 2 ,yyscanner );
2001  if ( ! b->yy_ch_buf )
2002  YY_FATAL_ERROR( "out of dynamic memory in ematch__create_buffer()" );
2003 
2004  b->yy_is_our_buffer = 1;
2005 
2006  ematch__init_buffer(b,file ,yyscanner);
2007 
2008  return b;
2009 }
2010 
2011 /** Destroy the buffer.
2012  * @param b a buffer created with ematch__create_buffer()
2013  * @param yyscanner The scanner object.
2014  */
2015  void ematch__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2016 {
2017  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2018 
2019  if ( ! b )
2020  return;
2021 
2022  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2023  YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2024 
2025  if ( b->yy_is_our_buffer )
2026  ematch_free((void *) b->yy_ch_buf ,yyscanner );
2027 
2028  ematch_free((void *) b ,yyscanner );
2029 }
2030 
2031 /* Initializes or reinitializes a buffer.
2032  * This function is sometimes called more than once on the same buffer,
2033  * such as during a ematch_restart() or at EOF.
2034  */
2035  static void ematch__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2036 
2037 {
2038  int oerrno = errno;
2039  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2040 
2041  ematch__flush_buffer(b ,yyscanner);
2042 
2043  b->yy_input_file = file;
2044  b->yy_fill_buffer = 1;
2045 
2046  /* If b is the current buffer, then ematch__init_buffer was _probably_
2047  * called from ematch_restart() or through yy_get_next_buffer.
2048  * In that case, we don't want to reset the lineno or column.
2049  */
2050  if (b != YY_CURRENT_BUFFER){
2051  b->yy_bs_lineno = 1;
2052  b->yy_bs_column = 0;
2053  }
2054 
2055  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2056 
2057  errno = oerrno;
2058 }
2059 
2060 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2061  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2062  * @param yyscanner The scanner object.
2063  */
2064  void ematch__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2065 {
2066  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2067  if ( ! b )
2068  return;
2069 
2070  b->yy_n_chars = 0;
2071 
2072  /* We always need two end-of-buffer characters. The first causes
2073  * a transition to the end-of-buffer state. The second causes
2074  * a jam in that state.
2075  */
2076  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2077  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2078 
2079  b->yy_buf_pos = &b->yy_ch_buf[0];
2080 
2081  b->yy_at_bol = 1;
2082  b->yy_buffer_status = YY_BUFFER_NEW;
2083 
2084  if ( b == YY_CURRENT_BUFFER )
2085  ematch__load_buffer_state(yyscanner );
2086 }
2087 
2088 /** Pushes the new state onto the stack. The new state becomes
2089  * the current state. This function will allocate the stack
2090  * if necessary.
2091  * @param new_buffer The new state.
2092  * @param yyscanner The scanner object.
2093  */
2094 void ematch_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2095 {
2096  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2097  if (new_buffer == NULL)
2098  return;
2099 
2100  ematch_ensure_buffer_stack(yyscanner);
2101 
2102  /* This block is copied from ematch__switch_to_buffer. */
2103  if ( YY_CURRENT_BUFFER )
2104  {
2105  /* Flush out information for old buffer. */
2106  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2107  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2108  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2109  }
2110 
2111  /* Only push if top exists. Otherwise, replace top. */
2112  if (YY_CURRENT_BUFFER)
2113  yyg->yy_buffer_stack_top++;
2114  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2115 
2116  /* copied from ematch__switch_to_buffer. */
2117  ematch__load_buffer_state(yyscanner );
2118  yyg->yy_did_buffer_switch_on_eof = 1;
2119 }
2120 
2121 /** Removes and deletes the top of the stack, if present.
2122  * The next element becomes the new top.
2123  * @param yyscanner The scanner object.
2124  */
2125 void ematch_pop_buffer_state (yyscan_t yyscanner)
2126 {
2127  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2128  if (!YY_CURRENT_BUFFER)
2129  return;
2130 
2131  ematch__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2132  YY_CURRENT_BUFFER_LVALUE = NULL;
2133  if (yyg->yy_buffer_stack_top > 0)
2134  --yyg->yy_buffer_stack_top;
2135 
2136  if (YY_CURRENT_BUFFER) {
2137  ematch__load_buffer_state(yyscanner );
2138  yyg->yy_did_buffer_switch_on_eof = 1;
2139  }
2140 }
2141 
2142 /* Allocates the stack if it does not exist.
2143  * Guarantees space for at least one push.
2144  */
2145 static void ematch_ensure_buffer_stack (yyscan_t yyscanner)
2146 {
2147  yy_size_t num_to_alloc;
2148  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2149 
2150  if (!yyg->yy_buffer_stack) {
2151 
2152  /* First allocation is just for 2 elements, since we don't know if this
2153  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2154  * immediate realloc on the next call.
2155  */
2156  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2157  yyg->yy_buffer_stack = (struct yy_buffer_state**)ematch_alloc
2158  (num_to_alloc * sizeof(struct yy_buffer_state*)
2159  , yyscanner);
2160  if ( ! yyg->yy_buffer_stack )
2161  YY_FATAL_ERROR( "out of dynamic memory in ematch_ensure_buffer_stack()" );
2162 
2163  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2164 
2165  yyg->yy_buffer_stack_max = num_to_alloc;
2166  yyg->yy_buffer_stack_top = 0;
2167  return;
2168  }
2169 
2170  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2171 
2172  /* Increase the buffer to prepare for a possible push. */
2173  yy_size_t grow_size = 8 /* arbitrary grow size */;
2174 
2175  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2176  yyg->yy_buffer_stack = (struct yy_buffer_state**)ematch_realloc
2177  (yyg->yy_buffer_stack,
2178  num_to_alloc * sizeof(struct yy_buffer_state*)
2179  , yyscanner);
2180  if ( ! yyg->yy_buffer_stack )
2181  YY_FATAL_ERROR( "out of dynamic memory in ematch_ensure_buffer_stack()" );
2182 
2183  /* zero only the new slots.*/
2184  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2185  yyg->yy_buffer_stack_max = num_to_alloc;
2186  }
2187 }
2188 
2189 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2190  * @param base the character buffer
2191  * @param size the size in bytes of the character buffer
2192  * @param yyscanner The scanner object.
2193  * @return the newly allocated buffer state object.
2194  */
2195 YY_BUFFER_STATE ematch__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2196 {
2197  YY_BUFFER_STATE b;
2198 
2199  if ( size < 2 ||
2200  base[size-2] != YY_END_OF_BUFFER_CHAR ||
2201  base[size-1] != YY_END_OF_BUFFER_CHAR )
2202  /* They forgot to leave room for the EOB's. */
2203  return 0;
2204 
2205  b = (YY_BUFFER_STATE) ematch_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2206  if ( ! b )
2207  YY_FATAL_ERROR( "out of dynamic memory in ematch__scan_buffer()" );
2208 
2209  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2210  b->yy_buf_pos = b->yy_ch_buf = base;
2211  b->yy_is_our_buffer = 0;
2212  b->yy_input_file = 0;
2213  b->yy_n_chars = b->yy_buf_size;
2214  b->yy_is_interactive = 0;
2215  b->yy_at_bol = 1;
2216  b->yy_fill_buffer = 0;
2217  b->yy_buffer_status = YY_BUFFER_NEW;
2218 
2219  ematch__switch_to_buffer(b ,yyscanner );
2220 
2221  return b;
2222 }
2223 
2224 /** Setup the input buffer state to scan a string. The next call to ematch_lex() will
2225  * scan from a @e copy of @a str.
2226  * @param yystr a NUL-terminated string to scan
2227  * @param yyscanner The scanner object.
2228  * @return the newly allocated buffer state object.
2229  * @note If you want to scan bytes that may contain NUL values, then use
2230  * ematch__scan_bytes() instead.
2231  */
2232 YY_BUFFER_STATE ematch__scan_string (yyconst char * yystr , yyscan_t yyscanner)
2233 {
2234 
2235  return ematch__scan_bytes(yystr,strlen(yystr) ,yyscanner);
2236 }
2237 
2238 /** Setup the input buffer state to scan the given bytes. The next call to ematch_lex() will
2239  * scan from a @e copy of @a bytes.
2240  * @param yybytes the byte buffer to scan
2241  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2242  * @param yyscanner The scanner object.
2243  * @return the newly allocated buffer state object.
2244  */
2245 YY_BUFFER_STATE ematch__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
2246 {
2247  YY_BUFFER_STATE b;
2248  char *buf;
2249  yy_size_t n;
2250  yy_size_t i;
2251 
2252  /* Get memory for full buffer, including space for trailing EOB's. */
2253  n = _yybytes_len + 2;
2254  buf = (char *) ematch_alloc(n ,yyscanner );
2255  if ( ! buf )
2256  YY_FATAL_ERROR( "out of dynamic memory in ematch__scan_bytes()" );
2257 
2258  for ( i = 0; i < _yybytes_len; ++i )
2259  buf[i] = yybytes[i];
2260 
2261  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2262 
2263  b = ematch__scan_buffer(buf,n ,yyscanner);
2264  if ( ! b )
2265  YY_FATAL_ERROR( "bad buffer in ematch__scan_bytes()" );
2266 
2267  /* It's okay to grow etc. this buffer, and we should throw it
2268  * away when we're done.
2269  */
2270  b->yy_is_our_buffer = 1;
2271 
2272  return b;
2273 }
2274 
2275 #ifndef YY_EXIT_FAILURE
2276 #define YY_EXIT_FAILURE 2
2277 #endif
2278 
2279 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2280 {
2281  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2282  (void)yyg;
2283  (void) fprintf( stderr, "%s\n", msg );
2284  exit( YY_EXIT_FAILURE );
2285 }
2286 
2287 /* Redefine yyless() so it works in section 3 code. */
2288 
2289 #undef yyless
2290 #define yyless(n) \
2291  do \
2292  { \
2293  /* Undo effects of setting up yytext. */ \
2294  yy_size_t yyless_macro_arg = (n); \
2295  YY_LESS_LINENO(yyless_macro_arg);\
2296  yytext[yyleng] = yyg->yy_hold_char; \
2297  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2298  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2299  *yyg->yy_c_buf_p = '\0'; \
2300  yyleng = yyless_macro_arg; \
2301  } \
2302  while ( 0 )
2303 
2304 /* Accessor methods (get/set functions) to struct members. */
2305 
2306 /** Get the user-defined data for this scanner.
2307  * @param yyscanner The scanner object.
2308  */
2309 YY_EXTRA_TYPE ematch_get_extra (yyscan_t yyscanner)
2310 {
2311  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2312  return yyextra;
2313 }
2314 
2315 /** Get the current line number.
2316  * @param yyscanner The scanner object.
2317  */
2318 int ematch_get_lineno (yyscan_t yyscanner)
2319 {
2320  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2321 
2322  if (! YY_CURRENT_BUFFER)
2323  return 0;
2324 
2325  return yylineno;
2326 }
2327 
2328 /** Get the current column number.
2329  * @param yyscanner The scanner object.
2330  */
2331 int ematch_get_column (yyscan_t yyscanner)
2332 {
2333  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2334 
2335  if (! YY_CURRENT_BUFFER)
2336  return 0;
2337 
2338  return yycolumn;
2339 }
2340 
2341 /** Get the input stream.
2342  * @param yyscanner The scanner object.
2343  */
2344 FILE *ematch_get_in (yyscan_t yyscanner)
2345 {
2346  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2347  return yyin;
2348 }
2349 
2350 /** Get the output stream.
2351  * @param yyscanner The scanner object.
2352  */
2353 FILE *ematch_get_out (yyscan_t yyscanner)
2354 {
2355  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2356  return yyout;
2357 }
2358 
2359 /** Get the length of the current token.
2360  * @param yyscanner The scanner object.
2361  */
2362 yy_size_t ematch_get_leng (yyscan_t yyscanner)
2363 {
2364  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2365  return yyleng;
2366 }
2367 
2368 /** Get the current token.
2369  * @param yyscanner The scanner object.
2370  */
2371 
2372 char *ematch_get_text (yyscan_t yyscanner)
2373 {
2374  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2375  return yytext;
2376 }
2377 
2378 /** Set the user-defined data. This data is never touched by the scanner.
2379  * @param user_defined The data to be associated with this scanner.
2380  * @param yyscanner The scanner object.
2381  */
2382 void ematch_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2383 {
2384  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2385  yyextra = user_defined ;
2386 }
2387 
2388 /** Set the current line number.
2389  * @param _line_number line number
2390  * @param yyscanner The scanner object.
2391  */
2392 void ematch_set_lineno (int _line_number , yyscan_t yyscanner)
2393 {
2394  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2395 
2396  /* lineno is only valid if an input buffer exists. */
2397  if (! YY_CURRENT_BUFFER )
2398  YY_FATAL_ERROR( "ematch_set_lineno called with no buffer" );
2399 
2400  yylineno = _line_number;
2401 }
2402 
2403 /** Set the current column.
2404  * @param _column_no column number
2405  * @param yyscanner The scanner object.
2406  */
2407 void ematch_set_column (int _column_no , yyscan_t yyscanner)
2408 {
2409  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2410 
2411  /* column is only valid if an input buffer exists. */
2412  if (! YY_CURRENT_BUFFER )
2413  YY_FATAL_ERROR( "ematch_set_column called with no buffer" );
2414 
2415  yycolumn = _column_no;
2416 }
2417 
2418 /** Set the input stream. This does not discard the current
2419  * input buffer.
2420  * @param _in_str A readable stream.
2421  * @param yyscanner The scanner object.
2422  * @see ematch__switch_to_buffer
2423  */
2424 void ematch_set_in (FILE * _in_str , yyscan_t yyscanner)
2425 {
2426  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2427  yyin = _in_str ;
2428 }
2429 
2430 void ematch_set_out (FILE * _out_str , yyscan_t yyscanner)
2431 {
2432  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2433  yyout = _out_str ;
2434 }
2435 
2436 int ematch_get_debug (yyscan_t yyscanner)
2437 {
2438  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2439  return yy_flex_debug;
2440 }
2441 
2442 void ematch_set_debug (int _bdebug , yyscan_t yyscanner)
2443 {
2444  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2445  yy_flex_debug = _bdebug ;
2446 }
2447 
2448 /* Accessor methods for yylval and yylloc */
2449 
2450 YYSTYPE * ematch_get_lval (yyscan_t yyscanner)
2451 {
2452  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2453  return yylval;
2454 }
2455 
2456 void ematch_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2457 {
2458  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2459  yylval = yylval_param;
2460 }
2461 
2462 /* User-visible API */
2463 
2464 /* ematch_lex_init is special because it creates the scanner itself, so it is
2465  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2466  * That's why we explicitly handle the declaration, instead of using our macros.
2467  */
2468 
2469 int ematch_lex_init(yyscan_t* ptr_yy_globals)
2470 
2471 {
2472  if (ptr_yy_globals == NULL){
2473  errno = EINVAL;
2474  return 1;
2475  }
2476 
2477  *ptr_yy_globals = (yyscan_t) ematch_alloc ( sizeof( struct yyguts_t ), NULL );
2478 
2479  if (*ptr_yy_globals == NULL){
2480  errno = ENOMEM;
2481  return 1;
2482  }
2483 
2484  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2485  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2486 
2487  return yy_init_globals ( *ptr_yy_globals );
2488 }
2489 
2490 /* ematch_lex_init_extra has the same functionality as ematch_lex_init, but follows the
2491  * convention of taking the scanner as the last argument. Note however, that
2492  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2493  * is the reason, too, why this function also must handle its own declaration).
2494  * The user defined value in the first argument will be available to ematch_alloc in
2495  * the yyextra field.
2496  */
2497 
2498 int ematch_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2499 
2500 {
2501  struct yyguts_t dummy_yyguts;
2502 
2503  ematch_set_extra (yy_user_defined, &dummy_yyguts);
2504 
2505  if (ptr_yy_globals == NULL){
2506  errno = EINVAL;
2507  return 1;
2508  }
2509 
2510  *ptr_yy_globals = (yyscan_t) ematch_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2511 
2512  if (*ptr_yy_globals == NULL){
2513  errno = ENOMEM;
2514  return 1;
2515  }
2516 
2517  /* By setting to 0xAA, we expose bugs in
2518  yy_init_globals. Leave at 0x00 for releases. */
2519  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2520 
2521  ematch_set_extra (yy_user_defined, *ptr_yy_globals);
2522 
2523  return yy_init_globals ( *ptr_yy_globals );
2524 }
2525 
2526 static int yy_init_globals (yyscan_t yyscanner)
2527 {
2528  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2529  /* Initialization is the same as for the non-reentrant scanner.
2530  * This function is called from ematch_lex_destroy(), so don't allocate here.
2531  */
2532 
2533  yyg->yy_buffer_stack = 0;
2534  yyg->yy_buffer_stack_top = 0;
2535  yyg->yy_buffer_stack_max = 0;
2536  yyg->yy_c_buf_p = (char *) 0;
2537  yyg->yy_init = 0;
2538  yyg->yy_start = 0;
2539 
2540  yyg->yy_start_stack_ptr = 0;
2541  yyg->yy_start_stack_depth = 0;
2542  yyg->yy_start_stack = NULL;
2543 
2544 /* Defined in main.c */
2545 #ifdef YY_STDINIT
2546  yyin = stdin;
2547  yyout = stdout;
2548 #else
2549  yyin = (FILE *) 0;
2550  yyout = (FILE *) 0;
2551 #endif
2552 
2553  /* For future reference: Set errno on error, since we are called by
2554  * ematch_lex_init()
2555  */
2556  return 0;
2557 }
2558 
2559 /* ematch_lex_destroy is for both reentrant and non-reentrant scanners. */
2560 int ematch_lex_destroy (yyscan_t yyscanner)
2561 {
2562  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2563 
2564  /* Pop the buffer stack, destroying each element. */
2565  while(YY_CURRENT_BUFFER){
2566  ematch__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2567  YY_CURRENT_BUFFER_LVALUE = NULL;
2568  ematch_pop_buffer_state(yyscanner);
2569  }
2570 
2571  /* Destroy the stack itself. */
2572  ematch_free(yyg->yy_buffer_stack ,yyscanner);
2573  yyg->yy_buffer_stack = NULL;
2574 
2575  /* Destroy the start condition stack. */
2576  ematch_free(yyg->yy_start_stack ,yyscanner );
2577  yyg->yy_start_stack = NULL;
2578 
2579  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2580  * ematch_lex() is called, initialization will occur. */
2581  yy_init_globals( yyscanner);
2582 
2583  /* Destroy the main struct (reentrant only). */
2584  ematch_free ( yyscanner , yyscanner );
2585  yyscanner = NULL;
2586  return 0;
2587 }
2588 
2589 /*
2590  * Internal utility routines.
2591  */
2592 
2593 #ifndef yytext_ptr
2594 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2595 {
2596  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2597  (void)yyg;
2598 
2599  int i;
2600  for ( i = 0; i < n; ++i )
2601  s1[i] = s2[i];
2602 }
2603 #endif
2604 
2605 #ifdef YY_NEED_STRLEN
2606 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2607 {
2608  int n;
2609  for ( n = 0; s[n]; ++n )
2610  ;
2611 
2612  return n;
2613 }
2614 #endif
2615 
2616 void *ematch_alloc (yy_size_t size , yyscan_t yyscanner)
2617 {
2618  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2619  (void)yyg;
2620  return (void *) malloc( size );
2621 }
2622 
2623 void *ematch_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2624 {
2625  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2626  (void)yyg;
2627 
2628  /* The cast to (char *) in the following accommodates both
2629  * implementations that use char* generic pointers, and those
2630  * that use void* generic pointers. It works with the latter
2631  * because both ANSI C and C++ allow castless assignment from
2632  * any pointer type to void*, and deal with argument conversions
2633  * as though doing an assignment.
2634  */
2635  return (void *) realloc( (char *) ptr, size );
2636 }
2637 
2638 void ematch_free (void * ptr , yyscan_t yyscanner)
2639 {
2640  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2641  (void)yyg;
2642  free( (char *) ptr ); /* see ematch_realloc() for (char *) cast */
2643 }
2644 
2645 #define YYTABLES_NAME "yytables"
2646 
2647 #line 163 "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.