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