52#define YYBISON_VERSION "3.8.2"
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 "nl-default.h"
79#include <netlink/netlink.h>
80#include <netlink/utils.h>
81#include <netlink/route/pktloc.h>
85#line 86 "lib/route/pktloc_syntax.c"
89# define YY_CAST(Type, Val) static_cast<Type> (Val)
90# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
92# define YY_CAST(Type, Val) ((Type) (Val))
93# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
97# if defined __cplusplus
98# if 201103L <= __cplusplus
99# define YY_NULLPTR nullptr
104# define YY_NULLPTR ((void*)0)
108#include "pktloc_syntax.h"
112 YYSYMBOL_YYEMPTY = -2,
114 YYSYMBOL_YYerror = 1,
115 YYSYMBOL_YYUNDEF = 2,
122 YYSYMBOL_YYACCEPT = 9,
124 YYSYMBOL_location = 11,
130typedef enum yysymbol_kind_t yysymbol_kind_t;
134#line 26 "lib/route/pktloc_syntax.y"
138#define pktloc_error yyerror
139static void yyerror(
YYLTYPE *locp,
void *scanner,
const char *msg)
141 NL_DBG(1,
"Error while parsing packet location file: %s\n", msg);
144#line 145 "lib/route/pktloc_syntax.c"
155#ifndef __PTRDIFF_MAX__
157# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
168#ifdef __INT_LEAST8_MAX__
169typedef __INT_LEAST8_TYPE__ yytype_int8;
170#elif defined YY_STDINT_H
171typedef int_least8_t yytype_int8;
173typedef signed char yytype_int8;
176#ifdef __INT_LEAST16_MAX__
177typedef __INT_LEAST16_TYPE__ yytype_int16;
178#elif defined YY_STDINT_H
179typedef int_least16_t yytype_int16;
181typedef short yytype_int16;
190# undef UINT_LEAST8_MAX
191# undef UINT_LEAST16_MAX
192# define UINT_LEAST8_MAX 255
193# define UINT_LEAST16_MAX 65535
196#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
197typedef __UINT_LEAST8_TYPE__ yytype_uint8;
198#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
199 && UINT_LEAST8_MAX <= INT_MAX)
200typedef uint_least8_t yytype_uint8;
201#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
202typedef unsigned char yytype_uint8;
204typedef short yytype_uint8;
207#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
208typedef __UINT_LEAST16_TYPE__ yytype_uint16;
209#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
210 && UINT_LEAST16_MAX <= INT_MAX)
211typedef uint_least16_t yytype_uint16;
212#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
213typedef unsigned short yytype_uint16;
215typedef int yytype_uint16;
219# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
220# define YYPTRDIFF_T __PTRDIFF_TYPE__
221# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
222# elif defined PTRDIFF_MAX
226# define YYPTRDIFF_T ptrdiff_t
227# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
229# define YYPTRDIFF_T long
230# define YYPTRDIFF_MAXIMUM LONG_MAX
236# define YYSIZE_T __SIZE_TYPE__
238# define YYSIZE_T size_t
239# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
241# define YYSIZE_T size_t
243# define YYSIZE_T unsigned
247#define YYSIZE_MAXIMUM \
248 YY_CAST (YYPTRDIFF_T, \
249 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
250 ? YYPTRDIFF_MAXIMUM \
251 : YY_CAST (YYSIZE_T, -1)))
253#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
257typedef yytype_int8 yy_state_t;
260typedef int yy_state_fast_t;
263# if defined YYENABLE_NLS && YYENABLE_NLS
266# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
270# define YY_(Msgid) Msgid
275#ifndef YY_ATTRIBUTE_PURE
276# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
277# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
279# define YY_ATTRIBUTE_PURE
283#ifndef YY_ATTRIBUTE_UNUSED
284# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
285# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
287# define YY_ATTRIBUTE_UNUSED
292#if ! defined lint || defined __GNUC__
293# define YY_USE(E) ((void) (E))
299#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
300# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
301# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
302 _Pragma ("GCC diagnostic push") \
303 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
305# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
306 _Pragma ("GCC diagnostic push") \
307 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
308 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
310# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
311 _Pragma ("GCC diagnostic pop")
313# define YY_INITIAL_VALUE(Value) Value
315#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
316# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
317# define YY_IGNORE_MAYBE_UNINITIALIZED_END
319#ifndef YY_INITIAL_VALUE
320# define YY_INITIAL_VALUE(Value)
323#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
324# define YY_IGNORE_USELESS_CAST_BEGIN \
325 _Pragma ("GCC diagnostic push") \
326 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
327# define YY_IGNORE_USELESS_CAST_END \
328 _Pragma ("GCC diagnostic pop")
330#ifndef YY_IGNORE_USELESS_CAST_BEGIN
331# define YY_IGNORE_USELESS_CAST_BEGIN
332# define YY_IGNORE_USELESS_CAST_END
336#define YY_ASSERT(E) ((void) (0 && (E)))
342# ifdef YYSTACK_USE_ALLOCA
343# if YYSTACK_USE_ALLOCA
345# define YYSTACK_ALLOC __builtin_alloca
346# elif defined __BUILTIN_VA_ARG_INCR
349# define YYSTACK_ALLOC __alloca
350# elif defined _MSC_VER
352# define alloca _alloca
354# define YYSTACK_ALLOC alloca
355# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
359# define EXIT_SUCCESS 0
368# define YYSTACK_FREE(Ptr) do { ; } while (0)
369# ifndef YYSTACK_ALLOC_MAXIMUM
374# define YYSTACK_ALLOC_MAXIMUM 4032
377# define YYSTACK_ALLOC YYMALLOC
378# define YYSTACK_FREE YYFREE
379# ifndef YYSTACK_ALLOC_MAXIMUM
380# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
382# if (defined __cplusplus && ! defined EXIT_SUCCESS \
383 && ! ((defined YYMALLOC || defined malloc) \
384 && (defined YYFREE || defined free)))
387# define EXIT_SUCCESS 0
391# define YYMALLOC malloc
392# if ! defined malloc && ! defined EXIT_SUCCESS
393void *malloc (YYSIZE_T);
398# if ! defined free && ! defined EXIT_SUCCESS
405#if (! defined yyoverflow \
406 && (! defined __cplusplus \
407 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
408 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
413 yy_state_t yyss_alloc;
419# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
423# define YYSTACK_BYTES(N) \
424 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
425 + YYSIZEOF (YYLTYPE)) \
426 + 2 * YYSTACK_GAP_MAXIMUM)
428# define YYCOPY_NEEDED 1
435# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
438 YYPTRDIFF_T yynewbytes; \
439 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
440 Stack = &yyptr->Stack_alloc; \
441 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
442 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
448#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
452# if defined __GNUC__ && 1 < __GNUC__
453# define YYCOPY(Dst, Src, Count) \
454 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
456# define YYCOPY(Dst, Src, Count) \
460 for (yyi = 0; yyi < (Count); yyi++) \
461 (Dst)[yyi] = (Src)[yyi]; \
488#define YYTRANSLATE(YYX) \
489 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
490 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
495static const yytype_int8 yytranslate[] =
497 0, 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, 8, 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, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
528static const yytype_int8 yyrline[] =
530 0, 48, 48, 50, 54, 81, 83, 89, 90, 96,
536#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
541static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
545static const char *
const yytname[] =
547 "\"end of file\"",
"error",
"\"invalid token\"",
"ERROR",
"NUMBER",
548 "LAYER",
"ALIGN",
"NAME",
"'+'",
"$accept",
"input",
"location",
"align",
549 "layer",
"mask",
"shift", YY_NULLPTR
553yysymbol_name (yysymbol_kind_t yysymbol)
555 return yytname[yysymbol];
559#define YYPACT_NINF (-7)
561#define yypact_value_is_default(Yyn) \
562 ((Yyn) == YYPACT_NINF)
564#define YYTABLE_NINF (-1)
566#define yytable_value_is_error(Yyn) \
571static const yytype_int8 yypact[] =
573 -6, -4, 3, -6, -7, -7, -1, -7, -7, -3,
574 2, -7, 4, -7, 5, -7, -7
580static const yytype_int8 yydefact[] =
582 2, 0, 0, 2, 6, 5, 7, 1, 3, 0,
583 0, 8, 9, 10, 11, 12, 4
587static const yytype_int8 yypgoto[] =
589 -7, 7, -7, -7, -7, -7, -7
593static const yytype_int8 yydefgoto[] =
595 0, 2, 3, 6, 10, 14, 16
601static const yytype_int8 yytable[] =
603 4, 1, 5, 7, 9, 11, 12, 0, 13, 15,
607static const yytype_int8 yycheck[] =
609 4, 7, 6, 0, 5, 8, 4, -1, 4, 4,
615static const yytype_int8 yystos[] =
617 0, 7, 10, 11, 4, 6, 12, 0, 10, 5,
618 13, 8, 4, 4, 14, 4, 15
622static const yytype_int8 yyr1[] =
624 0, 9, 10, 10, 11, 12, 12, 13, 13, 14,
629static const yytype_int8 yyr2[] =
631 0, 2, 0, 2, 6, 1, 1, 0, 2, 0,
636enum { YYENOMEM = -2 };
638#define yyerrok (yyerrstatus = 0)
639#define yyclearin (yychar = YYEMPTY)
641#define YYACCEPT goto yyacceptlab
642#define YYABORT goto yyabortlab
643#define YYERROR goto yyerrorlab
644#define YYNOMEM goto yyexhaustedlab
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 YYLOCATION_PRINT
718# if defined YY_LOCATION_PRINT
722# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
724# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
730yy_location_print_ (FILE *yyo,
YYLTYPE const *
const yylocp)
733 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
734 if (0 <= yylocp->first_line)
736 res += YYFPRINTF (yyo,
"%d", yylocp->first_line);
737 if (0 <= yylocp->first_column)
738 res += YYFPRINTF (yyo,
".%d", yylocp->first_column);
740 if (0 <= yylocp->last_line)
742 if (yylocp->first_line < yylocp->last_line)
744 res += YYFPRINTF (yyo,
"-%d", yylocp->last_line);
746 res += YYFPRINTF (yyo,
".%d", end_col);
748 else if (0 <= end_col && yylocp->first_column < end_col)
749 res += YYFPRINTF (yyo,
"-%d", end_col);
754# define YYLOCATION_PRINT yy_location_print_
758# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
762# define YYLOCATION_PRINT(File, Loc) ((void) 0)
765# define YY_LOCATION_PRINT YYLOCATION_PRINT
771# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
775 YYFPRINTF (stderr, "%s ", Title); \
776 yy_symbol_print (stderr, \
777 Kind, Value, Location, scanner); \
778 YYFPRINTF (stderr, "\n"); \
788yy_symbol_value_print (FILE *yyo,
789 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
791 FILE *yyoutput = yyo;
793 YY_USE (yylocationp);
797 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
799 YY_IGNORE_MAYBE_UNINITIALIZED_END
808yy_symbol_print (FILE *yyo,
809 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
811 YYFPRINTF (yyo,
"%s %s (",
812 yykind < YYNTOKENS ?
"token" :
"nterm", yysymbol_name (yykind));
814 YYLOCATION_PRINT (yyo, yylocationp);
815 YYFPRINTF (yyo,
": ");
816 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner);
817 YYFPRINTF (yyo,
")");
826yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
828 YYFPRINTF (stderr,
"Stack now");
829 for (; yybottom <= yytop; yybottom++)
831 int yybot = *yybottom;
832 YYFPRINTF (stderr,
" %d", yybot);
834 YYFPRINTF (stderr,
"\n");
837# define YY_STACK_PRINT(Bottom, Top) \
840 yy_stack_print ((Bottom), (Top)); \
849yy_reduce_print (yy_state_t *yyssp,
YYSTYPE *yyvsp,
YYLTYPE *yylsp,
850 int yyrule,
void *scanner)
852 int yylno = yyrline[yyrule];
853 int yynrhs = yyr2[yyrule];
855 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
858 for (yyi = 0; yyi < yynrhs; yyi++)
860 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
861 yy_symbol_print (stderr,
862 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
863 &yyvsp[(yyi + 1) - (yynrhs)],
864 &(yylsp[(yyi + 1) - (yynrhs)]), scanner);
865 YYFPRINTF (stderr,
"\n");
869# define YY_REDUCE_PRINT(Rule) \
872 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
879# define YYDPRINTF(Args) ((void) 0)
880# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
881# define YY_STACK_PRINT(Bottom, Top)
882# define YY_REDUCE_PRINT(Rule)
888# define YYINITDEPTH 200
899# define YYMAXDEPTH 10000
907 yysymbol_kind_t yytoken;
919 yysymbol_kind_t yyarg[],
int yyargn)
923 int yyn = yypact[+*yyctx->yyssp];
924 if (!yypact_value_is_default (yyn))
929 int yyxbegin = yyn < 0 ? -yyn : 0;
931 int yychecklim = YYLAST - yyn + 1;
932 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
934 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
935 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
936 && !yytable_value_is_error (yytable[yyx + yyn]))
940 else if (yycount == yyargn)
943 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
946 if (yyarg && yycount == 0 && 0 < yyargn)
947 yyarg[0] = YYSYMBOL_YYEMPTY;
955# if defined __GLIBC__ && defined _STRING_H
956# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
960yystrlen (
const char *yystr)
963 for (yylen = 0; yystr[yylen]; yylen++)
971# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
972# define yystpcpy stpcpy
977yystpcpy (
char *yydest,
const char *yysrc)
980 const char *yys = yysrc;
982 while ((*yyd++ = *yys++) !=
'\0')
999yytnamerr (
char *yyres,
const char *yystr)
1003 YYPTRDIFF_T yyn = 0;
1004 char const *yyp = yystr;
1010 goto do_not_strip_quotes;
1014 goto do_not_strip_quotes;
1030 do_not_strip_quotes: ;
1034 return yystpcpy (yyres, yystr) - yyres;
1036 return yystrlen (yystr);
1043 yysymbol_kind_t yyarg[],
int yyargn)
1070 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1074 yyarg[yycount] = yyctx->yytoken;
1076 yyn = yypcontext_expected_tokens (yyctx,
1077 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1078 if (yyn == YYENOMEM)
1095yysyntax_error (YYPTRDIFF_T *yymsg_alloc,
char **yymsg,
1098 enum { YYARGS_MAX = 5 };
1100 const char *yyformat = YY_NULLPTR;
1103 yysymbol_kind_t yyarg[YYARGS_MAX];
1105 YYPTRDIFF_T yysize = 0;
1108 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1109 if (yycount == YYENOMEM)
1114#define YYCASE_(N, S) \
1119 YYCASE_(0, YY_(
"syntax error"));
1120 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1121 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1122 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1123 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1124 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1130 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1133 for (yyi = 0; yyi < yycount; ++yyi)
1136 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1137 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1144 if (*yymsg_alloc < yysize)
1146 *yymsg_alloc = 2 * yysize;
1147 if (! (yysize <= *yymsg_alloc
1148 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1149 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1159 while ((*yyp = *yyformat) !=
'\0')
1160 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1162 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1180yydestruct (
const char *yymsg,
1181 yysymbol_kind_t yykind,
YYSTYPE *yyvaluep,
YYLTYPE *yylocationp,
void *scanner)
1184 YY_USE (yylocationp);
1188 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1190 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1194#line 42 "lib/route/pktloc_syntax.y"
1195 { free(((*yyvaluep).s)); }
1196#line 1197 "lib/route/pktloc_syntax.c"
1202 YY_IGNORE_MAYBE_UNINITIALIZED_END
1215yyparse (
void *scanner)
1224YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1225YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1229# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1233YYLTYPE yylloc = yyloc_default;
1238 yy_state_fast_t yystate = 0;
1240 int yyerrstatus = 0;
1246 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1249 yy_state_t yyssa[YYINITDEPTH];
1250 yy_state_t *yyss = yyssa;
1251 yy_state_t *yyssp = yyss;
1267 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1278 char *yymsg = yymsgbuf;
1279 YYPTRDIFF_T yymsg_alloc =
sizeof yymsgbuf;
1281#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1287 YYDPRINTF ((stderr,
"Starting parse\n"));
1308 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1309 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1310 YY_IGNORE_USELESS_CAST_BEGIN
1311 *yyssp = YY_CAST (yy_state_t, yystate);
1312 YY_IGNORE_USELESS_CAST_END
1313 YY_STACK_PRINT (yyss, yyssp);
1315 if (yyss + yystacksize - 1 <= yyssp)
1316#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1321 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1323# if defined yyoverflow
1328 yy_state_t *yyss1 = yyss;
1336 yyoverflow (YY_(
"memory exhausted"),
1337 &yyss1, yysize * YYSIZEOF (*yyssp),
1338 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1339 &yyls1, yysize * YYSIZEOF (*yylsp),
1347 if (YYMAXDEPTH <= yystacksize)
1350 if (YYMAXDEPTH < yystacksize)
1351 yystacksize = YYMAXDEPTH;
1354 yy_state_t *yyss1 = yyss;
1357 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1360 YYSTACK_RELOCATE (yyss_alloc, yyss);
1361 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1362 YYSTACK_RELOCATE (yyls_alloc, yyls);
1363# undef YYSTACK_RELOCATE
1365 YYSTACK_FREE (yyss1);
1369 yyssp = yyss + yysize - 1;
1370 yyvsp = yyvs + yysize - 1;
1371 yylsp = yyls + yysize - 1;
1373 YY_IGNORE_USELESS_CAST_BEGIN
1374 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1375 YY_CAST (
long, yystacksize)));
1376 YY_IGNORE_USELESS_CAST_END
1378 if (yyss + yystacksize - 1 <= yyssp)
1384 if (yystate == YYFINAL)
1398 yyn = yypact[yystate];
1399 if (yypact_value_is_default (yyn))
1405 if (yychar == YYEMPTY)
1407 YYDPRINTF ((stderr,
"Reading a token\n"));
1408 yychar = yylex (&yylval, &yylloc, scanner);
1411 if (yychar <= YYEOF)
1414 yytoken = YYSYMBOL_YYEOF;
1415 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1417 else if (yychar == YYerror)
1424 yytoken = YYSYMBOL_YYerror;
1425 yyerror_range[1] = yylloc;
1430 yytoken = YYTRANSLATE (yychar);
1431 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1437 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1442 if (yytable_value_is_error (yyn))
1454 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1456 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1458 YY_IGNORE_MAYBE_UNINITIALIZED_END
1470 yyn = yydefact[yystate];
1491 yyval = yyvsp[1-yylen];
1494 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1495 yyerror_range[1] = yyloc;
1496 YY_REDUCE_PRINT (yyn);
1500#line 55 "lib/route/pktloc_syntax.y"
1505 NL_DBG(1,
"Allocating a packet location "
1506 "object failed.\n");
1510 loc->name = (yyvsp[-5].s);
1511 loc->align = (yyvsp[-4].i);
1512 loc->layer = (yyvsp[-3].i);
1513 loc->offset = (yyvsp[-2].i);
1514 loc->mask = (yyvsp[-1].i);
1515 loc->shift = (yyvsp[0].i);
1518 NL_DBG(1,
"Duplicate packet location entry "
1519 "\"%s\"\n", (yyvsp[-5].s));
1524#line 1525 "lib/route/pktloc_syntax.c"
1528#line 82 "lib/route/pktloc_syntax.y"
1529 { (yyval.i) = (yyvsp[0].i); }
1530#line 1531 "lib/route/pktloc_syntax.c"
1534#line 84 "lib/route/pktloc_syntax.y"
1535 { (yyval.i) = (yyvsp[0].i); }
1536#line 1537 "lib/route/pktloc_syntax.c"
1540#line 89 "lib/route/pktloc_syntax.y"
1541 { (yyval.i) = TCF_LAYER_NETWORK; }
1542#line 1543 "lib/route/pktloc_syntax.c"
1546#line 91 "lib/route/pktloc_syntax.y"
1547 { (yyval.i) = (yyvsp[-1].i); }
1548#line 1549 "lib/route/pktloc_syntax.c"
1552#line 96 "lib/route/pktloc_syntax.y"
1554#line 1555 "lib/route/pktloc_syntax.c"
1558#line 98 "lib/route/pktloc_syntax.y"
1559 { (yyval.i) = (yyvsp[0].i); }
1560#line 1561 "lib/route/pktloc_syntax.c"
1564#line 103 "lib/route/pktloc_syntax.y"
1566#line 1567 "lib/route/pktloc_syntax.c"
1570#line 105 "lib/route/pktloc_syntax.y"
1571 { (yyval.i) = (yyvsp[0].i); }
1572#line 1573 "lib/route/pktloc_syntax.c"
1576#line 1577 "lib/route/pktloc_syntax.c"
1591 YY_SYMBOL_PRINT (
"-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1603 const int yylhs = yyr1[yyn] - YYNTOKENS;
1604 const int yyi = yypgoto[yylhs] + *yyssp;
1605 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1607 : yydefgoto[yylhs]);
1619 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1626 = {yyssp, yytoken, &yylloc};
1627 char const *yymsgp = YY_(
"syntax error");
1628 int yysyntax_error_status;
1629 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1630 if (yysyntax_error_status == 0)
1632 else if (yysyntax_error_status == -1)
1634 if (yymsg != yymsgbuf)
1635 YYSTACK_FREE (yymsg);
1636 yymsg = YY_CAST (
char *,
1637 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1640 yysyntax_error_status
1641 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1647 yymsg_alloc =
sizeof yymsgbuf;
1648 yysyntax_error_status = YYENOMEM;
1651 yyerror (&yylloc, scanner, yymsgp);
1652 if (yysyntax_error_status == YYENOMEM)
1657 yyerror_range[1] = yylloc;
1658 if (yyerrstatus == 3)
1663 if (yychar <= YYEOF)
1666 if (yychar == YYEOF)
1671 yydestruct (
"Error: discarding",
1672 yytoken, &yylval, &yylloc, scanner);
1696 YY_STACK_PRINT (yyss, yyssp);
1710 yyn = yypact[yystate];
1711 if (!yypact_value_is_default (yyn))
1713 yyn += YYSYMBOL_YYerror;
1714 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1726 yyerror_range[1] = *yylsp;
1727 yydestruct (
"Error: popping",
1728 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner);
1731 YY_STACK_PRINT (yyss, yyssp);
1734 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1736 YY_IGNORE_MAYBE_UNINITIALIZED_END
1738 yyerror_range[2] = yylloc;
1740 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
1743 YY_SYMBOL_PRINT (
"Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1769 yyerror (&yylloc, scanner, YY_(
"memory exhausted"));
1778 if (yychar != YYEMPTY)
1782 yytoken = YYTRANSLATE (yychar);
1783 yydestruct (
"Cleanup: discarding lookahead",
1784 yytoken, &yylval, &yylloc, scanner);
1789 YY_STACK_PRINT (yyss, yyssp);
1790 while (yyssp != yyss)
1792 yydestruct (
"Cleanup: popping",
1793 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner);
1798 YYSTACK_FREE (yyss);
1800 if (yymsg != yymsgbuf)
1801 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.