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