52 #define YYBISON_VERSION "3.7.6"
55 #define YYSKELETON_NAME "yacc.c"
68 #define yyparse pktloc_parse
69 #define yylex pktloc_lex
70 #define yyerror pktloc_error
71 #define yydebug pktloc_debug
72 #define yynerrs pktloc_nerrs
75 #line 1 "lib/route/pktloc_syntax.y"
77 #include <netlink-private/netlink.h>
78 #include <netlink-private/tc.h>
79 #include <netlink/netlink.h>
80 #include <netlink/utils.h>
81 #include <netlink/route/pktloc.h>
83 #line 84 "lib/route/pktloc_syntax.c"
87 # define YY_CAST(Type, Val) static_cast<Type> (Val)
88 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
90 # define YY_CAST(Type, Val) ((Type) (Val))
91 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
95 # if defined __cplusplus
96 # if 201103L <= __cplusplus
97 # define YY_NULLPTR nullptr
102 # define YY_NULLPTR ((void*)0)
106 #include "pktloc_syntax.h"
110 YYSYMBOL_YYEMPTY = -2,
112 YYSYMBOL_YYerror = 1,
113 YYSYMBOL_YYUNDEF = 2,
120 YYSYMBOL_YYACCEPT = 9,
122 YYSYMBOL_location = 11,
128 typedef enum yysymbol_kind_t yysymbol_kind_t;
132 #line 24 "lib/route/pktloc_syntax.y"
136 #define pktloc_error yyerror
137 static void yyerror(
YYLTYPE *locp,
void *scanner,
const char *msg)
139 NL_DBG(1,
"Error while parsing packet location file: %s\n", msg);
142 #line 143 "lib/route/pktloc_syntax.c"
153 #ifndef __PTRDIFF_MAX__
155 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
166 #ifdef __INT_LEAST8_MAX__
167 typedef __INT_LEAST8_TYPE__ yytype_int8;
168 #elif defined YY_STDINT_H
169 typedef int_least8_t yytype_int8;
171 typedef signed char yytype_int8;
174 #ifdef __INT_LEAST16_MAX__
175 typedef __INT_LEAST16_TYPE__ yytype_int16;
176 #elif defined YY_STDINT_H
177 typedef int_least16_t yytype_int16;
179 typedef short yytype_int16;
188 # undef UINT_LEAST8_MAX
189 # undef UINT_LEAST16_MAX
190 # define UINT_LEAST8_MAX 255
191 # define UINT_LEAST16_MAX 65535
194 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
195 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
196 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
197 && UINT_LEAST8_MAX <= INT_MAX)
198 typedef uint_least8_t yytype_uint8;
199 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
200 typedef unsigned char yytype_uint8;
202 typedef short yytype_uint8;
205 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
206 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
207 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
208 && UINT_LEAST16_MAX <= INT_MAX)
209 typedef uint_least16_t yytype_uint16;
210 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
211 typedef unsigned short yytype_uint16;
213 typedef int yytype_uint16;
217 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
218 # define YYPTRDIFF_T __PTRDIFF_TYPE__
219 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
220 # elif defined PTRDIFF_MAX
224 # define YYPTRDIFF_T ptrdiff_t
225 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
227 # define YYPTRDIFF_T long
228 # define YYPTRDIFF_MAXIMUM LONG_MAX
233 # ifdef __SIZE_TYPE__
234 # define YYSIZE_T __SIZE_TYPE__
235 # elif defined size_t
236 # define YYSIZE_T size_t
237 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
239 # define YYSIZE_T size_t
241 # define YYSIZE_T unsigned
245 #define YYSIZE_MAXIMUM \
246 YY_CAST (YYPTRDIFF_T, \
247 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
248 ? YYPTRDIFF_MAXIMUM \
249 : YY_CAST (YYSIZE_T, -1)))
251 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
255 typedef yytype_int8 yy_state_t;
258 typedef int yy_state_fast_t;
261 # if defined YYENABLE_NLS && YYENABLE_NLS
263 # include <libintl.h>
264 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
268 # define YY_(Msgid) Msgid
273 #ifndef YY_ATTRIBUTE_PURE
274 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
275 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
277 # define YY_ATTRIBUTE_PURE
281 #ifndef YY_ATTRIBUTE_UNUSED
282 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
283 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
285 # define YY_ATTRIBUTE_UNUSED
290 #if ! defined lint || defined __GNUC__
291 # define YY_USE(E) ((void) (E))
296 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
299 _Pragma ("GCC diagnostic push") \
300 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
301 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
302 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
303 _Pragma ("GCC diagnostic pop")
305 # define YY_INITIAL_VALUE(Value) Value
307 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
308 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
309 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
311 #ifndef YY_INITIAL_VALUE
312 # define YY_INITIAL_VALUE(Value)
315 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
316 # define YY_IGNORE_USELESS_CAST_BEGIN \
317 _Pragma ("GCC diagnostic push") \
318 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
319 # define YY_IGNORE_USELESS_CAST_END \
320 _Pragma ("GCC diagnostic pop")
322 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
323 # define YY_IGNORE_USELESS_CAST_BEGIN
324 # define YY_IGNORE_USELESS_CAST_END
328 #define YY_ASSERT(E) ((void) (0 && (E)))
334 # ifdef YYSTACK_USE_ALLOCA
335 # if YYSTACK_USE_ALLOCA
337 # define YYSTACK_ALLOC __builtin_alloca
338 # elif defined __BUILTIN_VA_ARG_INCR
341 # define YYSTACK_ALLOC __alloca
342 # elif defined _MSC_VER
344 # define alloca _alloca
346 # define YYSTACK_ALLOC alloca
347 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
350 # ifndef EXIT_SUCCESS
351 # define EXIT_SUCCESS 0
358 # ifdef YYSTACK_ALLOC
360 # define YYSTACK_FREE(Ptr) do { ; } while (0)
361 # ifndef YYSTACK_ALLOC_MAXIMUM
366 # define YYSTACK_ALLOC_MAXIMUM 4032
369 # define YYSTACK_ALLOC YYMALLOC
370 # define YYSTACK_FREE YYFREE
371 # ifndef YYSTACK_ALLOC_MAXIMUM
372 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
374 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
375 && ! ((defined YYMALLOC || defined malloc) \
376 && (defined YYFREE || defined free)))
378 # ifndef EXIT_SUCCESS
379 # define EXIT_SUCCESS 0
383 # define YYMALLOC malloc
384 # if ! defined malloc && ! defined EXIT_SUCCESS
385 void *malloc (YYSIZE_T);
390 # if ! defined free && ! defined EXIT_SUCCESS
397 #if (! defined yyoverflow \
398 && (! defined __cplusplus \
399 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
400 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
405 yy_state_t yyss_alloc;
411 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
415 # define YYSTACK_BYTES(N) \
416 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
417 + YYSIZEOF (YYLTYPE)) \
418 + 2 * YYSTACK_GAP_MAXIMUM)
420 # define YYCOPY_NEEDED 1
427 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
430 YYPTRDIFF_T yynewbytes; \
431 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
432 Stack = &yyptr->Stack_alloc; \
433 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
434 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
440 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
444 # if defined __GNUC__ && 1 < __GNUC__
445 # define YYCOPY(Dst, Src, Count) \
446 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
448 # define YYCOPY(Dst, Src, Count) \
452 for (yyi = 0; yyi < (Count); yyi++) \
453 (Dst)[yyi] = (Src)[yyi]; \
475 #define YYMAXUTOK 262
480 #define YYTRANSLATE(YYX) \
481 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
482 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
487 static const yytype_int8 yytranslate[] =
489 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 8, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
520 static const yytype_int8 yyrline[] =
522 0, 46, 46, 48, 52, 79, 81, 87, 88, 94,
528 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
533 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
537 static const char *
const yytname[] =
539 "\"end of file\"",
"error",
"\"invalid token\"",
"ERROR",
"NUMBER",
540 "LAYER",
"ALIGN",
"NAME",
"'+'",
"$accept",
"input",
"location",
"align",
541 "layer",
"mask",
"shift", YY_NULLPTR
545 yysymbol_name (yysymbol_kind_t yysymbol)
547 return yytname[yysymbol];
554 static const yytype_int16 yytoknum[] =
556 0, 256, 257, 258, 259, 260, 261, 262, 43
560 #define YYPACT_NINF (-7)
562 #define yypact_value_is_default(Yyn) \
563 ((Yyn) == YYPACT_NINF)
565 #define YYTABLE_NINF (-1)
567 #define yytable_value_is_error(Yyn) \
572 static const yytype_int8 yypact[] =
574 -6, -4, 3, -6, -7, -7, -1, -7, -7, -3,
575 2, -7, 4, -7, 5, -7, -7
581 static const yytype_int8 yydefact[] =
583 2, 0, 0, 2, 6, 5, 7, 1, 3, 0,
584 0, 8, 9, 10, 11, 12, 4
588 static const yytype_int8 yypgoto[] =
590 -7, 7, -7, -7, -7, -7, -7
594 static const yytype_int8 yydefgoto[] =
596 0, 2, 3, 6, 10, 14, 16
602 static const yytype_int8 yytable[] =
604 4, 1, 5, 7, 9, 11, 12, 0, 13, 15,
608 static const yytype_int8 yycheck[] =
610 4, 7, 6, 0, 5, 8, 4, -1, 4, 4,
616 static const yytype_int8 yystos[] =
618 0, 7, 10, 11, 4, 6, 12, 0, 10, 5,
619 13, 8, 4, 4, 14, 4, 15
623 static const yytype_int8 yyr1[] =
625 0, 9, 10, 10, 11, 12, 12, 13, 13, 14,
630 static const yytype_int8 yyr2[] =
632 0, 2, 0, 2, 6, 1, 1, 0, 2, 0,
637 enum { YYENOMEM = -2 };
639 #define yyerrok (yyerrstatus = 0)
640 #define yyclearin (yychar = YYEMPTY)
642 #define YYACCEPT goto yyacceptlab
643 #define YYABORT goto yyabortlab
644 #define YYERROR goto yyerrorlab
647 #define YYRECOVERING() (!!yyerrstatus)
649 #define YYBACKUP(Token, Value) \
651 if (yychar == YYEMPTY) \
655 YYPOPSTACK (yylen); \
661 yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
668 #define YYERRCODE YYUNDEF
674 #ifndef YYLLOC_DEFAULT
675 # define YYLLOC_DEFAULT(Current, Rhs, N) \
679 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
680 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
681 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
682 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
686 (Current).first_line = (Current).last_line = \
687 YYRHSLOC (Rhs, 0).last_line; \
688 (Current).first_column = (Current).last_column = \
689 YYRHSLOC (Rhs, 0).last_column; \
694 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
702 # define YYFPRINTF fprintf
705 # define YYDPRINTF(Args) \
716 # ifndef YY_LOCATION_PRINT
717 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
723 yy_location_print_ (FILE *yyo,
YYLTYPE const *
const yylocp)
726 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
727 if (0 <= yylocp->first_line)
729 res += YYFPRINTF (yyo,
"%d", yylocp->first_line);
730 if (0 <= yylocp->first_column)
731 res += YYFPRINTF (yyo,
".%d", yylocp->first_column);
733 if (0 <= yylocp->last_line)
735 if (yylocp->first_line < yylocp->last_line)
737 res += YYFPRINTF (yyo,
"-%d", yylocp->last_line);
739 res += YYFPRINTF (yyo,
".%d", end_col);
741 else if (0 <= end_col && yylocp->first_column < end_col)
742 res += YYFPRINTF (yyo,
"-%d", end_col);
747 # define YY_LOCATION_PRINT(File, Loc) \
748 yy_location_print_ (File, &(Loc))
751 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
756 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
760 YYFPRINTF (stderr, "%s ", Title); \
761 yy_symbol_print (stderr, \
762 Kind, Value, Location, scanner); \
763 YYFPRINTF (stderr, "\n"); \
773 yy_symbol_value_print (FILE *yyo,
774 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
776 FILE *yyoutput = yyo;
778 YY_USE (yylocationp);
783 if (yykind < YYNTOKENS)
784 YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
786 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
788 YY_IGNORE_MAYBE_UNINITIALIZED_END
797 yy_symbol_print (FILE *yyo,
798 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
800 YYFPRINTF (yyo,
"%s %s (",
801 yykind < YYNTOKENS ?
"token" :
"nterm", yysymbol_name (yykind));
803 YY_LOCATION_PRINT (yyo, *yylocationp);
804 YYFPRINTF (yyo,
": ");
805 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner);
806 YYFPRINTF (yyo,
")");
815 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
817 YYFPRINTF (stderr,
"Stack now");
818 for (; yybottom <= yytop; yybottom++)
820 int yybot = *yybottom;
821 YYFPRINTF (stderr,
" %d", yybot);
823 YYFPRINTF (stderr,
"\n");
826 # define YY_STACK_PRINT(Bottom, Top) \
829 yy_stack_print ((Bottom), (Top)); \
838 yy_reduce_print (yy_state_t *yyssp,
YYSTYPE *yyvsp,
YYLTYPE *yylsp,
839 int yyrule,
void *scanner)
841 int yylno = yyrline[yyrule];
842 int yynrhs = yyr2[yyrule];
844 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
847 for (yyi = 0; yyi < yynrhs; yyi++)
849 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
850 yy_symbol_print (stderr,
851 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
852 &yyvsp[(yyi + 1) - (yynrhs)],
853 &(yylsp[(yyi + 1) - (yynrhs)]), scanner);
854 YYFPRINTF (stderr,
"\n");
858 # define YY_REDUCE_PRINT(Rule) \
861 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
868 # define YYDPRINTF(Args) ((void) 0)
869 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
870 # define YY_STACK_PRINT(Bottom, Top)
871 # define YY_REDUCE_PRINT(Rule)
877 # define YYINITDEPTH 200
888 # define YYMAXDEPTH 10000
896 yysymbol_kind_t yytoken;
908 yysymbol_kind_t yyarg[],
int yyargn)
912 int yyn = yypact[+*yyctx->yyssp];
913 if (!yypact_value_is_default (yyn))
918 int yyxbegin = yyn < 0 ? -yyn : 0;
920 int yychecklim = YYLAST - yyn + 1;
921 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
923 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
924 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
925 && !yytable_value_is_error (yytable[yyx + yyn]))
929 else if (yycount == yyargn)
932 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
935 if (yyarg && yycount == 0 && 0 < yyargn)
936 yyarg[0] = YYSYMBOL_YYEMPTY;
944 # if defined __GLIBC__ && defined _STRING_H
945 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
949 yystrlen (
const char *yystr)
952 for (yylen = 0; yystr[yylen]; yylen++)
960 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
961 # define yystpcpy stpcpy
966 yystpcpy (
char *yydest,
const char *yysrc)
969 const char *yys = yysrc;
971 while ((*yyd++ = *yys++) !=
'\0')
988 yytnamerr (
char *yyres,
const char *yystr)
993 char const *yyp = yystr;
999 goto do_not_strip_quotes;
1003 goto do_not_strip_quotes;
1019 do_not_strip_quotes: ;
1023 return yystpcpy (yyres, yystr) - yyres;
1025 return yystrlen (yystr);
1032 yysymbol_kind_t yyarg[],
int yyargn)
1059 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1063 yyarg[yycount] = yyctx->yytoken;
1065 yyn = yypcontext_expected_tokens (yyctx,
1066 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1067 if (yyn == YYENOMEM)
1084 yysyntax_error (YYPTRDIFF_T *yymsg_alloc,
char **yymsg,
1087 enum { YYARGS_MAX = 5 };
1089 const char *yyformat = YY_NULLPTR;
1092 yysymbol_kind_t yyarg[YYARGS_MAX];
1094 YYPTRDIFF_T yysize = 0;
1097 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1098 if (yycount == YYENOMEM)
1103 #define YYCASE_(N, S) \
1108 YYCASE_(0, YY_(
"syntax error"));
1109 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1110 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1111 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1112 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1113 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1119 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1122 for (yyi = 0; yyi < yycount; ++yyi)
1125 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1126 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1133 if (*yymsg_alloc < yysize)
1135 *yymsg_alloc = 2 * yysize;
1136 if (! (yysize <= *yymsg_alloc
1137 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1138 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1148 while ((*yyp = *yyformat) !=
'\0')
1149 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1151 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1169 yydestruct (
const char *yymsg,
1170 yysymbol_kind_t yykind,
YYSTYPE *yyvaluep,
YYLTYPE *yylocationp,
void *scanner)
1173 YY_USE (yylocationp);
1177 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1179 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1183 #line 40 "lib/route/pktloc_syntax.y"
1184 { free(((*yyvaluep).s)); }
1185 #line 1186 "lib/route/pktloc_syntax.c"
1191 YY_IGNORE_MAYBE_UNINITIALIZED_END
1204 yyparse (
void *scanner)
1213 YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1214 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1218 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1222 YYLTYPE yylloc = yyloc_default;
1227 yy_state_fast_t yystate = 0;
1229 int yyerrstatus = 0;
1235 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1238 yy_state_t yyssa[YYINITDEPTH];
1239 yy_state_t *yyss = yyssa;
1240 yy_state_t *yyssp = yyss;
1256 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1267 char *yymsg = yymsgbuf;
1268 YYPTRDIFF_T yymsg_alloc =
sizeof yymsgbuf;
1270 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1276 YYDPRINTF ((stderr,
"Starting parse\n"));
1296 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1297 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1298 YY_IGNORE_USELESS_CAST_BEGIN
1299 *yyssp = YY_CAST (yy_state_t, yystate);
1300 YY_IGNORE_USELESS_CAST_END
1301 YY_STACK_PRINT (yyss, yyssp);
1303 if (yyss + yystacksize - 1 <= yyssp)
1304 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1305 goto yyexhaustedlab;
1309 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1311 # if defined yyoverflow
1316 yy_state_t *yyss1 = yyss;
1324 yyoverflow (YY_(
"memory exhausted"),
1325 &yyss1, yysize * YYSIZEOF (*yyssp),
1326 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1327 &yyls1, yysize * YYSIZEOF (*yylsp),
1335 if (YYMAXDEPTH <= yystacksize)
1336 goto yyexhaustedlab;
1338 if (YYMAXDEPTH < yystacksize)
1339 yystacksize = YYMAXDEPTH;
1342 yy_state_t *yyss1 = yyss;
1345 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1347 goto yyexhaustedlab;
1348 YYSTACK_RELOCATE (yyss_alloc, yyss);
1349 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1350 YYSTACK_RELOCATE (yyls_alloc, yyls);
1351 # undef YYSTACK_RELOCATE
1353 YYSTACK_FREE (yyss1);
1357 yyssp = yyss + yysize - 1;
1358 yyvsp = yyvs + yysize - 1;
1359 yylsp = yyls + yysize - 1;
1361 YY_IGNORE_USELESS_CAST_BEGIN
1362 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1363 YY_CAST (
long, yystacksize)));
1364 YY_IGNORE_USELESS_CAST_END
1366 if (yyss + yystacksize - 1 <= yyssp)
1371 if (yystate == YYFINAL)
1385 yyn = yypact[yystate];
1386 if (yypact_value_is_default (yyn))
1392 if (yychar == YYEMPTY)
1394 YYDPRINTF ((stderr,
"Reading a token\n"));
1395 yychar = yylex (&yylval, &yylloc, scanner);
1398 if (yychar <= YYEOF)
1401 yytoken = YYSYMBOL_YYEOF;
1402 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1404 else if (yychar == YYerror)
1411 yytoken = YYSYMBOL_YYerror;
1412 yyerror_range[1] = yylloc;
1417 yytoken = YYTRANSLATE (yychar);
1418 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1424 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1429 if (yytable_value_is_error (yyn))
1441 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1443 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1445 YY_IGNORE_MAYBE_UNINITIALIZED_END
1457 yyn = yydefact[yystate];
1478 yyval = yyvsp[1-yylen];
1481 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1482 yyerror_range[1] = yyloc;
1483 YY_REDUCE_PRINT (yyn);
1487 #line 53 "lib/route/pktloc_syntax.y"
1492 NL_DBG(1,
"Allocating a packet location "
1493 "object failed.\n");
1497 loc->name = (yyvsp[-5].s);
1498 loc->align = (yyvsp[-4].i);
1499 loc->layer = (yyvsp[-3].i);
1500 loc->offset = (yyvsp[-2].i);
1501 loc->mask = (yyvsp[-1].i);
1502 loc->shift = (yyvsp[0].i);
1505 NL_DBG(1,
"Duplicate packet location entry "
1506 "\"%s\"\n", (yyvsp[-5].s));
1511 #line 1512 "lib/route/pktloc_syntax.c"
1515 #line 80 "lib/route/pktloc_syntax.y"
1516 { (yyval.i) = (yyvsp[0].i); }
1517 #line 1518 "lib/route/pktloc_syntax.c"
1521 #line 82 "lib/route/pktloc_syntax.y"
1522 { (yyval.i) = (yyvsp[0].i); }
1523 #line 1524 "lib/route/pktloc_syntax.c"
1527 #line 87 "lib/route/pktloc_syntax.y"
1528 { (yyval.i) = TCF_LAYER_NETWORK; }
1529 #line 1530 "lib/route/pktloc_syntax.c"
1533 #line 89 "lib/route/pktloc_syntax.y"
1534 { (yyval.i) = (yyvsp[-1].i); }
1535 #line 1536 "lib/route/pktloc_syntax.c"
1539 #line 94 "lib/route/pktloc_syntax.y"
1541 #line 1542 "lib/route/pktloc_syntax.c"
1545 #line 96 "lib/route/pktloc_syntax.y"
1546 { (yyval.i) = (yyvsp[0].i); }
1547 #line 1548 "lib/route/pktloc_syntax.c"
1551 #line 101 "lib/route/pktloc_syntax.y"
1553 #line 1554 "lib/route/pktloc_syntax.c"
1557 #line 103 "lib/route/pktloc_syntax.y"
1558 { (yyval.i) = (yyvsp[0].i); }
1559 #line 1560 "lib/route/pktloc_syntax.c"
1563 #line 1564 "lib/route/pktloc_syntax.c"
1578 YY_SYMBOL_PRINT (
"-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1590 const int yylhs = yyr1[yyn] - YYNTOKENS;
1591 const int yyi = yypgoto[yylhs] + *yyssp;
1592 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1594 : yydefgoto[yylhs]);
1606 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1613 = {yyssp, yytoken, &yylloc};
1614 char const *yymsgp = YY_(
"syntax error");
1615 int yysyntax_error_status;
1616 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1617 if (yysyntax_error_status == 0)
1619 else if (yysyntax_error_status == -1)
1621 if (yymsg != yymsgbuf)
1622 YYSTACK_FREE (yymsg);
1623 yymsg = YY_CAST (
char *,
1624 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1627 yysyntax_error_status
1628 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1634 yymsg_alloc =
sizeof yymsgbuf;
1635 yysyntax_error_status = YYENOMEM;
1638 yyerror (&yylloc, scanner, yymsgp);
1639 if (yysyntax_error_status == YYENOMEM)
1640 goto yyexhaustedlab;
1644 yyerror_range[1] = yylloc;
1645 if (yyerrstatus == 3)
1650 if (yychar <= YYEOF)
1653 if (yychar == YYEOF)
1658 yydestruct (
"Error: discarding",
1659 yytoken, &yylval, &yylloc, scanner);
1682 YY_STACK_PRINT (yyss, yyssp);
1696 yyn = yypact[yystate];
1697 if (!yypact_value_is_default (yyn))
1699 yyn += YYSYMBOL_YYerror;
1700 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1712 yyerror_range[1] = *yylsp;
1713 yydestruct (
"Error: popping",
1714 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner);
1717 YY_STACK_PRINT (yyss, yyssp);
1720 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1722 YY_IGNORE_MAYBE_UNINITIALIZED_END
1724 yyerror_range[2] = yylloc;
1726 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
1729 YY_SYMBOL_PRINT (
"Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1756 yyerror (&yylloc, scanner, YY_(
"memory exhausted"));
1766 if (yychar != YYEMPTY)
1770 yytoken = YYTRANSLATE (yychar);
1771 yydestruct (
"Cleanup: discarding lookahead",
1772 yytoken, &yylval, &yylloc, scanner);
1777 YY_STACK_PRINT (yyss, yyssp);
1778 while (yyssp != yyss)
1780 yydestruct (
"Cleanup: popping",
1781 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner);
1786 YYSTACK_FREE (yyss);
1788 if (yymsg != yymsgbuf)
1789 YYSTACK_FREE (yymsg);
int rtnl_pktloc_add(struct rtnl_pktloc *loc)
Add a packet location to the hash table.
struct rtnl_pktloc * rtnl_pktloc_alloc(void)
Allocate packet location object.