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