libnl
3.2.7
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Bison implementation for Yacc-like parsers in C 00004 00005 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C LALR(1) parser skeleton written by Richard Stallman, by 00034 simplifying the original so-called "semantic" parser. */ 00035 00036 /* All symbols defined below should begin with yy or YY, to avoid 00037 infringing on user name space. This should be done even for local 00038 variables, as they might otherwise be expanded by user macros. 00039 There are some unavoidable exceptions within include files to 00040 define necessary library symbols; they are noted "INFRINGES ON 00041 USER NAME SPACE" below. */ 00042 00043 /* Identify Bison output. */ 00044 #define YYBISON 1 00045 00046 /* Bison version. */ 00047 #define YYBISON_VERSION "2.5" 00048 00049 /* Skeleton name. */ 00050 #define YYSKELETON_NAME "yacc.c" 00051 00052 /* Pure parsers. */ 00053 #define YYPURE 1 00054 00055 /* Push parsers. */ 00056 #define YYPUSH 0 00057 00058 /* Pull parsers. */ 00059 #define YYPULL 1 00060 00061 /* Using locations. */ 00062 #define YYLSP_NEEDED 1 00063 00064 /* Substitute the variable and function names. */ 00065 #define yyparse pktloc_parse 00066 #define yylex pktloc_lex 00067 #define yyerror pktloc_error 00068 #define yylval pktloc_lval 00069 #define yychar pktloc_char 00070 #define yydebug pktloc_debug 00071 #define yynerrs pktloc_nerrs 00072 #define yylloc pktloc_lloc 00073 00074 /* Copy the first part of user declarations. */ 00075 00076 /* Line 268 of yacc.c */ 00077 #line 1 "route/pktloc_syntax.y" 00078 00079 #include <netlink-local.h> 00080 #include <netlink-tc.h> 00081 #include <netlink/netlink.h> 00082 #include <netlink/utils.h> 00083 #include <netlink/route/pktloc.h> 00084 00085 00086 /* Line 268 of yacc.c */ 00087 #line 88 "route/pktloc_syntax.c" 00088 00089 /* Enabling traces. */ 00090 #ifndef YYDEBUG 00091 # define YYDEBUG 0 00092 #endif 00093 00094 /* Enabling verbose error messages. */ 00095 #ifdef YYERROR_VERBOSE 00096 # undef YYERROR_VERBOSE 00097 # define YYERROR_VERBOSE 1 00098 #else 00099 # define YYERROR_VERBOSE 1 00100 #endif 00101 00102 /* Enabling the token table. */ 00103 #ifndef YYTOKEN_TABLE 00104 # define YYTOKEN_TABLE 0 00105 #endif 00106 00107 00108 /* Tokens. */ 00109 #ifndef YYTOKENTYPE 00110 # define YYTOKENTYPE 00111 /* Put the tokens into the symbol table, so that GDB and other debuggers 00112 know about them. */ 00113 enum yytokentype { 00114 ERROR = 258, 00115 NUMBER = 259, 00116 LAYER = 260, 00117 ALIGN = 261, 00118 NAME = 262 00119 }; 00120 #endif 00121 /* Tokens. */ 00122 #define ERROR 258 00123 #define NUMBER 259 00124 #define LAYER 260 00125 #define ALIGN 261 00126 #define NAME 262 00127 00128 00129 00130 00131 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00132 typedef union YYSTYPE 00133 { 00134 00135 /* Line 293 of yacc.c */ 00136 #line 18 "route/pktloc_syntax.y" 00137 00138 struct rtnl_pktloc *l; 00139 uint32_t i; 00140 char *s; 00141 00142 00143 00144 /* Line 293 of yacc.c */ 00145 #line 146 "route/pktloc_syntax.c" 00146 } YYSTYPE; 00147 # define YYSTYPE_IS_TRIVIAL 1 00148 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00149 # define YYSTYPE_IS_DECLARED 1 00150 #endif 00151 00152 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED 00153 typedef struct YYLTYPE 00154 { 00155 int first_line; 00156 int first_column; 00157 int last_line; 00158 int last_column; 00159 } YYLTYPE; 00160 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ 00161 # define YYLTYPE_IS_DECLARED 1 00162 # define YYLTYPE_IS_TRIVIAL 1 00163 #endif 00164 00165 00166 /* Copy the second part of user declarations. */ 00167 00168 /* Line 343 of yacc.c */ 00169 #line 24 "route/pktloc_syntax.y" 00170 00171 extern int pktloc_lex(YYSTYPE *, YYLTYPE *, void *); 00172 00173 static void yyerror(YYLTYPE *locp, void *scanner, const char *msg) 00174 { 00175 NL_DBG(1, "Error while parsing packet location file: %s\n", msg); 00176 } 00177 00178 00179 /* Line 343 of yacc.c */ 00180 #line 181 "route/pktloc_syntax.c" 00181 00182 #ifdef short 00183 # undef short 00184 #endif 00185 00186 #ifdef YYTYPE_UINT8 00187 typedef YYTYPE_UINT8 yytype_uint8; 00188 #else 00189 typedef unsigned char yytype_uint8; 00190 #endif 00191 00192 #ifdef YYTYPE_INT8 00193 typedef YYTYPE_INT8 yytype_int8; 00194 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00195 || defined __cplusplus || defined _MSC_VER) 00196 typedef signed char yytype_int8; 00197 #else 00198 typedef short int yytype_int8; 00199 #endif 00200 00201 #ifdef YYTYPE_UINT16 00202 typedef YYTYPE_UINT16 yytype_uint16; 00203 #else 00204 typedef unsigned short int yytype_uint16; 00205 #endif 00206 00207 #ifdef YYTYPE_INT16 00208 typedef YYTYPE_INT16 yytype_int16; 00209 #else 00210 typedef short int yytype_int16; 00211 #endif 00212 00213 #ifndef YYSIZE_T 00214 # ifdef __SIZE_TYPE__ 00215 # define YYSIZE_T __SIZE_TYPE__ 00216 # elif defined size_t 00217 # define YYSIZE_T size_t 00218 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00219 || defined __cplusplus || defined _MSC_VER) 00220 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00221 # define YYSIZE_T size_t 00222 # else 00223 # define YYSIZE_T unsigned int 00224 # endif 00225 #endif 00226 00227 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00228 00229 #ifndef YY_ 00230 # if defined YYENABLE_NLS && YYENABLE_NLS 00231 # if ENABLE_NLS 00232 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00233 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00234 # endif 00235 # endif 00236 # ifndef YY_ 00237 # define YY_(msgid) msgid 00238 # endif 00239 #endif 00240 00241 /* Suppress unused-variable warnings by "using" E. */ 00242 #if ! defined lint || defined __GNUC__ 00243 # define YYUSE(e) ((void) (e)) 00244 #else 00245 # define YYUSE(e) /* empty */ 00246 #endif 00247 00248 /* Identity function, used to suppress warnings about constant conditions. */ 00249 #ifndef lint 00250 # define YYID(n) (n) 00251 #else 00252 #if (defined __STDC__ || defined __C99__FUNC__ \ 00253 || defined __cplusplus || defined _MSC_VER) 00254 static int 00255 YYID (int yyi) 00256 #else 00257 static int 00258 YYID (yyi) 00259 int yyi; 00260 #endif 00261 { 00262 return yyi; 00263 } 00264 #endif 00265 00266 #if ! defined yyoverflow || YYERROR_VERBOSE 00267 00268 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00269 00270 # ifdef YYSTACK_USE_ALLOCA 00271 # if YYSTACK_USE_ALLOCA 00272 # ifdef __GNUC__ 00273 # define YYSTACK_ALLOC __builtin_alloca 00274 # elif defined __BUILTIN_VA_ARG_INCR 00275 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00276 # elif defined _AIX 00277 # define YYSTACK_ALLOC __alloca 00278 # elif defined _MSC_VER 00279 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 00280 # define alloca _alloca 00281 # else 00282 # define YYSTACK_ALLOC alloca 00283 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00284 || defined __cplusplus || defined _MSC_VER) 00285 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00286 # ifndef EXIT_SUCCESS 00287 # define EXIT_SUCCESS 0 00288 # endif 00289 # endif 00290 # endif 00291 # endif 00292 # endif 00293 00294 # ifdef YYSTACK_ALLOC 00295 /* Pacify GCC's `empty if-body' warning. */ 00296 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00297 # ifndef YYSTACK_ALLOC_MAXIMUM 00298 /* The OS might guarantee only one guard page at the bottom of the stack, 00299 and a page size can be as small as 4096 bytes. So we cannot safely 00300 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00301 to allow for a few compiler-allocated temporary stack slots. */ 00302 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00303 # endif 00304 # else 00305 # define YYSTACK_ALLOC YYMALLOC 00306 # define YYSTACK_FREE YYFREE 00307 # ifndef YYSTACK_ALLOC_MAXIMUM 00308 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00309 # endif 00310 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00311 && ! ((defined YYMALLOC || defined malloc) \ 00312 && (defined YYFREE || defined free))) 00313 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00314 # ifndef EXIT_SUCCESS 00315 # define EXIT_SUCCESS 0 00316 # endif 00317 # endif 00318 # ifndef YYMALLOC 00319 # define YYMALLOC malloc 00320 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00321 || defined __cplusplus || defined _MSC_VER) 00322 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 00323 # endif 00324 # endif 00325 # ifndef YYFREE 00326 # define YYFREE free 00327 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00328 || defined __cplusplus || defined _MSC_VER) 00329 void free (void *); /* INFRINGES ON USER NAME SPACE */ 00330 # endif 00331 # endif 00332 # endif 00333 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 00334 00335 00336 #if (! defined yyoverflow \ 00337 && (! defined __cplusplus \ 00338 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ 00339 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 00340 00341 /* A type that is properly aligned for any stack member. */ 00342 union yyalloc 00343 { 00344 yytype_int16 yyss_alloc; 00345 YYSTYPE yyvs_alloc; 00346 YYLTYPE yyls_alloc; 00347 }; 00348 00349 /* The size of the maximum gap between one aligned stack and the next. */ 00350 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 00351 00352 /* The size of an array large to enough to hold all stacks, each with 00353 N elements. */ 00354 # define YYSTACK_BYTES(N) \ 00355 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ 00356 + 2 * YYSTACK_GAP_MAXIMUM) 00357 00358 # define YYCOPY_NEEDED 1 00359 00360 /* Relocate STACK from its old location to the new one. The 00361 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00362 elements in the stack, and YYPTR gives the new location of the 00363 stack. Advance YYPTR to a properly aligned location for the next 00364 stack. */ 00365 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 00366 do \ 00367 { \ 00368 YYSIZE_T yynewbytes; \ 00369 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 00370 Stack = &yyptr->Stack_alloc; \ 00371 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 00372 yyptr += yynewbytes / sizeof (*yyptr); \ 00373 } \ 00374 while (YYID (0)) 00375 00376 #endif 00377 00378 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 00379 /* Copy COUNT objects from FROM to TO. The source and destination do 00380 not overlap. */ 00381 # ifndef YYCOPY 00382 # if defined __GNUC__ && 1 < __GNUC__ 00383 # define YYCOPY(To, From, Count) \ 00384 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00385 # else 00386 # define YYCOPY(To, From, Count) \ 00387 do \ 00388 { \ 00389 YYSIZE_T yyi; \ 00390 for (yyi = 0; yyi < (Count); yyi++) \ 00391 (To)[yyi] = (From)[yyi]; \ 00392 } \ 00393 while (YYID (0)) 00394 # endif 00395 # endif 00396 #endif /* !YYCOPY_NEEDED */ 00397 00398 /* YYFINAL -- State number of the termination state. */ 00399 #define YYFINAL 7 00400 /* YYLAST -- Last index in YYTABLE. */ 00401 #define YYLAST 10 00402 00403 /* YYNTOKENS -- Number of terminals. */ 00404 #define YYNTOKENS 9 00405 /* YYNNTS -- Number of nonterminals. */ 00406 #define YYNNTS 7 00407 /* YYNRULES -- Number of rules. */ 00408 #define YYNRULES 12 00409 /* YYNRULES -- Number of states. */ 00410 #define YYNSTATES 17 00411 00412 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00413 #define YYUNDEFTOK 2 00414 #define YYMAXUTOK 262 00415 00416 #define YYTRANSLATE(YYX) \ 00417 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 00418 00419 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00420 static const yytype_uint8 yytranslate[] = 00421 { 00422 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00426 2, 2, 2, 8, 2, 2, 2, 2, 2, 2, 00427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00447 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00448 5, 6, 7 00449 }; 00450 00451 #if YYDEBUG 00452 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00453 YYRHS. */ 00454 static const yytype_uint8 yyprhs[] = 00455 { 00456 0, 0, 3, 4, 7, 14, 16, 18, 19, 22, 00457 23, 25, 26 00458 }; 00459 00460 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00461 static const yytype_int8 yyrhs[] = 00462 { 00463 10, 0, -1, -1, 11, 10, -1, 7, 12, 13, 00464 4, 14, 15, -1, 6, -1, 4, -1, -1, 5, 00465 8, -1, -1, 4, -1, -1, 4, -1 00466 }; 00467 00468 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00469 static const yytype_uint8 yyrline[] = 00470 { 00471 0, 45, 45, 47, 51, 78, 80, 86, 87, 93, 00472 94, 100, 101 00473 }; 00474 #endif 00475 00476 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00477 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00478 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00479 static const char *const yytname[] = 00480 { 00481 "$end", "error", "$undefined", "ERROR", "NUMBER", "LAYER", "ALIGN", 00482 "NAME", "'+'", "$accept", "input", "location", "align", "layer", "mask", 00483 "shift", 0 00484 }; 00485 #endif 00486 00487 # ifdef YYPRINT 00488 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00489 token YYLEX-NUM. */ 00490 static const yytype_uint16 yytoknum[] = 00491 { 00492 0, 256, 257, 258, 259, 260, 261, 262, 43 00493 }; 00494 # endif 00495 00496 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00497 static const yytype_uint8 yyr1[] = 00498 { 00499 0, 9, 10, 10, 11, 12, 12, 13, 13, 14, 00500 14, 15, 15 00501 }; 00502 00503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00504 static const yytype_uint8 yyr2[] = 00505 { 00506 0, 2, 0, 2, 6, 1, 1, 0, 2, 0, 00507 1, 0, 1 00508 }; 00509 00510 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 00511 Performed when YYTABLE doesn't specify something else to do. Zero 00512 means the default is an error. */ 00513 static const yytype_uint8 yydefact[] = 00514 { 00515 2, 0, 0, 2, 6, 5, 7, 1, 3, 0, 00516 0, 8, 9, 10, 11, 12, 4 00517 }; 00518 00519 /* YYDEFGOTO[NTERM-NUM]. */ 00520 static const yytype_int8 yydefgoto[] = 00521 { 00522 -1, 2, 3, 6, 10, 14, 16 00523 }; 00524 00525 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 00526 STATE-NUM. */ 00527 #define YYPACT_NINF -7 00528 static const yytype_int8 yypact[] = 00529 { 00530 -6, -4, 3, -6, -7, -7, -1, -7, -7, -3, 00531 2, -7, 4, -7, 5, -7, -7 00532 }; 00533 00534 /* YYPGOTO[NTERM-NUM]. */ 00535 static const yytype_int8 yypgoto[] = 00536 { 00537 -7, 7, -7, -7, -7, -7, -7 00538 }; 00539 00540 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 00541 positive, shift that token. If negative, reduce the rule which 00542 number is the opposite. If YYTABLE_NINF, syntax error. */ 00543 #define YYTABLE_NINF -1 00544 static const yytype_uint8 yytable[] = 00545 { 00546 4, 1, 5, 7, 9, 11, 12, 0, 13, 15, 00547 8 00548 }; 00549 00550 #define yypact_value_is_default(yystate) \ 00551 ((yystate) == (-7)) 00552 00553 #define yytable_value_is_error(yytable_value) \ 00554 YYID (0) 00555 00556 static const yytype_int8 yycheck[] = 00557 { 00558 4, 7, 6, 0, 5, 8, 4, -1, 4, 4, 00559 3 00560 }; 00561 00562 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 00563 symbol of state STATE-NUM. */ 00564 static const yytype_uint8 yystos[] = 00565 { 00566 0, 7, 10, 11, 4, 6, 12, 0, 10, 5, 00567 13, 8, 4, 4, 14, 4, 15 00568 }; 00569 00570 #define yyerrok (yyerrstatus = 0) 00571 #define yyclearin (yychar = YYEMPTY) 00572 #define YYEMPTY (-2) 00573 #define YYEOF 0 00574 00575 #define YYACCEPT goto yyacceptlab 00576 #define YYABORT goto yyabortlab 00577 #define YYERROR goto yyerrorlab 00578 00579 00580 /* Like YYERROR except do call yyerror. This remains here temporarily 00581 to ease the transition to the new meaning of YYERROR, for GCC. 00582 Once GCC version 2 has supplanted version 1, this can go. However, 00583 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 00584 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 00585 discussed. */ 00586 00587 #define YYFAIL goto yyerrlab 00588 #if defined YYFAIL 00589 /* This is here to suppress warnings from the GCC cpp's 00590 -Wunused-macros. Normally we don't worry about that warning, but 00591 some users do, and we want to make it easy for users to remove 00592 YYFAIL uses, which will produce warnings from Bison 2.5. */ 00593 #endif 00594 00595 #define YYRECOVERING() (!!yyerrstatus) 00596 00597 #define YYBACKUP(Token, Value) \ 00598 do \ 00599 if (yychar == YYEMPTY && yylen == 1) \ 00600 { \ 00601 yychar = (Token); \ 00602 yylval = (Value); \ 00603 YYPOPSTACK (1); \ 00604 goto yybackup; \ 00605 } \ 00606 else \ 00607 { \ 00608 yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \ 00609 YYERROR; \ 00610 } \ 00611 while (YYID (0)) 00612 00613 00614 #define YYTERROR 1 00615 #define YYERRCODE 256 00616 00617 00618 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 00619 If N is 0, then set CURRENT to the empty location which ends 00620 the previous symbol: RHS[0] (always defined). */ 00621 00622 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 00623 #ifndef YYLLOC_DEFAULT 00624 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 00625 do \ 00626 if (YYID (N)) \ 00627 { \ 00628 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 00629 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 00630 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 00631 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 00632 } \ 00633 else \ 00634 { \ 00635 (Current).first_line = (Current).last_line = \ 00636 YYRHSLOC (Rhs, 0).last_line; \ 00637 (Current).first_column = (Current).last_column = \ 00638 YYRHSLOC (Rhs, 0).last_column; \ 00639 } \ 00640 while (YYID (0)) 00641 #endif 00642 00643 00644 /* YY_LOCATION_PRINT -- Print the location on the stream. 00645 This macro was not mandated originally: define only if we know 00646 we won't break user code: when these are the locations we know. */ 00647 00648 #ifndef YY_LOCATION_PRINT 00649 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 00650 # define YY_LOCATION_PRINT(File, Loc) \ 00651 fprintf (File, "%d.%d-%d.%d", \ 00652 (Loc).first_line, (Loc).first_column, \ 00653 (Loc).last_line, (Loc).last_column) 00654 # else 00655 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 00656 # endif 00657 #endif 00658 00659 00660 /* YYLEX -- calling `yylex' with the right arguments. */ 00661 00662 #ifdef YYLEX_PARAM 00663 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) 00664 #else 00665 # define YYLEX yylex (&yylval, &yylloc, scanner) 00666 #endif 00667 00668 /* Enable debugging if requested. */ 00669 #if YYDEBUG 00670 00671 # ifndef YYFPRINTF 00672 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 00673 # define YYFPRINTF fprintf 00674 # endif 00675 00676 # define YYDPRINTF(Args) \ 00677 do { \ 00678 if (yydebug) \ 00679 YYFPRINTF Args; \ 00680 } while (YYID (0)) 00681 00682 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 00683 do { \ 00684 if (yydebug) \ 00685 { \ 00686 YYFPRINTF (stderr, "%s ", Title); \ 00687 yy_symbol_print (stderr, \ 00688 Type, Value, Location, scanner); \ 00689 YYFPRINTF (stderr, "\n"); \ 00690 } \ 00691 } while (YYID (0)) 00692 00693 00694 /*--------------------------------. 00695 | Print this symbol on YYOUTPUT. | 00696 `--------------------------------*/ 00697 00698 /*ARGSUSED*/ 00699 #if (defined __STDC__ || defined __C99__FUNC__ \ 00700 || defined __cplusplus || defined _MSC_VER) 00701 static void 00702 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) 00703 #else 00704 static void 00705 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) 00706 FILE *yyoutput; 00707 int yytype; 00708 YYSTYPE const * const yyvaluep; 00709 YYLTYPE const * const yylocationp; 00710 void *scanner; 00711 #endif 00712 { 00713 if (!yyvaluep) 00714 return; 00715 YYUSE (yylocationp); 00716 YYUSE (scanner); 00717 # ifdef YYPRINT 00718 if (yytype < YYNTOKENS) 00719 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 00720 # else 00721 YYUSE (yyoutput); 00722 # endif 00723 switch (yytype) 00724 { 00725 default: 00726 break; 00727 } 00728 } 00729 00730 00731 /*--------------------------------. 00732 | Print this symbol on YYOUTPUT. | 00733 `--------------------------------*/ 00734 00735 #if (defined __STDC__ || defined __C99__FUNC__ \ 00736 || defined __cplusplus || defined _MSC_VER) 00737 static void 00738 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) 00739 #else 00740 static void 00741 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) 00742 FILE *yyoutput; 00743 int yytype; 00744 YYSTYPE const * const yyvaluep; 00745 YYLTYPE const * const yylocationp; 00746 void *scanner; 00747 #endif 00748 { 00749 if (yytype < YYNTOKENS) 00750 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 00751 else 00752 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 00753 00754 YY_LOCATION_PRINT (yyoutput, *yylocationp); 00755 YYFPRINTF (yyoutput, ": "); 00756 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner); 00757 YYFPRINTF (yyoutput, ")"); 00758 } 00759 00760 /*------------------------------------------------------------------. 00761 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 00762 | TOP (included). | 00763 `------------------------------------------------------------------*/ 00764 00765 #if (defined __STDC__ || defined __C99__FUNC__ \ 00766 || defined __cplusplus || defined _MSC_VER) 00767 static void 00768 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 00769 #else 00770 static void 00771 yy_stack_print (yybottom, yytop) 00772 yytype_int16 *yybottom; 00773 yytype_int16 *yytop; 00774 #endif 00775 { 00776 YYFPRINTF (stderr, "Stack now"); 00777 for (; yybottom <= yytop; yybottom++) 00778 { 00779 int yybot = *yybottom; 00780 YYFPRINTF (stderr, " %d", yybot); 00781 } 00782 YYFPRINTF (stderr, "\n"); 00783 } 00784 00785 # define YY_STACK_PRINT(Bottom, Top) \ 00786 do { \ 00787 if (yydebug) \ 00788 yy_stack_print ((Bottom), (Top)); \ 00789 } while (YYID (0)) 00790 00791 00792 /*------------------------------------------------. 00793 | Report that the YYRULE is going to be reduced. | 00794 `------------------------------------------------*/ 00795 00796 #if (defined __STDC__ || defined __C99__FUNC__ \ 00797 || defined __cplusplus || defined _MSC_VER) 00798 static void 00799 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner) 00800 #else 00801 static void 00802 yy_reduce_print (yyvsp, yylsp, yyrule, scanner) 00803 YYSTYPE *yyvsp; 00804 YYLTYPE *yylsp; 00805 int yyrule; 00806 void *scanner; 00807 #endif 00808 { 00809 int yynrhs = yyr2[yyrule]; 00810 int yyi; 00811 unsigned long int yylno = yyrline[yyrule]; 00812 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 00813 yyrule - 1, yylno); 00814 /* The symbols being reduced. */ 00815 for (yyi = 0; yyi < yynrhs; yyi++) 00816 { 00817 YYFPRINTF (stderr, " $%d = ", yyi + 1); 00818 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 00819 &(yyvsp[(yyi + 1) - (yynrhs)]) 00820 , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner); 00821 YYFPRINTF (stderr, "\n"); 00822 } 00823 } 00824 00825 # define YY_REDUCE_PRINT(Rule) \ 00826 do { \ 00827 if (yydebug) \ 00828 yy_reduce_print (yyvsp, yylsp, Rule, scanner); \ 00829 } while (YYID (0)) 00830 00831 /* Nonzero means print parse trace. It is left uninitialized so that 00832 multiple parsers can coexist. */ 00833 int yydebug; 00834 #else /* !YYDEBUG */ 00835 # define YYDPRINTF(Args) 00836 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 00837 # define YY_STACK_PRINT(Bottom, Top) 00838 # define YY_REDUCE_PRINT(Rule) 00839 #endif /* !YYDEBUG */ 00840 00841 00842 /* YYINITDEPTH -- initial size of the parser's stacks. */ 00843 #ifndef YYINITDEPTH 00844 # define YYINITDEPTH 200 00845 #endif 00846 00847 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 00848 if the built-in stack extension method is used). 00849 00850 Do not make this value too large; the results are undefined if 00851 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 00852 evaluated with infinite-precision integer arithmetic. */ 00853 00854 #ifndef YYMAXDEPTH 00855 # define YYMAXDEPTH 10000 00856 #endif 00857 00858 00859 #if YYERROR_VERBOSE 00860 00861 # ifndef yystrlen 00862 # if defined __GLIBC__ && defined _STRING_H 00863 # define yystrlen strlen 00864 # else 00865 /* Return the length of YYSTR. */ 00866 #if (defined __STDC__ || defined __C99__FUNC__ \ 00867 || defined __cplusplus || defined _MSC_VER) 00868 static YYSIZE_T 00869 yystrlen (const char *yystr) 00870 #else 00871 static YYSIZE_T 00872 yystrlen (yystr) 00873 const char *yystr; 00874 #endif 00875 { 00876 YYSIZE_T yylen; 00877 for (yylen = 0; yystr[yylen]; yylen++) 00878 continue; 00879 return yylen; 00880 } 00881 # endif 00882 # endif 00883 00884 # ifndef yystpcpy 00885 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 00886 # define yystpcpy stpcpy 00887 # else 00888 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 00889 YYDEST. */ 00890 #if (defined __STDC__ || defined __C99__FUNC__ \ 00891 || defined __cplusplus || defined _MSC_VER) 00892 static char * 00893 yystpcpy (char *yydest, const char *yysrc) 00894 #else 00895 static char * 00896 yystpcpy (yydest, yysrc) 00897 char *yydest; 00898 const char *yysrc; 00899 #endif 00900 { 00901 char *yyd = yydest; 00902 const char *yys = yysrc; 00903 00904 while ((*yyd++ = *yys++) != '\0') 00905 continue; 00906 00907 return yyd - 1; 00908 } 00909 # endif 00910 # endif 00911 00912 # ifndef yytnamerr 00913 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 00914 quotes and backslashes, so that it's suitable for yyerror. The 00915 heuristic is that double-quoting is unnecessary unless the string 00916 contains an apostrophe, a comma, or backslash (other than 00917 backslash-backslash). YYSTR is taken from yytname. If YYRES is 00918 null, do not copy; instead, return the length of what the result 00919 would have been. */ 00920 static YYSIZE_T 00921 yytnamerr (char *yyres, const char *yystr) 00922 { 00923 if (*yystr == '"') 00924 { 00925 YYSIZE_T yyn = 0; 00926 char const *yyp = yystr; 00927 00928 for (;;) 00929 switch (*++yyp) 00930 { 00931 case '\'': 00932 case ',': 00933 goto do_not_strip_quotes; 00934 00935 case '\\': 00936 if (*++yyp != '\\') 00937 goto do_not_strip_quotes; 00938 /* Fall through. */ 00939 default: 00940 if (yyres) 00941 yyres[yyn] = *yyp; 00942 yyn++; 00943 break; 00944 00945 case '"': 00946 if (yyres) 00947 yyres[yyn] = '\0'; 00948 return yyn; 00949 } 00950 do_not_strip_quotes: ; 00951 } 00952 00953 if (! yyres) 00954 return yystrlen (yystr); 00955 00956 return yystpcpy (yyres, yystr) - yyres; 00957 } 00958 # endif 00959 00960 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 00961 about the unexpected token YYTOKEN for the state stack whose top is 00962 YYSSP. 00963 00964 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 00965 not large enough to hold the message. In that case, also set 00966 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 00967 required number of bytes is too large to store. */ 00968 static int 00969 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 00970 yytype_int16 *yyssp, int yytoken) 00971 { 00972 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 00973 YYSIZE_T yysize = yysize0; 00974 YYSIZE_T yysize1; 00975 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 00976 /* Internationalized format string. */ 00977 const char *yyformat = 0; 00978 /* Arguments of yyformat. */ 00979 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 00980 /* Number of reported tokens (one for the "unexpected", one per 00981 "expected"). */ 00982 int yycount = 0; 00983 00984 /* There are many possibilities here to consider: 00985 - Assume YYFAIL is not used. It's too flawed to consider. See 00986 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 00987 for details. YYERROR is fine as it does not invoke this 00988 function. 00989 - If this state is a consistent state with a default action, then 00990 the only way this function was invoked is if the default action 00991 is an error action. In that case, don't check for expected 00992 tokens because there are none. 00993 - The only way there can be no lookahead present (in yychar) is if 00994 this state is a consistent state with a default action. Thus, 00995 detecting the absence of a lookahead is sufficient to determine 00996 that there is no unexpected or expected token to report. In that 00997 case, just report a simple "syntax error". 00998 - Don't assume there isn't a lookahead just because this state is a 00999 consistent state with a default action. There might have been a 01000 previous inconsistent state, consistent state with a non-default 01001 action, or user semantic action that manipulated yychar. 01002 - Of course, the expected token list depends on states to have 01003 correct lookahead information, and it depends on the parser not 01004 to perform extra reductions after fetching a lookahead from the 01005 scanner and before detecting a syntax error. Thus, state merging 01006 (from LALR or IELR) and default reductions corrupt the expected 01007 token list. However, the list is correct for canonical LR with 01008 one exception: it will still contain any token that will not be 01009 accepted due to an error action in a later state. 01010 */ 01011 if (yytoken != YYEMPTY) 01012 { 01013 int yyn = yypact[*yyssp]; 01014 yyarg[yycount++] = yytname[yytoken]; 01015 if (!yypact_value_is_default (yyn)) 01016 { 01017 /* Start YYX at -YYN if negative to avoid negative indexes in 01018 YYCHECK. In other words, skip the first -YYN actions for 01019 this state because they are default actions. */ 01020 int yyxbegin = yyn < 0 ? -yyn : 0; 01021 /* Stay within bounds of both yycheck and yytname. */ 01022 int yychecklim = YYLAST - yyn + 1; 01023 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01024 int yyx; 01025 01026 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01027 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01028 && !yytable_value_is_error (yytable[yyx + yyn])) 01029 { 01030 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01031 { 01032 yycount = 1; 01033 yysize = yysize0; 01034 break; 01035 } 01036 yyarg[yycount++] = yytname[yyx]; 01037 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01038 if (! (yysize <= yysize1 01039 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01040 return 2; 01041 yysize = yysize1; 01042 } 01043 } 01044 } 01045 01046 switch (yycount) 01047 { 01048 # define YYCASE_(N, S) \ 01049 case N: \ 01050 yyformat = S; \ 01051 break 01052 YYCASE_(0, YY_("syntax error")); 01053 YYCASE_(1, YY_("syntax error, unexpected %s")); 01054 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 01055 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 01056 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 01057 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 01058 # undef YYCASE_ 01059 } 01060 01061 yysize1 = yysize + yystrlen (yyformat); 01062 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01063 return 2; 01064 yysize = yysize1; 01065 01066 if (*yymsg_alloc < yysize) 01067 { 01068 *yymsg_alloc = 2 * yysize; 01069 if (! (yysize <= *yymsg_alloc 01070 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 01071 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 01072 return 1; 01073 } 01074 01075 /* Avoid sprintf, as that infringes on the user's name space. 01076 Don't have undefined behavior even if the translation 01077 produced a string with the wrong number of "%s"s. */ 01078 { 01079 char *yyp = *yymsg; 01080 int yyi = 0; 01081 while ((*yyp = *yyformat) != '\0') 01082 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 01083 { 01084 yyp += yytnamerr (yyp, yyarg[yyi++]); 01085 yyformat += 2; 01086 } 01087 else 01088 { 01089 yyp++; 01090 yyformat++; 01091 } 01092 } 01093 return 0; 01094 } 01095 #endif /* YYERROR_VERBOSE */ 01096 01097 /*-----------------------------------------------. 01098 | Release the memory associated to this symbol. | 01099 `-----------------------------------------------*/ 01100 01101 /*ARGSUSED*/ 01102 #if (defined __STDC__ || defined __C99__FUNC__ \ 01103 || defined __cplusplus || defined _MSC_VER) 01104 static void 01105 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner) 01106 #else 01107 static void 01108 yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner) 01109 const char *yymsg; 01110 int yytype; 01111 YYSTYPE *yyvaluep; 01112 YYLTYPE *yylocationp; 01113 void *scanner; 01114 #endif 01115 { 01116 YYUSE (yyvaluep); 01117 YYUSE (yylocationp); 01118 YYUSE (scanner); 01119 01120 if (!yymsg) 01121 yymsg = "Deleting"; 01122 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 01123 01124 switch (yytype) 01125 { 01126 case 7: /* "NAME" */ 01127 01128 /* Line 1391 of yacc.c */ 01129 #line 39 "route/pktloc_syntax.y" 01130 { free((yyvaluep->s)); }; 01131 01132 /* Line 1391 of yacc.c */ 01133 #line 1134 "route/pktloc_syntax.c" 01134 break; 01135 01136 default: 01137 break; 01138 } 01139 } 01140 01141 01142 /* Prevent warnings from -Wmissing-prototypes. */ 01143 #ifdef YYPARSE_PARAM 01144 #if defined __STDC__ || defined __cplusplus 01145 int yyparse (void *YYPARSE_PARAM); 01146 #else 01147 int yyparse (); 01148 #endif 01149 #else /* ! YYPARSE_PARAM */ 01150 #if defined __STDC__ || defined __cplusplus 01151 int yyparse (void *scanner); 01152 #else 01153 int yyparse (); 01154 #endif 01155 #endif /* ! YYPARSE_PARAM */ 01156 01157 01158 /*----------. 01159 | yyparse. | 01160 `----------*/ 01161 01162 #ifdef YYPARSE_PARAM 01163 #if (defined __STDC__ || defined __C99__FUNC__ \ 01164 || defined __cplusplus || defined _MSC_VER) 01165 int 01166 yyparse (void *YYPARSE_PARAM) 01167 #else 01168 int 01169 yyparse (YYPARSE_PARAM) 01170 void *YYPARSE_PARAM; 01171 #endif 01172 #else /* ! YYPARSE_PARAM */ 01173 #if (defined __STDC__ || defined __C99__FUNC__ \ 01174 || defined __cplusplus || defined _MSC_VER) 01175 int 01176 yyparse (void *scanner) 01177 #else 01178 int 01179 yyparse (scanner) 01180 void *scanner; 01181 #endif 01182 #endif 01183 { 01184 /* The lookahead symbol. */ 01185 int yychar; 01186 01187 /* The semantic value of the lookahead symbol. */ 01188 YYSTYPE yylval; 01189 01190 /* Location data for the lookahead symbol. */ 01191 YYLTYPE yylloc; 01192 01193 /* Number of syntax errors so far. */ 01194 int yynerrs; 01195 01196 int yystate; 01197 /* Number of tokens to shift before error messages enabled. */ 01198 int yyerrstatus; 01199 01200 /* The stacks and their tools: 01201 `yyss': related to states. 01202 `yyvs': related to semantic values. 01203 `yyls': related to locations. 01204 01205 Refer to the stacks thru separate pointers, to allow yyoverflow 01206 to reallocate them elsewhere. */ 01207 01208 /* The state stack. */ 01209 yytype_int16 yyssa[YYINITDEPTH]; 01210 yytype_int16 *yyss; 01211 yytype_int16 *yyssp; 01212 01213 /* The semantic value stack. */ 01214 YYSTYPE yyvsa[YYINITDEPTH]; 01215 YYSTYPE *yyvs; 01216 YYSTYPE *yyvsp; 01217 01218 /* The location stack. */ 01219 YYLTYPE yylsa[YYINITDEPTH]; 01220 YYLTYPE *yyls; 01221 YYLTYPE *yylsp; 01222 01223 /* The locations where the error started and ended. */ 01224 YYLTYPE yyerror_range[3]; 01225 01226 YYSIZE_T yystacksize; 01227 01228 int yyn; 01229 int yyresult; 01230 /* Lookahead token as an internal (translated) token number. */ 01231 int yytoken; 01232 /* The variables used to return semantic value and location from the 01233 action routines. */ 01234 YYSTYPE yyval; 01235 YYLTYPE yyloc; 01236 01237 #if YYERROR_VERBOSE 01238 /* Buffer for error messages, and its allocated size. */ 01239 char yymsgbuf[128]; 01240 char *yymsg = yymsgbuf; 01241 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 01242 #endif 01243 01244 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 01245 01246 /* The number of symbols on the RHS of the reduced rule. 01247 Keep to zero when no symbol should be popped. */ 01248 int yylen = 0; 01249 01250 yytoken = 0; 01251 yyss = yyssa; 01252 yyvs = yyvsa; 01253 yyls = yylsa; 01254 yystacksize = YYINITDEPTH; 01255 01256 YYDPRINTF ((stderr, "Starting parse\n")); 01257 01258 yystate = 0; 01259 yyerrstatus = 0; 01260 yynerrs = 0; 01261 yychar = YYEMPTY; /* Cause a token to be read. */ 01262 01263 /* Initialize stack pointers. 01264 Waste one element of value and location stack 01265 so that they stay on the same level as the state stack. 01266 The wasted elements are never initialized. */ 01267 yyssp = yyss; 01268 yyvsp = yyvs; 01269 yylsp = yyls; 01270 01271 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 01272 /* Initialize the default location before parsing starts. */ 01273 yylloc.first_line = yylloc.last_line = 1; 01274 yylloc.first_column = yylloc.last_column = 1; 01275 #endif 01276 01277 goto yysetstate; 01278 01279 /*------------------------------------------------------------. 01280 | yynewstate -- Push a new state, which is found in yystate. | 01281 `------------------------------------------------------------*/ 01282 yynewstate: 01283 /* In all cases, when you get here, the value and location stacks 01284 have just been pushed. So pushing a state here evens the stacks. */ 01285 yyssp++; 01286 01287 yysetstate: 01288 *yyssp = yystate; 01289 01290 if (yyss + yystacksize - 1 <= yyssp) 01291 { 01292 /* Get the current used size of the three stacks, in elements. */ 01293 YYSIZE_T yysize = yyssp - yyss + 1; 01294 01295 #ifdef yyoverflow 01296 { 01297 /* Give user a chance to reallocate the stack. Use copies of 01298 these so that the &'s don't force the real ones into 01299 memory. */ 01300 YYSTYPE *yyvs1 = yyvs; 01301 yytype_int16 *yyss1 = yyss; 01302 YYLTYPE *yyls1 = yyls; 01303 01304 /* Each stack pointer address is followed by the size of the 01305 data in use in that stack, in bytes. This used to be a 01306 conditional around just the two extra args, but that might 01307 be undefined if yyoverflow is a macro. */ 01308 yyoverflow (YY_("memory exhausted"), 01309 &yyss1, yysize * sizeof (*yyssp), 01310 &yyvs1, yysize * sizeof (*yyvsp), 01311 &yyls1, yysize * sizeof (*yylsp), 01312 &yystacksize); 01313 01314 yyls = yyls1; 01315 yyss = yyss1; 01316 yyvs = yyvs1; 01317 } 01318 #else /* no yyoverflow */ 01319 # ifndef YYSTACK_RELOCATE 01320 goto yyexhaustedlab; 01321 # else 01322 /* Extend the stack our own way. */ 01323 if (YYMAXDEPTH <= yystacksize) 01324 goto yyexhaustedlab; 01325 yystacksize *= 2; 01326 if (YYMAXDEPTH < yystacksize) 01327 yystacksize = YYMAXDEPTH; 01328 01329 { 01330 yytype_int16 *yyss1 = yyss; 01331 union yyalloc *yyptr = 01332 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 01333 if (! yyptr) 01334 goto yyexhaustedlab; 01335 YYSTACK_RELOCATE (yyss_alloc, yyss); 01336 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 01337 YYSTACK_RELOCATE (yyls_alloc, yyls); 01338 # undef YYSTACK_RELOCATE 01339 if (yyss1 != yyssa) 01340 YYSTACK_FREE (yyss1); 01341 } 01342 # endif 01343 #endif /* no yyoverflow */ 01344 01345 yyssp = yyss + yysize - 1; 01346 yyvsp = yyvs + yysize - 1; 01347 yylsp = yyls + yysize - 1; 01348 01349 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 01350 (unsigned long int) yystacksize)); 01351 01352 if (yyss + yystacksize - 1 <= yyssp) 01353 YYABORT; 01354 } 01355 01356 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 01357 01358 if (yystate == YYFINAL) 01359 YYACCEPT; 01360 01361 goto yybackup; 01362 01363 /*-----------. 01364 | yybackup. | 01365 `-----------*/ 01366 yybackup: 01367 01368 /* Do appropriate processing given the current state. Read a 01369 lookahead token if we need one and don't already have one. */ 01370 01371 /* First try to decide what to do without reference to lookahead token. */ 01372 yyn = yypact[yystate]; 01373 if (yypact_value_is_default (yyn)) 01374 goto yydefault; 01375 01376 /* Not known => get a lookahead token if don't already have one. */ 01377 01378 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 01379 if (yychar == YYEMPTY) 01380 { 01381 YYDPRINTF ((stderr, "Reading a token: ")); 01382 yychar = YYLEX; 01383 } 01384 01385 if (yychar <= YYEOF) 01386 { 01387 yychar = yytoken = YYEOF; 01388 YYDPRINTF ((stderr, "Now at end of input.\n")); 01389 } 01390 else 01391 { 01392 yytoken = YYTRANSLATE (yychar); 01393 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 01394 } 01395 01396 /* If the proper action on seeing token YYTOKEN is to reduce or to 01397 detect an error, take that action. */ 01398 yyn += yytoken; 01399 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 01400 goto yydefault; 01401 yyn = yytable[yyn]; 01402 if (yyn <= 0) 01403 { 01404 if (yytable_value_is_error (yyn)) 01405 goto yyerrlab; 01406 yyn = -yyn; 01407 goto yyreduce; 01408 } 01409 01410 /* Count tokens shifted since error; after three, turn off error 01411 status. */ 01412 if (yyerrstatus) 01413 yyerrstatus--; 01414 01415 /* Shift the lookahead token. */ 01416 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 01417 01418 /* Discard the shifted token. */ 01419 yychar = YYEMPTY; 01420 01421 yystate = yyn; 01422 *++yyvsp = yylval; 01423 *++yylsp = yylloc; 01424 goto yynewstate; 01425 01426 01427 /*-----------------------------------------------------------. 01428 | yydefault -- do the default action for the current state. | 01429 `-----------------------------------------------------------*/ 01430 yydefault: 01431 yyn = yydefact[yystate]; 01432 if (yyn == 0) 01433 goto yyerrlab; 01434 goto yyreduce; 01435 01436 01437 /*-----------------------------. 01438 | yyreduce -- Do a reduction. | 01439 `-----------------------------*/ 01440 yyreduce: 01441 /* yyn is the number of a rule to reduce with. */ 01442 yylen = yyr2[yyn]; 01443 01444 /* If YYLEN is nonzero, implement the default value of the action: 01445 `$$ = $1'. 01446 01447 Otherwise, the following line sets YYVAL to garbage. 01448 This behavior is undocumented and Bison 01449 users should not rely upon it. Assigning to YYVAL 01450 unconditionally makes the parser a bit smaller, and it avoids a 01451 GCC warning that YYVAL may be used uninitialized. */ 01452 yyval = yyvsp[1-yylen]; 01453 01454 /* Default location. */ 01455 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); 01456 YY_REDUCE_PRINT (yyn); 01457 switch (yyn) 01458 { 01459 case 4: 01460 01461 /* Line 1806 of yacc.c */ 01462 #line 52 "route/pktloc_syntax.y" 01463 { 01464 struct rtnl_pktloc *loc; 01465 01466 if (!(loc = rtnl_pktloc_alloc())) { 01467 NL_DBG(1, "Allocating a packet location " 01468 "object failed.\n"); 01469 YYABORT; 01470 } 01471 01472 loc->name = (yyvsp[(1) - (6)].s); 01473 loc->align = (yyvsp[(2) - (6)].i); 01474 loc->layer = (yyvsp[(3) - (6)].i); 01475 loc->offset = (yyvsp[(4) - (6)].i); 01476 loc->mask = (yyvsp[(5) - (6)].i); 01477 loc->shift = (yyvsp[(6) - (6)].i); 01478 01479 if (rtnl_pktloc_add(loc) < 0) { 01480 NL_DBG(1, "Duplicate packet location entry " 01481 "\"%s\"\n", (yyvsp[(1) - (6)].s)); 01482 } 01483 01484 (yyval.l) = loc; 01485 } 01486 break; 01487 01488 case 5: 01489 01490 /* Line 1806 of yacc.c */ 01491 #line 79 "route/pktloc_syntax.y" 01492 { (yyval.i) = (yyvsp[(1) - (1)].i); } 01493 break; 01494 01495 case 6: 01496 01497 /* Line 1806 of yacc.c */ 01498 #line 81 "route/pktloc_syntax.y" 01499 { (yyval.i) = (yyvsp[(1) - (1)].i); } 01500 break; 01501 01502 case 7: 01503 01504 /* Line 1806 of yacc.c */ 01505 #line 86 "route/pktloc_syntax.y" 01506 { (yyval.i) = TCF_LAYER_NETWORK; } 01507 break; 01508 01509 case 8: 01510 01511 /* Line 1806 of yacc.c */ 01512 #line 88 "route/pktloc_syntax.y" 01513 { (yyval.i) = (yyvsp[(1) - (2)].i); } 01514 break; 01515 01516 case 9: 01517 01518 /* Line 1806 of yacc.c */ 01519 #line 93 "route/pktloc_syntax.y" 01520 { (yyval.i) = 0; } 01521 break; 01522 01523 case 10: 01524 01525 /* Line 1806 of yacc.c */ 01526 #line 95 "route/pktloc_syntax.y" 01527 { (yyval.i) = (yyvsp[(1) - (1)].i); } 01528 break; 01529 01530 case 11: 01531 01532 /* Line 1806 of yacc.c */ 01533 #line 100 "route/pktloc_syntax.y" 01534 { (yyval.i) = 0; } 01535 break; 01536 01537 case 12: 01538 01539 /* Line 1806 of yacc.c */ 01540 #line 102 "route/pktloc_syntax.y" 01541 { (yyval.i) = (yyvsp[(1) - (1)].i); } 01542 break; 01543 01544 01545 01546 /* Line 1806 of yacc.c */ 01547 #line 1548 "route/pktloc_syntax.c" 01548 default: break; 01549 } 01550 /* User semantic actions sometimes alter yychar, and that requires 01551 that yytoken be updated with the new translation. We take the 01552 approach of translating immediately before every use of yytoken. 01553 One alternative is translating here after every semantic action, 01554 but that translation would be missed if the semantic action invokes 01555 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 01556 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 01557 incorrect destructor might then be invoked immediately. In the 01558 case of YYERROR or YYBACKUP, subsequent parser actions might lead 01559 to an incorrect destructor call or verbose syntax error message 01560 before the lookahead is translated. */ 01561 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 01562 01563 YYPOPSTACK (yylen); 01564 yylen = 0; 01565 YY_STACK_PRINT (yyss, yyssp); 01566 01567 *++yyvsp = yyval; 01568 *++yylsp = yyloc; 01569 01570 /* Now `shift' the result of the reduction. Determine what state 01571 that goes to, based on the state we popped back to and the rule 01572 number reduced by. */ 01573 01574 yyn = yyr1[yyn]; 01575 01576 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 01577 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 01578 yystate = yytable[yystate]; 01579 else 01580 yystate = yydefgoto[yyn - YYNTOKENS]; 01581 01582 goto yynewstate; 01583 01584 01585 /*------------------------------------. 01586 | yyerrlab -- here on detecting error | 01587 `------------------------------------*/ 01588 yyerrlab: 01589 /* Make sure we have latest lookahead translation. See comments at 01590 user semantic actions for why this is necessary. */ 01591 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 01592 01593 /* If not already recovering from an error, report this error. */ 01594 if (!yyerrstatus) 01595 { 01596 ++yynerrs; 01597 #if ! YYERROR_VERBOSE 01598 yyerror (&yylloc, scanner, YY_("syntax error")); 01599 #else 01600 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 01601 yyssp, yytoken) 01602 { 01603 char const *yymsgp = YY_("syntax error"); 01604 int yysyntax_error_status; 01605 yysyntax_error_status = YYSYNTAX_ERROR; 01606 if (yysyntax_error_status == 0) 01607 yymsgp = yymsg; 01608 else if (yysyntax_error_status == 1) 01609 { 01610 if (yymsg != yymsgbuf) 01611 YYSTACK_FREE (yymsg); 01612 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 01613 if (!yymsg) 01614 { 01615 yymsg = yymsgbuf; 01616 yymsg_alloc = sizeof yymsgbuf; 01617 yysyntax_error_status = 2; 01618 } 01619 else 01620 { 01621 yysyntax_error_status = YYSYNTAX_ERROR; 01622 yymsgp = yymsg; 01623 } 01624 } 01625 yyerror (&yylloc, scanner, yymsgp); 01626 if (yysyntax_error_status == 2) 01627 goto yyexhaustedlab; 01628 } 01629 # undef YYSYNTAX_ERROR 01630 #endif 01631 } 01632 01633 yyerror_range[1] = yylloc; 01634 01635 if (yyerrstatus == 3) 01636 { 01637 /* If just tried and failed to reuse lookahead token after an 01638 error, discard it. */ 01639 01640 if (yychar <= YYEOF) 01641 { 01642 /* Return failure if at end of input. */ 01643 if (yychar == YYEOF) 01644 YYABORT; 01645 } 01646 else 01647 { 01648 yydestruct ("Error: discarding", 01649 yytoken, &yylval, &yylloc, scanner); 01650 yychar = YYEMPTY; 01651 } 01652 } 01653 01654 /* Else will try to reuse lookahead token after shifting the error 01655 token. */ 01656 goto yyerrlab1; 01657 01658 01659 /*---------------------------------------------------. 01660 | yyerrorlab -- error raised explicitly by YYERROR. | 01661 `---------------------------------------------------*/ 01662 yyerrorlab: 01663 01664 /* Pacify compilers like GCC when the user code never invokes 01665 YYERROR and the label yyerrorlab therefore never appears in user 01666 code. */ 01667 if (/*CONSTCOND*/ 0) 01668 goto yyerrorlab; 01669 01670 yyerror_range[1] = yylsp[1-yylen]; 01671 /* Do not reclaim the symbols of the rule which action triggered 01672 this YYERROR. */ 01673 YYPOPSTACK (yylen); 01674 yylen = 0; 01675 YY_STACK_PRINT (yyss, yyssp); 01676 yystate = *yyssp; 01677 goto yyerrlab1; 01678 01679 01680 /*-------------------------------------------------------------. 01681 | yyerrlab1 -- common code for both syntax error and YYERROR. | 01682 `-------------------------------------------------------------*/ 01683 yyerrlab1: 01684 yyerrstatus = 3; /* Each real token shifted decrements this. */ 01685 01686 for (;;) 01687 { 01688 yyn = yypact[yystate]; 01689 if (!yypact_value_is_default (yyn)) 01690 { 01691 yyn += YYTERROR; 01692 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 01693 { 01694 yyn = yytable[yyn]; 01695 if (0 < yyn) 01696 break; 01697 } 01698 } 01699 01700 /* Pop the current state because it cannot handle the error token. */ 01701 if (yyssp == yyss) 01702 YYABORT; 01703 01704 yyerror_range[1] = *yylsp; 01705 yydestruct ("Error: popping", 01706 yystos[yystate], yyvsp, yylsp, scanner); 01707 YYPOPSTACK (1); 01708 yystate = *yyssp; 01709 YY_STACK_PRINT (yyss, yyssp); 01710 } 01711 01712 *++yyvsp = yylval; 01713 01714 yyerror_range[2] = yylloc; 01715 /* Using YYLLOC is tempting, but would change the location of 01716 the lookahead. YYLOC is available though. */ 01717 YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 01718 *++yylsp = yyloc; 01719 01720 /* Shift the error token. */ 01721 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 01722 01723 yystate = yyn; 01724 goto yynewstate; 01725 01726 01727 /*-------------------------------------. 01728 | yyacceptlab -- YYACCEPT comes here. | 01729 `-------------------------------------*/ 01730 yyacceptlab: 01731 yyresult = 0; 01732 goto yyreturn; 01733 01734 /*-----------------------------------. 01735 | yyabortlab -- YYABORT comes here. | 01736 `-----------------------------------*/ 01737 yyabortlab: 01738 yyresult = 1; 01739 goto yyreturn; 01740 01741 #if !defined(yyoverflow) || YYERROR_VERBOSE 01742 /*-------------------------------------------------. 01743 | yyexhaustedlab -- memory exhaustion comes here. | 01744 `-------------------------------------------------*/ 01745 yyexhaustedlab: 01746 yyerror (&yylloc, scanner, YY_("memory exhausted")); 01747 yyresult = 2; 01748 /* Fall through. */ 01749 #endif 01750 01751 yyreturn: 01752 if (yychar != YYEMPTY) 01753 { 01754 /* Make sure we have latest lookahead translation. See comments at 01755 user semantic actions for why this is necessary. */ 01756 yytoken = YYTRANSLATE (yychar); 01757 yydestruct ("Cleanup: discarding lookahead", 01758 yytoken, &yylval, &yylloc, scanner); 01759 } 01760 /* Do not reclaim the symbols of the rule which action triggered 01761 this YYABORT or YYACCEPT. */ 01762 YYPOPSTACK (yylen); 01763 YY_STACK_PRINT (yyss, yyssp); 01764 while (yyssp != yyss) 01765 { 01766 yydestruct ("Cleanup: popping", 01767 yystos[*yyssp], yyvsp, yylsp, scanner); 01768 YYPOPSTACK (1); 01769 } 01770 #ifndef yyoverflow 01771 if (yyss != yyssa) 01772 YYSTACK_FREE (yyss); 01773 #endif 01774 #if YYERROR_VERBOSE 01775 if (yymsg != yymsgbuf) 01776 YYSTACK_FREE (yymsg); 01777 #endif 01778 /* Make sure YYID is used. */ 01779 return YYID (yyresult); 01780 } 01781 01782 01783