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 <netlink/netlink.h>
78#include <netlink/utils.h>
79#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,
128typedef enum yysymbol_kind_t yysymbol_kind_t;
132#line 24 "lib/route/pktloc_syntax.y"
136#define pktloc_error yyerror
137static 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__
167typedef __INT_LEAST8_TYPE__ yytype_int8;
168#elif defined YY_STDINT_H
169typedef int_least8_t yytype_int8;
171typedef signed char yytype_int8;
174#ifdef __INT_LEAST16_MAX__
175typedef __INT_LEAST16_TYPE__ yytype_int16;
176#elif defined YY_STDINT_H
177typedef int_least16_t yytype_int16;
179typedef 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__
195typedef __UINT_LEAST8_TYPE__ yytype_uint8;
196#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
197 && UINT_LEAST8_MAX <= INT_MAX)
198typedef uint_least8_t yytype_uint8;
199#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
200typedef unsigned char yytype_uint8;
202typedef short yytype_uint8;
205#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
206typedef __UINT_LEAST16_TYPE__ yytype_uint16;
207#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
208 && UINT_LEAST16_MAX <= INT_MAX)
209typedef uint_least16_t yytype_uint16;
210#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
211typedef unsigned short yytype_uint16;
213typedef 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
234# define YYSIZE_T __SIZE_TYPE__
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))
255typedef yytype_int8 yy_state_t;
258typedef int yy_state_fast_t;
261# if defined YYENABLE_NLS && YYENABLE_NLS
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))
297#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
298# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
299# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
300 _Pragma ("GCC diagnostic push") \
301 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
303# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
304 _Pragma ("GCC diagnostic push") \
305 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
306 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
308# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
309 _Pragma ("GCC diagnostic pop")
311# define YY_INITIAL_VALUE(Value) Value
313#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
314# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
315# define YY_IGNORE_MAYBE_UNINITIALIZED_END
317#ifndef YY_INITIAL_VALUE
318# define YY_INITIAL_VALUE(Value)
321#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
322# define YY_IGNORE_USELESS_CAST_BEGIN \
323 _Pragma ("GCC diagnostic push") \
324 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
325# define YY_IGNORE_USELESS_CAST_END \
326 _Pragma ("GCC diagnostic pop")
328#ifndef YY_IGNORE_USELESS_CAST_BEGIN
329# define YY_IGNORE_USELESS_CAST_BEGIN
330# define YY_IGNORE_USELESS_CAST_END
334#define YY_ASSERT(E) ((void) (0 && (E)))
340# ifdef YYSTACK_USE_ALLOCA
341# if YYSTACK_USE_ALLOCA
343# define YYSTACK_ALLOC __builtin_alloca
344# elif defined __BUILTIN_VA_ARG_INCR
347# define YYSTACK_ALLOC __alloca
348# elif defined _MSC_VER
350# define alloca _alloca
352# define YYSTACK_ALLOC alloca
353# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
357# define EXIT_SUCCESS 0
366# define YYSTACK_FREE(Ptr) do { ; } while (0)
367# ifndef YYSTACK_ALLOC_MAXIMUM
372# define YYSTACK_ALLOC_MAXIMUM 4032
375# define YYSTACK_ALLOC YYMALLOC
376# define YYSTACK_FREE YYFREE
377# ifndef YYSTACK_ALLOC_MAXIMUM
378# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
380# if (defined __cplusplus && ! defined EXIT_SUCCESS \
381 && ! ((defined YYMALLOC || defined malloc) \
382 && (defined YYFREE || defined free)))
385# define EXIT_SUCCESS 0
389# define YYMALLOC malloc
390# if ! defined malloc && ! defined EXIT_SUCCESS
391void *malloc (YYSIZE_T);
396# if ! defined free && ! defined EXIT_SUCCESS
403#if (! defined yyoverflow \
404 && (! defined __cplusplus \
405 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
406 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
411 yy_state_t yyss_alloc;
417# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
421# define YYSTACK_BYTES(N) \
422 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
423 + YYSIZEOF (YYLTYPE)) \
424 + 2 * YYSTACK_GAP_MAXIMUM)
426# define YYCOPY_NEEDED 1
433# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
436 YYPTRDIFF_T yynewbytes; \
437 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
438 Stack = &yyptr->Stack_alloc; \
439 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
440 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
446#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
450# if defined __GNUC__ && 1 < __GNUC__
451# define YYCOPY(Dst, Src, Count) \
452 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
454# define YYCOPY(Dst, Src, Count) \
458 for (yyi = 0; yyi < (Count); yyi++) \
459 (Dst)[yyi] = (Src)[yyi]; \
486#define YYTRANSLATE(YYX) \
487 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
488 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
493static const yytype_int8 yytranslate[] =
495 0, 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, 8, 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, 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, 1, 2, 3, 4,
526static const yytype_int8 yyrline[] =
528 0, 46, 46, 48, 52, 79, 81, 87, 88, 94,
534#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
539static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
543static const char *
const yytname[] =
545 "\"end of file\"",
"error",
"\"invalid token\"",
"ERROR",
"NUMBER",
546 "LAYER",
"ALIGN",
"NAME",
"'+'",
"$accept",
"input",
"location",
"align",
547 "layer",
"mask",
"shift", YY_NULLPTR
551yysymbol_name (yysymbol_kind_t yysymbol)
553 return yytname[yysymbol];
557#define YYPACT_NINF (-7)
559#define yypact_value_is_default(Yyn) \
560 ((Yyn) == YYPACT_NINF)
562#define YYTABLE_NINF (-1)
564#define yytable_value_is_error(Yyn) \
569static const yytype_int8 yypact[] =
571 -6, -4, 3, -6, -7, -7, -1, -7, -7, -3,
572 2, -7, 4, -7, 5, -7, -7
578static const yytype_int8 yydefact[] =
580 2, 0, 0, 2, 6, 5, 7, 1, 3, 0,
581 0, 8, 9, 10, 11, 12, 4
585static const yytype_int8 yypgoto[] =
587 -7, 7, -7, -7, -7, -7, -7
591static const yytype_int8 yydefgoto[] =
593 0, 2, 3, 6, 10, 14, 16
599static const yytype_int8 yytable[] =
601 4, 1, 5, 7, 9, 11, 12, 0, 13, 15,
605static const yytype_int8 yycheck[] =
607 4, 7, 6, 0, 5, 8, 4, -1, 4, 4,
613static const yytype_int8 yystos[] =
615 0, 7, 10, 11, 4, 6, 12, 0, 10, 5,
616 13, 8, 4, 4, 14, 4, 15
620static const yytype_int8 yyr1[] =
622 0, 9, 10, 10, 11, 12, 12, 13, 13, 14,
627static const yytype_int8 yyr2[] =
629 0, 2, 0, 2, 6, 1, 1, 0, 2, 0,
634enum { YYENOMEM = -2 };
636#define yyerrok (yyerrstatus = 0)
637#define yyclearin (yychar = YYEMPTY)
639#define YYACCEPT goto yyacceptlab
640#define YYABORT goto yyabortlab
641#define YYERROR goto yyerrorlab
642#define YYNOMEM goto yyexhaustedlab
645#define YYRECOVERING() (!!yyerrstatus)
647#define YYBACKUP(Token, Value) \
649 if (yychar == YYEMPTY) \
653 YYPOPSTACK (yylen); \
659 yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
666#define YYERRCODE YYUNDEF
672#ifndef YYLLOC_DEFAULT
673# define YYLLOC_DEFAULT(Current, Rhs, N) \
677 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
678 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
679 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
680 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
684 (Current).first_line = (Current).last_line = \
685 YYRHSLOC (Rhs, 0).last_line; \
686 (Current).first_column = (Current).last_column = \
687 YYRHSLOC (Rhs, 0).last_column; \
692#define YYRHSLOC(Rhs, K) ((Rhs)[K])
700# define YYFPRINTF fprintf
703# define YYDPRINTF(Args) \
714# ifndef YYLOCATION_PRINT
716# if defined YY_LOCATION_PRINT
720# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
722# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
728yy_location_print_ (FILE *yyo,
YYLTYPE const *
const yylocp)
731 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
732 if (0 <= yylocp->first_line)
734 res += YYFPRINTF (yyo,
"%d", yylocp->first_line);
735 if (0 <= yylocp->first_column)
736 res += YYFPRINTF (yyo,
".%d", yylocp->first_column);
738 if (0 <= yylocp->last_line)
740 if (yylocp->first_line < yylocp->last_line)
742 res += YYFPRINTF (yyo,
"-%d", yylocp->last_line);
744 res += YYFPRINTF (yyo,
".%d", end_col);
746 else if (0 <= end_col && yylocp->first_column < end_col)
747 res += YYFPRINTF (yyo,
"-%d", end_col);
752# define YYLOCATION_PRINT yy_location_print_
756# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
760# define YYLOCATION_PRINT(File, Loc) ((void) 0)
763# define YY_LOCATION_PRINT YYLOCATION_PRINT
769# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
773 YYFPRINTF (stderr, "%s ", Title); \
774 yy_symbol_print (stderr, \
775 Kind, Value, Location, scanner); \
776 YYFPRINTF (stderr, "\n"); \
786yy_symbol_value_print (FILE *yyo,
787 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
789 FILE *yyoutput = yyo;
791 YY_USE (yylocationp);
795 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
797 YY_IGNORE_MAYBE_UNINITIALIZED_END
806yy_symbol_print (FILE *yyo,
807 yysymbol_kind_t yykind,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp,
void *scanner)
809 YYFPRINTF (yyo,
"%s %s (",
810 yykind < YYNTOKENS ?
"token" :
"nterm", yysymbol_name (yykind));
812 YYLOCATION_PRINT (yyo, yylocationp);
813 YYFPRINTF (yyo,
": ");
814 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner);
815 YYFPRINTF (yyo,
")");
824yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
826 YYFPRINTF (stderr,
"Stack now");
827 for (; yybottom <= yytop; yybottom++)
829 int yybot = *yybottom;
830 YYFPRINTF (stderr,
" %d", yybot);
832 YYFPRINTF (stderr,
"\n");
835# define YY_STACK_PRINT(Bottom, Top) \
838 yy_stack_print ((Bottom), (Top)); \
847yy_reduce_print (yy_state_t *yyssp,
YYSTYPE *yyvsp,
YYLTYPE *yylsp,
848 int yyrule,
void *scanner)
850 int yylno = yyrline[yyrule];
851 int yynrhs = yyr2[yyrule];
853 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
856 for (yyi = 0; yyi < yynrhs; yyi++)
858 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
859 yy_symbol_print (stderr,
860 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
861 &yyvsp[(yyi + 1) - (yynrhs)],
862 &(yylsp[(yyi + 1) - (yynrhs)]), scanner);
863 YYFPRINTF (stderr,
"\n");
867# define YY_REDUCE_PRINT(Rule) \
870 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
877# define YYDPRINTF(Args) ((void) 0)
878# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
879# define YY_STACK_PRINT(Bottom, Top)
880# define YY_REDUCE_PRINT(Rule)
886# define YYINITDEPTH 200
897# define YYMAXDEPTH 10000
905 yysymbol_kind_t yytoken;
917 yysymbol_kind_t yyarg[],
int yyargn)
921 int yyn = yypact[+*yyctx->yyssp];
922 if (!yypact_value_is_default (yyn))
927 int yyxbegin = yyn < 0 ? -yyn : 0;
929 int yychecklim = YYLAST - yyn + 1;
930 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
932 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
933 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
934 && !yytable_value_is_error (yytable[yyx + yyn]))
938 else if (yycount == yyargn)
941 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
944 if (yyarg && yycount == 0 && 0 < yyargn)
945 yyarg[0] = YYSYMBOL_YYEMPTY;
953# if defined __GLIBC__ && defined _STRING_H
954# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
958yystrlen (
const char *yystr)
961 for (yylen = 0; yystr[yylen]; yylen++)
969# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
970# define yystpcpy stpcpy
975yystpcpy (
char *yydest,
const char *yysrc)
978 const char *yys = yysrc;
980 while ((*yyd++ = *yys++) !=
'\0')
997yytnamerr (
char *yyres,
const char *yystr)
1001 YYPTRDIFF_T yyn = 0;
1002 char const *yyp = yystr;
1008 goto do_not_strip_quotes;
1012 goto do_not_strip_quotes;
1028 do_not_strip_quotes: ;
1032 return yystpcpy (yyres, yystr) - yyres;
1034 return yystrlen (yystr);
1041 yysymbol_kind_t yyarg[],
int yyargn)
1068 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1072 yyarg[yycount] = yyctx->yytoken;
1074 yyn = yypcontext_expected_tokens (yyctx,
1075 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1076 if (yyn == YYENOMEM)
1093yysyntax_error (YYPTRDIFF_T *yymsg_alloc,
char **yymsg,
1096 enum { YYARGS_MAX = 5 };
1098 const char *yyformat = YY_NULLPTR;
1101 yysymbol_kind_t yyarg[YYARGS_MAX];
1103 YYPTRDIFF_T yysize = 0;
1106 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1107 if (yycount == YYENOMEM)
1112#define YYCASE_(N, S) \
1117 YYCASE_(0, YY_(
"syntax error"));
1118 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1119 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1120 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1121 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1122 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1128 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1131 for (yyi = 0; yyi < yycount; ++yyi)
1134 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1135 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1142 if (*yymsg_alloc < yysize)
1144 *yymsg_alloc = 2 * yysize;
1145 if (! (yysize <= *yymsg_alloc
1146 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1147 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1157 while ((*yyp = *yyformat) !=
'\0')
1158 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1160 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1178yydestruct (
const char *yymsg,
1179 yysymbol_kind_t yykind,
YYSTYPE *yyvaluep,
YYLTYPE *yylocationp,
void *scanner)
1182 YY_USE (yylocationp);
1186 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1188 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1192#line 40 "lib/route/pktloc_syntax.y"
1193 { free(((*yyvaluep).s)); }
1194#line 1195 "lib/route/pktloc_syntax.c"
1200 YY_IGNORE_MAYBE_UNINITIALIZED_END
1213yyparse (
void *scanner)
1222YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1223YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1227# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1231YYLTYPE yylloc = yyloc_default;
1236 yy_state_fast_t yystate = 0;
1238 int yyerrstatus = 0;
1244 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1247 yy_state_t yyssa[YYINITDEPTH];
1248 yy_state_t *yyss = yyssa;
1249 yy_state_t *yyssp = yyss;
1265 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1276 char *yymsg = yymsgbuf;
1277 YYPTRDIFF_T yymsg_alloc =
sizeof yymsgbuf;
1279#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1285 YYDPRINTF ((stderr,
"Starting parse\n"));
1306 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1307 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1308 YY_IGNORE_USELESS_CAST_BEGIN
1309 *yyssp = YY_CAST (yy_state_t, yystate);
1310 YY_IGNORE_USELESS_CAST_END
1311 YY_STACK_PRINT (yyss, yyssp);
1313 if (yyss + yystacksize - 1 <= yyssp)
1314#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1319 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1321# if defined yyoverflow
1326 yy_state_t *yyss1 = yyss;
1334 yyoverflow (YY_(
"memory exhausted"),
1335 &yyss1, yysize * YYSIZEOF (*yyssp),
1336 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1337 &yyls1, yysize * YYSIZEOF (*yylsp),
1345 if (YYMAXDEPTH <= yystacksize)
1348 if (YYMAXDEPTH < yystacksize)
1349 yystacksize = YYMAXDEPTH;
1352 yy_state_t *yyss1 = yyss;
1355 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1358 YYSTACK_RELOCATE (yyss_alloc, yyss);
1359 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1360 YYSTACK_RELOCATE (yyls_alloc, yyls);
1361# undef YYSTACK_RELOCATE
1363 YYSTACK_FREE (yyss1);
1367 yyssp = yyss + yysize - 1;
1368 yyvsp = yyvs + yysize - 1;
1369 yylsp = yyls + yysize - 1;
1371 YY_IGNORE_USELESS_CAST_BEGIN
1372 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1373 YY_CAST (
long, yystacksize)));
1374 YY_IGNORE_USELESS_CAST_END
1376 if (yyss + yystacksize - 1 <= yyssp)
1382 if (yystate == YYFINAL)
1396 yyn = yypact[yystate];
1397 if (yypact_value_is_default (yyn))
1403 if (yychar == YYEMPTY)
1405 YYDPRINTF ((stderr,
"Reading a token\n"));
1406 yychar = yylex (&yylval, &yylloc, scanner);
1409 if (yychar <= YYEOF)
1412 yytoken = YYSYMBOL_YYEOF;
1413 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1415 else if (yychar == YYerror)
1422 yytoken = YYSYMBOL_YYerror;
1423 yyerror_range[1] = yylloc;
1428 yytoken = YYTRANSLATE (yychar);
1429 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1435 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1440 if (yytable_value_is_error (yyn))
1452 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1454 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1456 YY_IGNORE_MAYBE_UNINITIALIZED_END
1468 yyn = yydefact[yystate];
1489 yyval = yyvsp[1-yylen];
1492 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1493 yyerror_range[1] = yyloc;
1494 YY_REDUCE_PRINT (yyn);
1498#line 53 "lib/route/pktloc_syntax.y"
1503 NL_DBG(1,
"Allocating a packet location "
1504 "object failed.\n");
1508 loc->name = (yyvsp[-5].s);
1509 loc->align = (yyvsp[-4].i);
1510 loc->layer = (yyvsp[-3].i);
1511 loc->offset = (yyvsp[-2].i);
1512 loc->mask = (yyvsp[-1].i);
1513 loc->shift = (yyvsp[0].i);
1516 NL_DBG(1,
"Duplicate packet location entry "
1517 "\"%s\"\n", (yyvsp[-5].s));
1522#line 1523 "lib/route/pktloc_syntax.c"
1526#line 80 "lib/route/pktloc_syntax.y"
1527 { (yyval.i) = (yyvsp[0].i); }
1528#line 1529 "lib/route/pktloc_syntax.c"
1532#line 82 "lib/route/pktloc_syntax.y"
1533 { (yyval.i) = (yyvsp[0].i); }
1534#line 1535 "lib/route/pktloc_syntax.c"
1538#line 87 "lib/route/pktloc_syntax.y"
1539 { (yyval.i) = TCF_LAYER_NETWORK; }
1540#line 1541 "lib/route/pktloc_syntax.c"
1544#line 89 "lib/route/pktloc_syntax.y"
1545 { (yyval.i) = (yyvsp[-1].i); }
1546#line 1547 "lib/route/pktloc_syntax.c"
1550#line 94 "lib/route/pktloc_syntax.y"
1552#line 1553 "lib/route/pktloc_syntax.c"
1556#line 96 "lib/route/pktloc_syntax.y"
1557 { (yyval.i) = (yyvsp[0].i); }
1558#line 1559 "lib/route/pktloc_syntax.c"
1562#line 101 "lib/route/pktloc_syntax.y"
1564#line 1565 "lib/route/pktloc_syntax.c"
1568#line 103 "lib/route/pktloc_syntax.y"
1569 { (yyval.i) = (yyvsp[0].i); }
1570#line 1571 "lib/route/pktloc_syntax.c"
1574#line 1575 "lib/route/pktloc_syntax.c"
1589 YY_SYMBOL_PRINT (
"-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1601 const int yylhs = yyr1[yyn] - YYNTOKENS;
1602 const int yyi = yypgoto[yylhs] + *yyssp;
1603 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1605 : yydefgoto[yylhs]);
1617 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1624 = {yyssp, yytoken, &yylloc};
1625 char const *yymsgp = YY_(
"syntax error");
1626 int yysyntax_error_status;
1627 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1628 if (yysyntax_error_status == 0)
1630 else if (yysyntax_error_status == -1)
1632 if (yymsg != yymsgbuf)
1633 YYSTACK_FREE (yymsg);
1634 yymsg = YY_CAST (
char *,
1635 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1638 yysyntax_error_status
1639 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1645 yymsg_alloc =
sizeof yymsgbuf;
1646 yysyntax_error_status = YYENOMEM;
1649 yyerror (&yylloc, scanner, yymsgp);
1650 if (yysyntax_error_status == YYENOMEM)
1655 yyerror_range[1] = yylloc;
1656 if (yyerrstatus == 3)
1661 if (yychar <= YYEOF)
1664 if (yychar == YYEOF)
1669 yydestruct (
"Error: discarding",
1670 yytoken, &yylval, &yylloc, scanner);
1694 YY_STACK_PRINT (yyss, yyssp);
1708 yyn = yypact[yystate];
1709 if (!yypact_value_is_default (yyn))
1711 yyn += YYSYMBOL_YYerror;
1712 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1724 yyerror_range[1] = *yylsp;
1725 yydestruct (
"Error: popping",
1726 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner);
1729 YY_STACK_PRINT (yyss, yyssp);
1732 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1734 YY_IGNORE_MAYBE_UNINITIALIZED_END
1736 yyerror_range[2] = yylloc;
1738 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
1741 YY_SYMBOL_PRINT (
"Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1767 yyerror (&yylloc, scanner, YY_(
"memory exhausted"));
1776 if (yychar != YYEMPTY)
1780 yytoken = YYTRANSLATE (yychar);
1781 yydestruct (
"Cleanup: discarding lookahead",
1782 yytoken, &yylval, &yylloc, scanner);
1787 YY_STACK_PRINT (yyss, yyssp);
1788 while (yyssp != yyss)
1790 yydestruct (
"Cleanup: popping",
1791 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner);
1796 YYSTACK_FREE (yyss);
1798 if (yymsg != yymsgbuf)
1799 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.