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