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