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