libnl  3.2.26
pktloc_syntax.c
1 /* A Bison parser, made by GNU Bison 2.7. */
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.7"
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 371 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 371 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 387 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 387 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 390 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 390 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 /* Error token number */
632 #define YYTERROR 1
633 #define YYERRCODE 256
634 
635 
636 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
637  If N is 0, then set CURRENT to the empty location which ends
638  the previous symbol: RHS[0] (always defined). */
639 
640 #ifndef YYLLOC_DEFAULT
641 # define YYLLOC_DEFAULT(Current, Rhs, N) \
642  do \
643  if (YYID (N)) \
644  { \
645  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
646  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
647  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
648  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
649  } \
650  else \
651  { \
652  (Current).first_line = (Current).last_line = \
653  YYRHSLOC (Rhs, 0).last_line; \
654  (Current).first_column = (Current).last_column = \
655  YYRHSLOC (Rhs, 0).last_column; \
656  } \
657  while (YYID (0))
658 #endif
659 
660 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
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 
670 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
671 
672 __attribute__((__unused__))
673 #if (defined __STDC__ || defined __C99__FUNC__ \
674  || defined __cplusplus || defined _MSC_VER)
675 static unsigned
676 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
677 #else
678 static unsigned
679 yy_location_print_ (yyo, yylocp)
680  FILE *yyo;
681  YYLTYPE const * const yylocp;
682 #endif
683 {
684  unsigned res = 0;
685  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
686  if (0 <= yylocp->first_line)
687  {
688  res += fprintf (yyo, "%d", yylocp->first_line);
689  if (0 <= yylocp->first_column)
690  res += fprintf (yyo, ".%d", yylocp->first_column);
691  }
692  if (0 <= yylocp->last_line)
693  {
694  if (yylocp->first_line < yylocp->last_line)
695  {
696  res += fprintf (yyo, "-%d", yylocp->last_line);
697  if (0 <= end_col)
698  res += fprintf (yyo, ".%d", end_col);
699  }
700  else if (0 <= end_col && yylocp->first_column < end_col)
701  res += fprintf (yyo, "-%d", end_col);
702  }
703  return res;
704  }
705 
706 # define YY_LOCATION_PRINT(File, Loc) \
707  yy_location_print_ (File, &(Loc))
708 
709 # else
710 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
711 # endif
712 #endif
713 
714 
715 /* YYLEX -- calling `yylex' with the right arguments. */
716 #ifdef YYLEX_PARAM
717 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
718 #else
719 # define YYLEX yylex (&yylval, &yylloc, scanner)
720 #endif
721 
722 /* Enable debugging if requested. */
723 #if YYDEBUG
724 
725 # ifndef YYFPRINTF
726 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
727 # define YYFPRINTF fprintf
728 # endif
729 
730 # define YYDPRINTF(Args) \
731 do { \
732  if (yydebug) \
733  YYFPRINTF Args; \
734 } while (YYID (0))
735 
736 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
737 do { \
738  if (yydebug) \
739  { \
740  YYFPRINTF (stderr, "%s ", Title); \
741  yy_symbol_print (stderr, \
742  Type, Value, Location, scanner); \
743  YYFPRINTF (stderr, "\n"); \
744  } \
745 } while (YYID (0))
746 
747 
748 /*--------------------------------.
749 | Print this symbol on YYOUTPUT. |
750 `--------------------------------*/
751 
752 /*ARGSUSED*/
753 #if (defined __STDC__ || defined __C99__FUNC__ \
754  || defined __cplusplus || defined _MSC_VER)
755 static void
756 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
757 #else
758 static void
759 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
760  FILE *yyoutput;
761  int yytype;
762  YYSTYPE const * const yyvaluep;
763  YYLTYPE const * const yylocationp;
764  void *scanner;
765 #endif
766 {
767  FILE *yyo = yyoutput;
768  YYUSE (yyo);
769  if (!yyvaluep)
770  return;
771  YYUSE (yylocationp);
772  YYUSE (scanner);
773 # ifdef YYPRINT
774  if (yytype < YYNTOKENS)
775  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
776 # else
777  YYUSE (yyoutput);
778 # endif
779  switch (yytype)
780  {
781  default:
782  break;
783  }
784 }
785 
786 
787 /*--------------------------------.
788 | Print this symbol on YYOUTPUT. |
789 `--------------------------------*/
790 
791 #if (defined __STDC__ || defined __C99__FUNC__ \
792  || defined __cplusplus || defined _MSC_VER)
793 static void
794 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
795 #else
796 static void
797 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
798  FILE *yyoutput;
799  int yytype;
800  YYSTYPE const * const yyvaluep;
801  YYLTYPE const * const yylocationp;
802  void *scanner;
803 #endif
804 {
805  if (yytype < YYNTOKENS)
806  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
807  else
808  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
809 
810  YY_LOCATION_PRINT (yyoutput, *yylocationp);
811  YYFPRINTF (yyoutput, ": ");
812  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
813  YYFPRINTF (yyoutput, ")");
814 }
815 
816 /*------------------------------------------------------------------.
817 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
818 | TOP (included). |
819 `------------------------------------------------------------------*/
820 
821 #if (defined __STDC__ || defined __C99__FUNC__ \
822  || defined __cplusplus || defined _MSC_VER)
823 static void
824 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
825 #else
826 static void
827 yy_stack_print (yybottom, yytop)
828  yytype_int16 *yybottom;
829  yytype_int16 *yytop;
830 #endif
831 {
832  YYFPRINTF (stderr, "Stack now");
833  for (; yybottom <= yytop; yybottom++)
834  {
835  int yybot = *yybottom;
836  YYFPRINTF (stderr, " %d", yybot);
837  }
838  YYFPRINTF (stderr, "\n");
839 }
840 
841 # define YY_STACK_PRINT(Bottom, Top) \
842 do { \
843  if (yydebug) \
844  yy_stack_print ((Bottom), (Top)); \
845 } while (YYID (0))
846 
847 
848 /*------------------------------------------------.
849 | Report that the YYRULE is going to be reduced. |
850 `------------------------------------------------*/
851 
852 #if (defined __STDC__ || defined __C99__FUNC__ \
853  || defined __cplusplus || defined _MSC_VER)
854 static void
855 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
856 #else
857 static void
858 yy_reduce_print (yyvsp, yylsp, yyrule, scanner)
859  YYSTYPE *yyvsp;
860  YYLTYPE *yylsp;
861  int yyrule;
862  void *scanner;
863 #endif
864 {
865  int yynrhs = yyr2[yyrule];
866  int yyi;
867  unsigned long int yylno = yyrline[yyrule];
868  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
869  yyrule - 1, yylno);
870  /* The symbols being reduced. */
871  for (yyi = 0; yyi < yynrhs; yyi++)
872  {
873  YYFPRINTF (stderr, " $%d = ", yyi + 1);
874  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
875  &(yyvsp[(yyi + 1) - (yynrhs)])
876  , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner);
877  YYFPRINTF (stderr, "\n");
878  }
879 }
880 
881 # define YY_REDUCE_PRINT(Rule) \
882 do { \
883  if (yydebug) \
884  yy_reduce_print (yyvsp, yylsp, Rule, scanner); \
885 } while (YYID (0))
886 
887 /* Nonzero means print parse trace. It is left uninitialized so that
888  multiple parsers can coexist. */
889 int yydebug;
890 #else /* !YYDEBUG */
891 # define YYDPRINTF(Args)
892 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
893 # define YY_STACK_PRINT(Bottom, Top)
894 # define YY_REDUCE_PRINT(Rule)
895 #endif /* !YYDEBUG */
896 
897 
898 /* YYINITDEPTH -- initial size of the parser's stacks. */
899 #ifndef YYINITDEPTH
900 # define YYINITDEPTH 200
901 #endif
902 
903 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
904  if the built-in stack extension method is used).
905 
906  Do not make this value too large; the results are undefined if
907  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
908  evaluated with infinite-precision integer arithmetic. */
909 
910 #ifndef YYMAXDEPTH
911 # define YYMAXDEPTH 10000
912 #endif
913 
914 
915 #if YYERROR_VERBOSE
916 
917 # ifndef yystrlen
918 # if defined __GLIBC__ && defined _STRING_H
919 # define yystrlen strlen
920 # else
921 /* Return the length of YYSTR. */
922 #if (defined __STDC__ || defined __C99__FUNC__ \
923  || defined __cplusplus || defined _MSC_VER)
924 static YYSIZE_T
925 yystrlen (const char *yystr)
926 #else
927 static YYSIZE_T
928 yystrlen (yystr)
929  const char *yystr;
930 #endif
931 {
932  YYSIZE_T yylen;
933  for (yylen = 0; yystr[yylen]; yylen++)
934  continue;
935  return yylen;
936 }
937 # endif
938 # endif
939 
940 # ifndef yystpcpy
941 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
942 # define yystpcpy stpcpy
943 # else
944 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
945  YYDEST. */
946 #if (defined __STDC__ || defined __C99__FUNC__ \
947  || defined __cplusplus || defined _MSC_VER)
948 static char *
949 yystpcpy (char *yydest, const char *yysrc)
950 #else
951 static char *
952 yystpcpy (yydest, yysrc)
953  char *yydest;
954  const char *yysrc;
955 #endif
956 {
957  char *yyd = yydest;
958  const char *yys = yysrc;
959 
960  while ((*yyd++ = *yys++) != '\0')
961  continue;
962 
963  return yyd - 1;
964 }
965 # endif
966 # endif
967 
968 # ifndef yytnamerr
969 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
970  quotes and backslashes, so that it's suitable for yyerror. The
971  heuristic is that double-quoting is unnecessary unless the string
972  contains an apostrophe, a comma, or backslash (other than
973  backslash-backslash). YYSTR is taken from yytname. If YYRES is
974  null, do not copy; instead, return the length of what the result
975  would have been. */
976 static YYSIZE_T
977 yytnamerr (char *yyres, const char *yystr)
978 {
979  if (*yystr == '"')
980  {
981  YYSIZE_T yyn = 0;
982  char const *yyp = yystr;
983 
984  for (;;)
985  switch (*++yyp)
986  {
987  case '\'':
988  case ',':
989  goto do_not_strip_quotes;
990 
991  case '\\':
992  if (*++yyp != '\\')
993  goto do_not_strip_quotes;
994  /* Fall through. */
995  default:
996  if (yyres)
997  yyres[yyn] = *yyp;
998  yyn++;
999  break;
1000 
1001  case '"':
1002  if (yyres)
1003  yyres[yyn] = '\0';
1004  return yyn;
1005  }
1006  do_not_strip_quotes: ;
1007  }
1008 
1009  if (! yyres)
1010  return yystrlen (yystr);
1011 
1012  return yystpcpy (yyres, yystr) - yyres;
1013 }
1014 # endif
1015 
1016 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1017  about the unexpected token YYTOKEN for the state stack whose top is
1018  YYSSP.
1019 
1020  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1021  not large enough to hold the message. In that case, also set
1022  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1023  required number of bytes is too large to store. */
1024 static int
1025 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1026  yytype_int16 *yyssp, int yytoken)
1027 {
1028  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1029  YYSIZE_T yysize = yysize0;
1030  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1031  /* Internationalized format string. */
1032  const char *yyformat = YY_NULL;
1033  /* Arguments of yyformat. */
1034  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1035  /* Number of reported tokens (one for the "unexpected", one per
1036  "expected"). */
1037  int yycount = 0;
1038 
1039  /* There are many possibilities here to consider:
1040  - Assume YYFAIL is not used. It's too flawed to consider. See
1041  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1042  for details. YYERROR is fine as it does not invoke this
1043  function.
1044  - If this state is a consistent state with a default action, then
1045  the only way this function was invoked is if the default action
1046  is an error action. In that case, don't check for expected
1047  tokens because there are none.
1048  - The only way there can be no lookahead present (in yychar) is if
1049  this state is a consistent state with a default action. Thus,
1050  detecting the absence of a lookahead is sufficient to determine
1051  that there is no unexpected or expected token to report. In that
1052  case, just report a simple "syntax error".
1053  - Don't assume there isn't a lookahead just because this state is a
1054  consistent state with a default action. There might have been a
1055  previous inconsistent state, consistent state with a non-default
1056  action, or user semantic action that manipulated yychar.
1057  - Of course, the expected token list depends on states to have
1058  correct lookahead information, and it depends on the parser not
1059  to perform extra reductions after fetching a lookahead from the
1060  scanner and before detecting a syntax error. Thus, state merging
1061  (from LALR or IELR) and default reductions corrupt the expected
1062  token list. However, the list is correct for canonical LR with
1063  one exception: it will still contain any token that will not be
1064  accepted due to an error action in a later state.
1065  */
1066  if (yytoken != YYEMPTY)
1067  {
1068  int yyn = yypact[*yyssp];
1069  yyarg[yycount++] = yytname[yytoken];
1070  if (!yypact_value_is_default (yyn))
1071  {
1072  /* Start YYX at -YYN if negative to avoid negative indexes in
1073  YYCHECK. In other words, skip the first -YYN actions for
1074  this state because they are default actions. */
1075  int yyxbegin = yyn < 0 ? -yyn : 0;
1076  /* Stay within bounds of both yycheck and yytname. */
1077  int yychecklim = YYLAST - yyn + 1;
1078  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1079  int yyx;
1080 
1081  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1082  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1083  && !yytable_value_is_error (yytable[yyx + yyn]))
1084  {
1085  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1086  {
1087  yycount = 1;
1088  yysize = yysize0;
1089  break;
1090  }
1091  yyarg[yycount++] = yytname[yyx];
1092  {
1093  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1094  if (! (yysize <= yysize1
1095  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1096  return 2;
1097  yysize = yysize1;
1098  }
1099  }
1100  }
1101  }
1102 
1103  switch (yycount)
1104  {
1105 # define YYCASE_(N, S) \
1106  case N: \
1107  yyformat = S; \
1108  break
1109  YYCASE_(0, YY_("syntax error"));
1110  YYCASE_(1, YY_("syntax error, unexpected %s"));
1111  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1112  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1113  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1114  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1115 # undef YYCASE_
1116  }
1117 
1118  {
1119  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1120  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1121  return 2;
1122  yysize = yysize1;
1123  }
1124 
1125  if (*yymsg_alloc < yysize)
1126  {
1127  *yymsg_alloc = 2 * yysize;
1128  if (! (yysize <= *yymsg_alloc
1129  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1130  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1131  return 1;
1132  }
1133 
1134  /* Avoid sprintf, as that infringes on the user's name space.
1135  Don't have undefined behavior even if the translation
1136  produced a string with the wrong number of "%s"s. */
1137  {
1138  char *yyp = *yymsg;
1139  int yyi = 0;
1140  while ((*yyp = *yyformat) != '\0')
1141  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1142  {
1143  yyp += yytnamerr (yyp, yyarg[yyi++]);
1144  yyformat += 2;
1145  }
1146  else
1147  {
1148  yyp++;
1149  yyformat++;
1150  }
1151  }
1152  return 0;
1153 }
1154 #endif /* YYERROR_VERBOSE */
1155 
1156 /*-----------------------------------------------.
1157 | Release the memory associated to this symbol. |
1158 `-----------------------------------------------*/
1159 
1160 /*ARGSUSED*/
1161 #if (defined __STDC__ || defined __C99__FUNC__ \
1162  || defined __cplusplus || defined _MSC_VER)
1163 static void
1164 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
1165 #else
1166 static void
1167 yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner)
1168  const char *yymsg;
1169  int yytype;
1170  YYSTYPE *yyvaluep;
1171  YYLTYPE *yylocationp;
1172  void *scanner;
1173 #endif
1174 {
1175  YYUSE (yyvaluep);
1176  YYUSE (yylocationp);
1177  YYUSE (scanner);
1178 
1179  if (!yymsg)
1180  yymsg = "Deleting";
1181  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1182 
1183  switch (yytype)
1184  {
1185  case 7: /* NAME */
1186 /* Line 1398 of yacc.c */
1187 #line 39 "route/pktloc_syntax.y"
1188  { free(((*yyvaluep).s)); };
1189 /* Line 1398 of yacc.c */
1190 #line 1191 "route/pktloc_syntax.c"
1191  break;
1192 
1193  default:
1194  break;
1195  }
1196 }
1197 
1198 
1199 
1200 
1201 /*----------.
1202 | yyparse. |
1203 `----------*/
1204 
1205 #ifdef YYPARSE_PARAM
1206 #if (defined __STDC__ || defined __C99__FUNC__ \
1207  || defined __cplusplus || defined _MSC_VER)
1208 int
1209 yyparse (void *YYPARSE_PARAM)
1210 #else
1211 int
1212 yyparse (YYPARSE_PARAM)
1213  void *YYPARSE_PARAM;
1214 #endif
1215 #else /* ! YYPARSE_PARAM */
1216 #if (defined __STDC__ || defined __C99__FUNC__ \
1217  || defined __cplusplus || defined _MSC_VER)
1218 int
1219 yyparse (void *scanner)
1220 #else
1221 int
1222 yyparse (scanner)
1223  void *scanner;
1224 #endif
1225 #endif
1226 {
1227 /* The lookahead symbol. */
1228 int yychar;
1229 
1230 
1231 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1232 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1233 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1234  _Pragma ("GCC diagnostic push") \
1235  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1236  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1237 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1238  _Pragma ("GCC diagnostic pop")
1239 #else
1240 /* Default value used for initialization, for pacifying older GCCs
1241  or non-GCC compilers. */
1242 static YYSTYPE yyval_default;
1243 # define YY_INITIAL_VALUE(Value) = Value
1244 #endif
1245 static YYLTYPE yyloc_default
1246 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1247  = { 1, 1, 1, 1 }
1248 # endif
1249 ;
1250 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1251 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1252 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1253 #endif
1254 #ifndef YY_INITIAL_VALUE
1255 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1256 #endif
1257 
1258 /* The semantic value of the lookahead symbol. */
1259 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1260 
1261 /* Location data for the lookahead symbol. */
1262 YYLTYPE yylloc = yyloc_default;
1263 
1264 
1265  /* Number of syntax errors so far. */
1266  int yynerrs;
1267 
1268  int yystate;
1269  /* Number of tokens to shift before error messages enabled. */
1270  int yyerrstatus;
1271 
1272  /* The stacks and their tools:
1273  `yyss': related to states.
1274  `yyvs': related to semantic values.
1275  `yyls': related to locations.
1276 
1277  Refer to the stacks through separate pointers, to allow yyoverflow
1278  to reallocate them elsewhere. */
1279 
1280  /* The state stack. */
1281  yytype_int16 yyssa[YYINITDEPTH];
1282  yytype_int16 *yyss;
1283  yytype_int16 *yyssp;
1284 
1285  /* The semantic value stack. */
1286  YYSTYPE yyvsa[YYINITDEPTH];
1287  YYSTYPE *yyvs;
1288  YYSTYPE *yyvsp;
1289 
1290  /* The location stack. */
1291  YYLTYPE yylsa[YYINITDEPTH];
1292  YYLTYPE *yyls;
1293  YYLTYPE *yylsp;
1294 
1295  /* The locations where the error started and ended. */
1296  YYLTYPE yyerror_range[3];
1297 
1298  YYSIZE_T yystacksize;
1299 
1300  int yyn;
1301  int yyresult;
1302  /* Lookahead token as an internal (translated) token number. */
1303  int yytoken = 0;
1304  /* The variables used to return semantic value and location from the
1305  action routines. */
1306  YYSTYPE yyval;
1307  YYLTYPE yyloc;
1308 
1309 #if YYERROR_VERBOSE
1310  /* Buffer for error messages, and its allocated size. */
1311  char yymsgbuf[128];
1312  char *yymsg = yymsgbuf;
1313  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1314 #endif
1315 
1316 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1317 
1318  /* The number of symbols on the RHS of the reduced rule.
1319  Keep to zero when no symbol should be popped. */
1320  int yylen = 0;
1321 
1322  yyssp = yyss = yyssa;
1323  yyvsp = yyvs = yyvsa;
1324  yylsp = yyls = yylsa;
1325  yystacksize = YYINITDEPTH;
1326 
1327  YYDPRINTF ((stderr, "Starting parse\n"));
1328 
1329  yystate = 0;
1330  yyerrstatus = 0;
1331  yynerrs = 0;
1332  yychar = YYEMPTY; /* Cause a token to be read. */
1333  yylsp[0] = yylloc;
1334  goto yysetstate;
1335 
1336 /*------------------------------------------------------------.
1337 | yynewstate -- Push a new state, which is found in yystate. |
1338 `------------------------------------------------------------*/
1339  yynewstate:
1340  /* In all cases, when you get here, the value and location stacks
1341  have just been pushed. So pushing a state here evens the stacks. */
1342  yyssp++;
1343 
1344  yysetstate:
1345  *yyssp = yystate;
1346 
1347  if (yyss + yystacksize - 1 <= yyssp)
1348  {
1349  /* Get the current used size of the three stacks, in elements. */
1350  YYSIZE_T yysize = yyssp - yyss + 1;
1351 
1352 #ifdef yyoverflow
1353  {
1354  /* Give user a chance to reallocate the stack. Use copies of
1355  these so that the &'s don't force the real ones into
1356  memory. */
1357  YYSTYPE *yyvs1 = yyvs;
1358  yytype_int16 *yyss1 = yyss;
1359  YYLTYPE *yyls1 = yyls;
1360 
1361  /* Each stack pointer address is followed by the size of the
1362  data in use in that stack, in bytes. This used to be a
1363  conditional around just the two extra args, but that might
1364  be undefined if yyoverflow is a macro. */
1365  yyoverflow (YY_("memory exhausted"),
1366  &yyss1, yysize * sizeof (*yyssp),
1367  &yyvs1, yysize * sizeof (*yyvsp),
1368  &yyls1, yysize * sizeof (*yylsp),
1369  &yystacksize);
1370 
1371  yyls = yyls1;
1372  yyss = yyss1;
1373  yyvs = yyvs1;
1374  }
1375 #else /* no yyoverflow */
1376 # ifndef YYSTACK_RELOCATE
1377  goto yyexhaustedlab;
1378 # else
1379  /* Extend the stack our own way. */
1380  if (YYMAXDEPTH <= yystacksize)
1381  goto yyexhaustedlab;
1382  yystacksize *= 2;
1383  if (YYMAXDEPTH < yystacksize)
1384  yystacksize = YYMAXDEPTH;
1385 
1386  {
1387  yytype_int16 *yyss1 = yyss;
1388  union yyalloc *yyptr =
1389  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1390  if (! yyptr)
1391  goto yyexhaustedlab;
1392  YYSTACK_RELOCATE (yyss_alloc, yyss);
1393  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1394  YYSTACK_RELOCATE (yyls_alloc, yyls);
1395 # undef YYSTACK_RELOCATE
1396  if (yyss1 != yyssa)
1397  YYSTACK_FREE (yyss1);
1398  }
1399 # endif
1400 #endif /* no yyoverflow */
1401 
1402  yyssp = yyss + yysize - 1;
1403  yyvsp = yyvs + yysize - 1;
1404  yylsp = yyls + yysize - 1;
1405 
1406  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1407  (unsigned long int) yystacksize));
1408 
1409  if (yyss + yystacksize - 1 <= yyssp)
1410  YYABORT;
1411  }
1412 
1413  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1414 
1415  if (yystate == YYFINAL)
1416  YYACCEPT;
1417 
1418  goto yybackup;
1419 
1420 /*-----------.
1421 | yybackup. |
1422 `-----------*/
1423 yybackup:
1424 
1425  /* Do appropriate processing given the current state. Read a
1426  lookahead token if we need one and don't already have one. */
1427 
1428  /* First try to decide what to do without reference to lookahead token. */
1429  yyn = yypact[yystate];
1430  if (yypact_value_is_default (yyn))
1431  goto yydefault;
1432 
1433  /* Not known => get a lookahead token if don't already have one. */
1434 
1435  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1436  if (yychar == YYEMPTY)
1437  {
1438  YYDPRINTF ((stderr, "Reading a token: "));
1439  yychar = YYLEX;
1440  }
1441 
1442  if (yychar <= YYEOF)
1443  {
1444  yychar = yytoken = YYEOF;
1445  YYDPRINTF ((stderr, "Now at end of input.\n"));
1446  }
1447  else
1448  {
1449  yytoken = YYTRANSLATE (yychar);
1450  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1451  }
1452 
1453  /* If the proper action on seeing token YYTOKEN is to reduce or to
1454  detect an error, take that action. */
1455  yyn += yytoken;
1456  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1457  goto yydefault;
1458  yyn = yytable[yyn];
1459  if (yyn <= 0)
1460  {
1461  if (yytable_value_is_error (yyn))
1462  goto yyerrlab;
1463  yyn = -yyn;
1464  goto yyreduce;
1465  }
1466 
1467  /* Count tokens shifted since error; after three, turn off error
1468  status. */
1469  if (yyerrstatus)
1470  yyerrstatus--;
1471 
1472  /* Shift the lookahead token. */
1473  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1474 
1475  /* Discard the shifted token. */
1476  yychar = YYEMPTY;
1477 
1478  yystate = yyn;
1479  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1480  *++yyvsp = yylval;
1481  YY_IGNORE_MAYBE_UNINITIALIZED_END
1482  *++yylsp = yylloc;
1483  goto yynewstate;
1484 
1485 
1486 /*-----------------------------------------------------------.
1487 | yydefault -- do the default action for the current state. |
1488 `-----------------------------------------------------------*/
1489 yydefault:
1490  yyn = yydefact[yystate];
1491  if (yyn == 0)
1492  goto yyerrlab;
1493  goto yyreduce;
1494 
1495 
1496 /*-----------------------------.
1497 | yyreduce -- Do a reduction. |
1498 `-----------------------------*/
1499 yyreduce:
1500  /* yyn is the number of a rule to reduce with. */
1501  yylen = yyr2[yyn];
1502 
1503  /* If YYLEN is nonzero, implement the default value of the action:
1504  `$$ = $1'.
1505 
1506  Otherwise, the following line sets YYVAL to garbage.
1507  This behavior is undocumented and Bison
1508  users should not rely upon it. Assigning to YYVAL
1509  unconditionally makes the parser a bit smaller, and it avoids a
1510  GCC warning that YYVAL may be used uninitialized. */
1511  yyval = yyvsp[1-yylen];
1512 
1513  /* Default location. */
1514  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1515  YY_REDUCE_PRINT (yyn);
1516  switch (yyn)
1517  {
1518  case 4:
1519 /* Line 1792 of yacc.c */
1520 #line 52 "route/pktloc_syntax.y"
1521  {
1522  struct rtnl_pktloc *loc;
1523 
1524  if (!(loc = rtnl_pktloc_alloc())) {
1525  NL_DBG(1, "Allocating a packet location "
1526  "object failed.\n");
1527  YYABORT;
1528  }
1529 
1530  loc->name = (yyvsp[(1) - (6)].s);
1531  loc->align = (yyvsp[(2) - (6)].i);
1532  loc->layer = (yyvsp[(3) - (6)].i);
1533  loc->offset = (yyvsp[(4) - (6)].i);
1534  loc->mask = (yyvsp[(5) - (6)].i);
1535  loc->shift = (yyvsp[(6) - (6)].i);
1536 
1537  if (rtnl_pktloc_add(loc) < 0) {
1538  NL_DBG(1, "Duplicate packet location entry "
1539  "\"%s\"\n", (yyvsp[(1) - (6)].s));
1540  }
1541 
1542  (yyval.l) = loc;
1543  }
1544  break;
1545 
1546  case 5:
1547 /* Line 1792 of yacc.c */
1548 #line 79 "route/pktloc_syntax.y"
1549  { (yyval.i) = (yyvsp[(1) - (1)].i); }
1550  break;
1551 
1552  case 6:
1553 /* Line 1792 of yacc.c */
1554 #line 81 "route/pktloc_syntax.y"
1555  { (yyval.i) = (yyvsp[(1) - (1)].i); }
1556  break;
1557 
1558  case 7:
1559 /* Line 1792 of yacc.c */
1560 #line 86 "route/pktloc_syntax.y"
1561  { (yyval.i) = TCF_LAYER_NETWORK; }
1562  break;
1563 
1564  case 8:
1565 /* Line 1792 of yacc.c */
1566 #line 88 "route/pktloc_syntax.y"
1567  { (yyval.i) = (yyvsp[(1) - (2)].i); }
1568  break;
1569 
1570  case 9:
1571 /* Line 1792 of yacc.c */
1572 #line 93 "route/pktloc_syntax.y"
1573  { (yyval.i) = 0; }
1574  break;
1575 
1576  case 10:
1577 /* Line 1792 of yacc.c */
1578 #line 95 "route/pktloc_syntax.y"
1579  { (yyval.i) = (yyvsp[(1) - (1)].i); }
1580  break;
1581 
1582  case 11:
1583 /* Line 1792 of yacc.c */
1584 #line 100 "route/pktloc_syntax.y"
1585  { (yyval.i) = 0; }
1586  break;
1587 
1588  case 12:
1589 /* Line 1792 of yacc.c */
1590 #line 102 "route/pktloc_syntax.y"
1591  { (yyval.i) = (yyvsp[(1) - (1)].i); }
1592  break;
1593 
1594 
1595 /* Line 1792 of yacc.c */
1596 #line 1597 "route/pktloc_syntax.c"
1597  default: break;
1598  }
1599  /* User semantic actions sometimes alter yychar, and that requires
1600  that yytoken be updated with the new translation. We take the
1601  approach of translating immediately before every use of yytoken.
1602  One alternative is translating here after every semantic action,
1603  but that translation would be missed if the semantic action invokes
1604  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1605  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1606  incorrect destructor might then be invoked immediately. In the
1607  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1608  to an incorrect destructor call or verbose syntax error message
1609  before the lookahead is translated. */
1610  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1611 
1612  YYPOPSTACK (yylen);
1613  yylen = 0;
1614  YY_STACK_PRINT (yyss, yyssp);
1615 
1616  *++yyvsp = yyval;
1617  *++yylsp = yyloc;
1618 
1619  /* Now `shift' the result of the reduction. Determine what state
1620  that goes to, based on the state we popped back to and the rule
1621  number reduced by. */
1622 
1623  yyn = yyr1[yyn];
1624 
1625  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1626  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1627  yystate = yytable[yystate];
1628  else
1629  yystate = yydefgoto[yyn - YYNTOKENS];
1630 
1631  goto yynewstate;
1632 
1633 
1634 /*------------------------------------.
1635 | yyerrlab -- here on detecting error |
1636 `------------------------------------*/
1637 yyerrlab:
1638  /* Make sure we have latest lookahead translation. See comments at
1639  user semantic actions for why this is necessary. */
1640  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1641 
1642  /* If not already recovering from an error, report this error. */
1643  if (!yyerrstatus)
1644  {
1645  ++yynerrs;
1646 #if ! YYERROR_VERBOSE
1647  yyerror (&yylloc, scanner, YY_("syntax error"));
1648 #else
1649 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1650  yyssp, yytoken)
1651  {
1652  char const *yymsgp = YY_("syntax error");
1653  int yysyntax_error_status;
1654  yysyntax_error_status = YYSYNTAX_ERROR;
1655  if (yysyntax_error_status == 0)
1656  yymsgp = yymsg;
1657  else if (yysyntax_error_status == 1)
1658  {
1659  if (yymsg != yymsgbuf)
1660  YYSTACK_FREE (yymsg);
1661  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1662  if (!yymsg)
1663  {
1664  yymsg = yymsgbuf;
1665  yymsg_alloc = sizeof yymsgbuf;
1666  yysyntax_error_status = 2;
1667  }
1668  else
1669  {
1670  yysyntax_error_status = YYSYNTAX_ERROR;
1671  yymsgp = yymsg;
1672  }
1673  }
1674  yyerror (&yylloc, scanner, yymsgp);
1675  if (yysyntax_error_status == 2)
1676  goto yyexhaustedlab;
1677  }
1678 # undef YYSYNTAX_ERROR
1679 #endif
1680  }
1681 
1682  yyerror_range[1] = yylloc;
1683 
1684  if (yyerrstatus == 3)
1685  {
1686  /* If just tried and failed to reuse lookahead token after an
1687  error, discard it. */
1688 
1689  if (yychar <= YYEOF)
1690  {
1691  /* Return failure if at end of input. */
1692  if (yychar == YYEOF)
1693  YYABORT;
1694  }
1695  else
1696  {
1697  yydestruct ("Error: discarding",
1698  yytoken, &yylval, &yylloc, scanner);
1699  yychar = YYEMPTY;
1700  }
1701  }
1702 
1703  /* Else will try to reuse lookahead token after shifting the error
1704  token. */
1705  goto yyerrlab1;
1706 
1707 
1708 /*---------------------------------------------------.
1709 | yyerrorlab -- error raised explicitly by YYERROR. |
1710 `---------------------------------------------------*/
1711 yyerrorlab:
1712 
1713  /* Pacify compilers like GCC when the user code never invokes
1714  YYERROR and the label yyerrorlab therefore never appears in user
1715  code. */
1716  if (/*CONSTCOND*/ 0)
1717  goto yyerrorlab;
1718 
1719  yyerror_range[1] = yylsp[1-yylen];
1720  /* Do not reclaim the symbols of the rule which action triggered
1721  this YYERROR. */
1722  YYPOPSTACK (yylen);
1723  yylen = 0;
1724  YY_STACK_PRINT (yyss, yyssp);
1725  yystate = *yyssp;
1726  goto yyerrlab1;
1727 
1728 
1729 /*-------------------------------------------------------------.
1730 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1731 `-------------------------------------------------------------*/
1732 yyerrlab1:
1733  yyerrstatus = 3; /* Each real token shifted decrements this. */
1734 
1735  for (;;)
1736  {
1737  yyn = yypact[yystate];
1738  if (!yypact_value_is_default (yyn))
1739  {
1740  yyn += YYTERROR;
1741  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1742  {
1743  yyn = yytable[yyn];
1744  if (0 < yyn)
1745  break;
1746  }
1747  }
1748 
1749  /* Pop the current state because it cannot handle the error token. */
1750  if (yyssp == yyss)
1751  YYABORT;
1752 
1753  yyerror_range[1] = *yylsp;
1754  yydestruct ("Error: popping",
1755  yystos[yystate], yyvsp, yylsp, scanner);
1756  YYPOPSTACK (1);
1757  yystate = *yyssp;
1758  YY_STACK_PRINT (yyss, yyssp);
1759  }
1760 
1761  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1762  *++yyvsp = yylval;
1763  YY_IGNORE_MAYBE_UNINITIALIZED_END
1764 
1765  yyerror_range[2] = yylloc;
1766  /* Using YYLLOC is tempting, but would change the location of
1767  the lookahead. YYLOC is available though. */
1768  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1769  *++yylsp = yyloc;
1770 
1771  /* Shift the error token. */
1772  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1773 
1774  yystate = yyn;
1775  goto yynewstate;
1776 
1777 
1778 /*-------------------------------------.
1779 | yyacceptlab -- YYACCEPT comes here. |
1780 `-------------------------------------*/
1781 yyacceptlab:
1782  yyresult = 0;
1783  goto yyreturn;
1784 
1785 /*-----------------------------------.
1786 | yyabortlab -- YYABORT comes here. |
1787 `-----------------------------------*/
1788 yyabortlab:
1789  yyresult = 1;
1790  goto yyreturn;
1791 
1792 #if !defined yyoverflow || YYERROR_VERBOSE
1793 /*-------------------------------------------------.
1794 | yyexhaustedlab -- memory exhaustion comes here. |
1795 `-------------------------------------------------*/
1796 yyexhaustedlab:
1797  yyerror (&yylloc, scanner, YY_("memory exhausted"));
1798  yyresult = 2;
1799  /* Fall through. */
1800 #endif
1801 
1802 yyreturn:
1803  if (yychar != YYEMPTY)
1804  {
1805  /* Make sure we have latest lookahead translation. See comments at
1806  user semantic actions for why this is necessary. */
1807  yytoken = YYTRANSLATE (yychar);
1808  yydestruct ("Cleanup: discarding lookahead",
1809  yytoken, &yylval, &yylloc, scanner);
1810  }
1811  /* Do not reclaim the symbols of the rule which action triggered
1812  this YYABORT or YYACCEPT. */
1813  YYPOPSTACK (yylen);
1814  YY_STACK_PRINT (yyss, yyssp);
1815  while (yyssp != yyss)
1816  {
1817  yydestruct ("Cleanup: popping",
1818  yystos[*yyssp], yyvsp, yylsp, scanner);
1819  YYPOPSTACK (1);
1820  }
1821 #ifndef yyoverflow
1822  if (yyss != yyssa)
1823  YYSTACK_FREE (yyss);
1824 #endif
1825 #if YYERROR_VERBOSE
1826  if (yymsg != yymsgbuf)
1827  YYSTACK_FREE (yymsg);
1828 #endif
1829  /* Make sure YYID is used. */
1830  return YYID (yyresult);
1831 }
1832 
1833 
struct rtnl_pktloc * rtnl_pktloc_alloc(void)
Allocate packet location object.
Definition: pktloc.c:184
int rtnl_pktloc_add(struct rtnl_pktloc *loc)
Add a packet location to the hash table.
Definition: pktloc.c:217