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