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