libnl  3.4.0
pktloc_syntax.c
1 /* A Bison parser, made by GNU Bison 3.0.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015 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 "3.0.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 pktloc_parse
64 #define yylex pktloc_lex
65 #define yyerror pktloc_error
66 #define yydebug pktloc_debug
67 #define yynerrs pktloc_nerrs
68 
69 
70 /* Copy the first part of user declarations. */
71 #line 1 "lib/route/pktloc_syntax.y" /* yacc.c:339 */
72 
73 #include <netlink-private/netlink.h>
74 #include <netlink-private/tc.h>
75 #include <netlink/netlink.h>
76 #include <netlink/utils.h>
77 #include <netlink/route/pktloc.h>
78 
79 #line 80 "lib/route/pktloc_syntax.c" /* yacc.c:339 */
80 
81 # ifndef YY_NULLPTR
82 # if defined __cplusplus && 201103L <= __cplusplus
83 # define YY_NULLPTR nullptr
84 # else
85 # define YY_NULLPTR 0
86 # endif
87 # endif
88 
89 /* Enabling verbose error messages. */
90 #ifdef YYERROR_VERBOSE
91 # undef YYERROR_VERBOSE
92 # define YYERROR_VERBOSE 1
93 #else
94 # define YYERROR_VERBOSE 1
95 #endif
96 
97 /* In a future release of Bison, this section will be replaced
98  by #include "pktloc_syntax.h". */
99 #ifndef YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED
100 # define YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED
101 /* Debug traces. */
102 #ifndef YYDEBUG
103 # define YYDEBUG 0
104 #endif
105 #if YYDEBUG
106 extern int pktloc_debug;
107 #endif
108 
109 /* Token type. */
110 #ifndef YYTOKENTYPE
111 # define YYTOKENTYPE
112  enum yytokentype
113  {
114  ERROR = 258,
115  NUMBER = 259,
116  LAYER = 260,
117  ALIGN = 261,
118  NAME = 262
119  };
120 #endif
121 /* Tokens. */
122 #define ERROR 258
123 #define NUMBER 259
124 #define LAYER 260
125 #define ALIGN 261
126 #define NAME 262
127 
128 /* Value type. */
129 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
130 
131 union YYSTYPE
132 {
133 #line 18 "lib/route/pktloc_syntax.y" /* yacc.c:355 */
134 
135  struct rtnl_pktloc *l;
136  uint32_t i;
137  char *s;
138 
139 #line 140 "lib/route/pktloc_syntax.c" /* yacc.c:355 */
140 };
141 
142 typedef union YYSTYPE YYSTYPE;
143 # define YYSTYPE_IS_TRIVIAL 1
144 # define YYSTYPE_IS_DECLARED 1
145 #endif
146 
147 /* Location type. */
148 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
149 typedef struct YYLTYPE YYLTYPE;
150 struct YYLTYPE
151 {
152  int first_line;
153  int first_column;
154  int last_line;
155  int last_column;
156 };
157 # define YYLTYPE_IS_DECLARED 1
158 # define YYLTYPE_IS_TRIVIAL 1
159 #endif
160 
161 
162 
163 int pktloc_parse (void *scanner);
164 
165 #endif /* !YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED */
166 
167 /* Copy the second part of user declarations. */
168 #line 24 "lib/route/pktloc_syntax.y" /* yacc.c:358 */
169 
170 extern int pktloc_lex(YYSTYPE *, YYLTYPE *, void *);
171 
172 static void yyerror(YYLTYPE *locp, void *scanner, const char *msg)
173 {
174  NL_DBG(1, "Error while parsing packet location file: %s\n", msg);
175 }
176 
177 #line 178 "lib/route/pktloc_syntax.c" /* yacc.c:358 */
178 
179 #ifdef short
180 # undef short
181 #endif
182 
183 #ifdef YYTYPE_UINT8
184 typedef YYTYPE_UINT8 yytype_uint8;
185 #else
186 typedef unsigned char yytype_uint8;
187 #endif
188 
189 #ifdef YYTYPE_INT8
190 typedef YYTYPE_INT8 yytype_int8;
191 #else
192 typedef signed char yytype_int8;
193 #endif
194 
195 #ifdef YYTYPE_UINT16
196 typedef YYTYPE_UINT16 yytype_uint16;
197 #else
198 typedef unsigned short int yytype_uint16;
199 #endif
200 
201 #ifdef YYTYPE_INT16
202 typedef YYTYPE_INT16 yytype_int16;
203 #else
204 typedef short int yytype_int16;
205 #endif
206 
207 #ifndef YYSIZE_T
208 # ifdef __SIZE_TYPE__
209 # define YYSIZE_T __SIZE_TYPE__
210 # elif defined size_t
211 # define YYSIZE_T size_t
212 # elif ! defined YYSIZE_T
213 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
214 # define YYSIZE_T size_t
215 # else
216 # define YYSIZE_T unsigned int
217 # endif
218 #endif
219 
220 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
221 
222 #ifndef YY_
223 # if defined YYENABLE_NLS && YYENABLE_NLS
224 # if ENABLE_NLS
225 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
226 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
227 # endif
228 # endif
229 # ifndef YY_
230 # define YY_(Msgid) Msgid
231 # endif
232 #endif
233 
234 #ifndef YY_ATTRIBUTE
235 # if (defined __GNUC__ \
236  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
237  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
238 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
239 # else
240 # define YY_ATTRIBUTE(Spec) /* empty */
241 # endif
242 #endif
243 
244 #ifndef YY_ATTRIBUTE_PURE
245 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
246 #endif
247 
248 #ifndef YY_ATTRIBUTE_UNUSED
249 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
250 #endif
251 
252 #if !defined _Noreturn \
253  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
254 # if defined _MSC_VER && 1200 <= _MSC_VER
255 # define _Noreturn __declspec (noreturn)
256 # else
257 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
258 # endif
259 #endif
260 
261 /* Suppress unused-variable warnings by "using" E. */
262 #if ! defined lint || defined __GNUC__
263 # define YYUSE(E) ((void) (E))
264 #else
265 # define YYUSE(E) /* empty */
266 #endif
267 
268 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
269 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
270 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
271  _Pragma ("GCC diagnostic push") \
272  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
273  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
274 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
275  _Pragma ("GCC diagnostic pop")
276 #else
277 # define YY_INITIAL_VALUE(Value) Value
278 #endif
279 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
280 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
281 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
282 #endif
283 #ifndef YY_INITIAL_VALUE
284 # define YY_INITIAL_VALUE(Value) /* Nothing. */
285 #endif
286 
287 
288 #if ! defined yyoverflow || YYERROR_VERBOSE
289 
290 /* The parser invokes alloca or malloc; define the necessary symbols. */
291 
292 # ifdef YYSTACK_USE_ALLOCA
293 # if YYSTACK_USE_ALLOCA
294 # ifdef __GNUC__
295 # define YYSTACK_ALLOC __builtin_alloca
296 # elif defined __BUILTIN_VA_ARG_INCR
297 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
298 # elif defined _AIX
299 # define YYSTACK_ALLOC __alloca
300 # elif defined _MSC_VER
301 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
302 # define alloca _alloca
303 # else
304 # define YYSTACK_ALLOC alloca
305 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
306 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
307  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
308 # ifndef EXIT_SUCCESS
309 # define EXIT_SUCCESS 0
310 # endif
311 # endif
312 # endif
313 # endif
314 # endif
315 
316 # ifdef YYSTACK_ALLOC
317  /* Pacify GCC's 'empty if-body' warning. */
318 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
319 # ifndef YYSTACK_ALLOC_MAXIMUM
320  /* The OS might guarantee only one guard page at the bottom of the stack,
321  and a page size can be as small as 4096 bytes. So we cannot safely
322  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
323  to allow for a few compiler-allocated temporary stack slots. */
324 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
325 # endif
326 # else
327 # define YYSTACK_ALLOC YYMALLOC
328 # define YYSTACK_FREE YYFREE
329 # ifndef YYSTACK_ALLOC_MAXIMUM
330 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
331 # endif
332 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
333  && ! ((defined YYMALLOC || defined malloc) \
334  && (defined YYFREE || defined free)))
335 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
336 # ifndef EXIT_SUCCESS
337 # define EXIT_SUCCESS 0
338 # endif
339 # endif
340 # ifndef YYMALLOC
341 # define YYMALLOC malloc
342 # if ! defined malloc && ! defined EXIT_SUCCESS
343 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
344 # endif
345 # endif
346 # ifndef YYFREE
347 # define YYFREE free
348 # if ! defined free && ! defined EXIT_SUCCESS
349 void free (void *); /* INFRINGES ON USER NAME SPACE */
350 # endif
351 # endif
352 # endif
353 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
354 
355 
356 #if (! defined yyoverflow \
357  && (! defined __cplusplus \
358  || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
359  && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
360 
361 /* A type that is properly aligned for any stack member. */
362 union yyalloc
363 {
364  yytype_int16 yyss_alloc;
365  YYSTYPE yyvs_alloc;
366  YYLTYPE yyls_alloc;
367 };
368 
369 /* The size of the maximum gap between one aligned stack and the next. */
370 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
371 
372 /* The size of an array large to enough to hold all stacks, each with
373  N elements. */
374 # define YYSTACK_BYTES(N) \
375  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
376  + 2 * YYSTACK_GAP_MAXIMUM)
377 
378 # define YYCOPY_NEEDED 1
379 
380 /* Relocate STACK from its old location to the new one. The
381  local variables YYSIZE and YYSTACKSIZE give the old and new number of
382  elements in the stack, and YYPTR gives the new location of the
383  stack. Advance YYPTR to a properly aligned location for the next
384  stack. */
385 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
386  do \
387  { \
388  YYSIZE_T yynewbytes; \
389  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
390  Stack = &yyptr->Stack_alloc; \
391  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
392  yyptr += yynewbytes / sizeof (*yyptr); \
393  } \
394  while (0)
395 
396 #endif
397 
398 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
399 /* Copy COUNT objects from SRC to DST. The source and destination do
400  not overlap. */
401 # ifndef YYCOPY
402 # if defined __GNUC__ && 1 < __GNUC__
403 # define YYCOPY(Dst, Src, Count) \
404  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
405 # else
406 # define YYCOPY(Dst, Src, Count) \
407  do \
408  { \
409  YYSIZE_T yyi; \
410  for (yyi = 0; yyi < (Count); yyi++) \
411  (Dst)[yyi] = (Src)[yyi]; \
412  } \
413  while (0)
414 # endif
415 # endif
416 #endif /* !YYCOPY_NEEDED */
417 
418 /* YYFINAL -- State number of the termination state. */
419 #define YYFINAL 7
420 /* YYLAST -- Last index in YYTABLE. */
421 #define YYLAST 10
422 
423 /* YYNTOKENS -- Number of terminals. */
424 #define YYNTOKENS 9
425 /* YYNNTS -- Number of nonterminals. */
426 #define YYNNTS 7
427 /* YYNRULES -- Number of rules. */
428 #define YYNRULES 12
429 /* YYNSTATES -- Number of states. */
430 #define YYNSTATES 17
431 
432 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
433  by yylex, with out-of-bounds checking. */
434 #define YYUNDEFTOK 2
435 #define YYMAXUTOK 262
436 
437 #define YYTRANSLATE(YYX) \
438  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
439 
440 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
441  as returned by yylex, without out-of-bounds checking. */
442 static const yytype_uint8 yytranslate[] =
443 {
444  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448  2, 2, 2, 8, 2, 2, 2, 2, 2, 2,
449  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
470  5, 6, 7
471 };
472 
473 #if YYDEBUG
474  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
475 static const yytype_uint8 yyrline[] =
476 {
477  0, 45, 45, 47, 51, 78, 80, 86, 87, 93,
478  94, 100, 101
479 };
480 #endif
481 
482 #if YYDEBUG || YYERROR_VERBOSE || 1
483 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
484  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
485 static const char *const yytname[] =
486 {
487  "$end", "error", "$undefined", "ERROR", "NUMBER", "LAYER", "ALIGN",
488  "NAME", "'+'", "$accept", "input", "location", "align", "layer", "mask",
489  "shift", YY_NULLPTR
490 };
491 #endif
492 
493 # ifdef YYPRINT
494 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
495  (internal) symbol number NUM (which must be that of a token). */
496 static const yytype_uint16 yytoknum[] =
497 {
498  0, 256, 257, 258, 259, 260, 261, 262, 43
499 };
500 # endif
501 
502 #define YYPACT_NINF -7
503 
504 #define yypact_value_is_default(Yystate) \
505  (!!((Yystate) == (-7)))
506 
507 #define YYTABLE_NINF -1
508 
509 #define yytable_value_is_error(Yytable_value) \
510  0
511 
512  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
513  STATE-NUM. */
514 static const yytype_int8 yypact[] =
515 {
516  -6, -4, 3, -6, -7, -7, -1, -7, -7, -3,
517  2, -7, 4, -7, 5, -7, -7
518 };
519 
520  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
521  Performed when YYTABLE does not specify something else to do. Zero
522  means the default is an error. */
523 static const yytype_uint8 yydefact[] =
524 {
525  2, 0, 0, 2, 6, 5, 7, 1, 3, 0,
526  0, 8, 9, 10, 11, 12, 4
527 };
528 
529  /* YYPGOTO[NTERM-NUM]. */
530 static const yytype_int8 yypgoto[] =
531 {
532  -7, 7, -7, -7, -7, -7, -7
533 };
534 
535  /* YYDEFGOTO[NTERM-NUM]. */
536 static const yytype_int8 yydefgoto[] =
537 {
538  -1, 2, 3, 6, 10, 14, 16
539 };
540 
541  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
542  positive, shift that token. If negative, reduce the rule whose
543  number is the opposite. If YYTABLE_NINF, syntax error. */
544 static const yytype_uint8 yytable[] =
545 {
546  4, 1, 5, 7, 9, 11, 12, 0, 13, 15,
547  8
548 };
549 
550 static const yytype_int8 yycheck[] =
551 {
552  4, 7, 6, 0, 5, 8, 4, -1, 4, 4,
553  3
554 };
555 
556  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
557  symbol of state STATE-NUM. */
558 static const yytype_uint8 yystos[] =
559 {
560  0, 7, 10, 11, 4, 6, 12, 0, 10, 5,
561  13, 8, 4, 4, 14, 4, 15
562 };
563 
564  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
565 static const yytype_uint8 yyr1[] =
566 {
567  0, 9, 10, 10, 11, 12, 12, 13, 13, 14,
568  14, 15, 15
569 };
570 
571  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
572 static const yytype_uint8 yyr2[] =
573 {
574  0, 2, 0, 2, 6, 1, 1, 0, 2, 0,
575  1, 0, 1
576 };
577 
578 
579 #define yyerrok (yyerrstatus = 0)
580 #define yyclearin (yychar = YYEMPTY)
581 #define YYEMPTY (-2)
582 #define YYEOF 0
583 
584 #define YYACCEPT goto yyacceptlab
585 #define YYABORT goto yyabortlab
586 #define YYERROR goto yyerrorlab
587 
588 
589 #define YYRECOVERING() (!!yyerrstatus)
590 
591 #define YYBACKUP(Token, Value) \
592 do \
593  if (yychar == YYEMPTY) \
594  { \
595  yychar = (Token); \
596  yylval = (Value); \
597  YYPOPSTACK (yylen); \
598  yystate = *yyssp; \
599  goto yybackup; \
600  } \
601  else \
602  { \
603  yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
604  YYERROR; \
605  } \
606 while (0)
607 
608 /* Error token number */
609 #define YYTERROR 1
610 #define YYERRCODE 256
611 
612 
613 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
614  If N is 0, then set CURRENT to the empty location which ends
615  the previous symbol: RHS[0] (always defined). */
616 
617 #ifndef YYLLOC_DEFAULT
618 # define YYLLOC_DEFAULT(Current, Rhs, N) \
619  do \
620  if (N) \
621  { \
622  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
623  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
624  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
625  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
626  } \
627  else \
628  { \
629  (Current).first_line = (Current).last_line = \
630  YYRHSLOC (Rhs, 0).last_line; \
631  (Current).first_column = (Current).last_column = \
632  YYRHSLOC (Rhs, 0).last_column; \
633  } \
634  while (0)
635 #endif
636 
637 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
638 
639 
640 /* Enable debugging if requested. */
641 #if YYDEBUG
642 
643 # ifndef YYFPRINTF
644 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
645 # define YYFPRINTF fprintf
646 # endif
647 
648 # define YYDPRINTF(Args) \
649 do { \
650  if (yydebug) \
651  YYFPRINTF Args; \
652 } while (0)
653 
654 
655 /* YY_LOCATION_PRINT -- Print the location on the stream.
656  This macro was not mandated originally: define only if we know
657  we won't break user code: when these are the locations we know. */
658 
659 #ifndef YY_LOCATION_PRINT
660 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
661 
662 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
663 
664 YY_ATTRIBUTE_UNUSED
665 static unsigned
666 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
667 {
668  unsigned res = 0;
669  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
670  if (0 <= yylocp->first_line)
671  {
672  res += YYFPRINTF (yyo, "%d", yylocp->first_line);
673  if (0 <= yylocp->first_column)
674  res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
675  }
676  if (0 <= yylocp->last_line)
677  {
678  if (yylocp->first_line < yylocp->last_line)
679  {
680  res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
681  if (0 <= end_col)
682  res += YYFPRINTF (yyo, ".%d", end_col);
683  }
684  else if (0 <= end_col && yylocp->first_column < end_col)
685  res += YYFPRINTF (yyo, "-%d", end_col);
686  }
687  return res;
688  }
689 
690 # define YY_LOCATION_PRINT(File, Loc) \
691  yy_location_print_ (File, &(Loc))
692 
693 # else
694 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
695 # endif
696 #endif
697 
698 
699 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
700 do { \
701  if (yydebug) \
702  { \
703  YYFPRINTF (stderr, "%s ", Title); \
704  yy_symbol_print (stderr, \
705  Type, Value, Location, scanner); \
706  YYFPRINTF (stderr, "\n"); \
707  } \
708 } while (0)
709 
710 
711 /*----------------------------------------.
712 | Print this symbol's value on YYOUTPUT. |
713 `----------------------------------------*/
714 
715 static void
716 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
717 {
718  FILE *yyo = yyoutput;
719  YYUSE (yyo);
720  YYUSE (yylocationp);
721  YYUSE (scanner);
722  if (!yyvaluep)
723  return;
724 # ifdef YYPRINT
725  if (yytype < YYNTOKENS)
726  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
727 # endif
728  YYUSE (yytype);
729 }
730 
731 
732 /*--------------------------------.
733 | Print this symbol on YYOUTPUT. |
734 `--------------------------------*/
735 
736 static void
737 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
738 {
739  YYFPRINTF (yyoutput, "%s %s (",
740  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
741 
742  YY_LOCATION_PRINT (yyoutput, *yylocationp);
743  YYFPRINTF (yyoutput, ": ");
744  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
745  YYFPRINTF (yyoutput, ")");
746 }
747 
748 /*------------------------------------------------------------------.
749 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
750 | TOP (included). |
751 `------------------------------------------------------------------*/
752 
753 static void
754 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
755 {
756  YYFPRINTF (stderr, "Stack now");
757  for (; yybottom <= yytop; yybottom++)
758  {
759  int yybot = *yybottom;
760  YYFPRINTF (stderr, " %d", yybot);
761  }
762  YYFPRINTF (stderr, "\n");
763 }
764 
765 # define YY_STACK_PRINT(Bottom, Top) \
766 do { \
767  if (yydebug) \
768  yy_stack_print ((Bottom), (Top)); \
769 } while (0)
770 
771 
772 /*------------------------------------------------.
773 | Report that the YYRULE is going to be reduced. |
774 `------------------------------------------------*/
775 
776 static void
777 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
778 {
779  unsigned long int yylno = yyrline[yyrule];
780  int yynrhs = yyr2[yyrule];
781  int yyi;
782  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
783  yyrule - 1, yylno);
784  /* The symbols being reduced. */
785  for (yyi = 0; yyi < yynrhs; yyi++)
786  {
787  YYFPRINTF (stderr, " $%d = ", yyi + 1);
788  yy_symbol_print (stderr,
789  yystos[yyssp[yyi + 1 - yynrhs]],
790  &(yyvsp[(yyi + 1) - (yynrhs)])
791  , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner);
792  YYFPRINTF (stderr, "\n");
793  }
794 }
795 
796 # define YY_REDUCE_PRINT(Rule) \
797 do { \
798  if (yydebug) \
799  yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
800 } while (0)
801 
802 /* Nonzero means print parse trace. It is left uninitialized so that
803  multiple parsers can coexist. */
804 int yydebug;
805 #else /* !YYDEBUG */
806 # define YYDPRINTF(Args)
807 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
808 # define YY_STACK_PRINT(Bottom, Top)
809 # define YY_REDUCE_PRINT(Rule)
810 #endif /* !YYDEBUG */
811 
812 
813 /* YYINITDEPTH -- initial size of the parser's stacks. */
814 #ifndef YYINITDEPTH
815 # define YYINITDEPTH 200
816 #endif
817 
818 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
819  if the built-in stack extension method is used).
820 
821  Do not make this value too large; the results are undefined if
822  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
823  evaluated with infinite-precision integer arithmetic. */
824 
825 #ifndef YYMAXDEPTH
826 # define YYMAXDEPTH 10000
827 #endif
828 
829 
830 #if YYERROR_VERBOSE
831 
832 # ifndef yystrlen
833 # if defined __GLIBC__ && defined _STRING_H
834 # define yystrlen strlen
835 # else
836 /* Return the length of YYSTR. */
837 static YYSIZE_T
838 yystrlen (const char *yystr)
839 {
840  YYSIZE_T yylen;
841  for (yylen = 0; yystr[yylen]; yylen++)
842  continue;
843  return yylen;
844 }
845 # endif
846 # endif
847 
848 # ifndef yystpcpy
849 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
850 # define yystpcpy stpcpy
851 # else
852 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
853  YYDEST. */
854 static char *
855 yystpcpy (char *yydest, const char *yysrc)
856 {
857  char *yyd = yydest;
858  const char *yys = yysrc;
859 
860  while ((*yyd++ = *yys++) != '\0')
861  continue;
862 
863  return yyd - 1;
864 }
865 # endif
866 # endif
867 
868 # ifndef yytnamerr
869 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
870  quotes and backslashes, so that it's suitable for yyerror. The
871  heuristic is that double-quoting is unnecessary unless the string
872  contains an apostrophe, a comma, or backslash (other than
873  backslash-backslash). YYSTR is taken from yytname. If YYRES is
874  null, do not copy; instead, return the length of what the result
875  would have been. */
876 static YYSIZE_T
877 yytnamerr (char *yyres, const char *yystr)
878 {
879  if (*yystr == '"')
880  {
881  YYSIZE_T yyn = 0;
882  char const *yyp = yystr;
883 
884  for (;;)
885  switch (*++yyp)
886  {
887  case '\'':
888  case ',':
889  goto do_not_strip_quotes;
890 
891  case '\\':
892  if (*++yyp != '\\')
893  goto do_not_strip_quotes;
894  /* Fall through. */
895  default:
896  if (yyres)
897  yyres[yyn] = *yyp;
898  yyn++;
899  break;
900 
901  case '"':
902  if (yyres)
903  yyres[yyn] = '\0';
904  return yyn;
905  }
906  do_not_strip_quotes: ;
907  }
908 
909  if (! yyres)
910  return yystrlen (yystr);
911 
912  return yystpcpy (yyres, yystr) - yyres;
913 }
914 # endif
915 
916 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
917  about the unexpected token YYTOKEN for the state stack whose top is
918  YYSSP.
919 
920  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
921  not large enough to hold the message. In that case, also set
922  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
923  required number of bytes is too large to store. */
924 static int
925 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
926  yytype_int16 *yyssp, int yytoken)
927 {
928  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
929  YYSIZE_T yysize = yysize0;
930  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
931  /* Internationalized format string. */
932  const char *yyformat = YY_NULLPTR;
933  /* Arguments of yyformat. */
934  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
935  /* Number of reported tokens (one for the "unexpected", one per
936  "expected"). */
937  int yycount = 0;
938 
939  /* There are many possibilities here to consider:
940  - If this state is a consistent state with a default action, then
941  the only way this function was invoked is if the default action
942  is an error action. In that case, don't check for expected
943  tokens because there are none.
944  - The only way there can be no lookahead present (in yychar) is if
945  this state is a consistent state with a default action. Thus,
946  detecting the absence of a lookahead is sufficient to determine
947  that there is no unexpected or expected token to report. In that
948  case, just report a simple "syntax error".
949  - Don't assume there isn't a lookahead just because this state is a
950  consistent state with a default action. There might have been a
951  previous inconsistent state, consistent state with a non-default
952  action, or user semantic action that manipulated yychar.
953  - Of course, the expected token list depends on states to have
954  correct lookahead information, and it depends on the parser not
955  to perform extra reductions after fetching a lookahead from the
956  scanner and before detecting a syntax error. Thus, state merging
957  (from LALR or IELR) and default reductions corrupt the expected
958  token list. However, the list is correct for canonical LR with
959  one exception: it will still contain any token that will not be
960  accepted due to an error action in a later state.
961  */
962  if (yytoken != YYEMPTY)
963  {
964  int yyn = yypact[*yyssp];
965  yyarg[yycount++] = yytname[yytoken];
966  if (!yypact_value_is_default (yyn))
967  {
968  /* Start YYX at -YYN if negative to avoid negative indexes in
969  YYCHECK. In other words, skip the first -YYN actions for
970  this state because they are default actions. */
971  int yyxbegin = yyn < 0 ? -yyn : 0;
972  /* Stay within bounds of both yycheck and yytname. */
973  int yychecklim = YYLAST - yyn + 1;
974  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
975  int yyx;
976 
977  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
978  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
979  && !yytable_value_is_error (yytable[yyx + yyn]))
980  {
981  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
982  {
983  yycount = 1;
984  yysize = yysize0;
985  break;
986  }
987  yyarg[yycount++] = yytname[yyx];
988  {
989  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
990  if (! (yysize <= yysize1
991  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
992  return 2;
993  yysize = yysize1;
994  }
995  }
996  }
997  }
998 
999  switch (yycount)
1000  {
1001 # define YYCASE_(N, S) \
1002  case N: \
1003  yyformat = S; \
1004  break
1005  YYCASE_(0, YY_("syntax error"));
1006  YYCASE_(1, YY_("syntax error, unexpected %s"));
1007  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1008  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1009  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1010  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1011 # undef YYCASE_
1012  }
1013 
1014  {
1015  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1016  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1017  return 2;
1018  yysize = yysize1;
1019  }
1020 
1021  if (*yymsg_alloc < yysize)
1022  {
1023  *yymsg_alloc = 2 * yysize;
1024  if (! (yysize <= *yymsg_alloc
1025  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1026  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1027  return 1;
1028  }
1029 
1030  /* Avoid sprintf, as that infringes on the user's name space.
1031  Don't have undefined behavior even if the translation
1032  produced a string with the wrong number of "%s"s. */
1033  {
1034  char *yyp = *yymsg;
1035  int yyi = 0;
1036  while ((*yyp = *yyformat) != '\0')
1037  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1038  {
1039  yyp += yytnamerr (yyp, yyarg[yyi++]);
1040  yyformat += 2;
1041  }
1042  else
1043  {
1044  yyp++;
1045  yyformat++;
1046  }
1047  }
1048  return 0;
1049 }
1050 #endif /* YYERROR_VERBOSE */
1051 
1052 /*-----------------------------------------------.
1053 | Release the memory associated to this symbol. |
1054 `-----------------------------------------------*/
1055 
1056 static void
1057 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
1058 {
1059  YYUSE (yyvaluep);
1060  YYUSE (yylocationp);
1061  YYUSE (scanner);
1062  if (!yymsg)
1063  yymsg = "Deleting";
1064  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1065 
1066  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1067  switch (yytype)
1068  {
1069  case 7: /* NAME */
1070 #line 39 "lib/route/pktloc_syntax.y" /* yacc.c:1257 */
1071  { free(((*yyvaluep).s)); }
1072 #line 1073 "lib/route/pktloc_syntax.c" /* yacc.c:1257 */
1073  break;
1074 
1075 
1076  default:
1077  break;
1078  }
1079  YY_IGNORE_MAYBE_UNINITIALIZED_END
1080 }
1081 
1082 
1083 
1084 
1085 /*----------.
1086 | yyparse. |
1087 `----------*/
1088 
1089 int
1090 yyparse (void *scanner)
1091 {
1092 /* The lookahead symbol. */
1093 int yychar;
1094 
1095 
1096 /* The semantic value of the lookahead symbol. */
1097 /* Default value used for initialization, for pacifying older GCCs
1098  or non-GCC compilers. */
1099 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1100 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1101 
1102 /* Location data for the lookahead symbol. */
1103 static YYLTYPE yyloc_default
1104 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1105  = { 1, 1, 1, 1 }
1106 # endif
1107 ;
1108 YYLTYPE yylloc = yyloc_default;
1109 
1110  /* Number of syntax errors so far. */
1111  int yynerrs;
1112 
1113  int yystate;
1114  /* Number of tokens to shift before error messages enabled. */
1115  int yyerrstatus;
1116 
1117  /* The stacks and their tools:
1118  'yyss': related to states.
1119  'yyvs': related to semantic values.
1120  'yyls': related to locations.
1121 
1122  Refer to the stacks through separate pointers, to allow yyoverflow
1123  to reallocate them elsewhere. */
1124 
1125  /* The state stack. */
1126  yytype_int16 yyssa[YYINITDEPTH];
1127  yytype_int16 *yyss;
1128  yytype_int16 *yyssp;
1129 
1130  /* The semantic value stack. */
1131  YYSTYPE yyvsa[YYINITDEPTH];
1132  YYSTYPE *yyvs;
1133  YYSTYPE *yyvsp;
1134 
1135  /* The location stack. */
1136  YYLTYPE yylsa[YYINITDEPTH];
1137  YYLTYPE *yyls;
1138  YYLTYPE *yylsp;
1139 
1140  /* The locations where the error started and ended. */
1141  YYLTYPE yyerror_range[3];
1142 
1143  YYSIZE_T yystacksize;
1144 
1145  int yyn;
1146  int yyresult;
1147  /* Lookahead token as an internal (translated) token number. */
1148  int yytoken = 0;
1149  /* The variables used to return semantic value and location from the
1150  action routines. */
1151  YYSTYPE yyval;
1152  YYLTYPE yyloc;
1153 
1154 #if YYERROR_VERBOSE
1155  /* Buffer for error messages, and its allocated size. */
1156  char yymsgbuf[128];
1157  char *yymsg = yymsgbuf;
1158  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1159 #endif
1160 
1161 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1162 
1163  /* The number of symbols on the RHS of the reduced rule.
1164  Keep to zero when no symbol should be popped. */
1165  int yylen = 0;
1166 
1167  yyssp = yyss = yyssa;
1168  yyvsp = yyvs = yyvsa;
1169  yylsp = yyls = yylsa;
1170  yystacksize = YYINITDEPTH;
1171 
1172  YYDPRINTF ((stderr, "Starting parse\n"));
1173 
1174  yystate = 0;
1175  yyerrstatus = 0;
1176  yynerrs = 0;
1177  yychar = YYEMPTY; /* Cause a token to be read. */
1178  yylsp[0] = yylloc;
1179  goto yysetstate;
1180 
1181 /*------------------------------------------------------------.
1182 | yynewstate -- Push a new state, which is found in yystate. |
1183 `------------------------------------------------------------*/
1184  yynewstate:
1185  /* In all cases, when you get here, the value and location stacks
1186  have just been pushed. So pushing a state here evens the stacks. */
1187  yyssp++;
1188 
1189  yysetstate:
1190  *yyssp = yystate;
1191 
1192  if (yyss + yystacksize - 1 <= yyssp)
1193  {
1194  /* Get the current used size of the three stacks, in elements. */
1195  YYSIZE_T yysize = yyssp - yyss + 1;
1196 
1197 #ifdef yyoverflow
1198  {
1199  /* Give user a chance to reallocate the stack. Use copies of
1200  these so that the &'s don't force the real ones into
1201  memory. */
1202  YYSTYPE *yyvs1 = yyvs;
1203  yytype_int16 *yyss1 = yyss;
1204  YYLTYPE *yyls1 = yyls;
1205 
1206  /* Each stack pointer address is followed by the size of the
1207  data in use in that stack, in bytes. This used to be a
1208  conditional around just the two extra args, but that might
1209  be undefined if yyoverflow is a macro. */
1210  yyoverflow (YY_("memory exhausted"),
1211  &yyss1, yysize * sizeof (*yyssp),
1212  &yyvs1, yysize * sizeof (*yyvsp),
1213  &yyls1, yysize * sizeof (*yylsp),
1214  &yystacksize);
1215 
1216  yyls = yyls1;
1217  yyss = yyss1;
1218  yyvs = yyvs1;
1219  }
1220 #else /* no yyoverflow */
1221 # ifndef YYSTACK_RELOCATE
1222  goto yyexhaustedlab;
1223 # else
1224  /* Extend the stack our own way. */
1225  if (YYMAXDEPTH <= yystacksize)
1226  goto yyexhaustedlab;
1227  yystacksize *= 2;
1228  if (YYMAXDEPTH < yystacksize)
1229  yystacksize = YYMAXDEPTH;
1230 
1231  {
1232  yytype_int16 *yyss1 = yyss;
1233  union yyalloc *yyptr =
1234  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1235  if (! yyptr)
1236  goto yyexhaustedlab;
1237  YYSTACK_RELOCATE (yyss_alloc, yyss);
1238  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1239  YYSTACK_RELOCATE (yyls_alloc, yyls);
1240 # undef YYSTACK_RELOCATE
1241  if (yyss1 != yyssa)
1242  YYSTACK_FREE (yyss1);
1243  }
1244 # endif
1245 #endif /* no yyoverflow */
1246 
1247  yyssp = yyss + yysize - 1;
1248  yyvsp = yyvs + yysize - 1;
1249  yylsp = yyls + yysize - 1;
1250 
1251  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1252  (unsigned long int) yystacksize));
1253 
1254  if (yyss + yystacksize - 1 <= yyssp)
1255  YYABORT;
1256  }
1257 
1258  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1259 
1260  if (yystate == YYFINAL)
1261  YYACCEPT;
1262 
1263  goto yybackup;
1264 
1265 /*-----------.
1266 | yybackup. |
1267 `-----------*/
1268 yybackup:
1269 
1270  /* Do appropriate processing given the current state. Read a
1271  lookahead token if we need one and don't already have one. */
1272 
1273  /* First try to decide what to do without reference to lookahead token. */
1274  yyn = yypact[yystate];
1275  if (yypact_value_is_default (yyn))
1276  goto yydefault;
1277 
1278  /* Not known => get a lookahead token if don't already have one. */
1279 
1280  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1281  if (yychar == YYEMPTY)
1282  {
1283  YYDPRINTF ((stderr, "Reading a token: "));
1284  yychar = yylex (&yylval, &yylloc, scanner);
1285  }
1286 
1287  if (yychar <= YYEOF)
1288  {
1289  yychar = yytoken = YYEOF;
1290  YYDPRINTF ((stderr, "Now at end of input.\n"));
1291  }
1292  else
1293  {
1294  yytoken = YYTRANSLATE (yychar);
1295  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1296  }
1297 
1298  /* If the proper action on seeing token YYTOKEN is to reduce or to
1299  detect an error, take that action. */
1300  yyn += yytoken;
1301  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1302  goto yydefault;
1303  yyn = yytable[yyn];
1304  if (yyn <= 0)
1305  {
1306  if (yytable_value_is_error (yyn))
1307  goto yyerrlab;
1308  yyn = -yyn;
1309  goto yyreduce;
1310  }
1311 
1312  /* Count tokens shifted since error; after three, turn off error
1313  status. */
1314  if (yyerrstatus)
1315  yyerrstatus--;
1316 
1317  /* Shift the lookahead token. */
1318  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1319 
1320  /* Discard the shifted token. */
1321  yychar = YYEMPTY;
1322 
1323  yystate = yyn;
1324  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1325  *++yyvsp = yylval;
1326  YY_IGNORE_MAYBE_UNINITIALIZED_END
1327  *++yylsp = yylloc;
1328  goto yynewstate;
1329 
1330 
1331 /*-----------------------------------------------------------.
1332 | yydefault -- do the default action for the current state. |
1333 `-----------------------------------------------------------*/
1334 yydefault:
1335  yyn = yydefact[yystate];
1336  if (yyn == 0)
1337  goto yyerrlab;
1338  goto yyreduce;
1339 
1340 
1341 /*-----------------------------.
1342 | yyreduce -- Do a reduction. |
1343 `-----------------------------*/
1344 yyreduce:
1345  /* yyn is the number of a rule to reduce with. */
1346  yylen = yyr2[yyn];
1347 
1348  /* If YYLEN is nonzero, implement the default value of the action:
1349  '$$ = $1'.
1350 
1351  Otherwise, the following line sets YYVAL to garbage.
1352  This behavior is undocumented and Bison
1353  users should not rely upon it. Assigning to YYVAL
1354  unconditionally makes the parser a bit smaller, and it avoids a
1355  GCC warning that YYVAL may be used uninitialized. */
1356  yyval = yyvsp[1-yylen];
1357 
1358  /* Default location. */
1359  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1360  YY_REDUCE_PRINT (yyn);
1361  switch (yyn)
1362  {
1363  case 4:
1364 #line 52 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1365  {
1366  struct rtnl_pktloc *loc;
1367 
1368  if (!(loc = rtnl_pktloc_alloc())) {
1369  NL_DBG(1, "Allocating a packet location "
1370  "object failed.\n");
1371  YYABORT;
1372  }
1373 
1374  loc->name = (yyvsp[-5].s);
1375  loc->align = (yyvsp[-4].i);
1376  loc->layer = (yyvsp[-3].i);
1377  loc->offset = (yyvsp[-2].i);
1378  loc->mask = (yyvsp[-1].i);
1379  loc->shift = (yyvsp[0].i);
1380 
1381  if (rtnl_pktloc_add(loc) < 0) {
1382  NL_DBG(1, "Duplicate packet location entry "
1383  "\"%s\"\n", (yyvsp[-5].s));
1384  }
1385 
1386  (yyval.l) = loc;
1387  }
1388 #line 1389 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1389  break;
1390 
1391  case 5:
1392 #line 79 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1393  { (yyval.i) = (yyvsp[0].i); }
1394 #line 1395 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1395  break;
1396 
1397  case 6:
1398 #line 81 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1399  { (yyval.i) = (yyvsp[0].i); }
1400 #line 1401 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1401  break;
1402 
1403  case 7:
1404 #line 86 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1405  { (yyval.i) = TCF_LAYER_NETWORK; }
1406 #line 1407 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1407  break;
1408 
1409  case 8:
1410 #line 88 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1411  { (yyval.i) = (yyvsp[-1].i); }
1412 #line 1413 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1413  break;
1414 
1415  case 9:
1416 #line 93 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1417  { (yyval.i) = 0; }
1418 #line 1419 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1419  break;
1420 
1421  case 10:
1422 #line 95 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1423  { (yyval.i) = (yyvsp[0].i); }
1424 #line 1425 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1425  break;
1426 
1427  case 11:
1428 #line 100 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1429  { (yyval.i) = 0; }
1430 #line 1431 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1431  break;
1432 
1433  case 12:
1434 #line 102 "lib/route/pktloc_syntax.y" /* yacc.c:1646 */
1435  { (yyval.i) = (yyvsp[0].i); }
1436 #line 1437 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1437  break;
1438 
1439 
1440 #line 1441 "lib/route/pktloc_syntax.c" /* yacc.c:1646 */
1441  default: break;
1442  }
1443  /* User semantic actions sometimes alter yychar, and that requires
1444  that yytoken be updated with the new translation. We take the
1445  approach of translating immediately before every use of yytoken.
1446  One alternative is translating here after every semantic action,
1447  but that translation would be missed if the semantic action invokes
1448  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1449  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1450  incorrect destructor might then be invoked immediately. In the
1451  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1452  to an incorrect destructor call or verbose syntax error message
1453  before the lookahead is translated. */
1454  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1455 
1456  YYPOPSTACK (yylen);
1457  yylen = 0;
1458  YY_STACK_PRINT (yyss, yyssp);
1459 
1460  *++yyvsp = yyval;
1461  *++yylsp = yyloc;
1462 
1463  /* Now 'shift' the result of the reduction. Determine what state
1464  that goes to, based on the state we popped back to and the rule
1465  number reduced by. */
1466 
1467  yyn = yyr1[yyn];
1468 
1469  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1470  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1471  yystate = yytable[yystate];
1472  else
1473  yystate = yydefgoto[yyn - YYNTOKENS];
1474 
1475  goto yynewstate;
1476 
1477 
1478 /*--------------------------------------.
1479 | yyerrlab -- here on detecting error. |
1480 `--------------------------------------*/
1481 yyerrlab:
1482  /* Make sure we have latest lookahead translation. See comments at
1483  user semantic actions for why this is necessary. */
1484  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1485 
1486  /* If not already recovering from an error, report this error. */
1487  if (!yyerrstatus)
1488  {
1489  ++yynerrs;
1490 #if ! YYERROR_VERBOSE
1491  yyerror (&yylloc, scanner, YY_("syntax error"));
1492 #else
1493 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1494  yyssp, yytoken)
1495  {
1496  char const *yymsgp = YY_("syntax error");
1497  int yysyntax_error_status;
1498  yysyntax_error_status = YYSYNTAX_ERROR;
1499  if (yysyntax_error_status == 0)
1500  yymsgp = yymsg;
1501  else if (yysyntax_error_status == 1)
1502  {
1503  if (yymsg != yymsgbuf)
1504  YYSTACK_FREE (yymsg);
1505  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1506  if (!yymsg)
1507  {
1508  yymsg = yymsgbuf;
1509  yymsg_alloc = sizeof yymsgbuf;
1510  yysyntax_error_status = 2;
1511  }
1512  else
1513  {
1514  yysyntax_error_status = YYSYNTAX_ERROR;
1515  yymsgp = yymsg;
1516  }
1517  }
1518  yyerror (&yylloc, scanner, yymsgp);
1519  if (yysyntax_error_status == 2)
1520  goto yyexhaustedlab;
1521  }
1522 # undef YYSYNTAX_ERROR
1523 #endif
1524  }
1525 
1526  yyerror_range[1] = yylloc;
1527 
1528  if (yyerrstatus == 3)
1529  {
1530  /* If just tried and failed to reuse lookahead token after an
1531  error, discard it. */
1532 
1533  if (yychar <= YYEOF)
1534  {
1535  /* Return failure if at end of input. */
1536  if (yychar == YYEOF)
1537  YYABORT;
1538  }
1539  else
1540  {
1541  yydestruct ("Error: discarding",
1542  yytoken, &yylval, &yylloc, scanner);
1543  yychar = YYEMPTY;
1544  }
1545  }
1546 
1547  /* Else will try to reuse lookahead token after shifting the error
1548  token. */
1549  goto yyerrlab1;
1550 
1551 
1552 /*---------------------------------------------------.
1553 | yyerrorlab -- error raised explicitly by YYERROR. |
1554 `---------------------------------------------------*/
1555 yyerrorlab:
1556 
1557  /* Pacify compilers like GCC when the user code never invokes
1558  YYERROR and the label yyerrorlab therefore never appears in user
1559  code. */
1560  if (/*CONSTCOND*/ 0)
1561  goto yyerrorlab;
1562 
1563  yyerror_range[1] = yylsp[1-yylen];
1564  /* Do not reclaim the symbols of the rule whose action triggered
1565  this YYERROR. */
1566  YYPOPSTACK (yylen);
1567  yylen = 0;
1568  YY_STACK_PRINT (yyss, yyssp);
1569  yystate = *yyssp;
1570  goto yyerrlab1;
1571 
1572 
1573 /*-------------------------------------------------------------.
1574 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1575 `-------------------------------------------------------------*/
1576 yyerrlab1:
1577  yyerrstatus = 3; /* Each real token shifted decrements this. */
1578 
1579  for (;;)
1580  {
1581  yyn = yypact[yystate];
1582  if (!yypact_value_is_default (yyn))
1583  {
1584  yyn += YYTERROR;
1585  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1586  {
1587  yyn = yytable[yyn];
1588  if (0 < yyn)
1589  break;
1590  }
1591  }
1592 
1593  /* Pop the current state because it cannot handle the error token. */
1594  if (yyssp == yyss)
1595  YYABORT;
1596 
1597  yyerror_range[1] = *yylsp;
1598  yydestruct ("Error: popping",
1599  yystos[yystate], yyvsp, yylsp, scanner);
1600  YYPOPSTACK (1);
1601  yystate = *yyssp;
1602  YY_STACK_PRINT (yyss, yyssp);
1603  }
1604 
1605  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1606  *++yyvsp = yylval;
1607  YY_IGNORE_MAYBE_UNINITIALIZED_END
1608 
1609  yyerror_range[2] = yylloc;
1610  /* Using YYLLOC is tempting, but would change the location of
1611  the lookahead. YYLOC is available though. */
1612  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1613  *++yylsp = yyloc;
1614 
1615  /* Shift the error token. */
1616  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1617 
1618  yystate = yyn;
1619  goto yynewstate;
1620 
1621 
1622 /*-------------------------------------.
1623 | yyacceptlab -- YYACCEPT comes here. |
1624 `-------------------------------------*/
1625 yyacceptlab:
1626  yyresult = 0;
1627  goto yyreturn;
1628 
1629 /*-----------------------------------.
1630 | yyabortlab -- YYABORT comes here. |
1631 `-----------------------------------*/
1632 yyabortlab:
1633  yyresult = 1;
1634  goto yyreturn;
1635 
1636 #if !defined yyoverflow || YYERROR_VERBOSE
1637 /*-------------------------------------------------.
1638 | yyexhaustedlab -- memory exhaustion comes here. |
1639 `-------------------------------------------------*/
1640 yyexhaustedlab:
1641  yyerror (&yylloc, scanner, YY_("memory exhausted"));
1642  yyresult = 2;
1643  /* Fall through. */
1644 #endif
1645 
1646 yyreturn:
1647  if (yychar != YYEMPTY)
1648  {
1649  /* Make sure we have latest lookahead translation. See comments at
1650  user semantic actions for why this is necessary. */
1651  yytoken = YYTRANSLATE (yychar);
1652  yydestruct ("Cleanup: discarding lookahead",
1653  yytoken, &yylval, &yylloc, scanner);
1654  }
1655  /* Do not reclaim the symbols of the rule whose action triggered
1656  this YYABORT or YYACCEPT. */
1657  YYPOPSTACK (yylen);
1658  YY_STACK_PRINT (yyss, yyssp);
1659  while (yyssp != yyss)
1660  {
1661  yydestruct ("Cleanup: popping",
1662  yystos[*yyssp], yyvsp, yylsp, scanner);
1663  YYPOPSTACK (1);
1664  }
1665 #ifndef yyoverflow
1666  if (yyss != yyssa)
1667  YYSTACK_FREE (yyss);
1668 #endif
1669 #if YYERROR_VERBOSE
1670  if (yymsg != yymsgbuf)
1671  YYSTACK_FREE (yymsg);
1672 #endif
1673  return yyresult;
1674 }
struct rtnl_pktloc * rtnl_pktloc_alloc(void)
Allocate packet location object.
Definition: pktloc.c:186
int rtnl_pktloc_add(struct rtnl_pktloc *loc)
Add a packet location to the hash table.
Definition: pktloc.c:219