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