libnl  3.2.24-rc1
ematch_syntax.c
1 /* A Bison parser, made by GNU Bison 2.6.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.6.4"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse ematch_parse
64 #define yylex ematch_lex
65 #define yyerror ematch_error
66 #define yylval ematch_lval
67 #define yychar ematch_char
68 #define yydebug ematch_debug
69 #define yynerrs ematch_nerrs
70 
71 /* Copy the first part of user declarations. */
72 /* Line 358 of yacc.c */
73 #line 12 "route/cls/ematch_syntax.y"
74 
75 #include <netlink-private/netlink.h>
76 #include <netlink-private/tc.h>
77 #include <netlink/netlink.h>
78 #include <netlink/utils.h>
79 #include <netlink/route/pktloc.h>
80 #include <netlink/route/cls/ematch.h>
81 #include <netlink/route/cls/ematch/cmp.h>
82 #include <netlink/route/cls/ematch/nbyte.h>
83 #include <netlink/route/cls/ematch/text.h>
84 #include <netlink/route/cls/ematch/meta.h>
85 
86 #define META_ALLOC rtnl_meta_value_alloc_id
87 #define META_ID(name) TCF_META_ID_##name
88 #define META_INT TCF_META_TYPE_INT
89 #define META_VAR TCF_META_TYPE_VAR
90 
91 /* Line 358 of yacc.c */
92 #line 93 "route/cls/ematch_syntax.c"
93 
94 # ifndef YY_NULL
95 # if defined __cplusplus && 201103L <= __cplusplus
96 # define YY_NULL nullptr
97 # else
98 # define YY_NULL 0
99 # endif
100 # endif
101 
102 /* Enabling verbose error messages. */
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
106 #else
107 # define YYERROR_VERBOSE 1
108 #endif
109 
110 /* In a future release of Bison, this section will be replaced
111  by #include "ematch_syntax.h". */
112 #ifndef YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
113 # define YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
114 /* Enabling traces. */
115 #ifndef YYDEBUG
116 # define YYDEBUG 0
117 #endif
118 #if YYDEBUG
119 extern int ematch_debug;
120 #endif
121 
122 /* Tokens. */
123 #ifndef YYTOKENTYPE
124 # define YYTOKENTYPE
125  /* Put the tokens into the symbol table, so that GDB and other debuggers
126  know about them. */
127  enum yytokentype {
128  ERROR = 258,
129  LOGIC = 259,
130  NOT = 260,
131  OPERAND = 261,
132  NUMBER = 262,
133  ALIGN = 263,
134  LAYER = 264,
135  KW_OPEN = 265,
136  KW_CLOSE = 266,
137  KW_PLUS = 267,
138  KW_MASK = 268,
139  KW_SHIFT = 269,
140  KW_AT = 270,
141  EMATCH_CMP = 271,
142  EMATCH_NBYTE = 272,
143  EMATCH_TEXT = 273,
144  EMATCH_META = 274,
145  KW_EQ = 275,
146  KW_GT = 276,
147  KW_LT = 277,
148  KW_FROM = 278,
149  KW_TO = 279,
150  META_RANDOM = 280,
151  META_LOADAVG_0 = 281,
152  META_LOADAVG_1 = 282,
153  META_LOADAVG_2 = 283,
154  META_DEV = 284,
155  META_PRIO = 285,
156  META_PROTO = 286,
157  META_PKTTYPE = 287,
158  META_PKTLEN = 288,
159  META_DATALEN = 289,
160  META_MACLEN = 290,
161  META_MARK = 291,
162  META_TCINDEX = 292,
163  META_RTCLASSID = 293,
164  META_RTIIF = 294,
165  META_SK_FAMILY = 295,
166  META_SK_STATE = 296,
167  META_SK_REUSE = 297,
168  META_SK_REFCNT = 298,
169  META_SK_RCVBUF = 299,
170  META_SK_SNDBUF = 300,
171  META_SK_SHUTDOWN = 301,
172  META_SK_PROTO = 302,
173  META_SK_TYPE = 303,
174  META_SK_RMEM_ALLOC = 304,
175  META_SK_WMEM_ALLOC = 305,
176  META_SK_WMEM_QUEUED = 306,
177  META_SK_RCV_QLEN = 307,
178  META_SK_SND_QLEN = 308,
179  META_SK_ERR_QLEN = 309,
180  META_SK_FORWARD_ALLOCS = 310,
181  META_SK_ALLOCS = 311,
182  META_SK_ROUTE_CAPS = 312,
183  META_SK_HASH = 313,
184  META_SK_LINGERTIME = 314,
185  META_SK_ACK_BACKLOG = 315,
186  META_SK_MAX_ACK_BACKLOG = 316,
187  META_SK_PRIO = 317,
188  META_SK_RCVLOWAT = 318,
189  META_SK_RCVTIMEO = 319,
190  META_SK_SNDTIMEO = 320,
191  META_SK_SENDMSG_OFF = 321,
192  META_SK_WRITE_PENDING = 322,
193  META_VLAN = 323,
194  META_RXHASH = 324,
195  META_DEVNAME = 325,
196  META_SK_BOUND_IF = 326,
197  STR = 327,
198  QUOTED = 328
199  };
200 #endif
201 /* Tokens. */
202 #define ERROR 258
203 #define LOGIC 259
204 #define NOT 260
205 #define OPERAND 261
206 #define NUMBER 262
207 #define ALIGN 263
208 #define LAYER 264
209 #define KW_OPEN 265
210 #define KW_CLOSE 266
211 #define KW_PLUS 267
212 #define KW_MASK 268
213 #define KW_SHIFT 269
214 #define KW_AT 270
215 #define EMATCH_CMP 271
216 #define EMATCH_NBYTE 272
217 #define EMATCH_TEXT 273
218 #define EMATCH_META 274
219 #define KW_EQ 275
220 #define KW_GT 276
221 #define KW_LT 277
222 #define KW_FROM 278
223 #define KW_TO 279
224 #define META_RANDOM 280
225 #define META_LOADAVG_0 281
226 #define META_LOADAVG_1 282
227 #define META_LOADAVG_2 283
228 #define META_DEV 284
229 #define META_PRIO 285
230 #define META_PROTO 286
231 #define META_PKTTYPE 287
232 #define META_PKTLEN 288
233 #define META_DATALEN 289
234 #define META_MACLEN 290
235 #define META_MARK 291
236 #define META_TCINDEX 292
237 #define META_RTCLASSID 293
238 #define META_RTIIF 294
239 #define META_SK_FAMILY 295
240 #define META_SK_STATE 296
241 #define META_SK_REUSE 297
242 #define META_SK_REFCNT 298
243 #define META_SK_RCVBUF 299
244 #define META_SK_SNDBUF 300
245 #define META_SK_SHUTDOWN 301
246 #define META_SK_PROTO 302
247 #define META_SK_TYPE 303
248 #define META_SK_RMEM_ALLOC 304
249 #define META_SK_WMEM_ALLOC 305
250 #define META_SK_WMEM_QUEUED 306
251 #define META_SK_RCV_QLEN 307
252 #define META_SK_SND_QLEN 308
253 #define META_SK_ERR_QLEN 309
254 #define META_SK_FORWARD_ALLOCS 310
255 #define META_SK_ALLOCS 311
256 #define META_SK_ROUTE_CAPS 312
257 #define META_SK_HASH 313
258 #define META_SK_LINGERTIME 314
259 #define META_SK_ACK_BACKLOG 315
260 #define META_SK_MAX_ACK_BACKLOG 316
261 #define META_SK_PRIO 317
262 #define META_SK_RCVLOWAT 318
263 #define META_SK_RCVTIMEO 319
264 #define META_SK_SNDTIMEO 320
265 #define META_SK_SENDMSG_OFF 321
266 #define META_SK_WRITE_PENDING 322
267 #define META_VLAN 323
268 #define META_RXHASH 324
269 #define META_DEVNAME 325
270 #define META_SK_BOUND_IF 326
271 #define STR 327
272 #define QUOTED 328
273 
274 
275 
276 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
277 typedef union YYSTYPE
278 {
279 /* Line 374 of yacc.c */
280 #line 39 "route/cls/ematch_syntax.y"
281 
282  struct tcf_em_cmp cmp;
283  struct ematch_quoted q;
284  struct rtnl_ematch * e;
285  struct rtnl_pktloc * loc;
286  struct rtnl_meta_value *mv;
287  uint32_t i;
288  uint64_t i64;
289  char * s;
290 
291 
292 /* Line 374 of yacc.c */
293 #line 294 "route/cls/ematch_syntax.c"
294 } YYSTYPE;
295 # define YYSTYPE_IS_TRIVIAL 1
296 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
297 # define YYSTYPE_IS_DECLARED 1
298 #endif
299 
300 
301 #ifdef YYPARSE_PARAM
302 #if defined __STDC__ || defined __cplusplus
303 int ematch_parse (void *YYPARSE_PARAM);
304 #else
305 int ematch_parse ();
306 #endif
307 #else /* ! YYPARSE_PARAM */
308 #if defined __STDC__ || defined __cplusplus
309 int ematch_parse (void *scanner, char **errp, struct nl_list_head *root);
310 #else
311 int ematch_parse ();
312 #endif
313 #endif /* ! YYPARSE_PARAM */
314 
315 #endif /* !YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED */
316 
317 /* Copy the second part of user declarations. */
318 /* Line 377 of yacc.c */
319 #line 50 "route/cls/ematch_syntax.y"
320 
321 extern int ematch_lex(YYSTYPE *, void *);
322 
323 static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg)
324 {
325  if (msg)
326  *errp = strdup(msg);
327  else
328  *errp = NULL;
329 }
330 
331 /* Line 377 of yacc.c */
332 #line 333 "route/cls/ematch_syntax.c"
333 
334 #ifdef short
335 # undef short
336 #endif
337 
338 #ifdef YYTYPE_UINT8
339 typedef YYTYPE_UINT8 yytype_uint8;
340 #else
341 typedef unsigned char yytype_uint8;
342 #endif
343 
344 #ifdef YYTYPE_INT8
345 typedef YYTYPE_INT8 yytype_int8;
346 #elif (defined __STDC__ || defined __C99__FUNC__ \
347  || defined __cplusplus || defined _MSC_VER)
348 typedef signed char yytype_int8;
349 #else
350 typedef short int yytype_int8;
351 #endif
352 
353 #ifdef YYTYPE_UINT16
354 typedef YYTYPE_UINT16 yytype_uint16;
355 #else
356 typedef unsigned short int yytype_uint16;
357 #endif
358 
359 #ifdef YYTYPE_INT16
360 typedef YYTYPE_INT16 yytype_int16;
361 #else
362 typedef short int yytype_int16;
363 #endif
364 
365 #ifndef YYSIZE_T
366 # ifdef __SIZE_TYPE__
367 # define YYSIZE_T __SIZE_TYPE__
368 # elif defined size_t
369 # define YYSIZE_T size_t
370 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
371  || defined __cplusplus || defined _MSC_VER)
372 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
373 # define YYSIZE_T size_t
374 # else
375 # define YYSIZE_T unsigned int
376 # endif
377 #endif
378 
379 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
380 
381 #ifndef YY_
382 # if defined YYENABLE_NLS && YYENABLE_NLS
383 # if ENABLE_NLS
384 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
385 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
386 # endif
387 # endif
388 # ifndef YY_
389 # define YY_(Msgid) Msgid
390 # endif
391 #endif
392 
393 /* Suppress unused-variable warnings by "using" E. */
394 #if ! defined lint || defined __GNUC__
395 # define YYUSE(E) ((void) (E))
396 #else
397 # define YYUSE(E) /* empty */
398 #endif
399 
400 /* Identity function, used to suppress warnings about constant conditions. */
401 #ifndef lint
402 # define YYID(N) (N)
403 #else
404 #if (defined __STDC__ || defined __C99__FUNC__ \
405  || defined __cplusplus || defined _MSC_VER)
406 static int
407 YYID (int yyi)
408 #else
409 static int
410 YYID (yyi)
411  int yyi;
412 #endif
413 {
414  return yyi;
415 }
416 #endif
417 
418 #if ! defined yyoverflow || YYERROR_VERBOSE
419 
420 /* The parser invokes alloca or malloc; define the necessary symbols. */
421 
422 # ifdef YYSTACK_USE_ALLOCA
423 # if YYSTACK_USE_ALLOCA
424 # ifdef __GNUC__
425 # define YYSTACK_ALLOC __builtin_alloca
426 # elif defined __BUILTIN_VA_ARG_INCR
427 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
428 # elif defined _AIX
429 # define YYSTACK_ALLOC __alloca
430 # elif defined _MSC_VER
431 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
432 # define alloca _alloca
433 # else
434 # define YYSTACK_ALLOC alloca
435 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
436  || defined __cplusplus || defined _MSC_VER)
437 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
438  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
439 # ifndef EXIT_SUCCESS
440 # define EXIT_SUCCESS 0
441 # endif
442 # endif
443 # endif
444 # endif
445 # endif
446 
447 # ifdef YYSTACK_ALLOC
448  /* Pacify GCC's `empty if-body' warning. */
449 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
450 # ifndef YYSTACK_ALLOC_MAXIMUM
451  /* The OS might guarantee only one guard page at the bottom of the stack,
452  and a page size can be as small as 4096 bytes. So we cannot safely
453  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
454  to allow for a few compiler-allocated temporary stack slots. */
455 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
456 # endif
457 # else
458 # define YYSTACK_ALLOC YYMALLOC
459 # define YYSTACK_FREE YYFREE
460 # ifndef YYSTACK_ALLOC_MAXIMUM
461 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
462 # endif
463 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
464  && ! ((defined YYMALLOC || defined malloc) \
465  && (defined YYFREE || defined free)))
466 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
467 # ifndef EXIT_SUCCESS
468 # define EXIT_SUCCESS 0
469 # endif
470 # endif
471 # ifndef YYMALLOC
472 # define YYMALLOC malloc
473 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
474  || defined __cplusplus || defined _MSC_VER)
475 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
476 # endif
477 # endif
478 # ifndef YYFREE
479 # define YYFREE free
480 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
481  || defined __cplusplus || defined _MSC_VER)
482 void free (void *); /* INFRINGES ON USER NAME SPACE */
483 # endif
484 # endif
485 # endif
486 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
487 
488 
489 #if (! defined yyoverflow \
490  && (! defined __cplusplus \
491  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
492 
493 /* A type that is properly aligned for any stack member. */
494 union yyalloc
495 {
496  yytype_int16 yyss_alloc;
497  YYSTYPE yyvs_alloc;
498 };
499 
500 /* The size of the maximum gap between one aligned stack and the next. */
501 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
502 
503 /* The size of an array large to enough to hold all stacks, each with
504  N elements. */
505 # define YYSTACK_BYTES(N) \
506  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
507  + YYSTACK_GAP_MAXIMUM)
508 
509 # define YYCOPY_NEEDED 1
510 
511 /* Relocate STACK from its old location to the new one. The
512  local variables YYSIZE and YYSTACKSIZE give the old and new number of
513  elements in the stack, and YYPTR gives the new location of the
514  stack. Advance YYPTR to a properly aligned location for the next
515  stack. */
516 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
517  do \
518  { \
519  YYSIZE_T yynewbytes; \
520  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
521  Stack = &yyptr->Stack_alloc; \
522  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
523  yyptr += yynewbytes / sizeof (*yyptr); \
524  } \
525  while (YYID (0))
526 
527 #endif
528 
529 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
530 /* Copy COUNT objects from SRC to DST. The source and destination do
531  not overlap. */
532 # ifndef YYCOPY
533 # if defined __GNUC__ && 1 < __GNUC__
534 # define YYCOPY(Dst, Src, Count) \
535  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
536 # else
537 # define YYCOPY(Dst, Src, Count) \
538  do \
539  { \
540  YYSIZE_T yyi; \
541  for (yyi = 0; yyi < (Count); yyi++) \
542  (Dst)[yyi] = (Src)[yyi]; \
543  } \
544  while (YYID (0))
545 # endif
546 # endif
547 #endif /* !YYCOPY_NEEDED */
548 
549 /* YYFINAL -- State number of the termination state. */
550 #define YYFINAL 26
551 /* YYLAST -- Last index in YYTABLE. */
552 #define YYLAST 138
553 
554 /* YYNTOKENS -- Number of terminals. */
555 #define YYNTOKENS 74
556 /* YYNNTS -- Number of nonterminals. */
557 #define YYNNTS 18
558 /* YYNRULES -- Number of rules. */
559 #define YYNRULES 84
560 /* YYNRULES -- Number of states. */
561 #define YYNSTATES 118
562 
563 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
564 #define YYUNDEFTOK 2
565 #define YYMAXUTOK 328
566 
567 #define YYTRANSLATE(YYX) \
568  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
569 
570 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
571 static const yytype_uint8 yytranslate[] =
572 {
573  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
599  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
600  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
601  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
602  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
603  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
604  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
605  65, 66, 67, 68, 69, 70, 71, 72, 73
606 };
607 
608 #if YYDEBUG
609 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
610  YYRHS. */
611 static const yytype_uint8 yyprhs[] =
612 {
613  0, 0, 3, 4, 6, 8, 12, 15, 17, 19,
614  26, 34, 41, 45, 50, 52, 56, 57, 60, 61,
615  64, 66, 68, 72, 75, 77, 79, 81, 83, 85,
616  87, 89, 91, 93, 95, 97, 99, 101, 103, 105,
617  107, 109, 111, 113, 115, 117, 119, 121, 123, 125,
618  127, 129, 131, 133, 135, 137, 139, 141, 143, 145,
619  147, 149, 151, 153, 155, 157, 159, 161, 163, 165,
620  167, 169, 171, 173, 175, 181, 182, 185, 188, 189,
621  192, 193, 196, 198, 200
622 };
623 
624 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
625 static const yytype_int8 yyrhs[] =
626 {
627  75, 0, -1, -1, 76, -1, 77, -1, 77, 4,
628  76, -1, 5, 78, -1, 78, -1, 79, -1, 17,
629  10, 87, 20, 86, 11, -1, 18, 10, 72, 73,
630  81, 82, 11, -1, 19, 10, 83, 91, 83, 11,
631  -1, 10, 76, 11, -1, 16, 10, 80, 11, -1,
632  80, -1, 87, 91, 7, -1, -1, 23, 87, -1,
633  -1, 24, 87, -1, 73, -1, 7, -1, 84, 90,
634  89, -1, 85, 90, -1, 25, -1, 26, -1, 27,
635  -1, 28, -1, 29, -1, 30, -1, 31, -1, 32,
636  -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
637  -1, 38, -1, 39, -1, 40, -1, 41, -1, 42,
638  -1, 43, -1, 44, -1, 45, -1, 46, -1, 47,
639  -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
640  -1, 53, -1, 54, -1, 55, -1, 56, -1, 57,
641  -1, 58, -1, 59, -1, 60, -1, 61, -1, 62,
642  -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
643  -1, 68, -1, 69, -1, 70, -1, 71, -1, 73,
644  -1, 72, -1, 72, -1, 88, 9, 12, 7, 89,
645  -1, -1, 8, 15, -1, 7, 15, -1, -1, 13,
646  7, -1, -1, 14, 7, -1, 20, -1, 21, -1,
647  22, -1
648 };
649 
650 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
651 static const yytype_uint16 yyrline[] =
652 {
653  0, 148, 148, 150, 157, 161, 173, 178, 186, 201,
654  219, 246, 265, 293, 295, 300, 321, 322, 328, 329,
655  334, 336, 338, 340, 345, 346, 347, 348, 349, 350,
656  351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
657  361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
658  371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
659  381, 382, 383, 384, 385, 386, 387, 388, 389, 393,
660  394, 401, 405, 434, 447, 473, 474, 476, 482, 483,
661  489, 490, 495, 497, 499
662 };
663 #endif
664 
665 #if YYDEBUG || YYERROR_VERBOSE || 1
666 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
668 static const char *const yytname[] =
669 {
670  "$end", "error", "$undefined", "ERROR", "LOGIC", "NOT", "OPERAND",
671  "NUMBER", "ALIGN", "LAYER", "\"(\"", "\")\"", "\"+\"", "\"mask\"",
672  "\">>\"", "\"at\"", "\"cmp\"", "\"pattern\"", "\"text\"", "\"meta\"",
673  "\"=\"", "\">\"", "\"<\"", "\"from\"", "\"to\"", "\"random\"",
674  "\"loadavg_0\"", "\"loadavg_1\"", "\"loadavg_2\"", "\"dev\"", "\"prio\"",
675  "\"proto\"", "\"pkttype\"", "\"pktlen\"", "\"datalen\"", "\"maclen\"",
676  "\"mark\"", "\"tcindex\"", "\"rtclassid\"", "\"rtiif\"", "\"sk_family\"",
677  "\"sk_state\"", "\"sk_reuse\"", "\"sk_refcnt\"", "\"sk_rcvbuf\"",
678  "\"sk_sndbuf\"", "\"sk_shutdown\"", "\"sk_proto\"", "\"sk_type\"",
679  "\"sk_rmem_alloc\"", "\"sk_wmem_alloc\"", "\"sk_wmem_queued\"",
680  "\"sk_rcv_qlen\"", "\"sk_snd_qlen\"", "\"sk_err_qlen\"",
681  "\"sk_forward_allocs\"", "\"sk_allocs\"", "\"sk_route_caps\"",
682  "\"sk_hash\"", "\"sk_lingertime\"", "\"sk_ack_backlog\"",
683  "\"sk_max_ack_backlog\"", "\"sk_prio\"", "\"sk_rcvlowat\"",
684  "\"sk_rcvtimeo\"", "\"sk_sndtimeo\"", "\"sk_sendmsg_off\"",
685  "\"sk_write_pending\"", "\"vlan\"", "\"rxhash\"", "\"devname\"",
686  "\"sk_bound_if\"", "STR", "QUOTED", "$accept", "input", "expr", "match",
687  "ematch", "cmp_match", "cmp_expr", "text_from", "text_to", "meta_value",
688  "meta_int_id", "meta_var_id", "pattern", "pktloc", "align", "mask",
689  "shift", "operand", YY_NULL
690 };
691 #endif
692 
693 # ifdef YYPRINT
694 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
695  token YYLEX-NUM. */
696 static const yytype_uint16 yytoknum[] =
697 {
698  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
699  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
700  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
701  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
702  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
703  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
704  315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
705  325, 326, 327, 328
706 };
707 # endif
708 
709 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
710 static const yytype_uint8 yyr1[] =
711 {
712  0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
713  78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
714  83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
715  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
716  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
717  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
718  84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
719  85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
720  90, 90, 91, 91, 91
721 };
722 
723 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
724 static const yytype_uint8 yyr2[] =
725 {
726  0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
727  7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
728  1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
729  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
730  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
731  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
732  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
733  1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
734  0, 2, 1, 1, 1
735 };
736 
737 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
738  Performed when YYTABLE doesn't specify something else to do. Zero
739  means the default is an error. */
740 static const yytype_uint8 yydefact[] =
741 {
742  2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
743  0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
744  76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
745  84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
746  26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
747  36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
748  46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
749  56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
750  66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
751  15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
752  72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
753  9, 17, 75, 0, 11, 79, 19, 10
754 };
755 
756 /* YYDEFGOTO[NTERM-NUM]. */
757 static const yytype_int8 yydefgoto[] =
758 {
759  -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
760  87, 88, 102, 16, 17, 108, 97, 31
761 };
762 
763 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
764  STATE-NUM. */
765 #define YYPACT_NINF -63
766 static const yytype_int8 yypact[] =
767 {
768  -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
769  26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
770  -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
771  -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
772  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
773  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
774  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
775  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
776  -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
777  -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
778  -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
779  -63, -63, 1, 47, -63, -63, -63, -63
780 };
781 
782 /* YYPGOTO[NTERM-NUM]. */
783 static const yytype_int8 yypgoto[] =
784 {
785  -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
786  -63, -63, -63, -23, -63, -36, -22, -21
787 };
788 
789 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
790  positive, shift that token. If negative, reduce the rule which
791  number is the opposite. If YYTABLE_NINF, syntax error. */
792 #define YYTABLE_NINF -76
793 static const yytype_int8 yytable[] =
794 {
795  35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
796  100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
797  22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
798  8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
799  89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
800  99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
801  18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
802  0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
803  111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
804  38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
805  48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
806  58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
807  68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
808  78, 79, 80, 81, 82, 83, 84, 0, 85
809 };
810 
811 #define yypact_value_is_default(Yystate) \
812  (!!((Yystate) == (-63)))
813 
814 #define yytable_value_is_error(Yytable_value) \
815  YYID (0)
816 
817 static const yytype_int8 yycheck[] =
818 {
819  23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
820  72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
821  10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
822  19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
823  27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
824  7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
825  1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
826  -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
827  103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
828  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
829  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
830  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
831  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
832  65, 66, 67, 68, 69, 70, 71, -1, 73
833 };
834 
835 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
836  symbol of state STATE-NUM. */
837 static const yytype_uint8 yystos[] =
838 {
839  0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
840  75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
841  15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
842  22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
843  27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
844  37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
845  47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
846  57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
847  67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
848  7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
849  72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
850  11, 87, 24, 82, 11, 7, 87, 11
851 };
852 
853 #define yyerrok (yyerrstatus = 0)
854 #define yyclearin (yychar = YYEMPTY)
855 #define YYEMPTY (-2)
856 #define YYEOF 0
857 
858 #define YYACCEPT goto yyacceptlab
859 #define YYABORT goto yyabortlab
860 #define YYERROR goto yyerrorlab
861 
862 
863 /* Like YYERROR except do call yyerror. This remains here temporarily
864  to ease the transition to the new meaning of YYERROR, for GCC.
865  Once GCC version 2 has supplanted version 1, this can go. However,
866  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
867  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
868  discussed. */
869 
870 #define YYFAIL goto yyerrlab
871 #if defined YYFAIL
872  /* This is here to suppress warnings from the GCC cpp's
873  -Wunused-macros. Normally we don't worry about that warning, but
874  some users do, and we want to make it easy for users to remove
875  YYFAIL uses, which will produce warnings from Bison 2.5. */
876 #endif
877 
878 #define YYRECOVERING() (!!yyerrstatus)
879 
880 #define YYBACKUP(Token, Value) \
881 do \
882  if (yychar == YYEMPTY) \
883  { \
884  yychar = (Token); \
885  yylval = (Value); \
886  YYPOPSTACK (yylen); \
887  yystate = *yyssp; \
888  goto yybackup; \
889  } \
890  else \
891  { \
892  yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
893  YYERROR; \
894  } \
895 while (YYID (0))
896 
897 
898 #define YYTERROR 1
899 #define YYERRCODE 256
900 
901 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
902  If N is 0, then set CURRENT to the empty location which ends
903  the previous symbol: RHS[0] (always defined). */
904 
905 #ifndef YYLLOC_DEFAULT
906 # define YYLLOC_DEFAULT(Current, Rhs, N) \
907  do \
908  if (YYID (N)) \
909  { \
910  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
911  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
912  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
913  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
914  } \
915  else \
916  { \
917  (Current).first_line = (Current).last_line = \
918  YYRHSLOC (Rhs, 0).last_line; \
919  (Current).first_column = (Current).last_column = \
920  YYRHSLOC (Rhs, 0).last_column; \
921  } \
922  while (YYID (0))
923 #endif
924 
925 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
926 
927 
928 
929 /* This macro is provided for backward compatibility. */
930 
931 #ifndef YY_LOCATION_PRINT
932 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
933 #endif
934 
935 
936 /* YYLEX -- calling `yylex' with the right arguments. */
937 
938 #ifdef YYLEX_PARAM
939 # define YYLEX yylex (&yylval, YYLEX_PARAM)
940 #else
941 # define YYLEX yylex (&yylval, scanner)
942 #endif
943 
944 /* Enable debugging if requested. */
945 #if YYDEBUG
946 
947 # ifndef YYFPRINTF
948 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
949 # define YYFPRINTF fprintf
950 # endif
951 
952 # define YYDPRINTF(Args) \
953 do { \
954  if (yydebug) \
955  YYFPRINTF Args; \
956 } while (YYID (0))
957 
958 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
959 do { \
960  if (yydebug) \
961  { \
962  YYFPRINTF (stderr, "%s ", Title); \
963  yy_symbol_print (stderr, \
964  Type, Value, scanner, errp, root); \
965  YYFPRINTF (stderr, "\n"); \
966  } \
967 } while (YYID (0))
968 
969 
970 /*--------------------------------.
971 | Print this symbol on YYOUTPUT. |
972 `--------------------------------*/
973 
974 /*ARGSUSED*/
975 #if (defined __STDC__ || defined __C99__FUNC__ \
976  || defined __cplusplus || defined _MSC_VER)
977 static void
978 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
979 #else
980 static void
981 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
982  FILE *yyoutput;
983  int yytype;
984  YYSTYPE const * const yyvaluep;
985  void *scanner;
986  char **errp;
987  struct nl_list_head *root;
988 #endif
989 {
990  FILE *yyo = yyoutput;
991  YYUSE (yyo);
992  if (!yyvaluep)
993  return;
994  YYUSE (scanner);
995  YYUSE (errp);
996  YYUSE (root);
997 # ifdef YYPRINT
998  if (yytype < YYNTOKENS)
999  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1000 # else
1001  YYUSE (yyoutput);
1002 # endif
1003  switch (yytype)
1004  {
1005  default:
1006  break;
1007  }
1008 }
1009 
1010 
1011 /*--------------------------------.
1012 | Print this symbol on YYOUTPUT. |
1013 `--------------------------------*/
1014 
1015 #if (defined __STDC__ || defined __C99__FUNC__ \
1016  || defined __cplusplus || defined _MSC_VER)
1017 static void
1018 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
1019 #else
1020 static void
1021 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
1022  FILE *yyoutput;
1023  int yytype;
1024  YYSTYPE const * const yyvaluep;
1025  void *scanner;
1026  char **errp;
1027  struct nl_list_head *root;
1028 #endif
1029 {
1030  if (yytype < YYNTOKENS)
1031  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1032  else
1033  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1034 
1035  yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1036  YYFPRINTF (yyoutput, ")");
1037 }
1038 
1039 /*------------------------------------------------------------------.
1040 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1041 | TOP (included). |
1042 `------------------------------------------------------------------*/
1043 
1044 #if (defined __STDC__ || defined __C99__FUNC__ \
1045  || defined __cplusplus || defined _MSC_VER)
1046 static void
1047 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1048 #else
1049 static void
1050 yy_stack_print (yybottom, yytop)
1051  yytype_int16 *yybottom;
1052  yytype_int16 *yytop;
1053 #endif
1054 {
1055  YYFPRINTF (stderr, "Stack now");
1056  for (; yybottom <= yytop; yybottom++)
1057  {
1058  int yybot = *yybottom;
1059  YYFPRINTF (stderr, " %d", yybot);
1060  }
1061  YYFPRINTF (stderr, "\n");
1062 }
1063 
1064 # define YY_STACK_PRINT(Bottom, Top) \
1065 do { \
1066  if (yydebug) \
1067  yy_stack_print ((Bottom), (Top)); \
1068 } while (YYID (0))
1069 
1070 
1071 /*------------------------------------------------.
1072 | Report that the YYRULE is going to be reduced. |
1073 `------------------------------------------------*/
1074 
1075 #if (defined __STDC__ || defined __C99__FUNC__ \
1076  || defined __cplusplus || defined _MSC_VER)
1077 static void
1078 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, char **errp, struct nl_list_head *root)
1079 #else
1080 static void
1081 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1082  YYSTYPE *yyvsp;
1083  int yyrule;
1084  void *scanner;
1085  char **errp;
1086  struct nl_list_head *root;
1087 #endif
1088 {
1089  int yynrhs = yyr2[yyrule];
1090  int yyi;
1091  unsigned long int yylno = yyrline[yyrule];
1092  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1093  yyrule - 1, yylno);
1094  /* The symbols being reduced. */
1095  for (yyi = 0; yyi < yynrhs; yyi++)
1096  {
1097  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1098  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1099  &(yyvsp[(yyi + 1) - (yynrhs)])
1100  , scanner, errp, root);
1101  YYFPRINTF (stderr, "\n");
1102  }
1103 }
1104 
1105 # define YY_REDUCE_PRINT(Rule) \
1106 do { \
1107  if (yydebug) \
1108  yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1109 } while (YYID (0))
1110 
1111 /* Nonzero means print parse trace. It is left uninitialized so that
1112  multiple parsers can coexist. */
1113 int yydebug;
1114 #else /* !YYDEBUG */
1115 # define YYDPRINTF(Args)
1116 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1117 # define YY_STACK_PRINT(Bottom, Top)
1118 # define YY_REDUCE_PRINT(Rule)
1119 #endif /* !YYDEBUG */
1120 
1121 
1122 /* YYINITDEPTH -- initial size of the parser's stacks. */
1123 #ifndef YYINITDEPTH
1124 # define YYINITDEPTH 200
1125 #endif
1126 
1127 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1128  if the built-in stack extension method is used).
1129 
1130  Do not make this value too large; the results are undefined if
1131  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1132  evaluated with infinite-precision integer arithmetic. */
1133 
1134 #ifndef YYMAXDEPTH
1135 # define YYMAXDEPTH 10000
1136 #endif
1137 
1138 
1139 #if YYERROR_VERBOSE
1140 
1141 # ifndef yystrlen
1142 # if defined __GLIBC__ && defined _STRING_H
1143 # define yystrlen strlen
1144 # else
1145 /* Return the length of YYSTR. */
1146 #if (defined __STDC__ || defined __C99__FUNC__ \
1147  || defined __cplusplus || defined _MSC_VER)
1148 static YYSIZE_T
1149 yystrlen (const char *yystr)
1150 #else
1151 static YYSIZE_T
1152 yystrlen (yystr)
1153  const char *yystr;
1154 #endif
1155 {
1156  YYSIZE_T yylen;
1157  for (yylen = 0; yystr[yylen]; yylen++)
1158  continue;
1159  return yylen;
1160 }
1161 # endif
1162 # endif
1163 
1164 # ifndef yystpcpy
1165 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1166 # define yystpcpy stpcpy
1167 # else
1168 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1169  YYDEST. */
1170 #if (defined __STDC__ || defined __C99__FUNC__ \
1171  || defined __cplusplus || defined _MSC_VER)
1172 static char *
1173 yystpcpy (char *yydest, const char *yysrc)
1174 #else
1175 static char *
1176 yystpcpy (yydest, yysrc)
1177  char *yydest;
1178  const char *yysrc;
1179 #endif
1180 {
1181  char *yyd = yydest;
1182  const char *yys = yysrc;
1183 
1184  while ((*yyd++ = *yys++) != '\0')
1185  continue;
1186 
1187  return yyd - 1;
1188 }
1189 # endif
1190 # endif
1191 
1192 # ifndef yytnamerr
1193 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1194  quotes and backslashes, so that it's suitable for yyerror. The
1195  heuristic is that double-quoting is unnecessary unless the string
1196  contains an apostrophe, a comma, or backslash (other than
1197  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1198  null, do not copy; instead, return the length of what the result
1199  would have been. */
1200 static YYSIZE_T
1201 yytnamerr (char *yyres, const char *yystr)
1202 {
1203  if (*yystr == '"')
1204  {
1205  YYSIZE_T yyn = 0;
1206  char const *yyp = yystr;
1207 
1208  for (;;)
1209  switch (*++yyp)
1210  {
1211  case '\'':
1212  case ',':
1213  goto do_not_strip_quotes;
1214 
1215  case '\\':
1216  if (*++yyp != '\\')
1217  goto do_not_strip_quotes;
1218  /* Fall through. */
1219  default:
1220  if (yyres)
1221  yyres[yyn] = *yyp;
1222  yyn++;
1223  break;
1224 
1225  case '"':
1226  if (yyres)
1227  yyres[yyn] = '\0';
1228  return yyn;
1229  }
1230  do_not_strip_quotes: ;
1231  }
1232 
1233  if (! yyres)
1234  return yystrlen (yystr);
1235 
1236  return yystpcpy (yyres, yystr) - yyres;
1237 }
1238 # endif
1239 
1240 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1241  about the unexpected token YYTOKEN for the state stack whose top is
1242  YYSSP.
1243 
1244  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1245  not large enough to hold the message. In that case, also set
1246  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1247  required number of bytes is too large to store. */
1248 static int
1249 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1250  yytype_int16 *yyssp, int yytoken)
1251 {
1252  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1253  YYSIZE_T yysize = yysize0;
1254  YYSIZE_T yysize1;
1255  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1256  /* Internationalized format string. */
1257  const char *yyformat = YY_NULL;
1258  /* Arguments of yyformat. */
1259  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1260  /* Number of reported tokens (one for the "unexpected", one per
1261  "expected"). */
1262  int yycount = 0;
1263 
1264  /* There are many possibilities here to consider:
1265  - Assume YYFAIL is not used. It's too flawed to consider. See
1266  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1267  for details. YYERROR is fine as it does not invoke this
1268  function.
1269  - If this state is a consistent state with a default action, then
1270  the only way this function was invoked is if the default action
1271  is an error action. In that case, don't check for expected
1272  tokens because there are none.
1273  - The only way there can be no lookahead present (in yychar) is if
1274  this state is a consistent state with a default action. Thus,
1275  detecting the absence of a lookahead is sufficient to determine
1276  that there is no unexpected or expected token to report. In that
1277  case, just report a simple "syntax error".
1278  - Don't assume there isn't a lookahead just because this state is a
1279  consistent state with a default action. There might have been a
1280  previous inconsistent state, consistent state with a non-default
1281  action, or user semantic action that manipulated yychar.
1282  - Of course, the expected token list depends on states to have
1283  correct lookahead information, and it depends on the parser not
1284  to perform extra reductions after fetching a lookahead from the
1285  scanner and before detecting a syntax error. Thus, state merging
1286  (from LALR or IELR) and default reductions corrupt the expected
1287  token list. However, the list is correct for canonical LR with
1288  one exception: it will still contain any token that will not be
1289  accepted due to an error action in a later state.
1290  */
1291  if (yytoken != YYEMPTY)
1292  {
1293  int yyn = yypact[*yyssp];
1294  yyarg[yycount++] = yytname[yytoken];
1295  if (!yypact_value_is_default (yyn))
1296  {
1297  /* Start YYX at -YYN if negative to avoid negative indexes in
1298  YYCHECK. In other words, skip the first -YYN actions for
1299  this state because they are default actions. */
1300  int yyxbegin = yyn < 0 ? -yyn : 0;
1301  /* Stay within bounds of both yycheck and yytname. */
1302  int yychecklim = YYLAST - yyn + 1;
1303  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1304  int yyx;
1305 
1306  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1307  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1308  && !yytable_value_is_error (yytable[yyx + yyn]))
1309  {
1310  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1311  {
1312  yycount = 1;
1313  yysize = yysize0;
1314  break;
1315  }
1316  yyarg[yycount++] = yytname[yyx];
1317  yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1318  if (! (yysize <= yysize1
1319  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1320  return 2;
1321  yysize = yysize1;
1322  }
1323  }
1324  }
1325 
1326  switch (yycount)
1327  {
1328 # define YYCASE_(N, S) \
1329  case N: \
1330  yyformat = S; \
1331  break
1332  YYCASE_(0, YY_("syntax error"));
1333  YYCASE_(1, YY_("syntax error, unexpected %s"));
1334  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1335  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1336  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1337  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1338 # undef YYCASE_
1339  }
1340 
1341  yysize1 = yysize + yystrlen (yyformat);
1342  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1343  return 2;
1344  yysize = yysize1;
1345 
1346  if (*yymsg_alloc < yysize)
1347  {
1348  *yymsg_alloc = 2 * yysize;
1349  if (! (yysize <= *yymsg_alloc
1350  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1351  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1352  return 1;
1353  }
1354 
1355  /* Avoid sprintf, as that infringes on the user's name space.
1356  Don't have undefined behavior even if the translation
1357  produced a string with the wrong number of "%s"s. */
1358  {
1359  char *yyp = *yymsg;
1360  int yyi = 0;
1361  while ((*yyp = *yyformat) != '\0')
1362  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1363  {
1364  yyp += yytnamerr (yyp, yyarg[yyi++]);
1365  yyformat += 2;
1366  }
1367  else
1368  {
1369  yyp++;
1370  yyformat++;
1371  }
1372  }
1373  return 0;
1374 }
1375 #endif /* YYERROR_VERBOSE */
1376 
1377 /*-----------------------------------------------.
1378 | Release the memory associated to this symbol. |
1379 `-----------------------------------------------*/
1380 
1381 /*ARGSUSED*/
1382 #if (defined __STDC__ || defined __C99__FUNC__ \
1383  || defined __cplusplus || defined _MSC_VER)
1384 static void
1385 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
1386 #else
1387 static void
1388 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1389  const char *yymsg;
1390  int yytype;
1391  YYSTYPE *yyvaluep;
1392  void *scanner;
1393  char **errp;
1394  struct nl_list_head *root;
1395 #endif
1396 {
1397  YYUSE (yyvaluep);
1398  YYUSE (scanner);
1399  YYUSE (errp);
1400  YYUSE (root);
1401 
1402  if (!yymsg)
1403  yymsg = "Deleting";
1404  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1405 
1406  switch (yytype)
1407  {
1408  case 72: /* STR */
1409 /* Line 1405 of yacc.c */
1410 #line 139 "route/cls/ematch_syntax.y"
1411  { free(((*yyvaluep).s)); NL_DBG(2, "string destructor\n"); };
1412 /* Line 1405 of yacc.c */
1413 #line 1414 "route/cls/ematch_syntax.c"
1414  break;
1415  case 73: /* QUOTED */
1416 /* Line 1405 of yacc.c */
1417 #line 141 "route/cls/ematch_syntax.y"
1418  { free(((*yyvaluep).q).data); NL_DBG(2, "quoted destructor\n"); };
1419 /* Line 1405 of yacc.c */
1420 #line 1421 "route/cls/ematch_syntax.c"
1421  break;
1422  case 81: /* text_from */
1423 /* Line 1405 of yacc.c */
1424 #line 140 "route/cls/ematch_syntax.y"
1425  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); };
1426 /* Line 1405 of yacc.c */
1427 #line 1428 "route/cls/ematch_syntax.c"
1428  break;
1429  case 82: /* text_to */
1430 /* Line 1405 of yacc.c */
1431 #line 140 "route/cls/ematch_syntax.y"
1432  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); };
1433 /* Line 1405 of yacc.c */
1434 #line 1435 "route/cls/ematch_syntax.c"
1435  break;
1436  case 83: /* meta_value */
1437 /* Line 1405 of yacc.c */
1438 #line 142 "route/cls/ematch_syntax.y"
1439  { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2, "meta value destructor\n"); };
1440 /* Line 1405 of yacc.c */
1441 #line 1442 "route/cls/ematch_syntax.c"
1442  break;
1443  case 86: /* pattern */
1444 /* Line 1405 of yacc.c */
1445 #line 141 "route/cls/ematch_syntax.y"
1446  { free(((*yyvaluep).q).data); NL_DBG(2, "quoted destructor\n"); };
1447 /* Line 1405 of yacc.c */
1448 #line 1449 "route/cls/ematch_syntax.c"
1449  break;
1450  case 87: /* pktloc */
1451 /* Line 1405 of yacc.c */
1452 #line 140 "route/cls/ematch_syntax.y"
1453  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); };
1454 /* Line 1405 of yacc.c */
1455 #line 1456 "route/cls/ematch_syntax.c"
1456  break;
1457 
1458  default:
1459  break;
1460  }
1461 }
1462 
1463 
1464 
1465 
1466 /*----------.
1467 | yyparse. |
1468 `----------*/
1469 
1470 #ifdef YYPARSE_PARAM
1471 #if (defined __STDC__ || defined __C99__FUNC__ \
1472  || defined __cplusplus || defined _MSC_VER)
1473 int
1474 yyparse (void *YYPARSE_PARAM)
1475 #else
1476 int
1477 yyparse (YYPARSE_PARAM)
1478  void *YYPARSE_PARAM;
1479 #endif
1480 #else /* ! YYPARSE_PARAM */
1481 #if (defined __STDC__ || defined __C99__FUNC__ \
1482  || defined __cplusplus || defined _MSC_VER)
1483 int
1484 yyparse (void *scanner, char **errp, struct nl_list_head *root)
1485 #else
1486 int
1487 yyparse (scanner, errp, root)
1488  void *scanner;
1489  char **errp;
1490  struct nl_list_head *root;
1491 #endif
1492 #endif
1493 {
1494 /* The lookahead symbol. */
1495 int yychar;
1496 
1497 
1498 #if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
1499 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1500 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1501  _Pragma ("GCC diagnostic push") \
1502  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1503 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1504  _Pragma ("GCC diagnostic pop")
1505 #else
1506 /* Default value used for initialization, for pacifying older GCCs
1507  or non-GCC compilers. */
1508 static YYSTYPE yyval_default;
1509 # define YYLVAL_INITIALIZE() (yylval = yyval_default)
1510 #endif
1511 #ifndef YYLVAL_INITIALIZE
1512 # define YYLVAL_INITIALIZE()
1513 #endif
1514 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1515 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1516 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1517 #endif
1518 
1519 /* The semantic value of the lookahead symbol. */
1520 YYSTYPE yylval;
1521 
1522  /* Number of syntax errors so far. */
1523  int yynerrs;
1524 
1525  int yystate;
1526  /* Number of tokens to shift before error messages enabled. */
1527  int yyerrstatus;
1528 
1529  /* The stacks and their tools:
1530  `yyss': related to states.
1531  `yyvs': related to semantic values.
1532 
1533  Refer to the stacks through separate pointers, to allow yyoverflow
1534  to reallocate them elsewhere. */
1535 
1536  /* The state stack. */
1537  yytype_int16 yyssa[YYINITDEPTH];
1538  yytype_int16 *yyss;
1539  yytype_int16 *yyssp;
1540 
1541  /* The semantic value stack. */
1542  YYSTYPE yyvsa[YYINITDEPTH];
1543  YYSTYPE *yyvs;
1544  YYSTYPE *yyvsp;
1545 
1546  YYSIZE_T yystacksize;
1547 
1548  int yyn;
1549  int yyresult;
1550  /* Lookahead token as an internal (translated) token number. */
1551  int yytoken = 0;
1552  /* The variables used to return semantic value and location from the
1553  action routines. */
1554  YYSTYPE yyval;
1555 
1556 #if YYERROR_VERBOSE
1557  /* Buffer for error messages, and its allocated size. */
1558  char yymsgbuf[128];
1559  char *yymsg = yymsgbuf;
1560  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1561 #endif
1562 
1563 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1564 
1565  /* The number of symbols on the RHS of the reduced rule.
1566  Keep to zero when no symbol should be popped. */
1567  int yylen = 0;
1568 
1569  yyss = yyssa;
1570  yyvs = yyvsa;
1571  yystacksize = YYINITDEPTH;
1572 
1573  YYDPRINTF ((stderr, "Starting parse\n"));
1574 
1575  yystate = 0;
1576  yyerrstatus = 0;
1577  yynerrs = 0;
1578  yychar = YYEMPTY; /* Cause a token to be read. */
1579 
1580  /* Initialize stack pointers.
1581  Waste one element of value and location stack
1582  so that they stay on the same level as the state stack.
1583  The wasted elements are never initialized. */
1584  yyssp = yyss;
1585  yyvsp = yyvs;
1586 
1587  YYLVAL_INITIALIZE ();
1588  goto yysetstate;
1589 
1590 /*------------------------------------------------------------.
1591 | yynewstate -- Push a new state, which is found in yystate. |
1592 `------------------------------------------------------------*/
1593  yynewstate:
1594  /* In all cases, when you get here, the value and location stacks
1595  have just been pushed. So pushing a state here evens the stacks. */
1596  yyssp++;
1597 
1598  yysetstate:
1599  *yyssp = yystate;
1600 
1601  if (yyss + yystacksize - 1 <= yyssp)
1602  {
1603  /* Get the current used size of the three stacks, in elements. */
1604  YYSIZE_T yysize = yyssp - yyss + 1;
1605 
1606 #ifdef yyoverflow
1607  {
1608  /* Give user a chance to reallocate the stack. Use copies of
1609  these so that the &'s don't force the real ones into
1610  memory. */
1611  YYSTYPE *yyvs1 = yyvs;
1612  yytype_int16 *yyss1 = yyss;
1613 
1614  /* Each stack pointer address is followed by the size of the
1615  data in use in that stack, in bytes. This used to be a
1616  conditional around just the two extra args, but that might
1617  be undefined if yyoverflow is a macro. */
1618  yyoverflow (YY_("memory exhausted"),
1619  &yyss1, yysize * sizeof (*yyssp),
1620  &yyvs1, yysize * sizeof (*yyvsp),
1621  &yystacksize);
1622 
1623  yyss = yyss1;
1624  yyvs = yyvs1;
1625  }
1626 #else /* no yyoverflow */
1627 # ifndef YYSTACK_RELOCATE
1628  goto yyexhaustedlab;
1629 # else
1630  /* Extend the stack our own way. */
1631  if (YYMAXDEPTH <= yystacksize)
1632  goto yyexhaustedlab;
1633  yystacksize *= 2;
1634  if (YYMAXDEPTH < yystacksize)
1635  yystacksize = YYMAXDEPTH;
1636 
1637  {
1638  yytype_int16 *yyss1 = yyss;
1639  union yyalloc *yyptr =
1640  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1641  if (! yyptr)
1642  goto yyexhaustedlab;
1643  YYSTACK_RELOCATE (yyss_alloc, yyss);
1644  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1645 # undef YYSTACK_RELOCATE
1646  if (yyss1 != yyssa)
1647  YYSTACK_FREE (yyss1);
1648  }
1649 # endif
1650 #endif /* no yyoverflow */
1651 
1652  yyssp = yyss + yysize - 1;
1653  yyvsp = yyvs + yysize - 1;
1654 
1655  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1656  (unsigned long int) yystacksize));
1657 
1658  if (yyss + yystacksize - 1 <= yyssp)
1659  YYABORT;
1660  }
1661 
1662  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1663 
1664  if (yystate == YYFINAL)
1665  YYACCEPT;
1666 
1667  goto yybackup;
1668 
1669 /*-----------.
1670 | yybackup. |
1671 `-----------*/
1672 yybackup:
1673 
1674  /* Do appropriate processing given the current state. Read a
1675  lookahead token if we need one and don't already have one. */
1676 
1677  /* First try to decide what to do without reference to lookahead token. */
1678  yyn = yypact[yystate];
1679  if (yypact_value_is_default (yyn))
1680  goto yydefault;
1681 
1682  /* Not known => get a lookahead token if don't already have one. */
1683 
1684  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1685  if (yychar == YYEMPTY)
1686  {
1687  YYDPRINTF ((stderr, "Reading a token: "));
1688  yychar = YYLEX;
1689  }
1690 
1691  if (yychar <= YYEOF)
1692  {
1693  yychar = yytoken = YYEOF;
1694  YYDPRINTF ((stderr, "Now at end of input.\n"));
1695  }
1696  else
1697  {
1698  yytoken = YYTRANSLATE (yychar);
1699  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1700  }
1701 
1702  /* If the proper action on seeing token YYTOKEN is to reduce or to
1703  detect an error, take that action. */
1704  yyn += yytoken;
1705  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1706  goto yydefault;
1707  yyn = yytable[yyn];
1708  if (yyn <= 0)
1709  {
1710  if (yytable_value_is_error (yyn))
1711  goto yyerrlab;
1712  yyn = -yyn;
1713  goto yyreduce;
1714  }
1715 
1716  /* Count tokens shifted since error; after three, turn off error
1717  status. */
1718  if (yyerrstatus)
1719  yyerrstatus--;
1720 
1721  /* Shift the lookahead token. */
1722  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1723 
1724  /* Discard the shifted token. */
1725  yychar = YYEMPTY;
1726 
1727  yystate = yyn;
1728  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1729  *++yyvsp = yylval;
1730  YY_IGNORE_MAYBE_UNINITIALIZED_END
1731 
1732  goto yynewstate;
1733 
1734 
1735 /*-----------------------------------------------------------.
1736 | yydefault -- do the default action for the current state. |
1737 `-----------------------------------------------------------*/
1738 yydefault:
1739  yyn = yydefact[yystate];
1740  if (yyn == 0)
1741  goto yyerrlab;
1742  goto yyreduce;
1743 
1744 
1745 /*-----------------------------.
1746 | yyreduce -- Do a reduction. |
1747 `-----------------------------*/
1748 yyreduce:
1749  /* yyn is the number of a rule to reduce with. */
1750  yylen = yyr2[yyn];
1751 
1752  /* If YYLEN is nonzero, implement the default value of the action:
1753  `$$ = $1'.
1754 
1755  Otherwise, the following line sets YYVAL to garbage.
1756  This behavior is undocumented and Bison
1757  users should not rely upon it. Assigning to YYVAL
1758  unconditionally makes the parser a bit smaller, and it avoids a
1759  GCC warning that YYVAL may be used uninitialized. */
1760  yyval = yyvsp[1-yylen];
1761 
1762 
1763  YY_REDUCE_PRINT (yyn);
1764  switch (yyn)
1765  {
1766  case 3:
1767 /* Line 1813 of yacc.c */
1768 #line 151 "route/cls/ematch_syntax.y"
1769  {
1770  nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1771  }
1772  break;
1773 
1774  case 4:
1775 /* Line 1813 of yacc.c */
1776 #line 158 "route/cls/ematch_syntax.y"
1777  {
1778  (yyval.e) = (yyvsp[(1) - (1)].e);
1779  }
1780  break;
1781 
1782  case 5:
1783 /* Line 1813 of yacc.c */
1784 #line 162 "route/cls/ematch_syntax.y"
1785  {
1786  rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1787 
1788  /* make ematch new head */
1789  nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1790 
1791  (yyval.e) = (yyvsp[(1) - (3)].e);
1792  }
1793  break;
1794 
1795  case 6:
1796 /* Line 1813 of yacc.c */
1797 #line 174 "route/cls/ematch_syntax.y"
1798  {
1799  rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1800  (yyval.e) = (yyvsp[(2) - (2)].e);
1801  }
1802  break;
1803 
1804  case 7:
1805 /* Line 1813 of yacc.c */
1806 #line 179 "route/cls/ematch_syntax.y"
1807  {
1808  (yyval.e) = (yyvsp[(1) - (1)].e);
1809  }
1810  break;
1811 
1812  case 8:
1813 /* Line 1813 of yacc.c */
1814 #line 187 "route/cls/ematch_syntax.y"
1815  {
1816  struct rtnl_ematch *e;
1817 
1818  if (!(e = rtnl_ematch_alloc())) {
1819  *errp = strdup("Unable to allocate ematch object");
1820  YYABORT;
1821  }
1822 
1823  if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1824  BUG();
1825 
1826  rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
1827  (yyval.e) = e;
1828  }
1829  break;
1830 
1831  case 9:
1832 /* Line 1813 of yacc.c */
1833 #line 202 "route/cls/ematch_syntax.y"
1834  {
1835  struct rtnl_ematch *e;
1836 
1837  if (!(e = rtnl_ematch_alloc())) {
1838  *errp = strdup("Unable to allocate ematch object");
1839  YYABORT;
1840  }
1841 
1842  if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1843  BUG();
1844 
1845  rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1846  rtnl_pktloc_put((yyvsp[(3) - (6)].loc));
1847  rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1848 
1849  (yyval.e) = e;
1850  }
1851  break;
1852 
1853  case 10:
1854 /* Line 1813 of yacc.c */
1855 #line 220 "route/cls/ematch_syntax.y"
1856  {
1857  struct rtnl_ematch *e;
1858 
1859  if (!(e = rtnl_ematch_alloc())) {
1860  *errp = strdup("Unable to allocate ematch object");
1861  YYABORT;
1862  }
1863 
1864  if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1865  BUG();
1866 
1867  rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1868  rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1869 
1870  if ((yyvsp[(5) - (7)].loc)) {
1871  rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1872  rtnl_pktloc_put((yyvsp[(5) - (7)].loc));
1873  }
1874 
1875  if ((yyvsp[(6) - (7)].loc)) {
1876  rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1877  rtnl_pktloc_put((yyvsp[(6) - (7)].loc));
1878  }
1879 
1880  (yyval.e) = e;
1881  }
1882  break;
1883 
1884  case 11:
1885 /* Line 1813 of yacc.c */
1886 #line 247 "route/cls/ematch_syntax.y"
1887  {
1888  struct rtnl_ematch *e;
1889 
1890  if (!(e = rtnl_ematch_alloc())) {
1891  *errp = strdup("Unable to allocate ematch object");
1892  YYABORT;
1893  }
1894 
1895  if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1896  BUG();
1897 
1898  rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1899  rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1900  rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1901 
1902  (yyval.e) = e;
1903  }
1904  break;
1905 
1906  case 12:
1907 /* Line 1813 of yacc.c */
1908 #line 266 "route/cls/ematch_syntax.y"
1909  {
1910  struct rtnl_ematch *e;
1911 
1912  if (!(e = rtnl_ematch_alloc())) {
1913  *errp = strdup("Unable to allocate ematch object");
1914  YYABORT;
1915  }
1916 
1917  if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1918  BUG();
1919 
1920  /* Make e->childs the list head of a the ematch sequence */
1921  nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1922 
1923  (yyval.e) = e;
1924  }
1925  break;
1926 
1927  case 13:
1928 /* Line 1813 of yacc.c */
1929 #line 294 "route/cls/ematch_syntax.y"
1930  { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1931  break;
1932 
1933  case 14:
1934 /* Line 1813 of yacc.c */
1935 #line 296 "route/cls/ematch_syntax.y"
1936  { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1937  break;
1938 
1939  case 15:
1940 /* Line 1813 of yacc.c */
1941 #line 301 "route/cls/ematch_syntax.y"
1942  {
1943  if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1944  (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1945  (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1946 
1947  memset(&(yyval.cmp), 0, sizeof((yyval.cmp)));
1948 
1949  (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1950  (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1951  (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1952  (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1953  (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1954  (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1955 
1956  rtnl_pktloc_put((yyvsp[(1) - (3)].loc));
1957  }
1958  break;
1959 
1960  case 16:
1961 /* Line 1813 of yacc.c */
1962 #line 321 "route/cls/ematch_syntax.y"
1963  { (yyval.loc) = NULL; }
1964  break;
1965 
1966  case 17:
1967 /* Line 1813 of yacc.c */
1968 #line 323 "route/cls/ematch_syntax.y"
1969  { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1970  break;
1971 
1972  case 18:
1973 /* Line 1813 of yacc.c */
1974 #line 328 "route/cls/ematch_syntax.y"
1975  { (yyval.loc) = NULL; }
1976  break;
1977 
1978  case 19:
1979 /* Line 1813 of yacc.c */
1980 #line 330 "route/cls/ematch_syntax.y"
1981  { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1982  break;
1983 
1984  case 20:
1985 /* Line 1813 of yacc.c */
1986 #line 335 "route/cls/ematch_syntax.y"
1987  { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
1988  break;
1989 
1990  case 21:
1991 /* Line 1813 of yacc.c */
1992 #line 337 "route/cls/ematch_syntax.y"
1993  { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
1994  break;
1995 
1996  case 22:
1997 /* Line 1813 of yacc.c */
1998 #line 339 "route/cls/ematch_syntax.y"
1999  { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
2000  break;
2001 
2002  case 23:
2003 /* Line 1813 of yacc.c */
2004 #line 341 "route/cls/ematch_syntax.y"
2005  { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
2006  break;
2007 
2008  case 24:
2009 /* Line 1813 of yacc.c */
2010 #line 345 "route/cls/ematch_syntax.y"
2011  { (yyval.i) = META_ID(RANDOM); }
2012  break;
2013 
2014  case 25:
2015 /* Line 1813 of yacc.c */
2016 #line 346 "route/cls/ematch_syntax.y"
2017  { (yyval.i) = META_ID(LOADAVG_0); }
2018  break;
2019 
2020  case 26:
2021 /* Line 1813 of yacc.c */
2022 #line 347 "route/cls/ematch_syntax.y"
2023  { (yyval.i) = META_ID(LOADAVG_1); }
2024  break;
2025 
2026  case 27:
2027 /* Line 1813 of yacc.c */
2028 #line 348 "route/cls/ematch_syntax.y"
2029  { (yyval.i) = META_ID(LOADAVG_2); }
2030  break;
2031 
2032  case 28:
2033 /* Line 1813 of yacc.c */
2034 #line 349 "route/cls/ematch_syntax.y"
2035  { (yyval.i) = META_ID(DEV); }
2036  break;
2037 
2038  case 29:
2039 /* Line 1813 of yacc.c */
2040 #line 350 "route/cls/ematch_syntax.y"
2041  { (yyval.i) = META_ID(PRIORITY); }
2042  break;
2043 
2044  case 30:
2045 /* Line 1813 of yacc.c */
2046 #line 351 "route/cls/ematch_syntax.y"
2047  { (yyval.i) = META_ID(PROTOCOL); }
2048  break;
2049 
2050  case 31:
2051 /* Line 1813 of yacc.c */
2052 #line 352 "route/cls/ematch_syntax.y"
2053  { (yyval.i) = META_ID(PKTTYPE); }
2054  break;
2055 
2056  case 32:
2057 /* Line 1813 of yacc.c */
2058 #line 353 "route/cls/ematch_syntax.y"
2059  { (yyval.i) = META_ID(PKTLEN); }
2060  break;
2061 
2062  case 33:
2063 /* Line 1813 of yacc.c */
2064 #line 354 "route/cls/ematch_syntax.y"
2065  { (yyval.i) = META_ID(DATALEN); }
2066  break;
2067 
2068  case 34:
2069 /* Line 1813 of yacc.c */
2070 #line 355 "route/cls/ematch_syntax.y"
2071  { (yyval.i) = META_ID(MACLEN); }
2072  break;
2073 
2074  case 35:
2075 /* Line 1813 of yacc.c */
2076 #line 356 "route/cls/ematch_syntax.y"
2077  { (yyval.i) = META_ID(NFMARK); }
2078  break;
2079 
2080  case 36:
2081 /* Line 1813 of yacc.c */
2082 #line 357 "route/cls/ematch_syntax.y"
2083  { (yyval.i) = META_ID(TCINDEX); }
2084  break;
2085 
2086  case 37:
2087 /* Line 1813 of yacc.c */
2088 #line 358 "route/cls/ematch_syntax.y"
2089  { (yyval.i) = META_ID(RTCLASSID); }
2090  break;
2091 
2092  case 38:
2093 /* Line 1813 of yacc.c */
2094 #line 359 "route/cls/ematch_syntax.y"
2095  { (yyval.i) = META_ID(RTIIF); }
2096  break;
2097 
2098  case 39:
2099 /* Line 1813 of yacc.c */
2100 #line 360 "route/cls/ematch_syntax.y"
2101  { (yyval.i) = META_ID(SK_FAMILY); }
2102  break;
2103 
2104  case 40:
2105 /* Line 1813 of yacc.c */
2106 #line 361 "route/cls/ematch_syntax.y"
2107  { (yyval.i) = META_ID(SK_STATE); }
2108  break;
2109 
2110  case 41:
2111 /* Line 1813 of yacc.c */
2112 #line 362 "route/cls/ematch_syntax.y"
2113  { (yyval.i) = META_ID(SK_REUSE); }
2114  break;
2115 
2116  case 42:
2117 /* Line 1813 of yacc.c */
2118 #line 363 "route/cls/ematch_syntax.y"
2119  { (yyval.i) = META_ID(SK_REFCNT); }
2120  break;
2121 
2122  case 43:
2123 /* Line 1813 of yacc.c */
2124 #line 364 "route/cls/ematch_syntax.y"
2125  { (yyval.i) = META_ID(SK_RCVBUF); }
2126  break;
2127 
2128  case 44:
2129 /* Line 1813 of yacc.c */
2130 #line 365 "route/cls/ematch_syntax.y"
2131  { (yyval.i) = META_ID(SK_SNDBUF); }
2132  break;
2133 
2134  case 45:
2135 /* Line 1813 of yacc.c */
2136 #line 366 "route/cls/ematch_syntax.y"
2137  { (yyval.i) = META_ID(SK_SHUTDOWN); }
2138  break;
2139 
2140  case 46:
2141 /* Line 1813 of yacc.c */
2142 #line 367 "route/cls/ematch_syntax.y"
2143  { (yyval.i) = META_ID(SK_PROTO); }
2144  break;
2145 
2146  case 47:
2147 /* Line 1813 of yacc.c */
2148 #line 368 "route/cls/ematch_syntax.y"
2149  { (yyval.i) = META_ID(SK_TYPE); }
2150  break;
2151 
2152  case 48:
2153 /* Line 1813 of yacc.c */
2154 #line 369 "route/cls/ematch_syntax.y"
2155  { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2156  break;
2157 
2158  case 49:
2159 /* Line 1813 of yacc.c */
2160 #line 370 "route/cls/ematch_syntax.y"
2161  { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2162  break;
2163 
2164  case 50:
2165 /* Line 1813 of yacc.c */
2166 #line 371 "route/cls/ematch_syntax.y"
2167  { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2168  break;
2169 
2170  case 51:
2171 /* Line 1813 of yacc.c */
2172 #line 372 "route/cls/ematch_syntax.y"
2173  { (yyval.i) = META_ID(SK_RCV_QLEN); }
2174  break;
2175 
2176  case 52:
2177 /* Line 1813 of yacc.c */
2178 #line 373 "route/cls/ematch_syntax.y"
2179  { (yyval.i) = META_ID(SK_SND_QLEN); }
2180  break;
2181 
2182  case 53:
2183 /* Line 1813 of yacc.c */
2184 #line 374 "route/cls/ematch_syntax.y"
2185  { (yyval.i) = META_ID(SK_ERR_QLEN); }
2186  break;
2187 
2188  case 54:
2189 /* Line 1813 of yacc.c */
2190 #line 375 "route/cls/ematch_syntax.y"
2191  { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2192  break;
2193 
2194  case 55:
2195 /* Line 1813 of yacc.c */
2196 #line 376 "route/cls/ematch_syntax.y"
2197  { (yyval.i) = META_ID(SK_ALLOCS); }
2198  break;
2199 
2200  case 56:
2201 /* Line 1813 of yacc.c */
2202 #line 377 "route/cls/ematch_syntax.y"
2203  { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2204  break;
2205 
2206  case 57:
2207 /* Line 1813 of yacc.c */
2208 #line 378 "route/cls/ematch_syntax.y"
2209  { (yyval.i) = META_ID(SK_HASH); }
2210  break;
2211 
2212  case 58:
2213 /* Line 1813 of yacc.c */
2214 #line 379 "route/cls/ematch_syntax.y"
2215  { (yyval.i) = META_ID(SK_LINGERTIME); }
2216  break;
2217 
2218  case 59:
2219 /* Line 1813 of yacc.c */
2220 #line 380 "route/cls/ematch_syntax.y"
2221  { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2222  break;
2223 
2224  case 60:
2225 /* Line 1813 of yacc.c */
2226 #line 381 "route/cls/ematch_syntax.y"
2227  { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2228  break;
2229 
2230  case 61:
2231 /* Line 1813 of yacc.c */
2232 #line 382 "route/cls/ematch_syntax.y"
2233  { (yyval.i) = META_ID(SK_PRIO); }
2234  break;
2235 
2236  case 62:
2237 /* Line 1813 of yacc.c */
2238 #line 383 "route/cls/ematch_syntax.y"
2239  { (yyval.i) = META_ID(SK_RCVLOWAT); }
2240  break;
2241 
2242  case 63:
2243 /* Line 1813 of yacc.c */
2244 #line 384 "route/cls/ematch_syntax.y"
2245  { (yyval.i) = META_ID(SK_RCVTIMEO); }
2246  break;
2247 
2248  case 64:
2249 /* Line 1813 of yacc.c */
2250 #line 385 "route/cls/ematch_syntax.y"
2251  { (yyval.i) = META_ID(SK_SNDTIMEO); }
2252  break;
2253 
2254  case 65:
2255 /* Line 1813 of yacc.c */
2256 #line 386 "route/cls/ematch_syntax.y"
2257  { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2258  break;
2259 
2260  case 66:
2261 /* Line 1813 of yacc.c */
2262 #line 387 "route/cls/ematch_syntax.y"
2263  { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2264  break;
2265 
2266  case 67:
2267 /* Line 1813 of yacc.c */
2268 #line 388 "route/cls/ematch_syntax.y"
2269  { (yyval.i) = META_ID(VLAN_TAG); }
2270  break;
2271 
2272  case 68:
2273 /* Line 1813 of yacc.c */
2274 #line 389 "route/cls/ematch_syntax.y"
2275  { (yyval.i) = META_ID(RXHASH); }
2276  break;
2277 
2278  case 69:
2279 /* Line 1813 of yacc.c */
2280 #line 393 "route/cls/ematch_syntax.y"
2281  { (yyval.i) = META_ID(DEV); }
2282  break;
2283 
2284  case 70:
2285 /* Line 1813 of yacc.c */
2286 #line 394 "route/cls/ematch_syntax.y"
2287  { (yyval.i) = META_ID(SK_BOUND_IF); }
2288  break;
2289 
2290  case 71:
2291 /* Line 1813 of yacc.c */
2292 #line 402 "route/cls/ematch_syntax.y"
2293  {
2294  (yyval.q) = (yyvsp[(1) - (1)].q);
2295  }
2296  break;
2297 
2298  case 72:
2299 /* Line 1813 of yacc.c */
2300 #line 406 "route/cls/ematch_syntax.y"
2301  {
2302  struct nl_addr *addr;
2303 
2304  if (nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2305  (yyval.q).len = nl_addr_get_len(addr);
2306 
2307  (yyval.q).index = min_t(int, (yyval.q).len, nl_addr_get_prefixlen(addr)/8);
2308 
2309  if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2310  nl_addr_put(addr);
2311  YYABORT;
2312  }
2313 
2314  memcpy((yyval.q).data, nl_addr_get_binary_addr(addr), (yyval.q).len);
2315  nl_addr_put(addr);
2316  } else {
2317  if (asprintf(errp, "invalid pattern \"%s\"", (yyvsp[(1) - (1)].s)) == -1)
2318  *errp = NULL;
2319  YYABORT;
2320  }
2321  }
2322  break;
2323 
2324  case 73:
2325 /* Line 1813 of yacc.c */
2326 #line 435 "route/cls/ematch_syntax.y"
2327  {
2328  struct rtnl_pktloc *loc;
2329 
2330  if (rtnl_pktloc_lookup((yyvsp[(1) - (1)].s), &loc) < 0) {
2331  if (asprintf(errp, "Packet location \"%s\" not found", (yyvsp[(1) - (1)].s)) == -1)
2332  *errp = NULL;
2333  YYABORT;
2334  }
2335 
2336  (yyval.loc) = loc;
2337  }
2338  break;
2339 
2340  case 74:
2341 /* Line 1813 of yacc.c */
2342 #line 448 "route/cls/ematch_syntax.y"
2343  {
2344  struct rtnl_pktloc *loc;
2345 
2346  if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2347  *errp = strdup("mask only allowed for alignments u8|u16|u32");
2348  YYABORT;
2349  }
2350 
2351  if (!(loc = rtnl_pktloc_alloc())) {
2352  *errp = strdup("Unable to allocate packet location object");
2353  YYABORT;
2354  }
2355 
2356  loc->name = strdup("<USER-DEFINED>");
2357  loc->align = (yyvsp[(1) - (5)].i);
2358  loc->layer = (yyvsp[(2) - (5)].i);
2359  loc->offset = (yyvsp[(4) - (5)].i);
2360  loc->mask = (yyvsp[(5) - (5)].i64);
2361 
2362  (yyval.loc) = loc;
2363  }
2364  break;
2365 
2366  case 75:
2367 /* Line 1813 of yacc.c */
2368 #line 473 "route/cls/ematch_syntax.y"
2369  { (yyval.i) = 0; }
2370  break;
2371 
2372  case 76:
2373 /* Line 1813 of yacc.c */
2374 #line 475 "route/cls/ematch_syntax.y"
2375  { (yyval.i) = (yyvsp[(1) - (2)].i); }
2376  break;
2377 
2378  case 77:
2379 /* Line 1813 of yacc.c */
2380 #line 477 "route/cls/ematch_syntax.y"
2381  { (yyval.i) = (yyvsp[(1) - (2)].i); }
2382  break;
2383 
2384  case 78:
2385 /* Line 1813 of yacc.c */
2386 #line 482 "route/cls/ematch_syntax.y"
2387  { (yyval.i64) = 0; }
2388  break;
2389 
2390  case 79:
2391 /* Line 1813 of yacc.c */
2392 #line 484 "route/cls/ematch_syntax.y"
2393  { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2394  break;
2395 
2396  case 80:
2397 /* Line 1813 of yacc.c */
2398 #line 489 "route/cls/ematch_syntax.y"
2399  { (yyval.i) = 0; }
2400  break;
2401 
2402  case 81:
2403 /* Line 1813 of yacc.c */
2404 #line 491 "route/cls/ematch_syntax.y"
2405  { (yyval.i) = (yyvsp[(2) - (2)].i); }
2406  break;
2407 
2408  case 82:
2409 /* Line 1813 of yacc.c */
2410 #line 496 "route/cls/ematch_syntax.y"
2411  { (yyval.i) = TCF_EM_OPND_EQ; }
2412  break;
2413 
2414  case 83:
2415 /* Line 1813 of yacc.c */
2416 #line 498 "route/cls/ematch_syntax.y"
2417  { (yyval.i) = TCF_EM_OPND_GT; }
2418  break;
2419 
2420  case 84:
2421 /* Line 1813 of yacc.c */
2422 #line 500 "route/cls/ematch_syntax.y"
2423  { (yyval.i) = TCF_EM_OPND_LT; }
2424  break;
2425 
2426 
2427 /* Line 1813 of yacc.c */
2428 #line 2429 "route/cls/ematch_syntax.c"
2429  default: break;
2430  }
2431  /* User semantic actions sometimes alter yychar, and that requires
2432  that yytoken be updated with the new translation. We take the
2433  approach of translating immediately before every use of yytoken.
2434  One alternative is translating here after every semantic action,
2435  but that translation would be missed if the semantic action invokes
2436  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2437  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2438  incorrect destructor might then be invoked immediately. In the
2439  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2440  to an incorrect destructor call or verbose syntax error message
2441  before the lookahead is translated. */
2442  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2443 
2444  YYPOPSTACK (yylen);
2445  yylen = 0;
2446  YY_STACK_PRINT (yyss, yyssp);
2447 
2448  *++yyvsp = yyval;
2449 
2450  /* Now `shift' the result of the reduction. Determine what state
2451  that goes to, based on the state we popped back to and the rule
2452  number reduced by. */
2453 
2454  yyn = yyr1[yyn];
2455 
2456  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2457  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2458  yystate = yytable[yystate];
2459  else
2460  yystate = yydefgoto[yyn - YYNTOKENS];
2461 
2462  goto yynewstate;
2463 
2464 
2465 /*------------------------------------.
2466 | yyerrlab -- here on detecting error |
2467 `------------------------------------*/
2468 yyerrlab:
2469  /* Make sure we have latest lookahead translation. See comments at
2470  user semantic actions for why this is necessary. */
2471  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2472 
2473  /* If not already recovering from an error, report this error. */
2474  if (!yyerrstatus)
2475  {
2476  ++yynerrs;
2477 #if ! YYERROR_VERBOSE
2478  yyerror (scanner, errp, root, YY_("syntax error"));
2479 #else
2480 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2481  yyssp, yytoken)
2482  {
2483  char const *yymsgp = YY_("syntax error");
2484  int yysyntax_error_status;
2485  yysyntax_error_status = YYSYNTAX_ERROR;
2486  if (yysyntax_error_status == 0)
2487  yymsgp = yymsg;
2488  else if (yysyntax_error_status == 1)
2489  {
2490  if (yymsg != yymsgbuf)
2491  YYSTACK_FREE (yymsg);
2492  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2493  if (!yymsg)
2494  {
2495  yymsg = yymsgbuf;
2496  yymsg_alloc = sizeof yymsgbuf;
2497  yysyntax_error_status = 2;
2498  }
2499  else
2500  {
2501  yysyntax_error_status = YYSYNTAX_ERROR;
2502  yymsgp = yymsg;
2503  }
2504  }
2505  yyerror (scanner, errp, root, yymsgp);
2506  if (yysyntax_error_status == 2)
2507  goto yyexhaustedlab;
2508  }
2509 # undef YYSYNTAX_ERROR
2510 #endif
2511  }
2512 
2513 
2514 
2515  if (yyerrstatus == 3)
2516  {
2517  /* If just tried and failed to reuse lookahead token after an
2518  error, discard it. */
2519 
2520  if (yychar <= YYEOF)
2521  {
2522  /* Return failure if at end of input. */
2523  if (yychar == YYEOF)
2524  YYABORT;
2525  }
2526  else
2527  {
2528  yydestruct ("Error: discarding",
2529  yytoken, &yylval, scanner, errp, root);
2530  yychar = YYEMPTY;
2531  }
2532  }
2533 
2534  /* Else will try to reuse lookahead token after shifting the error
2535  token. */
2536  goto yyerrlab1;
2537 
2538 
2539 /*---------------------------------------------------.
2540 | yyerrorlab -- error raised explicitly by YYERROR. |
2541 `---------------------------------------------------*/
2542 yyerrorlab:
2543 
2544  /* Pacify compilers like GCC when the user code never invokes
2545  YYERROR and the label yyerrorlab therefore never appears in user
2546  code. */
2547  if (/*CONSTCOND*/ 0)
2548  goto yyerrorlab;
2549 
2550  /* Do not reclaim the symbols of the rule which action triggered
2551  this YYERROR. */
2552  YYPOPSTACK (yylen);
2553  yylen = 0;
2554  YY_STACK_PRINT (yyss, yyssp);
2555  yystate = *yyssp;
2556  goto yyerrlab1;
2557 
2558 
2559 /*-------------------------------------------------------------.
2560 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2561 `-------------------------------------------------------------*/
2562 yyerrlab1:
2563  yyerrstatus = 3; /* Each real token shifted decrements this. */
2564 
2565  for (;;)
2566  {
2567  yyn = yypact[yystate];
2568  if (!yypact_value_is_default (yyn))
2569  {
2570  yyn += YYTERROR;
2571  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2572  {
2573  yyn = yytable[yyn];
2574  if (0 < yyn)
2575  break;
2576  }
2577  }
2578 
2579  /* Pop the current state because it cannot handle the error token. */
2580  if (yyssp == yyss)
2581  YYABORT;
2582 
2583 
2584  yydestruct ("Error: popping",
2585  yystos[yystate], yyvsp, scanner, errp, root);
2586  YYPOPSTACK (1);
2587  yystate = *yyssp;
2588  YY_STACK_PRINT (yyss, yyssp);
2589  }
2590 
2591  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2592  *++yyvsp = yylval;
2593  YY_IGNORE_MAYBE_UNINITIALIZED_END
2594 
2595 
2596  /* Shift the error token. */
2597  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2598 
2599  yystate = yyn;
2600  goto yynewstate;
2601 
2602 
2603 /*-------------------------------------.
2604 | yyacceptlab -- YYACCEPT comes here. |
2605 `-------------------------------------*/
2606 yyacceptlab:
2607  yyresult = 0;
2608  goto yyreturn;
2609 
2610 /*-----------------------------------.
2611 | yyabortlab -- YYABORT comes here. |
2612 `-----------------------------------*/
2613 yyabortlab:
2614  yyresult = 1;
2615  goto yyreturn;
2616 
2617 #if !defined yyoverflow || YYERROR_VERBOSE
2618 /*-------------------------------------------------.
2619 | yyexhaustedlab -- memory exhaustion comes here. |
2620 `-------------------------------------------------*/
2621 yyexhaustedlab:
2622  yyerror (scanner, errp, root, YY_("memory exhausted"));
2623  yyresult = 2;
2624  /* Fall through. */
2625 #endif
2626 
2627 yyreturn:
2628  if (yychar != YYEMPTY)
2629  {
2630  /* Make sure we have latest lookahead translation. See comments at
2631  user semantic actions for why this is necessary. */
2632  yytoken = YYTRANSLATE (yychar);
2633  yydestruct ("Cleanup: discarding lookahead",
2634  yytoken, &yylval, scanner, errp, root);
2635  }
2636  /* Do not reclaim the symbols of the rule which action triggered
2637  this YYABORT or YYACCEPT. */
2638  YYPOPSTACK (yylen);
2639  YY_STACK_PRINT (yyss, yyssp);
2640  while (yyssp != yyss)
2641  {
2642  yydestruct ("Cleanup: popping",
2643  yystos[*yyssp], yyvsp, scanner, errp, root);
2644  YYPOPSTACK (1);
2645  }
2646 #ifndef yyoverflow
2647  if (yyss != yyssa)
2648  YYSTACK_FREE (yyss);
2649 #endif
2650 #if YYERROR_VERBOSE
2651  if (yymsg != yymsgbuf)
2652  YYSTACK_FREE (yymsg);
2653 #endif
2654  /* Make sure YYID is used. */
2655  return YYID (yyresult);
2656 }
2657 
2658