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