1 | /* A Bison parser, made by GNU Bison 2.7. */ |
---|
2 | |
---|
3 | /* Bison implementation for Yacc-like parsers in C |
---|
4 | |
---|
5 | Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. |
---|
6 | |
---|
7 | This program is free software: you can redistribute it and/or modify |
---|
8 | it under the terms of the GNU General Public License as published by |
---|
9 | the Free Software Foundation, either version 3 of the License, or |
---|
10 | (at your option) any later version. |
---|
11 | |
---|
12 | This program is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | GNU General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU General Public License |
---|
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
---|
19 | |
---|
20 | /* As a special exception, you may create a larger work that contains |
---|
21 | part or all of the Bison parser skeleton and distribute that work |
---|
22 | under terms of your choice, so long as that work isn't itself a |
---|
23 | parser generator using the skeleton or a modified version thereof |
---|
24 | as a parser skeleton. Alternatively, if you modify or redistribute |
---|
25 | the parser skeleton itself, you may (at your option) remove this |
---|
26 | special exception, which will cause the skeleton and the resulting |
---|
27 | Bison output files to be licensed under the GNU General Public |
---|
28 | License without this special exception. |
---|
29 | |
---|
30 | This special exception was added by the Free Software Foundation in |
---|
31 | version 2.2 of Bison. */ |
---|
32 | |
---|
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
---|
34 | simplifying the original so-called "semantic" parser. */ |
---|
35 | |
---|
36 | /* All symbols defined below should begin with yy or YY, to avoid |
---|
37 | infringing on user name space. This should be done even for local |
---|
38 | variables, as they might otherwise be expanded by user macros. |
---|
39 | There are some unavoidable exceptions within include files to |
---|
40 | define necessary library symbols; they are noted "INFRINGES ON |
---|
41 | USER NAME SPACE" below. */ |
---|
42 | |
---|
43 | /* Identify Bison output. */ |
---|
44 | #define YYBISON 1 |
---|
45 | |
---|
46 | /* Bison version. */ |
---|
47 | #define YYBISON_VERSION "2.7" |
---|
48 | |
---|
49 | /* Skeleton name. */ |
---|
50 | #define YYSKELETON_NAME "yacc.c" |
---|
51 | |
---|
52 | /* Pure parsers. */ |
---|
53 | #define YYPURE 0 |
---|
54 | |
---|
55 | /* Push parsers. */ |
---|
56 | #define YYPUSH 0 |
---|
57 | |
---|
58 | /* Pull parsers. */ |
---|
59 | #define YYPULL 1 |
---|
60 | |
---|
61 | |
---|
62 | /* Substitute the variable and function names. */ |
---|
63 | #define yyparse _nsyyparse |
---|
64 | #define yylex _nsyylex |
---|
65 | #define yyerror _nsyyerror |
---|
66 | #define yylval _nsyylval |
---|
67 | #define yychar _nsyychar |
---|
68 | #define yydebug _nsyydebug |
---|
69 | #define yynerrs _nsyynerrs |
---|
70 | |
---|
71 | /* Copy the first part of user declarations. */ |
---|
72 | /* Line 371 of yacc.c */ |
---|
73 | #line 1 "freebsd/lib/libc/net/nsparser.y" |
---|
74 | |
---|
75 | /* $NetBSD: nsparser.y,v 1.3 1999/01/25 00:16:18 lukem Exp $ */ |
---|
76 | |
---|
77 | /*- |
---|
78 | * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. |
---|
79 | * All rights reserved. |
---|
80 | * |
---|
81 | * This code is derived from software contributed to The NetBSD Foundation |
---|
82 | * by Luke Mewburn. |
---|
83 | * |
---|
84 | * Redistribution and use in source and binary forms, with or without |
---|
85 | * modification, are permitted provided that the following conditions |
---|
86 | * are met: |
---|
87 | * 1. Redistributions of source code must retain the above copyright |
---|
88 | * notice, this list of conditions and the following disclaimer. |
---|
89 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
90 | * notice, this list of conditions and the following disclaimer in the |
---|
91 | * documentation and/or other materials provided with the distribution. |
---|
92 | * 3. All advertising materials mentioning features or use of this software |
---|
93 | * must display the following acknowledgement: |
---|
94 | * This product includes software developed by the NetBSD |
---|
95 | * Foundation, Inc. and its contributors. |
---|
96 | * 4. Neither the name of The NetBSD Foundation nor the names of its |
---|
97 | * contributors may be used to endorse or promote products derived |
---|
98 | * from this software without specific prior written permission. |
---|
99 | * |
---|
100 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
---|
101 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
---|
102 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
---|
103 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
---|
104 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
105 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
106 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
107 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
108 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
109 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
110 | * POSSIBILITY OF SUCH DAMAGE. |
---|
111 | */ |
---|
112 | |
---|
113 | #include <sys/cdefs.h> |
---|
114 | __FBSDID("$FreeBSD$"); |
---|
115 | |
---|
116 | #include "namespace.h" |
---|
117 | #define _NS_PRIVATE |
---|
118 | #include <nsswitch.h> |
---|
119 | #include <stdio.h> |
---|
120 | #include <stdlib.h> |
---|
121 | #include <string.h> |
---|
122 | #include <syslog.h> |
---|
123 | #include "un-namespace.h" |
---|
124 | |
---|
125 | static void _nsaddsrctomap(const char *); |
---|
126 | |
---|
127 | static ns_dbt curdbt; |
---|
128 | static ns_src cursrc; |
---|
129 | |
---|
130 | /* Line 371 of yacc.c */ |
---|
131 | #line 132 "_nsyy.tab.c" |
---|
132 | |
---|
133 | # ifndef YY_NULL |
---|
134 | # if defined __cplusplus && 201103L <= __cplusplus |
---|
135 | # define YY_NULL nullptr |
---|
136 | # else |
---|
137 | # define YY_NULL 0 |
---|
138 | # endif |
---|
139 | # endif |
---|
140 | |
---|
141 | /* Enabling verbose error messages. */ |
---|
142 | #ifdef YYERROR_VERBOSE |
---|
143 | # undef YYERROR_VERBOSE |
---|
144 | # define YYERROR_VERBOSE 1 |
---|
145 | #else |
---|
146 | # define YYERROR_VERBOSE 0 |
---|
147 | #endif |
---|
148 | |
---|
149 | /* In a future release of Bison, this section will be replaced |
---|
150 | by #include "_nsyy.tab.h". */ |
---|
151 | #ifndef YY__NSYY_NSYY_TAB_H_INCLUDED |
---|
152 | # define YY__NSYY_NSYY_TAB_H_INCLUDED |
---|
153 | /* Enabling traces. */ |
---|
154 | #ifndef YYDEBUG |
---|
155 | # define YYDEBUG 0 |
---|
156 | #endif |
---|
157 | #if YYDEBUG |
---|
158 | extern int _nsyydebug; |
---|
159 | #endif |
---|
160 | |
---|
161 | /* Tokens. */ |
---|
162 | #ifndef YYTOKENTYPE |
---|
163 | # define YYTOKENTYPE |
---|
164 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
---|
165 | know about them. */ |
---|
166 | enum yytokentype { |
---|
167 | NL = 258, |
---|
168 | SUCCESS = 259, |
---|
169 | UNAVAIL = 260, |
---|
170 | NOTFOUND = 261, |
---|
171 | TRYAGAIN = 262, |
---|
172 | RETURN = 263, |
---|
173 | CONTINUE = 264, |
---|
174 | ERRORTOKEN = 265, |
---|
175 | STRING = 266 |
---|
176 | }; |
---|
177 | #endif |
---|
178 | /* Tokens. */ |
---|
179 | #define NL 258 |
---|
180 | #define SUCCESS 259 |
---|
181 | #define UNAVAIL 260 |
---|
182 | #define NOTFOUND 261 |
---|
183 | #define TRYAGAIN 262 |
---|
184 | #define RETURN 263 |
---|
185 | #define CONTINUE 264 |
---|
186 | #define ERRORTOKEN 265 |
---|
187 | #define STRING 266 |
---|
188 | |
---|
189 | |
---|
190 | |
---|
191 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
---|
192 | typedef union YYSTYPE |
---|
193 | { |
---|
194 | /* Line 387 of yacc.c */ |
---|
195 | #line 58 "freebsd/lib/libc/net/nsparser.y" |
---|
196 | |
---|
197 | char *str; |
---|
198 | int mapval; |
---|
199 | |
---|
200 | |
---|
201 | /* Line 387 of yacc.c */ |
---|
202 | #line 203 "_nsyy.tab.c" |
---|
203 | } YYSTYPE; |
---|
204 | # define YYSTYPE_IS_TRIVIAL 1 |
---|
205 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
---|
206 | # define YYSTYPE_IS_DECLARED 1 |
---|
207 | #endif |
---|
208 | |
---|
209 | extern YYSTYPE _nsyylval; |
---|
210 | |
---|
211 | #ifdef YYPARSE_PARAM |
---|
212 | #if defined __STDC__ || defined __cplusplus |
---|
213 | int _nsyyparse (void *YYPARSE_PARAM); |
---|
214 | #else |
---|
215 | int _nsyyparse (); |
---|
216 | #endif |
---|
217 | #else /* ! YYPARSE_PARAM */ |
---|
218 | #if defined __STDC__ || defined __cplusplus |
---|
219 | int _nsyyparse (void); |
---|
220 | #else |
---|
221 | int _nsyyparse (); |
---|
222 | #endif |
---|
223 | #endif /* ! YYPARSE_PARAM */ |
---|
224 | |
---|
225 | #endif /* !YY__NSYY_NSYY_TAB_H_INCLUDED */ |
---|
226 | |
---|
227 | /* Copy the second part of user declarations. */ |
---|
228 | |
---|
229 | /* Line 390 of yacc.c */ |
---|
230 | #line 231 "_nsyy.tab.c" |
---|
231 | |
---|
232 | #ifdef short |
---|
233 | # undef short |
---|
234 | #endif |
---|
235 | |
---|
236 | #ifdef YYTYPE_UINT8 |
---|
237 | typedef YYTYPE_UINT8 yytype_uint8; |
---|
238 | #else |
---|
239 | typedef unsigned char yytype_uint8; |
---|
240 | #endif |
---|
241 | |
---|
242 | #ifdef YYTYPE_INT8 |
---|
243 | typedef YYTYPE_INT8 yytype_int8; |
---|
244 | #elif (defined __STDC__ || defined __C99__FUNC__ \ |
---|
245 | || defined __cplusplus || defined _MSC_VER) |
---|
246 | typedef signed char yytype_int8; |
---|
247 | #else |
---|
248 | typedef short int yytype_int8; |
---|
249 | #endif |
---|
250 | |
---|
251 | #ifdef YYTYPE_UINT16 |
---|
252 | typedef YYTYPE_UINT16 yytype_uint16; |
---|
253 | #else |
---|
254 | typedef unsigned short int yytype_uint16; |
---|
255 | #endif |
---|
256 | |
---|
257 | #ifdef YYTYPE_INT16 |
---|
258 | typedef YYTYPE_INT16 yytype_int16; |
---|
259 | #else |
---|
260 | typedef short int yytype_int16; |
---|
261 | #endif |
---|
262 | |
---|
263 | #ifndef YYSIZE_T |
---|
264 | # ifdef __SIZE_TYPE__ |
---|
265 | # define YYSIZE_T __SIZE_TYPE__ |
---|
266 | # elif defined size_t |
---|
267 | # define YYSIZE_T size_t |
---|
268 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
269 | || defined __cplusplus || defined _MSC_VER) |
---|
270 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
---|
271 | # define YYSIZE_T size_t |
---|
272 | # else |
---|
273 | # define YYSIZE_T unsigned int |
---|
274 | # endif |
---|
275 | #endif |
---|
276 | |
---|
277 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
---|
278 | |
---|
279 | #ifndef YY_ |
---|
280 | # if defined YYENABLE_NLS && YYENABLE_NLS |
---|
281 | # if ENABLE_NLS |
---|
282 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
---|
283 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
---|
284 | # endif |
---|
285 | # endif |
---|
286 | # ifndef YY_ |
---|
287 | # define YY_(Msgid) Msgid |
---|
288 | # endif |
---|
289 | #endif |
---|
290 | |
---|
291 | /* Suppress unused-variable warnings by "using" E. */ |
---|
292 | #if ! defined lint || defined __GNUC__ |
---|
293 | # define YYUSE(E) ((void) (E)) |
---|
294 | #else |
---|
295 | # define YYUSE(E) /* empty */ |
---|
296 | #endif |
---|
297 | |
---|
298 | /* Identity function, used to suppress warnings about constant conditions. */ |
---|
299 | #ifndef lint |
---|
300 | # define YYID(N) (N) |
---|
301 | #else |
---|
302 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
303 | || defined __cplusplus || defined _MSC_VER) |
---|
304 | static int |
---|
305 | YYID (int yyi) |
---|
306 | #else |
---|
307 | static int |
---|
308 | YYID (yyi) |
---|
309 | int yyi; |
---|
310 | #endif |
---|
311 | { |
---|
312 | return yyi; |
---|
313 | } |
---|
314 | #endif |
---|
315 | |
---|
316 | #if ! defined yyoverflow || YYERROR_VERBOSE |
---|
317 | |
---|
318 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
---|
319 | |
---|
320 | # ifdef YYSTACK_USE_ALLOCA |
---|
321 | # if YYSTACK_USE_ALLOCA |
---|
322 | # ifdef __GNUC__ |
---|
323 | # define YYSTACK_ALLOC __builtin_alloca |
---|
324 | # elif defined __BUILTIN_VA_ARG_INCR |
---|
325 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
---|
326 | # elif defined _AIX |
---|
327 | # define YYSTACK_ALLOC __alloca |
---|
328 | # elif defined _MSC_VER |
---|
329 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
---|
330 | # define alloca _alloca |
---|
331 | # else |
---|
332 | # define YYSTACK_ALLOC alloca |
---|
333 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
334 | || defined __cplusplus || defined _MSC_VER) |
---|
335 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
336 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
---|
337 | # ifndef EXIT_SUCCESS |
---|
338 | # define EXIT_SUCCESS 0 |
---|
339 | # endif |
---|
340 | # endif |
---|
341 | # endif |
---|
342 | # endif |
---|
343 | # endif |
---|
344 | |
---|
345 | # ifdef YYSTACK_ALLOC |
---|
346 | /* Pacify GCC's `empty if-body' warning. */ |
---|
347 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
---|
348 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
349 | /* The OS might guarantee only one guard page at the bottom of the stack, |
---|
350 | and a page size can be as small as 4096 bytes. So we cannot safely |
---|
351 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
---|
352 | to allow for a few compiler-allocated temporary stack slots. */ |
---|
353 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
---|
354 | # endif |
---|
355 | # else |
---|
356 | # define YYSTACK_ALLOC YYMALLOC |
---|
357 | # define YYSTACK_FREE YYFREE |
---|
358 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
359 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
---|
360 | # endif |
---|
361 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
---|
362 | && ! ((defined YYMALLOC || defined malloc) \ |
---|
363 | && (defined YYFREE || defined free))) |
---|
364 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
365 | # ifndef EXIT_SUCCESS |
---|
366 | # define EXIT_SUCCESS 0 |
---|
367 | # endif |
---|
368 | # endif |
---|
369 | # ifndef YYMALLOC |
---|
370 | # define YYMALLOC malloc |
---|
371 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
372 | || defined __cplusplus || defined _MSC_VER) |
---|
373 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
---|
374 | # endif |
---|
375 | # endif |
---|
376 | # ifndef YYFREE |
---|
377 | # define YYFREE free |
---|
378 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
379 | || defined __cplusplus || defined _MSC_VER) |
---|
380 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
---|
381 | # endif |
---|
382 | # endif |
---|
383 | # endif |
---|
384 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
---|
385 | |
---|
386 | |
---|
387 | #if (! defined yyoverflow \ |
---|
388 | && (! defined __cplusplus \ |
---|
389 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
---|
390 | |
---|
391 | /* A type that is properly aligned for any stack member. */ |
---|
392 | union yyalloc |
---|
393 | { |
---|
394 | yytype_int16 yyss_alloc; |
---|
395 | YYSTYPE yyvs_alloc; |
---|
396 | }; |
---|
397 | |
---|
398 | /* The size of the maximum gap between one aligned stack and the next. */ |
---|
399 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
---|
400 | |
---|
401 | /* The size of an array large to enough to hold all stacks, each with |
---|
402 | N elements. */ |
---|
403 | # define YYSTACK_BYTES(N) \ |
---|
404 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
---|
405 | + YYSTACK_GAP_MAXIMUM) |
---|
406 | |
---|
407 | # define YYCOPY_NEEDED 1 |
---|
408 | |
---|
409 | /* Relocate STACK from its old location to the new one. The |
---|
410 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
---|
411 | elements in the stack, and YYPTR gives the new location of the |
---|
412 | stack. Advance YYPTR to a properly aligned location for the next |
---|
413 | stack. */ |
---|
414 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
---|
415 | do \ |
---|
416 | { \ |
---|
417 | YYSIZE_T yynewbytes; \ |
---|
418 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
---|
419 | Stack = &yyptr->Stack_alloc; \ |
---|
420 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
---|
421 | yyptr += yynewbytes / sizeof (*yyptr); \ |
---|
422 | } \ |
---|
423 | while (YYID (0)) |
---|
424 | |
---|
425 | #endif |
---|
426 | |
---|
427 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
---|
428 | /* Copy COUNT objects from SRC to DST. The source and destination do |
---|
429 | not overlap. */ |
---|
430 | # ifndef YYCOPY |
---|
431 | # if defined __GNUC__ && 1 < __GNUC__ |
---|
432 | # define YYCOPY(Dst, Src, Count) \ |
---|
433 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
---|
434 | # else |
---|
435 | # define YYCOPY(Dst, Src, Count) \ |
---|
436 | do \ |
---|
437 | { \ |
---|
438 | YYSIZE_T yyi; \ |
---|
439 | for (yyi = 0; yyi < (Count); yyi++) \ |
---|
440 | (Dst)[yyi] = (Src)[yyi]; \ |
---|
441 | } \ |
---|
442 | while (YYID (0)) |
---|
443 | # endif |
---|
444 | # endif |
---|
445 | #endif /* !YYCOPY_NEEDED */ |
---|
446 | |
---|
447 | /* YYFINAL -- State number of the termination state. */ |
---|
448 | #define YYFINAL 9 |
---|
449 | /* YYLAST -- Last index in YYTABLE. */ |
---|
450 | #define YYLAST 30 |
---|
451 | |
---|
452 | /* YYNTOKENS -- Number of terminals. */ |
---|
453 | #define YYNTOKENS 16 |
---|
454 | /* YYNNTS -- Number of nonterminals. */ |
---|
455 | #define YYNNTS 12 |
---|
456 | /* YYNRULES -- Number of rules. */ |
---|
457 | #define YYNRULES 24 |
---|
458 | /* YYNRULES -- Number of states. */ |
---|
459 | #define YYNSTATES 33 |
---|
460 | |
---|
461 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
---|
462 | #define YYUNDEFTOK 2 |
---|
463 | #define YYMAXUTOK 266 |
---|
464 | |
---|
465 | #define YYTRANSLATE(YYX) \ |
---|
466 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
---|
467 | |
---|
468 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
---|
469 | static const yytype_uint8 yytranslate[] = |
---|
470 | { |
---|
471 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
472 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
473 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
474 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
475 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
476 | 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, |
---|
477 | 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
478 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
479 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
480 | 2, 13, 2, 14, 2, 2, 2, 2, 2, 2, |
---|
481 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
482 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
483 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
484 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
485 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
486 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
487 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
488 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
489 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
490 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
491 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
492 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
493 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
494 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
495 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
496 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
---|
497 | 5, 6, 7, 8, 9, 10, 11 |
---|
498 | }; |
---|
499 | |
---|
500 | #if YYDEBUG |
---|
501 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
---|
502 | YYRHS. */ |
---|
503 | static const yytype_uint8 yyprhs[] = |
---|
504 | { |
---|
505 | 0, 0, 3, 4, 6, 8, 11, 13, 17, 22, |
---|
506 | 25, 27, 29, 32, 34, 35, 41, 43, 46, 50, |
---|
507 | 52, 54, 56, 58, 60 |
---|
508 | }; |
---|
509 | |
---|
510 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
---|
511 | static const yytype_int8 yyrhs[] = |
---|
512 | { |
---|
513 | 17, 0, -1, -1, 18, -1, 19, -1, 18, 19, |
---|
514 | -1, 3, -1, 20, 12, 3, -1, 20, 12, 21, |
---|
515 | 3, -1, 1, 3, -1, 11, -1, 22, -1, 21, |
---|
516 | 22, -1, 11, -1, -1, 11, 13, 23, 24, 14, |
---|
517 | -1, 25, -1, 24, 25, -1, 26, 15, 27, -1, |
---|
518 | 4, -1, 5, -1, 6, -1, 7, -1, 8, -1, |
---|
519 | 9, -1 |
---|
520 | }; |
---|
521 | |
---|
522 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
---|
523 | static const yytype_uint8 yyrline[] = |
---|
524 | { |
---|
525 | 0, 73, 73, 75, 79, 80, 84, 85, 89, 93, |
---|
526 | 100, 109, 110, 114, 119, 119, 126, 127, 131, 141, |
---|
527 | 142, 143, 144, 148, 149 |
---|
528 | }; |
---|
529 | #endif |
---|
530 | |
---|
531 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
---|
532 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
---|
533 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
---|
534 | static const char *const yytname[] = |
---|
535 | { |
---|
536 | "$end", "error", "$undefined", "NL", "SUCCESS", "UNAVAIL", "NOTFOUND", |
---|
537 | "TRYAGAIN", "RETURN", "CONTINUE", "ERRORTOKEN", "STRING", "':'", "'['", |
---|
538 | "']'", "'='", "$accept", "File", "Lines", "Entry", "Database", "Srclist", |
---|
539 | "Item", "$@1", "Criteria", "Criterion", "Status", "Action", YY_NULL |
---|
540 | }; |
---|
541 | #endif |
---|
542 | |
---|
543 | # ifdef YYPRINT |
---|
544 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
---|
545 | token YYLEX-NUM. */ |
---|
546 | static const yytype_uint16 yytoknum[] = |
---|
547 | { |
---|
548 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
---|
549 | 265, 266, 58, 91, 93, 61 |
---|
550 | }; |
---|
551 | # endif |
---|
552 | |
---|
553 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
---|
554 | static const yytype_uint8 yyr1[] = |
---|
555 | { |
---|
556 | 0, 16, 17, 17, 18, 18, 19, 19, 19, 19, |
---|
557 | 20, 21, 21, 22, 23, 22, 24, 24, 25, 26, |
---|
558 | 26, 26, 26, 27, 27 |
---|
559 | }; |
---|
560 | |
---|
561 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
---|
562 | static const yytype_uint8 yyr2[] = |
---|
563 | { |
---|
564 | 0, 2, 0, 1, 1, 2, 1, 3, 4, 2, |
---|
565 | 1, 1, 2, 1, 0, 5, 1, 2, 3, 1, |
---|
566 | 1, 1, 1, 1, 1 |
---|
567 | }; |
---|
568 | |
---|
569 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
---|
570 | Performed when YYTABLE doesn't specify something else to do. Zero |
---|
571 | means the default is an error. */ |
---|
572 | static const yytype_uint8 yydefact[] = |
---|
573 | { |
---|
574 | 0, 0, 6, 10, 0, 0, 4, 0, 9, 1, |
---|
575 | 5, 0, 7, 13, 0, 11, 14, 8, 12, 0, |
---|
576 | 19, 20, 21, 22, 0, 16, 0, 15, 17, 0, |
---|
577 | 23, 24, 18 |
---|
578 | }; |
---|
579 | |
---|
580 | /* YYDEFGOTO[NTERM-NUM]. */ |
---|
581 | static const yytype_int8 yydefgoto[] = |
---|
582 | { |
---|
583 | -1, 4, 5, 6, 7, 14, 15, 19, 24, 25, |
---|
584 | 26, 32 |
---|
585 | }; |
---|
586 | |
---|
587 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
---|
588 | STATE-NUM. */ |
---|
589 | #define YYPACT_NINF -4 |
---|
590 | static const yytype_int8 yypact[] = |
---|
591 | { |
---|
592 | 0, 5, -4, -4, 9, 4, -4, 1, -4, -4, |
---|
593 | -4, -1, -4, 11, 3, -4, -4, -4, -4, 16, |
---|
594 | -4, -4, -4, -4, 12, -4, -3, -4, -4, 19, |
---|
595 | -4, -4, -4 |
---|
596 | }; |
---|
597 | |
---|
598 | /* YYPGOTO[NTERM-NUM]. */ |
---|
599 | static const yytype_int8 yypgoto[] = |
---|
600 | { |
---|
601 | -4, -4, -4, 20, -4, -4, 15, -4, -4, 6, |
---|
602 | -4, -4 |
---|
603 | }; |
---|
604 | |
---|
605 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
---|
606 | positive, shift that token. If negative, reduce the rule which |
---|
607 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
---|
608 | #define YYTABLE_NINF -4 |
---|
609 | static const yytype_int8 yytable[] = |
---|
610 | { |
---|
611 | -2, 1, 12, 2, -3, 1, 17, 2, 8, 9, |
---|
612 | 13, 3, 29, 11, 13, 3, 20, 21, 22, 23, |
---|
613 | 20, 21, 22, 23, 16, 10, 27, 30, 31, 18, |
---|
614 | 28 |
---|
615 | }; |
---|
616 | |
---|
617 | #define yypact_value_is_default(Yystate) \ |
---|
618 | (!!((Yystate) == (-4))) |
---|
619 | |
---|
620 | #define yytable_value_is_error(Yytable_value) \ |
---|
621 | YYID (0) |
---|
622 | |
---|
623 | static const yytype_uint8 yycheck[] = |
---|
624 | { |
---|
625 | 0, 1, 3, 3, 0, 1, 3, 3, 3, 0, |
---|
626 | 11, 11, 15, 12, 11, 11, 4, 5, 6, 7, |
---|
627 | 4, 5, 6, 7, 13, 5, 14, 8, 9, 14, |
---|
628 | 24 |
---|
629 | }; |
---|
630 | |
---|
631 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
---|
632 | symbol of state STATE-NUM. */ |
---|
633 | static const yytype_uint8 yystos[] = |
---|
634 | { |
---|
635 | 0, 1, 3, 11, 17, 18, 19, 20, 3, 0, |
---|
636 | 19, 12, 3, 11, 21, 22, 13, 3, 22, 23, |
---|
637 | 4, 5, 6, 7, 24, 25, 26, 14, 25, 15, |
---|
638 | 8, 9, 27 |
---|
639 | }; |
---|
640 | |
---|
641 | #define yyerrok (yyerrstatus = 0) |
---|
642 | #define yyclearin (yychar = YYEMPTY) |
---|
643 | #define YYEMPTY (-2) |
---|
644 | #define YYEOF 0 |
---|
645 | |
---|
646 | #define YYACCEPT goto yyacceptlab |
---|
647 | #define YYABORT goto yyabortlab |
---|
648 | #define YYERROR goto yyerrorlab |
---|
649 | |
---|
650 | |
---|
651 | /* Like YYERROR except do call yyerror. This remains here temporarily |
---|
652 | to ease the transition to the new meaning of YYERROR, for GCC. |
---|
653 | Once GCC version 2 has supplanted version 1, this can go. However, |
---|
654 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated |
---|
655 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is |
---|
656 | discussed. */ |
---|
657 | |
---|
658 | #define YYFAIL goto yyerrlab |
---|
659 | #if defined YYFAIL |
---|
660 | /* This is here to suppress warnings from the GCC cpp's |
---|
661 | -Wunused-macros. Normally we don't worry about that warning, but |
---|
662 | some users do, and we want to make it easy for users to remove |
---|
663 | YYFAIL uses, which will produce warnings from Bison 2.5. */ |
---|
664 | #endif |
---|
665 | |
---|
666 | #define YYRECOVERING() (!!yyerrstatus) |
---|
667 | |
---|
668 | #define YYBACKUP(Token, Value) \ |
---|
669 | do \ |
---|
670 | if (yychar == YYEMPTY) \ |
---|
671 | { \ |
---|
672 | yychar = (Token); \ |
---|
673 | yylval = (Value); \ |
---|
674 | YYPOPSTACK (yylen); \ |
---|
675 | yystate = *yyssp; \ |
---|
676 | goto yybackup; \ |
---|
677 | } \ |
---|
678 | else \ |
---|
679 | { \ |
---|
680 | yyerror (YY_("syntax error: cannot back up")); \ |
---|
681 | YYERROR; \ |
---|
682 | } \ |
---|
683 | while (YYID (0)) |
---|
684 | |
---|
685 | /* Error token number */ |
---|
686 | #define YYTERROR 1 |
---|
687 | #define YYERRCODE 256 |
---|
688 | |
---|
689 | |
---|
690 | /* This macro is provided for backward compatibility. */ |
---|
691 | #ifndef YY_LOCATION_PRINT |
---|
692 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
---|
693 | #endif |
---|
694 | |
---|
695 | |
---|
696 | /* YYLEX -- calling `yylex' with the right arguments. */ |
---|
697 | #ifdef YYLEX_PARAM |
---|
698 | # define YYLEX yylex (YYLEX_PARAM) |
---|
699 | #else |
---|
700 | # define YYLEX yylex () |
---|
701 | #endif |
---|
702 | |
---|
703 | /* Enable debugging if requested. */ |
---|
704 | #if YYDEBUG |
---|
705 | |
---|
706 | # ifndef YYFPRINTF |
---|
707 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
---|
708 | # define YYFPRINTF fprintf |
---|
709 | # endif |
---|
710 | |
---|
711 | # define YYDPRINTF(Args) \ |
---|
712 | do { \ |
---|
713 | if (yydebug) \ |
---|
714 | YYFPRINTF Args; \ |
---|
715 | } while (YYID (0)) |
---|
716 | |
---|
717 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
---|
718 | do { \ |
---|
719 | if (yydebug) \ |
---|
720 | { \ |
---|
721 | YYFPRINTF (stderr, "%s ", Title); \ |
---|
722 | yy_symbol_print (stderr, \ |
---|
723 | Type, Value); \ |
---|
724 | YYFPRINTF (stderr, "\n"); \ |
---|
725 | } \ |
---|
726 | } while (YYID (0)) |
---|
727 | |
---|
728 | |
---|
729 | /*--------------------------------. |
---|
730 | | Print this symbol on YYOUTPUT. | |
---|
731 | `--------------------------------*/ |
---|
732 | |
---|
733 | /*ARGSUSED*/ |
---|
734 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
735 | || defined __cplusplus || defined _MSC_VER) |
---|
736 | static void |
---|
737 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
---|
738 | #else |
---|
739 | static void |
---|
740 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
---|
741 | FILE *yyoutput; |
---|
742 | int yytype; |
---|
743 | YYSTYPE const * const yyvaluep; |
---|
744 | #endif |
---|
745 | { |
---|
746 | FILE *yyo = yyoutput; |
---|
747 | YYUSE (yyo); |
---|
748 | if (!yyvaluep) |
---|
749 | return; |
---|
750 | # ifdef YYPRINT |
---|
751 | if (yytype < YYNTOKENS) |
---|
752 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
---|
753 | # else |
---|
754 | YYUSE (yyoutput); |
---|
755 | # endif |
---|
756 | switch (yytype) |
---|
757 | { |
---|
758 | default: |
---|
759 | break; |
---|
760 | } |
---|
761 | } |
---|
762 | |
---|
763 | |
---|
764 | /*--------------------------------. |
---|
765 | | Print this symbol on YYOUTPUT. | |
---|
766 | `--------------------------------*/ |
---|
767 | |
---|
768 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
769 | || defined __cplusplus || defined _MSC_VER) |
---|
770 | static void |
---|
771 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
---|
772 | #else |
---|
773 | static void |
---|
774 | yy_symbol_print (yyoutput, yytype, yyvaluep) |
---|
775 | FILE *yyoutput; |
---|
776 | int yytype; |
---|
777 | YYSTYPE const * const yyvaluep; |
---|
778 | #endif |
---|
779 | { |
---|
780 | if (yytype < YYNTOKENS) |
---|
781 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
---|
782 | else |
---|
783 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
---|
784 | |
---|
785 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
---|
786 | YYFPRINTF (yyoutput, ")"); |
---|
787 | } |
---|
788 | |
---|
789 | /*------------------------------------------------------------------. |
---|
790 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
---|
791 | | TOP (included). | |
---|
792 | `------------------------------------------------------------------*/ |
---|
793 | |
---|
794 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
795 | || defined __cplusplus || defined _MSC_VER) |
---|
796 | static void |
---|
797 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
---|
798 | #else |
---|
799 | static void |
---|
800 | yy_stack_print (yybottom, yytop) |
---|
801 | yytype_int16 *yybottom; |
---|
802 | yytype_int16 *yytop; |
---|
803 | #endif |
---|
804 | { |
---|
805 | YYFPRINTF (stderr, "Stack now"); |
---|
806 | for (; yybottom <= yytop; yybottom++) |
---|
807 | { |
---|
808 | int yybot = *yybottom; |
---|
809 | YYFPRINTF (stderr, " %d", yybot); |
---|
810 | } |
---|
811 | YYFPRINTF (stderr, "\n"); |
---|
812 | } |
---|
813 | |
---|
814 | # define YY_STACK_PRINT(Bottom, Top) \ |
---|
815 | do { \ |
---|
816 | if (yydebug) \ |
---|
817 | yy_stack_print ((Bottom), (Top)); \ |
---|
818 | } while (YYID (0)) |
---|
819 | |
---|
820 | |
---|
821 | /*------------------------------------------------. |
---|
822 | | Report that the YYRULE is going to be reduced. | |
---|
823 | `------------------------------------------------*/ |
---|
824 | |
---|
825 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
826 | || defined __cplusplus || defined _MSC_VER) |
---|
827 | static void |
---|
828 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
---|
829 | #else |
---|
830 | static void |
---|
831 | yy_reduce_print (yyvsp, yyrule) |
---|
832 | YYSTYPE *yyvsp; |
---|
833 | int yyrule; |
---|
834 | #endif |
---|
835 | { |
---|
836 | int yynrhs = yyr2[yyrule]; |
---|
837 | int yyi; |
---|
838 | unsigned long int yylno = yyrline[yyrule]; |
---|
839 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
---|
840 | yyrule - 1, yylno); |
---|
841 | /* The symbols being reduced. */ |
---|
842 | for (yyi = 0; yyi < yynrhs; yyi++) |
---|
843 | { |
---|
844 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
---|
845 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
---|
846 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
---|
847 | ); |
---|
848 | YYFPRINTF (stderr, "\n"); |
---|
849 | } |
---|
850 | } |
---|
851 | |
---|
852 | # define YY_REDUCE_PRINT(Rule) \ |
---|
853 | do { \ |
---|
854 | if (yydebug) \ |
---|
855 | yy_reduce_print (yyvsp, Rule); \ |
---|
856 | } while (YYID (0)) |
---|
857 | |
---|
858 | /* Nonzero means print parse trace. It is left uninitialized so that |
---|
859 | multiple parsers can coexist. */ |
---|
860 | int yydebug; |
---|
861 | #else /* !YYDEBUG */ |
---|
862 | # define YYDPRINTF(Args) |
---|
863 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
---|
864 | # define YY_STACK_PRINT(Bottom, Top) |
---|
865 | # define YY_REDUCE_PRINT(Rule) |
---|
866 | #endif /* !YYDEBUG */ |
---|
867 | |
---|
868 | |
---|
869 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
---|
870 | #ifndef YYINITDEPTH |
---|
871 | # define YYINITDEPTH 200 |
---|
872 | #endif |
---|
873 | |
---|
874 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
---|
875 | if the built-in stack extension method is used). |
---|
876 | |
---|
877 | Do not make this value too large; the results are undefined if |
---|
878 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
---|
879 | evaluated with infinite-precision integer arithmetic. */ |
---|
880 | |
---|
881 | #ifndef YYMAXDEPTH |
---|
882 | # define YYMAXDEPTH 10000 |
---|
883 | #endif |
---|
884 | |
---|
885 | |
---|
886 | #if YYERROR_VERBOSE |
---|
887 | |
---|
888 | # ifndef yystrlen |
---|
889 | # if defined __GLIBC__ && defined _STRING_H |
---|
890 | # define yystrlen strlen |
---|
891 | # else |
---|
892 | /* Return the length of YYSTR. */ |
---|
893 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
894 | || defined __cplusplus || defined _MSC_VER) |
---|
895 | static YYSIZE_T |
---|
896 | yystrlen (const char *yystr) |
---|
897 | #else |
---|
898 | static YYSIZE_T |
---|
899 | yystrlen (yystr) |
---|
900 | const char *yystr; |
---|
901 | #endif |
---|
902 | { |
---|
903 | YYSIZE_T yylen; |
---|
904 | for (yylen = 0; yystr[yylen]; yylen++) |
---|
905 | continue; |
---|
906 | return yylen; |
---|
907 | } |
---|
908 | # endif |
---|
909 | # endif |
---|
910 | |
---|
911 | # ifndef yystpcpy |
---|
912 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
---|
913 | # define yystpcpy stpcpy |
---|
914 | # else |
---|
915 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
---|
916 | YYDEST. */ |
---|
917 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
918 | || defined __cplusplus || defined _MSC_VER) |
---|
919 | static char * |
---|
920 | yystpcpy (char *yydest, const char *yysrc) |
---|
921 | #else |
---|
922 | static char * |
---|
923 | yystpcpy (yydest, yysrc) |
---|
924 | char *yydest; |
---|
925 | const char *yysrc; |
---|
926 | #endif |
---|
927 | { |
---|
928 | char *yyd = yydest; |
---|
929 | const char *yys = yysrc; |
---|
930 | |
---|
931 | while ((*yyd++ = *yys++) != '\0') |
---|
932 | continue; |
---|
933 | |
---|
934 | return yyd - 1; |
---|
935 | } |
---|
936 | # endif |
---|
937 | # endif |
---|
938 | |
---|
939 | # ifndef yytnamerr |
---|
940 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
---|
941 | quotes and backslashes, so that it's suitable for yyerror. The |
---|
942 | heuristic is that double-quoting is unnecessary unless the string |
---|
943 | contains an apostrophe, a comma, or backslash (other than |
---|
944 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
---|
945 | null, do not copy; instead, return the length of what the result |
---|
946 | would have been. */ |
---|
947 | static YYSIZE_T |
---|
948 | yytnamerr (char *yyres, const char *yystr) |
---|
949 | { |
---|
950 | if (*yystr == '"') |
---|
951 | { |
---|
952 | YYSIZE_T yyn = 0; |
---|
953 | char const *yyp = yystr; |
---|
954 | |
---|
955 | for (;;) |
---|
956 | switch (*++yyp) |
---|
957 | { |
---|
958 | case '\'': |
---|
959 | case ',': |
---|
960 | goto do_not_strip_quotes; |
---|
961 | |
---|
962 | case '\\': |
---|
963 | if (*++yyp != '\\') |
---|
964 | goto do_not_strip_quotes; |
---|
965 | /* Fall through. */ |
---|
966 | default: |
---|
967 | if (yyres) |
---|
968 | yyres[yyn] = *yyp; |
---|
969 | yyn++; |
---|
970 | break; |
---|
971 | |
---|
972 | case '"': |
---|
973 | if (yyres) |
---|
974 | yyres[yyn] = '\0'; |
---|
975 | return yyn; |
---|
976 | } |
---|
977 | do_not_strip_quotes: ; |
---|
978 | } |
---|
979 | |
---|
980 | if (! yyres) |
---|
981 | return yystrlen (yystr); |
---|
982 | |
---|
983 | return yystpcpy (yyres, yystr) - yyres; |
---|
984 | } |
---|
985 | # endif |
---|
986 | |
---|
987 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
---|
988 | about the unexpected token YYTOKEN for the state stack whose top is |
---|
989 | YYSSP. |
---|
990 | |
---|
991 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
---|
992 | not large enough to hold the message. In that case, also set |
---|
993 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
---|
994 | required number of bytes is too large to store. */ |
---|
995 | static int |
---|
996 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
---|
997 | yytype_int16 *yyssp, int yytoken) |
---|
998 | { |
---|
999 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
---|
1000 | YYSIZE_T yysize = yysize0; |
---|
1001 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
---|
1002 | /* Internationalized format string. */ |
---|
1003 | const char *yyformat = YY_NULL; |
---|
1004 | /* Arguments of yyformat. */ |
---|
1005 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
---|
1006 | /* Number of reported tokens (one for the "unexpected", one per |
---|
1007 | "expected"). */ |
---|
1008 | int yycount = 0; |
---|
1009 | |
---|
1010 | /* There are many possibilities here to consider: |
---|
1011 | - Assume YYFAIL is not used. It's too flawed to consider. See |
---|
1012 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> |
---|
1013 | for details. YYERROR is fine as it does not invoke this |
---|
1014 | function. |
---|
1015 | - If this state is a consistent state with a default action, then |
---|
1016 | the only way this function was invoked is if the default action |
---|
1017 | is an error action. In that case, don't check for expected |
---|
1018 | tokens because there are none. |
---|
1019 | - The only way there can be no lookahead present (in yychar) is if |
---|
1020 | this state is a consistent state with a default action. Thus, |
---|
1021 | detecting the absence of a lookahead is sufficient to determine |
---|
1022 | that there is no unexpected or expected token to report. In that |
---|
1023 | case, just report a simple "syntax error". |
---|
1024 | - Don't assume there isn't a lookahead just because this state is a |
---|
1025 | consistent state with a default action. There might have been a |
---|
1026 | previous inconsistent state, consistent state with a non-default |
---|
1027 | action, or user semantic action that manipulated yychar. |
---|
1028 | - Of course, the expected token list depends on states to have |
---|
1029 | correct lookahead information, and it depends on the parser not |
---|
1030 | to perform extra reductions after fetching a lookahead from the |
---|
1031 | scanner and before detecting a syntax error. Thus, state merging |
---|
1032 | (from LALR or IELR) and default reductions corrupt the expected |
---|
1033 | token list. However, the list is correct for canonical LR with |
---|
1034 | one exception: it will still contain any token that will not be |
---|
1035 | accepted due to an error action in a later state. |
---|
1036 | */ |
---|
1037 | if (yytoken != YYEMPTY) |
---|
1038 | { |
---|
1039 | int yyn = yypact[*yyssp]; |
---|
1040 | yyarg[yycount++] = yytname[yytoken]; |
---|
1041 | if (!yypact_value_is_default (yyn)) |
---|
1042 | { |
---|
1043 | /* Start YYX at -YYN if negative to avoid negative indexes in |
---|
1044 | YYCHECK. In other words, skip the first -YYN actions for |
---|
1045 | this state because they are default actions. */ |
---|
1046 | int yyxbegin = yyn < 0 ? -yyn : 0; |
---|
1047 | /* Stay within bounds of both yycheck and yytname. */ |
---|
1048 | int yychecklim = YYLAST - yyn + 1; |
---|
1049 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
---|
1050 | int yyx; |
---|
1051 | |
---|
1052 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
---|
1053 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
---|
1054 | && !yytable_value_is_error (yytable[yyx + yyn])) |
---|
1055 | { |
---|
1056 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
---|
1057 | { |
---|
1058 | yycount = 1; |
---|
1059 | yysize = yysize0; |
---|
1060 | break; |
---|
1061 | } |
---|
1062 | yyarg[yycount++] = yytname[yyx]; |
---|
1063 | { |
---|
1064 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
---|
1065 | if (! (yysize <= yysize1 |
---|
1066 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1067 | return 2; |
---|
1068 | yysize = yysize1; |
---|
1069 | } |
---|
1070 | } |
---|
1071 | } |
---|
1072 | } |
---|
1073 | |
---|
1074 | switch (yycount) |
---|
1075 | { |
---|
1076 | # define YYCASE_(N, S) \ |
---|
1077 | case N: \ |
---|
1078 | yyformat = S; \ |
---|
1079 | break |
---|
1080 | YYCASE_(0, YY_("syntax error")); |
---|
1081 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
---|
1082 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
---|
1083 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
---|
1084 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
---|
1085 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
---|
1086 | # undef YYCASE_ |
---|
1087 | } |
---|
1088 | |
---|
1089 | { |
---|
1090 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
---|
1091 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1092 | return 2; |
---|
1093 | yysize = yysize1; |
---|
1094 | } |
---|
1095 | |
---|
1096 | if (*yymsg_alloc < yysize) |
---|
1097 | { |
---|
1098 | *yymsg_alloc = 2 * yysize; |
---|
1099 | if (! (yysize <= *yymsg_alloc |
---|
1100 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
---|
1101 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
---|
1102 | return 1; |
---|
1103 | } |
---|
1104 | |
---|
1105 | /* Avoid sprintf, as that infringes on the user's name space. |
---|
1106 | Don't have undefined behavior even if the translation |
---|
1107 | produced a string with the wrong number of "%s"s. */ |
---|
1108 | { |
---|
1109 | char *yyp = *yymsg; |
---|
1110 | int yyi = 0; |
---|
1111 | while ((*yyp = *yyformat) != '\0') |
---|
1112 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
---|
1113 | { |
---|
1114 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
---|
1115 | yyformat += 2; |
---|
1116 | } |
---|
1117 | else |
---|
1118 | { |
---|
1119 | yyp++; |
---|
1120 | yyformat++; |
---|
1121 | } |
---|
1122 | } |
---|
1123 | return 0; |
---|
1124 | } |
---|
1125 | #endif /* YYERROR_VERBOSE */ |
---|
1126 | |
---|
1127 | /*-----------------------------------------------. |
---|
1128 | | Release the memory associated to this symbol. | |
---|
1129 | `-----------------------------------------------*/ |
---|
1130 | |
---|
1131 | /*ARGSUSED*/ |
---|
1132 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
1133 | || defined __cplusplus || defined _MSC_VER) |
---|
1134 | static void |
---|
1135 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
---|
1136 | #else |
---|
1137 | static void |
---|
1138 | yydestruct (yymsg, yytype, yyvaluep) |
---|
1139 | const char *yymsg; |
---|
1140 | int yytype; |
---|
1141 | YYSTYPE *yyvaluep; |
---|
1142 | #endif |
---|
1143 | { |
---|
1144 | YYUSE (yyvaluep); |
---|
1145 | |
---|
1146 | if (!yymsg) |
---|
1147 | yymsg = "Deleting"; |
---|
1148 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
---|
1149 | |
---|
1150 | switch (yytype) |
---|
1151 | { |
---|
1152 | |
---|
1153 | default: |
---|
1154 | break; |
---|
1155 | } |
---|
1156 | } |
---|
1157 | |
---|
1158 | |
---|
1159 | |
---|
1160 | |
---|
1161 | /* The lookahead symbol. */ |
---|
1162 | int yychar; |
---|
1163 | |
---|
1164 | |
---|
1165 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1166 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1167 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1168 | #endif |
---|
1169 | #ifndef YY_INITIAL_VALUE |
---|
1170 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
---|
1171 | #endif |
---|
1172 | |
---|
1173 | /* The semantic value of the lookahead symbol. */ |
---|
1174 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
---|
1175 | |
---|
1176 | /* Number of syntax errors so far. */ |
---|
1177 | int yynerrs; |
---|
1178 | |
---|
1179 | |
---|
1180 | /*----------. |
---|
1181 | | yyparse. | |
---|
1182 | `----------*/ |
---|
1183 | |
---|
1184 | #ifdef YYPARSE_PARAM |
---|
1185 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
1186 | || defined __cplusplus || defined _MSC_VER) |
---|
1187 | int |
---|
1188 | yyparse (void *YYPARSE_PARAM) |
---|
1189 | #else |
---|
1190 | int |
---|
1191 | yyparse (YYPARSE_PARAM) |
---|
1192 | void *YYPARSE_PARAM; |
---|
1193 | #endif |
---|
1194 | #else /* ! YYPARSE_PARAM */ |
---|
1195 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
1196 | || defined __cplusplus || defined _MSC_VER) |
---|
1197 | int |
---|
1198 | yyparse (void) |
---|
1199 | #else |
---|
1200 | int |
---|
1201 | yyparse () |
---|
1202 | |
---|
1203 | #endif |
---|
1204 | #endif |
---|
1205 | { |
---|
1206 | int yystate; |
---|
1207 | /* Number of tokens to shift before error messages enabled. */ |
---|
1208 | int yyerrstatus; |
---|
1209 | |
---|
1210 | /* The stacks and their tools: |
---|
1211 | `yyss': related to states. |
---|
1212 | `yyvs': related to semantic values. |
---|
1213 | |
---|
1214 | Refer to the stacks through separate pointers, to allow yyoverflow |
---|
1215 | to reallocate them elsewhere. */ |
---|
1216 | |
---|
1217 | /* The state stack. */ |
---|
1218 | yytype_int16 yyssa[YYINITDEPTH]; |
---|
1219 | yytype_int16 *yyss; |
---|
1220 | yytype_int16 *yyssp; |
---|
1221 | |
---|
1222 | /* The semantic value stack. */ |
---|
1223 | YYSTYPE yyvsa[YYINITDEPTH]; |
---|
1224 | YYSTYPE *yyvs; |
---|
1225 | YYSTYPE *yyvsp; |
---|
1226 | |
---|
1227 | YYSIZE_T yystacksize; |
---|
1228 | |
---|
1229 | int yyn; |
---|
1230 | int yyresult; |
---|
1231 | /* Lookahead token as an internal (translated) token number. */ |
---|
1232 | int yytoken = 0; |
---|
1233 | /* The variables used to return semantic value and location from the |
---|
1234 | action routines. */ |
---|
1235 | YYSTYPE yyval; |
---|
1236 | |
---|
1237 | #if YYERROR_VERBOSE |
---|
1238 | /* Buffer for error messages, and its allocated size. */ |
---|
1239 | char yymsgbuf[128]; |
---|
1240 | char *yymsg = yymsgbuf; |
---|
1241 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
---|
1242 | #endif |
---|
1243 | |
---|
1244 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
---|
1245 | |
---|
1246 | /* The number of symbols on the RHS of the reduced rule. |
---|
1247 | Keep to zero when no symbol should be popped. */ |
---|
1248 | int yylen = 0; |
---|
1249 | |
---|
1250 | yyssp = yyss = yyssa; |
---|
1251 | yyvsp = yyvs = yyvsa; |
---|
1252 | yystacksize = YYINITDEPTH; |
---|
1253 | |
---|
1254 | YYDPRINTF ((stderr, "Starting parse\n")); |
---|
1255 | |
---|
1256 | yystate = 0; |
---|
1257 | yyerrstatus = 0; |
---|
1258 | yynerrs = 0; |
---|
1259 | yychar = YYEMPTY; /* Cause a token to be read. */ |
---|
1260 | goto yysetstate; |
---|
1261 | |
---|
1262 | /*------------------------------------------------------------. |
---|
1263 | | yynewstate -- Push a new state, which is found in yystate. | |
---|
1264 | `------------------------------------------------------------*/ |
---|
1265 | yynewstate: |
---|
1266 | /* In all cases, when you get here, the value and location stacks |
---|
1267 | have just been pushed. So pushing a state here evens the stacks. */ |
---|
1268 | yyssp++; |
---|
1269 | |
---|
1270 | yysetstate: |
---|
1271 | *yyssp = yystate; |
---|
1272 | |
---|
1273 | if (yyss + yystacksize - 1 <= yyssp) |
---|
1274 | { |
---|
1275 | /* Get the current used size of the three stacks, in elements. */ |
---|
1276 | YYSIZE_T yysize = yyssp - yyss + 1; |
---|
1277 | |
---|
1278 | #ifdef yyoverflow |
---|
1279 | { |
---|
1280 | /* Give user a chance to reallocate the stack. Use copies of |
---|
1281 | these so that the &'s don't force the real ones into |
---|
1282 | memory. */ |
---|
1283 | YYSTYPE *yyvs1 = yyvs; |
---|
1284 | yytype_int16 *yyss1 = yyss; |
---|
1285 | |
---|
1286 | /* Each stack pointer address is followed by the size of the |
---|
1287 | data in use in that stack, in bytes. This used to be a |
---|
1288 | conditional around just the two extra args, but that might |
---|
1289 | be undefined if yyoverflow is a macro. */ |
---|
1290 | yyoverflow (YY_("memory exhausted"), |
---|
1291 | &yyss1, yysize * sizeof (*yyssp), |
---|
1292 | &yyvs1, yysize * sizeof (*yyvsp), |
---|
1293 | &yystacksize); |
---|
1294 | |
---|
1295 | yyss = yyss1; |
---|
1296 | yyvs = yyvs1; |
---|
1297 | } |
---|
1298 | #else /* no yyoverflow */ |
---|
1299 | # ifndef YYSTACK_RELOCATE |
---|
1300 | goto yyexhaustedlab; |
---|
1301 | # else |
---|
1302 | /* Extend the stack our own way. */ |
---|
1303 | if (YYMAXDEPTH <= yystacksize) |
---|
1304 | goto yyexhaustedlab; |
---|
1305 | yystacksize *= 2; |
---|
1306 | if (YYMAXDEPTH < yystacksize) |
---|
1307 | yystacksize = YYMAXDEPTH; |
---|
1308 | |
---|
1309 | { |
---|
1310 | yytype_int16 *yyss1 = yyss; |
---|
1311 | union yyalloc *yyptr = |
---|
1312 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
---|
1313 | if (! yyptr) |
---|
1314 | goto yyexhaustedlab; |
---|
1315 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
---|
1316 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
---|
1317 | # undef YYSTACK_RELOCATE |
---|
1318 | if (yyss1 != yyssa) |
---|
1319 | YYSTACK_FREE (yyss1); |
---|
1320 | } |
---|
1321 | # endif |
---|
1322 | #endif /* no yyoverflow */ |
---|
1323 | |
---|
1324 | yyssp = yyss + yysize - 1; |
---|
1325 | yyvsp = yyvs + yysize - 1; |
---|
1326 | |
---|
1327 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
---|
1328 | (unsigned long int) yystacksize)); |
---|
1329 | |
---|
1330 | if (yyss + yystacksize - 1 <= yyssp) |
---|
1331 | YYABORT; |
---|
1332 | } |
---|
1333 | |
---|
1334 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
---|
1335 | |
---|
1336 | if (yystate == YYFINAL) |
---|
1337 | YYACCEPT; |
---|
1338 | |
---|
1339 | goto yybackup; |
---|
1340 | |
---|
1341 | /*-----------. |
---|
1342 | | yybackup. | |
---|
1343 | `-----------*/ |
---|
1344 | yybackup: |
---|
1345 | |
---|
1346 | /* Do appropriate processing given the current state. Read a |
---|
1347 | lookahead token if we need one and don't already have one. */ |
---|
1348 | |
---|
1349 | /* First try to decide what to do without reference to lookahead token. */ |
---|
1350 | yyn = yypact[yystate]; |
---|
1351 | if (yypact_value_is_default (yyn)) |
---|
1352 | goto yydefault; |
---|
1353 | |
---|
1354 | /* Not known => get a lookahead token if don't already have one. */ |
---|
1355 | |
---|
1356 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
---|
1357 | if (yychar == YYEMPTY) |
---|
1358 | { |
---|
1359 | YYDPRINTF ((stderr, "Reading a token: ")); |
---|
1360 | yychar = YYLEX; |
---|
1361 | } |
---|
1362 | |
---|
1363 | if (yychar <= YYEOF) |
---|
1364 | { |
---|
1365 | yychar = yytoken = YYEOF; |
---|
1366 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
---|
1367 | } |
---|
1368 | else |
---|
1369 | { |
---|
1370 | yytoken = YYTRANSLATE (yychar); |
---|
1371 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
---|
1372 | } |
---|
1373 | |
---|
1374 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
---|
1375 | detect an error, take that action. */ |
---|
1376 | yyn += yytoken; |
---|
1377 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
---|
1378 | goto yydefault; |
---|
1379 | yyn = yytable[yyn]; |
---|
1380 | if (yyn <= 0) |
---|
1381 | { |
---|
1382 | if (yytable_value_is_error (yyn)) |
---|
1383 | goto yyerrlab; |
---|
1384 | yyn = -yyn; |
---|
1385 | goto yyreduce; |
---|
1386 | } |
---|
1387 | |
---|
1388 | /* Count tokens shifted since error; after three, turn off error |
---|
1389 | status. */ |
---|
1390 | if (yyerrstatus) |
---|
1391 | yyerrstatus--; |
---|
1392 | |
---|
1393 | /* Shift the lookahead token. */ |
---|
1394 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
---|
1395 | |
---|
1396 | /* Discard the shifted token. */ |
---|
1397 | yychar = YYEMPTY; |
---|
1398 | |
---|
1399 | yystate = yyn; |
---|
1400 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1401 | *++yyvsp = yylval; |
---|
1402 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1403 | |
---|
1404 | goto yynewstate; |
---|
1405 | |
---|
1406 | |
---|
1407 | /*-----------------------------------------------------------. |
---|
1408 | | yydefault -- do the default action for the current state. | |
---|
1409 | `-----------------------------------------------------------*/ |
---|
1410 | yydefault: |
---|
1411 | yyn = yydefact[yystate]; |
---|
1412 | if (yyn == 0) |
---|
1413 | goto yyerrlab; |
---|
1414 | goto yyreduce; |
---|
1415 | |
---|
1416 | |
---|
1417 | /*-----------------------------. |
---|
1418 | | yyreduce -- Do a reduction. | |
---|
1419 | `-----------------------------*/ |
---|
1420 | yyreduce: |
---|
1421 | /* yyn is the number of a rule to reduce with. */ |
---|
1422 | yylen = yyr2[yyn]; |
---|
1423 | |
---|
1424 | /* If YYLEN is nonzero, implement the default value of the action: |
---|
1425 | `$$ = $1'. |
---|
1426 | |
---|
1427 | Otherwise, the following line sets YYVAL to garbage. |
---|
1428 | This behavior is undocumented and Bison |
---|
1429 | users should not rely upon it. Assigning to YYVAL |
---|
1430 | unconditionally makes the parser a bit smaller, and it avoids a |
---|
1431 | GCC warning that YYVAL may be used uninitialized. */ |
---|
1432 | yyval = yyvsp[1-yylen]; |
---|
1433 | |
---|
1434 | |
---|
1435 | YY_REDUCE_PRINT (yyn); |
---|
1436 | switch (yyn) |
---|
1437 | { |
---|
1438 | case 7: |
---|
1439 | /* Line 1792 of yacc.c */ |
---|
1440 | #line 86 "freebsd/lib/libc/net/nsparser.y" |
---|
1441 | { |
---|
1442 | free((char*)curdbt.name); |
---|
1443 | } |
---|
1444 | break; |
---|
1445 | |
---|
1446 | case 8: |
---|
1447 | /* Line 1792 of yacc.c */ |
---|
1448 | #line 90 "freebsd/lib/libc/net/nsparser.y" |
---|
1449 | { |
---|
1450 | _nsdbtput(&curdbt); |
---|
1451 | } |
---|
1452 | break; |
---|
1453 | |
---|
1454 | case 9: |
---|
1455 | /* Line 1792 of yacc.c */ |
---|
1456 | #line 94 "freebsd/lib/libc/net/nsparser.y" |
---|
1457 | { |
---|
1458 | yyerrok; |
---|
1459 | } |
---|
1460 | break; |
---|
1461 | |
---|
1462 | case 10: |
---|
1463 | /* Line 1792 of yacc.c */ |
---|
1464 | #line 101 "freebsd/lib/libc/net/nsparser.y" |
---|
1465 | { |
---|
1466 | curdbt.name = yylval.str; |
---|
1467 | curdbt.srclist = NULL; |
---|
1468 | curdbt.srclistsize = 0; |
---|
1469 | } |
---|
1470 | break; |
---|
1471 | |
---|
1472 | case 13: |
---|
1473 | /* Line 1792 of yacc.c */ |
---|
1474 | #line 115 "freebsd/lib/libc/net/nsparser.y" |
---|
1475 | { |
---|
1476 | cursrc.flags = NS_TERMINATE; |
---|
1477 | _nsaddsrctomap((yyvsp[(1) - (1)].str)); |
---|
1478 | } |
---|
1479 | break; |
---|
1480 | |
---|
1481 | case 14: |
---|
1482 | /* Line 1792 of yacc.c */ |
---|
1483 | #line 119 "freebsd/lib/libc/net/nsparser.y" |
---|
1484 | { cursrc.flags = NS_SUCCESS; } |
---|
1485 | break; |
---|
1486 | |
---|
1487 | case 15: |
---|
1488 | /* Line 1792 of yacc.c */ |
---|
1489 | #line 120 "freebsd/lib/libc/net/nsparser.y" |
---|
1490 | { |
---|
1491 | _nsaddsrctomap((yyvsp[(1) - (5)].str)); |
---|
1492 | } |
---|
1493 | break; |
---|
1494 | |
---|
1495 | case 18: |
---|
1496 | /* Line 1792 of yacc.c */ |
---|
1497 | #line 132 "freebsd/lib/libc/net/nsparser.y" |
---|
1498 | { |
---|
1499 | if ((yyvsp[(3) - (3)].mapval)) /* if action == RETURN set RETURN bit */ |
---|
1500 | cursrc.flags |= (yyvsp[(1) - (3)].mapval); |
---|
1501 | else /* else unset it */ |
---|
1502 | cursrc.flags &= ~(yyvsp[(1) - (3)].mapval); |
---|
1503 | } |
---|
1504 | break; |
---|
1505 | |
---|
1506 | case 19: |
---|
1507 | /* Line 1792 of yacc.c */ |
---|
1508 | #line 141 "freebsd/lib/libc/net/nsparser.y" |
---|
1509 | { (yyval.mapval) = NS_SUCCESS; } |
---|
1510 | break; |
---|
1511 | |
---|
1512 | case 20: |
---|
1513 | /* Line 1792 of yacc.c */ |
---|
1514 | #line 142 "freebsd/lib/libc/net/nsparser.y" |
---|
1515 | { (yyval.mapval) = NS_UNAVAIL; } |
---|
1516 | break; |
---|
1517 | |
---|
1518 | case 21: |
---|
1519 | /* Line 1792 of yacc.c */ |
---|
1520 | #line 143 "freebsd/lib/libc/net/nsparser.y" |
---|
1521 | { (yyval.mapval) = NS_NOTFOUND; } |
---|
1522 | break; |
---|
1523 | |
---|
1524 | case 22: |
---|
1525 | /* Line 1792 of yacc.c */ |
---|
1526 | #line 144 "freebsd/lib/libc/net/nsparser.y" |
---|
1527 | { (yyval.mapval) = NS_TRYAGAIN; } |
---|
1528 | break; |
---|
1529 | |
---|
1530 | case 23: |
---|
1531 | /* Line 1792 of yacc.c */ |
---|
1532 | #line 148 "freebsd/lib/libc/net/nsparser.y" |
---|
1533 | { (yyval.mapval) = NS_ACTION_RETURN; } |
---|
1534 | break; |
---|
1535 | |
---|
1536 | case 24: |
---|
1537 | /* Line 1792 of yacc.c */ |
---|
1538 | #line 149 "freebsd/lib/libc/net/nsparser.y" |
---|
1539 | { (yyval.mapval) = NS_ACTION_CONTINUE; } |
---|
1540 | break; |
---|
1541 | |
---|
1542 | |
---|
1543 | /* Line 1792 of yacc.c */ |
---|
1544 | #line 1545 "_nsyy.tab.c" |
---|
1545 | default: break; |
---|
1546 | } |
---|
1547 | /* User semantic actions sometimes alter yychar, and that requires |
---|
1548 | that yytoken be updated with the new translation. We take the |
---|
1549 | approach of translating immediately before every use of yytoken. |
---|
1550 | One alternative is translating here after every semantic action, |
---|
1551 | but that translation would be missed if the semantic action invokes |
---|
1552 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
---|
1553 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
---|
1554 | incorrect destructor might then be invoked immediately. In the |
---|
1555 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
---|
1556 | to an incorrect destructor call or verbose syntax error message |
---|
1557 | before the lookahead is translated. */ |
---|
1558 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
---|
1559 | |
---|
1560 | YYPOPSTACK (yylen); |
---|
1561 | yylen = 0; |
---|
1562 | YY_STACK_PRINT (yyss, yyssp); |
---|
1563 | |
---|
1564 | *++yyvsp = yyval; |
---|
1565 | |
---|
1566 | /* Now `shift' the result of the reduction. Determine what state |
---|
1567 | that goes to, based on the state we popped back to and the rule |
---|
1568 | number reduced by. */ |
---|
1569 | |
---|
1570 | yyn = yyr1[yyn]; |
---|
1571 | |
---|
1572 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
---|
1573 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
---|
1574 | yystate = yytable[yystate]; |
---|
1575 | else |
---|
1576 | yystate = yydefgoto[yyn - YYNTOKENS]; |
---|
1577 | |
---|
1578 | goto yynewstate; |
---|
1579 | |
---|
1580 | |
---|
1581 | /*------------------------------------. |
---|
1582 | | yyerrlab -- here on detecting error | |
---|
1583 | `------------------------------------*/ |
---|
1584 | yyerrlab: |
---|
1585 | /* Make sure we have latest lookahead translation. See comments at |
---|
1586 | user semantic actions for why this is necessary. */ |
---|
1587 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
---|
1588 | |
---|
1589 | /* If not already recovering from an error, report this error. */ |
---|
1590 | if (!yyerrstatus) |
---|
1591 | { |
---|
1592 | ++yynerrs; |
---|
1593 | #if ! YYERROR_VERBOSE |
---|
1594 | yyerror (YY_("syntax error")); |
---|
1595 | #else |
---|
1596 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
---|
1597 | yyssp, yytoken) |
---|
1598 | { |
---|
1599 | char const *yymsgp = YY_("syntax error"); |
---|
1600 | int yysyntax_error_status; |
---|
1601 | yysyntax_error_status = YYSYNTAX_ERROR; |
---|
1602 | if (yysyntax_error_status == 0) |
---|
1603 | yymsgp = yymsg; |
---|
1604 | else if (yysyntax_error_status == 1) |
---|
1605 | { |
---|
1606 | if (yymsg != yymsgbuf) |
---|
1607 | YYSTACK_FREE (yymsg); |
---|
1608 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
---|
1609 | if (!yymsg) |
---|
1610 | { |
---|
1611 | yymsg = yymsgbuf; |
---|
1612 | yymsg_alloc = sizeof yymsgbuf; |
---|
1613 | yysyntax_error_status = 2; |
---|
1614 | } |
---|
1615 | else |
---|
1616 | { |
---|
1617 | yysyntax_error_status = YYSYNTAX_ERROR; |
---|
1618 | yymsgp = yymsg; |
---|
1619 | } |
---|
1620 | } |
---|
1621 | yyerror (yymsgp); |
---|
1622 | if (yysyntax_error_status == 2) |
---|
1623 | goto yyexhaustedlab; |
---|
1624 | } |
---|
1625 | # undef YYSYNTAX_ERROR |
---|
1626 | #endif |
---|
1627 | } |
---|
1628 | |
---|
1629 | |
---|
1630 | |
---|
1631 | if (yyerrstatus == 3) |
---|
1632 | { |
---|
1633 | /* If just tried and failed to reuse lookahead token after an |
---|
1634 | error, discard it. */ |
---|
1635 | |
---|
1636 | if (yychar <= YYEOF) |
---|
1637 | { |
---|
1638 | /* Return failure if at end of input. */ |
---|
1639 | if (yychar == YYEOF) |
---|
1640 | YYABORT; |
---|
1641 | } |
---|
1642 | else |
---|
1643 | { |
---|
1644 | yydestruct ("Error: discarding", |
---|
1645 | yytoken, &yylval); |
---|
1646 | yychar = YYEMPTY; |
---|
1647 | } |
---|
1648 | } |
---|
1649 | |
---|
1650 | /* Else will try to reuse lookahead token after shifting the error |
---|
1651 | token. */ |
---|
1652 | goto yyerrlab1; |
---|
1653 | |
---|
1654 | |
---|
1655 | /*---------------------------------------------------. |
---|
1656 | | yyerrorlab -- error raised explicitly by YYERROR. | |
---|
1657 | `---------------------------------------------------*/ |
---|
1658 | yyerrorlab: |
---|
1659 | |
---|
1660 | /* Pacify compilers like GCC when the user code never invokes |
---|
1661 | YYERROR and the label yyerrorlab therefore never appears in user |
---|
1662 | code. */ |
---|
1663 | if (/*CONSTCOND*/ 0) |
---|
1664 | goto yyerrorlab; |
---|
1665 | |
---|
1666 | /* Do not reclaim the symbols of the rule which action triggered |
---|
1667 | this YYERROR. */ |
---|
1668 | YYPOPSTACK (yylen); |
---|
1669 | yylen = 0; |
---|
1670 | YY_STACK_PRINT (yyss, yyssp); |
---|
1671 | yystate = *yyssp; |
---|
1672 | goto yyerrlab1; |
---|
1673 | |
---|
1674 | |
---|
1675 | /*-------------------------------------------------------------. |
---|
1676 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
---|
1677 | `-------------------------------------------------------------*/ |
---|
1678 | yyerrlab1: |
---|
1679 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
---|
1680 | |
---|
1681 | for (;;) |
---|
1682 | { |
---|
1683 | yyn = yypact[yystate]; |
---|
1684 | if (!yypact_value_is_default (yyn)) |
---|
1685 | { |
---|
1686 | yyn += YYTERROR; |
---|
1687 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
---|
1688 | { |
---|
1689 | yyn = yytable[yyn]; |
---|
1690 | if (0 < yyn) |
---|
1691 | break; |
---|
1692 | } |
---|
1693 | } |
---|
1694 | |
---|
1695 | /* Pop the current state because it cannot handle the error token. */ |
---|
1696 | if (yyssp == yyss) |
---|
1697 | YYABORT; |
---|
1698 | |
---|
1699 | |
---|
1700 | yydestruct ("Error: popping", |
---|
1701 | yystos[yystate], yyvsp); |
---|
1702 | YYPOPSTACK (1); |
---|
1703 | yystate = *yyssp; |
---|
1704 | YY_STACK_PRINT (yyss, yyssp); |
---|
1705 | } |
---|
1706 | |
---|
1707 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
---|
1708 | *++yyvsp = yylval; |
---|
1709 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
---|
1710 | |
---|
1711 | |
---|
1712 | /* Shift the error token. */ |
---|
1713 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
---|
1714 | |
---|
1715 | yystate = yyn; |
---|
1716 | goto yynewstate; |
---|
1717 | |
---|
1718 | |
---|
1719 | /*-------------------------------------. |
---|
1720 | | yyacceptlab -- YYACCEPT comes here. | |
---|
1721 | `-------------------------------------*/ |
---|
1722 | yyacceptlab: |
---|
1723 | yyresult = 0; |
---|
1724 | goto yyreturn; |
---|
1725 | |
---|
1726 | /*-----------------------------------. |
---|
1727 | | yyabortlab -- YYABORT comes here. | |
---|
1728 | `-----------------------------------*/ |
---|
1729 | yyabortlab: |
---|
1730 | yyresult = 1; |
---|
1731 | goto yyreturn; |
---|
1732 | |
---|
1733 | #if !defined yyoverflow || YYERROR_VERBOSE |
---|
1734 | /*-------------------------------------------------. |
---|
1735 | | yyexhaustedlab -- memory exhaustion comes here. | |
---|
1736 | `-------------------------------------------------*/ |
---|
1737 | yyexhaustedlab: |
---|
1738 | yyerror (YY_("memory exhausted")); |
---|
1739 | yyresult = 2; |
---|
1740 | /* Fall through. */ |
---|
1741 | #endif |
---|
1742 | |
---|
1743 | yyreturn: |
---|
1744 | if (yychar != YYEMPTY) |
---|
1745 | { |
---|
1746 | /* Make sure we have latest lookahead translation. See comments at |
---|
1747 | user semantic actions for why this is necessary. */ |
---|
1748 | yytoken = YYTRANSLATE (yychar); |
---|
1749 | yydestruct ("Cleanup: discarding lookahead", |
---|
1750 | yytoken, &yylval); |
---|
1751 | } |
---|
1752 | /* Do not reclaim the symbols of the rule which action triggered |
---|
1753 | this YYABORT or YYACCEPT. */ |
---|
1754 | YYPOPSTACK (yylen); |
---|
1755 | YY_STACK_PRINT (yyss, yyssp); |
---|
1756 | while (yyssp != yyss) |
---|
1757 | { |
---|
1758 | yydestruct ("Cleanup: popping", |
---|
1759 | yystos[*yyssp], yyvsp); |
---|
1760 | YYPOPSTACK (1); |
---|
1761 | } |
---|
1762 | #ifndef yyoverflow |
---|
1763 | if (yyss != yyssa) |
---|
1764 | YYSTACK_FREE (yyss); |
---|
1765 | #endif |
---|
1766 | #if YYERROR_VERBOSE |
---|
1767 | if (yymsg != yymsgbuf) |
---|
1768 | YYSTACK_FREE (yymsg); |
---|
1769 | #endif |
---|
1770 | /* Make sure YYID is used. */ |
---|
1771 | return YYID (yyresult); |
---|
1772 | } |
---|
1773 | |
---|
1774 | |
---|
1775 | /* Line 2055 of yacc.c */ |
---|
1776 | #line 152 "freebsd/lib/libc/net/nsparser.y" |
---|
1777 | |
---|
1778 | |
---|
1779 | static void |
---|
1780 | _nsaddsrctomap(elem) |
---|
1781 | const char *elem; |
---|
1782 | { |
---|
1783 | int i, lineno; |
---|
1784 | extern int _nsyylineno; |
---|
1785 | extern char _nsyytext[]; |
---|
1786 | |
---|
1787 | lineno = _nsyylineno - (_nsyytext[0] == '\n' ? 1 : 0); |
---|
1788 | if (curdbt.srclistsize > 0) { |
---|
1789 | if (((strcasecmp(elem, NSSRC_COMPAT) == 0) && |
---|
1790 | (strcasecmp(curdbt.srclist[0].name, NSSRC_CACHE) != 0)) || |
---|
1791 | (strcasecmp(curdbt.srclist[0].name, NSSRC_COMPAT) == 0)) { |
---|
1792 | syslog(LOG_ERR, |
---|
1793 | "NSSWITCH(nsparser): %s line %d: 'compat' used with sources, other than 'cache'", |
---|
1794 | _PATH_NS_CONF, lineno); |
---|
1795 | free((void*)elem); |
---|
1796 | return; |
---|
1797 | } |
---|
1798 | } |
---|
1799 | for (i = 0; i < curdbt.srclistsize; i++) { |
---|
1800 | if (strcasecmp(curdbt.srclist[i].name, elem) == 0) { |
---|
1801 | syslog(LOG_ERR, |
---|
1802 | "NSSWITCH(nsparser): %s line %d: duplicate source '%s'", |
---|
1803 | _PATH_NS_CONF, lineno, elem); |
---|
1804 | free((void*)elem); |
---|
1805 | return; |
---|
1806 | } |
---|
1807 | } |
---|
1808 | cursrc.name = elem; |
---|
1809 | _nsdbtaddsrc(&curdbt, &cursrc); |
---|
1810 | } |
---|