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