configparser.c revision 1.6 1 1.5 christos /* A Bison parser, made by GNU Bison 3.0.5. */
2 1.1 christos
3 1.1 christos /* Bison implementation for Yacc-like parsers in C
4 1.1 christos
5 1.5 christos Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
6 1.1 christos
7 1.1 christos This program is free software: you can redistribute it and/or modify
8 1.1 christos it under the terms of the GNU General Public License as published by
9 1.1 christos the Free Software Foundation, either version 3 of the License, or
10 1.1 christos (at your option) any later version.
11 1.1 christos
12 1.1 christos This program is distributed in the hope that it will be useful,
13 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
14 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 1.1 christos GNU General Public License for more details.
16 1.1 christos
17 1.1 christos You should have received a copy of the GNU General Public License
18 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 1.1 christos
20 1.1 christos /* As a special exception, you may create a larger work that contains
21 1.1 christos part or all of the Bison parser skeleton and distribute that work
22 1.1 christos under terms of your choice, so long as that work isn't itself a
23 1.1 christos parser generator using the skeleton or a modified version thereof
24 1.1 christos as a parser skeleton. Alternatively, if you modify or redistribute
25 1.1 christos the parser skeleton itself, you may (at your option) remove this
26 1.1 christos special exception, which will cause the skeleton and the resulting
27 1.1 christos Bison output files to be licensed under the GNU General Public
28 1.1 christos License without this special exception.
29 1.1 christos
30 1.1 christos This special exception was added by the Free Software Foundation in
31 1.1 christos version 2.2 of Bison. */
32 1.1 christos
33 1.1 christos /* C LALR(1) parser skeleton written by Richard Stallman, by
34 1.1 christos simplifying the original so-called "semantic" parser. */
35 1.1 christos
36 1.1 christos /* All symbols defined below should begin with yy or YY, to avoid
37 1.1 christos infringing on user name space. This should be done even for local
38 1.1 christos variables, as they might otherwise be expanded by user macros.
39 1.1 christos There are some unavoidable exceptions within include files to
40 1.1 christos define necessary library symbols; they are noted "INFRINGES ON
41 1.1 christos USER NAME SPACE" below. */
42 1.1 christos
43 1.1 christos /* Identify Bison output. */
44 1.1 christos #define YYBISON 1
45 1.1 christos
46 1.1 christos /* Bison version. */
47 1.5 christos #define YYBISON_VERSION "3.0.5"
48 1.1 christos
49 1.1 christos /* Skeleton name. */
50 1.1 christos #define YYSKELETON_NAME "yacc.c"
51 1.1 christos
52 1.1 christos /* Pure parsers. */
53 1.1 christos #define YYPURE 0
54 1.1 christos
55 1.1 christos /* Push parsers. */
56 1.1 christos #define YYPUSH 0
57 1.1 christos
58 1.1 christos /* Pull parsers. */
59 1.1 christos #define YYPULL 1
60 1.1 christos
61 1.1 christos
62 1.1 christos
63 1.1 christos
64 1.1 christos /* Copy the first part of user declarations. */
65 1.1 christos #line 10 "configparser.y" /* yacc.c:339 */
66 1.1 christos
67 1.1 christos #include "config.h"
68 1.1 christos
69 1.6 christos #include <assert.h>
70 1.6 christos #include <errno.h>
71 1.1 christos #include <stdio.h>
72 1.1 christos #include <string.h>
73 1.1 christos
74 1.1 christos #include "options.h"
75 1.1 christos #include "util.h"
76 1.1 christos #include "dname.h"
77 1.1 christos #include "tsig.h"
78 1.1 christos #include "rrl.h"
79 1.1 christos #include "configyyrename.h"
80 1.6 christos
81 1.6 christos int yylex(void);
82 1.1 christos
83 1.1 christos #ifdef __cplusplus
84 1.1 christos extern "C"
85 1.6 christos #endif
86 1.1 christos
87 1.1 christos /* these need to be global, otherwise they cannot be used inside yacc */
88 1.6 christos extern config_parser_state_type *cfg_parser;
89 1.1 christos
90 1.6 christos static void append_acl(struct acl_options **list, struct acl_options *acl);
91 1.1 christos
92 1.6 christos #line 93 "configparser.c" /* yacc.c:339 */
93 1.1 christos
94 1.1 christos # ifndef YY_NULLPTR
95 1.1 christos # if defined __cplusplus && 201103L <= __cplusplus
96 1.1 christos # define YY_NULLPTR nullptr
97 1.1 christos # else
98 1.1 christos # define YY_NULLPTR 0
99 1.1 christos # endif
100 1.1 christos # endif
101 1.1 christos
102 1.1 christos /* Enabling verbose error messages. */
103 1.1 christos #ifdef YYERROR_VERBOSE
104 1.1 christos # undef YYERROR_VERBOSE
105 1.1 christos # define YYERROR_VERBOSE 1
106 1.1 christos #else
107 1.1 christos # define YYERROR_VERBOSE 0
108 1.1 christos #endif
109 1.1 christos
110 1.1 christos /* In a future release of Bison, this section will be replaced
111 1.1 christos by #include "configparser.h". */
112 1.1 christos #ifndef YY_YY_CONFIGPARSER_H_INCLUDED
113 1.1 christos # define YY_YY_CONFIGPARSER_H_INCLUDED
114 1.1 christos /* Debug traces. */
115 1.1 christos #ifndef YYDEBUG
116 1.1 christos # define YYDEBUG 0
117 1.1 christos #endif
118 1.1 christos #if YYDEBUG
119 1.1 christos extern int yydebug;
120 1.1 christos #endif
121 1.1 christos
122 1.1 christos /* Token type. */
123 1.1 christos #ifndef YYTOKENTYPE
124 1.1 christos # define YYTOKENTYPE
125 1.1 christos enum yytokentype
126 1.1 christos {
127 1.6 christos STRING = 258,
128 1.6 christos VAR_SERVER = 259,
129 1.6 christos VAR_SERVER_COUNT = 260,
130 1.6 christos VAR_IP_ADDRESS = 261,
131 1.6 christos VAR_IP_TRANSPARENT = 262,
132 1.6 christos VAR_IP_FREEBIND = 263,
133 1.6 christos VAR_REUSEPORT = 264,
134 1.6 christos VAR_SEND_BUFFER_SIZE = 265,
135 1.6 christos VAR_RECEIVE_BUFFER_SIZE = 266,
136 1.6 christos VAR_DEBUG_MODE = 267,
137 1.6 christos VAR_IP4_ONLY = 268,
138 1.6 christos VAR_IP6_ONLY = 269,
139 1.6 christos VAR_DO_IP4 = 270,
140 1.6 christos VAR_DO_IP6 = 271,
141 1.6 christos VAR_PORT = 272,
142 1.6 christos VAR_USE_SYSTEMD = 273,
143 1.6 christos VAR_VERBOSITY = 274,
144 1.6 christos VAR_USERNAME = 275,
145 1.6 christos VAR_CHROOT = 276,
146 1.6 christos VAR_ZONESDIR = 277,
147 1.6 christos VAR_ZONELISTFILE = 278,
148 1.6 christos VAR_DATABASE = 279,
149 1.6 christos VAR_LOGFILE = 280,
150 1.6 christos VAR_PIDFILE = 281,
151 1.6 christos VAR_DIFFFILE = 282,
152 1.6 christos VAR_XFRDFILE = 283,
153 1.6 christos VAR_XFRDIR = 284,
154 1.6 christos VAR_HIDE_VERSION = 285,
155 1.6 christos VAR_HIDE_IDENTITY = 286,
156 1.6 christos VAR_VERSION = 287,
157 1.6 christos VAR_IDENTITY = 288,
158 1.6 christos VAR_NSID = 289,
159 1.6 christos VAR_TCP_COUNT = 290,
160 1.6 christos VAR_TCP_REJECT_OVERFLOW = 291,
161 1.6 christos VAR_TCP_QUERY_COUNT = 292,
162 1.6 christos VAR_TCP_TIMEOUT = 293,
163 1.1 christos VAR_TCP_MSS = 294,
164 1.1 christos VAR_OUTGOING_TCP_MSS = 295,
165 1.6 christos VAR_IPV4_EDNS_SIZE = 296,
166 1.6 christos VAR_IPV6_EDNS_SIZE = 297,
167 1.6 christos VAR_STATISTICS = 298,
168 1.6 christos VAR_XFRD_RELOAD_TIMEOUT = 299,
169 1.6 christos VAR_LOG_TIME_ASCII = 300,
170 1.6 christos VAR_ROUND_ROBIN = 301,
171 1.6 christos VAR_MINIMAL_RESPONSES = 302,
172 1.6 christos VAR_CONFINE_TO_ZONE = 303,
173 1.6 christos VAR_REFUSE_ANY = 304,
174 1.6 christos VAR_ZONEFILES_CHECK = 305,
175 1.6 christos VAR_ZONEFILES_WRITE = 306,
176 1.6 christos VAR_RRL_SIZE = 307,
177 1.6 christos VAR_RRL_RATELIMIT = 308,
178 1.6 christos VAR_RRL_SLIP = 309,
179 1.6 christos VAR_RRL_IPV4_PREFIX_LENGTH = 310,
180 1.6 christos VAR_RRL_IPV6_PREFIX_LENGTH = 311,
181 1.6 christos VAR_RRL_WHITELIST_RATELIMIT = 312,
182 1.6 christos VAR_TLS_SERVICE_KEY = 313,
183 1.6 christos VAR_TLS_SERVICE_PEM = 314,
184 1.6 christos VAR_TLS_SERVICE_OCSP = 315,
185 1.6 christos VAR_TLS_PORT = 316,
186 1.6 christos VAR_DNSTAP = 317,
187 1.6 christos VAR_DNSTAP_ENABLE = 318,
188 1.6 christos VAR_DNSTAP_SOCKET_PATH = 319,
189 1.6 christos VAR_DNSTAP_SEND_IDENTITY = 320,
190 1.6 christos VAR_DNSTAP_SEND_VERSION = 321,
191 1.6 christos VAR_DNSTAP_IDENTITY = 322,
192 1.6 christos VAR_DNSTAP_VERSION = 323,
193 1.6 christos VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES = 324,
194 1.6 christos VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES = 325,
195 1.6 christos VAR_REMOTE_CONTROL = 326,
196 1.6 christos VAR_CONTROL_ENABLE = 327,
197 1.6 christos VAR_CONTROL_INTERFACE = 328,
198 1.6 christos VAR_CONTROL_PORT = 329,
199 1.6 christos VAR_SERVER_KEY_FILE = 330,
200 1.6 christos VAR_SERVER_CERT_FILE = 331,
201 1.6 christos VAR_CONTROL_KEY_FILE = 332,
202 1.6 christos VAR_CONTROL_CERT_FILE = 333,
203 1.6 christos VAR_KEY = 334,
204 1.6 christos VAR_ALGORITHM = 335,
205 1.6 christos VAR_SECRET = 336,
206 1.6 christos VAR_PATTERN = 337,
207 1.6 christos VAR_NAME = 338,
208 1.6 christos VAR_ZONEFILE = 339,
209 1.6 christos VAR_NOTIFY = 340,
210 1.6 christos VAR_PROVIDE_XFR = 341,
211 1.6 christos VAR_AXFR = 342,
212 1.6 christos VAR_UDP = 343,
213 1.6 christos VAR_NOTIFY_RETRY = 344,
214 1.6 christos VAR_ALLOW_NOTIFY = 345,
215 1.6 christos VAR_REQUEST_XFR = 346,
216 1.6 christos VAR_ALLOW_AXFR_FALLBACK = 347,
217 1.6 christos VAR_OUTGOING_INTERFACE = 348,
218 1.6 christos VAR_MAX_REFRESH_TIME = 349,
219 1.6 christos VAR_MIN_REFRESH_TIME = 350,
220 1.6 christos VAR_MAX_RETRY_TIME = 351,
221 1.6 christos VAR_MIN_RETRY_TIME = 352,
222 1.6 christos VAR_MULTI_MASTER_CHECK = 353,
223 1.6 christos VAR_SIZE_LIMIT_XFR = 354,
224 1.6 christos VAR_ZONESTATS = 355,
225 1.6 christos VAR_INCLUDE_PATTERN = 356,
226 1.6 christos VAR_ZONE = 357,
227 1.6 christos VAR_RRL_WHITELIST = 358
228 1.1 christos };
229 1.1 christos #endif
230 1.1 christos /* Tokens. */
231 1.6 christos #define STRING 258
232 1.6 christos #define VAR_SERVER 259
233 1.6 christos #define VAR_SERVER_COUNT 260
234 1.6 christos #define VAR_IP_ADDRESS 261
235 1.6 christos #define VAR_IP_TRANSPARENT 262
236 1.6 christos #define VAR_IP_FREEBIND 263
237 1.6 christos #define VAR_REUSEPORT 264
238 1.6 christos #define VAR_SEND_BUFFER_SIZE 265
239 1.6 christos #define VAR_RECEIVE_BUFFER_SIZE 266
240 1.6 christos #define VAR_DEBUG_MODE 267
241 1.6 christos #define VAR_IP4_ONLY 268
242 1.6 christos #define VAR_IP6_ONLY 269
243 1.6 christos #define VAR_DO_IP4 270
244 1.6 christos #define VAR_DO_IP6 271
245 1.6 christos #define VAR_PORT 272
246 1.6 christos #define VAR_USE_SYSTEMD 273
247 1.6 christos #define VAR_VERBOSITY 274
248 1.6 christos #define VAR_USERNAME 275
249 1.6 christos #define VAR_CHROOT 276
250 1.6 christos #define VAR_ZONESDIR 277
251 1.6 christos #define VAR_ZONELISTFILE 278
252 1.6 christos #define VAR_DATABASE 279
253 1.6 christos #define VAR_LOGFILE 280
254 1.6 christos #define VAR_PIDFILE 281
255 1.6 christos #define VAR_DIFFFILE 282
256 1.6 christos #define VAR_XFRDFILE 283
257 1.6 christos #define VAR_XFRDIR 284
258 1.6 christos #define VAR_HIDE_VERSION 285
259 1.6 christos #define VAR_HIDE_IDENTITY 286
260 1.6 christos #define VAR_VERSION 287
261 1.6 christos #define VAR_IDENTITY 288
262 1.6 christos #define VAR_NSID 289
263 1.6 christos #define VAR_TCP_COUNT 290
264 1.6 christos #define VAR_TCP_REJECT_OVERFLOW 291
265 1.6 christos #define VAR_TCP_QUERY_COUNT 292
266 1.6 christos #define VAR_TCP_TIMEOUT 293
267 1.1 christos #define VAR_TCP_MSS 294
268 1.1 christos #define VAR_OUTGOING_TCP_MSS 295
269 1.6 christos #define VAR_IPV4_EDNS_SIZE 296
270 1.6 christos #define VAR_IPV6_EDNS_SIZE 297
271 1.6 christos #define VAR_STATISTICS 298
272 1.6 christos #define VAR_XFRD_RELOAD_TIMEOUT 299
273 1.6 christos #define VAR_LOG_TIME_ASCII 300
274 1.6 christos #define VAR_ROUND_ROBIN 301
275 1.6 christos #define VAR_MINIMAL_RESPONSES 302
276 1.6 christos #define VAR_CONFINE_TO_ZONE 303
277 1.6 christos #define VAR_REFUSE_ANY 304
278 1.6 christos #define VAR_ZONEFILES_CHECK 305
279 1.6 christos #define VAR_ZONEFILES_WRITE 306
280 1.6 christos #define VAR_RRL_SIZE 307
281 1.6 christos #define VAR_RRL_RATELIMIT 308
282 1.6 christos #define VAR_RRL_SLIP 309
283 1.6 christos #define VAR_RRL_IPV4_PREFIX_LENGTH 310
284 1.6 christos #define VAR_RRL_IPV6_PREFIX_LENGTH 311
285 1.6 christos #define VAR_RRL_WHITELIST_RATELIMIT 312
286 1.6 christos #define VAR_TLS_SERVICE_KEY 313
287 1.6 christos #define VAR_TLS_SERVICE_PEM 314
288 1.6 christos #define VAR_TLS_SERVICE_OCSP 315
289 1.6 christos #define VAR_TLS_PORT 316
290 1.6 christos #define VAR_DNSTAP 317
291 1.6 christos #define VAR_DNSTAP_ENABLE 318
292 1.6 christos #define VAR_DNSTAP_SOCKET_PATH 319
293 1.6 christos #define VAR_DNSTAP_SEND_IDENTITY 320
294 1.6 christos #define VAR_DNSTAP_SEND_VERSION 321
295 1.6 christos #define VAR_DNSTAP_IDENTITY 322
296 1.6 christos #define VAR_DNSTAP_VERSION 323
297 1.6 christos #define VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES 324
298 1.6 christos #define VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES 325
299 1.6 christos #define VAR_REMOTE_CONTROL 326
300 1.6 christos #define VAR_CONTROL_ENABLE 327
301 1.6 christos #define VAR_CONTROL_INTERFACE 328
302 1.6 christos #define VAR_CONTROL_PORT 329
303 1.6 christos #define VAR_SERVER_KEY_FILE 330
304 1.6 christos #define VAR_SERVER_CERT_FILE 331
305 1.6 christos #define VAR_CONTROL_KEY_FILE 332
306 1.6 christos #define VAR_CONTROL_CERT_FILE 333
307 1.6 christos #define VAR_KEY 334
308 1.6 christos #define VAR_ALGORITHM 335
309 1.6 christos #define VAR_SECRET 336
310 1.6 christos #define VAR_PATTERN 337
311 1.6 christos #define VAR_NAME 338
312 1.6 christos #define VAR_ZONEFILE 339
313 1.6 christos #define VAR_NOTIFY 340
314 1.6 christos #define VAR_PROVIDE_XFR 341
315 1.6 christos #define VAR_AXFR 342
316 1.6 christos #define VAR_UDP 343
317 1.6 christos #define VAR_NOTIFY_RETRY 344
318 1.6 christos #define VAR_ALLOW_NOTIFY 345
319 1.6 christos #define VAR_REQUEST_XFR 346
320 1.6 christos #define VAR_ALLOW_AXFR_FALLBACK 347
321 1.6 christos #define VAR_OUTGOING_INTERFACE 348
322 1.6 christos #define VAR_MAX_REFRESH_TIME 349
323 1.6 christos #define VAR_MIN_REFRESH_TIME 350
324 1.6 christos #define VAR_MAX_RETRY_TIME 351
325 1.6 christos #define VAR_MIN_RETRY_TIME 352
326 1.6 christos #define VAR_MULTI_MASTER_CHECK 353
327 1.6 christos #define VAR_SIZE_LIMIT_XFR 354
328 1.6 christos #define VAR_ZONESTATS 355
329 1.6 christos #define VAR_INCLUDE_PATTERN 356
330 1.6 christos #define VAR_ZONE 357
331 1.6 christos #define VAR_RRL_WHITELIST 358
332 1.1 christos
333 1.1 christos /* Value type. */
334 1.1 christos #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
335 1.1 christos
336 1.1 christos union YYSTYPE
337 1.1 christos {
338 1.6 christos #line 37 "configparser.y" /* yacc.c:355 */
339 1.1 christos
340 1.6 christos char *str;
341 1.6 christos long long llng;
342 1.6 christos int bln;
343 1.6 christos struct ip_address_option *ip;
344 1.1 christos
345 1.6 christos #line 346 "configparser.c" /* yacc.c:355 */
346 1.1 christos };
347 1.1 christos
348 1.1 christos typedef union YYSTYPE YYSTYPE;
349 1.1 christos # define YYSTYPE_IS_TRIVIAL 1
350 1.1 christos # define YYSTYPE_IS_DECLARED 1
351 1.1 christos #endif
352 1.1 christos
353 1.1 christos
354 1.1 christos extern YYSTYPE yylval;
355 1.1 christos
356 1.1 christos int yyparse (void);
357 1.1 christos
358 1.1 christos #endif /* !YY_YY_CONFIGPARSER_H_INCLUDED */
359 1.1 christos
360 1.1 christos /* Copy the second part of user declarations. */
361 1.1 christos
362 1.6 christos #line 363 "configparser.c" /* yacc.c:358 */
363 1.1 christos
364 1.1 christos #ifdef short
365 1.1 christos # undef short
366 1.1 christos #endif
367 1.1 christos
368 1.1 christos #ifdef YYTYPE_UINT8
369 1.1 christos typedef YYTYPE_UINT8 yytype_uint8;
370 1.1 christos #else
371 1.1 christos typedef unsigned char yytype_uint8;
372 1.1 christos #endif
373 1.1 christos
374 1.1 christos #ifdef YYTYPE_INT8
375 1.1 christos typedef YYTYPE_INT8 yytype_int8;
376 1.1 christos #else
377 1.1 christos typedef signed char yytype_int8;
378 1.1 christos #endif
379 1.1 christos
380 1.1 christos #ifdef YYTYPE_UINT16
381 1.1 christos typedef YYTYPE_UINT16 yytype_uint16;
382 1.1 christos #else
383 1.1 christos typedef unsigned short int yytype_uint16;
384 1.1 christos #endif
385 1.1 christos
386 1.1 christos #ifdef YYTYPE_INT16
387 1.1 christos typedef YYTYPE_INT16 yytype_int16;
388 1.1 christos #else
389 1.1 christos typedef short int yytype_int16;
390 1.1 christos #endif
391 1.1 christos
392 1.1 christos #ifndef YYSIZE_T
393 1.1 christos # ifdef __SIZE_TYPE__
394 1.1 christos # define YYSIZE_T __SIZE_TYPE__
395 1.1 christos # elif defined size_t
396 1.1 christos # define YYSIZE_T size_t
397 1.1 christos # elif ! defined YYSIZE_T
398 1.1 christos # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
399 1.1 christos # define YYSIZE_T size_t
400 1.1 christos # else
401 1.1 christos # define YYSIZE_T unsigned int
402 1.1 christos # endif
403 1.1 christos #endif
404 1.1 christos
405 1.1 christos #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
406 1.1 christos
407 1.1 christos #ifndef YY_
408 1.1 christos # if defined YYENABLE_NLS && YYENABLE_NLS
409 1.1 christos # if ENABLE_NLS
410 1.1 christos # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
411 1.1 christos # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
412 1.1 christos # endif
413 1.1 christos # endif
414 1.1 christos # ifndef YY_
415 1.1 christos # define YY_(Msgid) Msgid
416 1.1 christos # endif
417 1.1 christos #endif
418 1.1 christos
419 1.1 christos #ifndef YY_ATTRIBUTE
420 1.1 christos # if (defined __GNUC__ \
421 1.1 christos && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
422 1.1 christos || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
423 1.1 christos # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
424 1.1 christos # else
425 1.1 christos # define YY_ATTRIBUTE(Spec) /* empty */
426 1.1 christos # endif
427 1.1 christos #endif
428 1.1 christos
429 1.1 christos #ifndef YY_ATTRIBUTE_PURE
430 1.1 christos # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
431 1.1 christos #endif
432 1.1 christos
433 1.1 christos #ifndef YY_ATTRIBUTE_UNUSED
434 1.1 christos # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
435 1.1 christos #endif
436 1.1 christos
437 1.1 christos #if !defined _Noreturn \
438 1.1 christos && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
439 1.1 christos # if defined _MSC_VER && 1200 <= _MSC_VER
440 1.1 christos # define _Noreturn __declspec (noreturn)
441 1.1 christos # else
442 1.1 christos # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
443 1.1 christos # endif
444 1.1 christos #endif
445 1.1 christos
446 1.1 christos /* Suppress unused-variable warnings by "using" E. */
447 1.1 christos #if ! defined lint || defined __GNUC__
448 1.1 christos # define YYUSE(E) ((void) (E))
449 1.1 christos #else
450 1.1 christos # define YYUSE(E) /* empty */
451 1.1 christos #endif
452 1.1 christos
453 1.1 christos #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
454 1.1 christos /* Suppress an incorrect diagnostic about yylval being uninitialized. */
455 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
456 1.1 christos _Pragma ("GCC diagnostic push") \
457 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
458 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
459 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
460 1.1 christos _Pragma ("GCC diagnostic pop")
461 1.1 christos #else
462 1.1 christos # define YY_INITIAL_VALUE(Value) Value
463 1.1 christos #endif
464 1.1 christos #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
465 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
466 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_END
467 1.1 christos #endif
468 1.1 christos #ifndef YY_INITIAL_VALUE
469 1.1 christos # define YY_INITIAL_VALUE(Value) /* Nothing. */
470 1.1 christos #endif
471 1.1 christos
472 1.1 christos
473 1.1 christos #if ! defined yyoverflow || YYERROR_VERBOSE
474 1.1 christos
475 1.1 christos /* The parser invokes alloca or malloc; define the necessary symbols. */
476 1.1 christos
477 1.1 christos # ifdef YYSTACK_USE_ALLOCA
478 1.1 christos # if YYSTACK_USE_ALLOCA
479 1.1 christos # ifdef __GNUC__
480 1.1 christos # define YYSTACK_ALLOC __builtin_alloca
481 1.1 christos # elif defined __BUILTIN_VA_ARG_INCR
482 1.1 christos # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
483 1.1 christos # elif defined _AIX
484 1.1 christos # define YYSTACK_ALLOC __alloca
485 1.1 christos # elif defined _MSC_VER
486 1.1 christos # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
487 1.1 christos # define alloca _alloca
488 1.1 christos # else
489 1.1 christos # define YYSTACK_ALLOC alloca
490 1.1 christos # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
491 1.1 christos # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
492 1.1 christos /* Use EXIT_SUCCESS as a witness for stdlib.h. */
493 1.1 christos # ifndef EXIT_SUCCESS
494 1.1 christos # define EXIT_SUCCESS 0
495 1.1 christos # endif
496 1.1 christos # endif
497 1.1 christos # endif
498 1.1 christos # endif
499 1.1 christos # endif
500 1.1 christos
501 1.1 christos # ifdef YYSTACK_ALLOC
502 1.1 christos /* Pacify GCC's 'empty if-body' warning. */
503 1.1 christos # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
504 1.1 christos # ifndef YYSTACK_ALLOC_MAXIMUM
505 1.1 christos /* The OS might guarantee only one guard page at the bottom of the stack,
506 1.1 christos and a page size can be as small as 4096 bytes. So we cannot safely
507 1.1 christos invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
508 1.1 christos to allow for a few compiler-allocated temporary stack slots. */
509 1.1 christos # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
510 1.1 christos # endif
511 1.1 christos # else
512 1.1 christos # define YYSTACK_ALLOC YYMALLOC
513 1.1 christos # define YYSTACK_FREE YYFREE
514 1.1 christos # ifndef YYSTACK_ALLOC_MAXIMUM
515 1.1 christos # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
516 1.1 christos # endif
517 1.1 christos # if (defined __cplusplus && ! defined EXIT_SUCCESS \
518 1.1 christos && ! ((defined YYMALLOC || defined malloc) \
519 1.1 christos && (defined YYFREE || defined free)))
520 1.1 christos # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
521 1.1 christos # ifndef EXIT_SUCCESS
522 1.1 christos # define EXIT_SUCCESS 0
523 1.1 christos # endif
524 1.1 christos # endif
525 1.1 christos # ifndef YYMALLOC
526 1.1 christos # define YYMALLOC malloc
527 1.1 christos # if ! defined malloc && ! defined EXIT_SUCCESS
528 1.1 christos void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
529 1.1 christos # endif
530 1.1 christos # endif
531 1.1 christos # ifndef YYFREE
532 1.1 christos # define YYFREE free
533 1.1 christos # if ! defined free && ! defined EXIT_SUCCESS
534 1.1 christos void free (void *); /* INFRINGES ON USER NAME SPACE */
535 1.1 christos # endif
536 1.1 christos # endif
537 1.1 christos # endif
538 1.1 christos #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
539 1.1 christos
540 1.1 christos
541 1.1 christos #if (! defined yyoverflow \
542 1.1 christos && (! defined __cplusplus \
543 1.1 christos || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
544 1.1 christos
545 1.1 christos /* A type that is properly aligned for any stack member. */
546 1.1 christos union yyalloc
547 1.1 christos {
548 1.1 christos yytype_int16 yyss_alloc;
549 1.1 christos YYSTYPE yyvs_alloc;
550 1.1 christos };
551 1.1 christos
552 1.1 christos /* The size of the maximum gap between one aligned stack and the next. */
553 1.1 christos # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
554 1.1 christos
555 1.1 christos /* The size of an array large to enough to hold all stacks, each with
556 1.1 christos N elements. */
557 1.1 christos # define YYSTACK_BYTES(N) \
558 1.1 christos ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
559 1.1 christos + YYSTACK_GAP_MAXIMUM)
560 1.1 christos
561 1.1 christos # define YYCOPY_NEEDED 1
562 1.1 christos
563 1.1 christos /* Relocate STACK from its old location to the new one. The
564 1.1 christos local variables YYSIZE and YYSTACKSIZE give the old and new number of
565 1.1 christos elements in the stack, and YYPTR gives the new location of the
566 1.1 christos stack. Advance YYPTR to a properly aligned location for the next
567 1.1 christos stack. */
568 1.1 christos # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
569 1.1 christos do \
570 1.1 christos { \
571 1.1 christos YYSIZE_T yynewbytes; \
572 1.1 christos YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
573 1.1 christos Stack = &yyptr->Stack_alloc; \
574 1.1 christos yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
575 1.1 christos yyptr += yynewbytes / sizeof (*yyptr); \
576 1.1 christos } \
577 1.1 christos while (0)
578 1.1 christos
579 1.1 christos #endif
580 1.1 christos
581 1.1 christos #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
582 1.1 christos /* Copy COUNT objects from SRC to DST. The source and destination do
583 1.1 christos not overlap. */
584 1.1 christos # ifndef YYCOPY
585 1.1 christos # if defined __GNUC__ && 1 < __GNUC__
586 1.1 christos # define YYCOPY(Dst, Src, Count) \
587 1.1 christos __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
588 1.1 christos # else
589 1.1 christos # define YYCOPY(Dst, Src, Count) \
590 1.1 christos do \
591 1.1 christos { \
592 1.1 christos YYSIZE_T yyi; \
593 1.1 christos for (yyi = 0; yyi < (Count); yyi++) \
594 1.1 christos (Dst)[yyi] = (Src)[yyi]; \
595 1.1 christos } \
596 1.1 christos while (0)
597 1.1 christos # endif
598 1.1 christos # endif
599 1.1 christos #endif /* !YYCOPY_NEEDED */
600 1.1 christos
601 1.1 christos /* YYFINAL -- State number of the termination state. */
602 1.1 christos #define YYFINAL 2
603 1.1 christos /* YYLAST -- Last index in YYTABLE. */
604 1.6 christos #define YYLAST 266
605 1.1 christos
606 1.1 christos /* YYNTOKENS -- Number of terminals. */
607 1.6 christos #define YYNTOKENS 104
608 1.1 christos /* YYNNTS -- Number of nonterminals. */
609 1.6 christos #define YYNNTS 28
610 1.1 christos /* YYNRULES -- Number of rules. */
611 1.6 christos #define YYNRULES 131
612 1.1 christos /* YYNSTATES -- Number of states. */
613 1.6 christos #define YYNSTATES 234
614 1.1 christos
615 1.1 christos /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
616 1.1 christos by yylex, with out-of-bounds checking. */
617 1.1 christos #define YYUNDEFTOK 2
618 1.6 christos #define YYMAXUTOK 358
619 1.1 christos
620 1.1 christos #define YYTRANSLATE(YYX) \
621 1.1 christos ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
622 1.1 christos
623 1.1 christos /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
624 1.1 christos as returned by yylex, without out-of-bounds checking. */
625 1.1 christos static const yytype_uint8 yytranslate[] =
626 1.1 christos {
627 1.1 christos 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 1.1 christos 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
653 1.1 christos 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
654 1.1 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
655 1.1 christos 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
656 1.1 christos 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
657 1.1 christos 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
658 1.1 christos 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
659 1.1 christos 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
660 1.1 christos 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
661 1.4 prlw1 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
662 1.6 christos 95, 96, 97, 98, 99, 100, 101, 102, 103
663 1.1 christos };
664 1.1 christos
665 1.1 christos #if YYDEBUG
666 1.1 christos /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
667 1.1 christos static const yytype_uint16 yyrline[] =
668 1.1 christos {
669 1.6 christos 0, 163, 163, 165, 168, 169, 170, 171, 172, 173,
670 1.6 christos 176, 179, 179, 182, 192, 200, 202, 204, 206, 208,
671 1.6 christos 210, 212, 214, 216, 218, 220, 222, 224, 233, 235,
672 1.6 christos 237, 267, 269, 277, 279, 281, 283, 285, 287, 289,
673 1.6 christos 291, 293, 300, 302, 304, 306, 308, 310, 312, 314,
674 1.6 christos 316, 318, 320, 322, 332, 338, 344, 354, 364, 370,
675 1.6 christos 372, 374, 379, 384, 389, 391, 393, 395, 397, 399,
676 1.6 christos 409, 412, 412, 415, 417, 419, 421, 423, 425, 427,
677 1.6 christos 429, 434, 437, 437, 440, 442, 452, 460, 462, 464,
678 1.6 christos 466, 472, 471, 496, 496, 499, 511, 519, 538, 537,
679 1.6 christos 562, 562, 565, 578, 582, 581, 598, 598, 601, 608,
680 1.6 christos 611, 617, 619, 621, 629, 631, 633, 642, 652, 662,
681 1.6 christos 667, 676, 681, 686, 691, 696, 701, 706, 711, 718,
682 1.6 christos 727, 749
683 1.1 christos };
684 1.1 christos #endif
685 1.1 christos
686 1.1 christos #if YYDEBUG || YYERROR_VERBOSE || 0
687 1.1 christos /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
688 1.1 christos First, the terminals, then, starting at YYNTOKENS, nonterminals. */
689 1.1 christos static const char *const yytname[] =
690 1.1 christos {
691 1.6 christos "$end", "error", "$undefined", "STRING", "VAR_SERVER",
692 1.6 christos "VAR_SERVER_COUNT", "VAR_IP_ADDRESS", "VAR_IP_TRANSPARENT",
693 1.6 christos "VAR_IP_FREEBIND", "VAR_REUSEPORT", "VAR_SEND_BUFFER_SIZE",
694 1.6 christos "VAR_RECEIVE_BUFFER_SIZE", "VAR_DEBUG_MODE", "VAR_IP4_ONLY",
695 1.6 christos "VAR_IP6_ONLY", "VAR_DO_IP4", "VAR_DO_IP6", "VAR_PORT",
696 1.6 christos "VAR_USE_SYSTEMD", "VAR_VERBOSITY", "VAR_USERNAME", "VAR_CHROOT",
697 1.6 christos "VAR_ZONESDIR", "VAR_ZONELISTFILE", "VAR_DATABASE", "VAR_LOGFILE",
698 1.6 christos "VAR_PIDFILE", "VAR_DIFFFILE", "VAR_XFRDFILE", "VAR_XFRDIR",
699 1.6 christos "VAR_HIDE_VERSION", "VAR_HIDE_IDENTITY", "VAR_VERSION", "VAR_IDENTITY",
700 1.6 christos "VAR_NSID", "VAR_TCP_COUNT", "VAR_TCP_REJECT_OVERFLOW",
701 1.6 christos "VAR_TCP_QUERY_COUNT", "VAR_TCP_TIMEOUT", "VAR_TCP_MSS",
702 1.6 christos "VAR_OUTGOING_TCP_MSS", "VAR_IPV4_EDNS_SIZE", "VAR_IPV6_EDNS_SIZE",
703 1.6 christos "VAR_STATISTICS", "VAR_XFRD_RELOAD_TIMEOUT", "VAR_LOG_TIME_ASCII",
704 1.6 christos "VAR_ROUND_ROBIN", "VAR_MINIMAL_RESPONSES", "VAR_CONFINE_TO_ZONE",
705 1.6 christos "VAR_REFUSE_ANY", "VAR_ZONEFILES_CHECK", "VAR_ZONEFILES_WRITE",
706 1.6 christos "VAR_RRL_SIZE", "VAR_RRL_RATELIMIT", "VAR_RRL_SLIP",
707 1.1 christos "VAR_RRL_IPV4_PREFIX_LENGTH", "VAR_RRL_IPV6_PREFIX_LENGTH",
708 1.6 christos "VAR_RRL_WHITELIST_RATELIMIT", "VAR_TLS_SERVICE_KEY",
709 1.6 christos "VAR_TLS_SERVICE_PEM", "VAR_TLS_SERVICE_OCSP", "VAR_TLS_PORT",
710 1.6 christos "VAR_DNSTAP", "VAR_DNSTAP_ENABLE", "VAR_DNSTAP_SOCKET_PATH",
711 1.6 christos "VAR_DNSTAP_SEND_IDENTITY", "VAR_DNSTAP_SEND_VERSION",
712 1.6 christos "VAR_DNSTAP_IDENTITY", "VAR_DNSTAP_VERSION",
713 1.4 prlw1 "VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES",
714 1.6 christos "VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES", "VAR_REMOTE_CONTROL",
715 1.6 christos "VAR_CONTROL_ENABLE", "VAR_CONTROL_INTERFACE", "VAR_CONTROL_PORT",
716 1.6 christos "VAR_SERVER_KEY_FILE", "VAR_SERVER_CERT_FILE", "VAR_CONTROL_KEY_FILE",
717 1.6 christos "VAR_CONTROL_CERT_FILE", "VAR_KEY", "VAR_ALGORITHM", "VAR_SECRET",
718 1.6 christos "VAR_PATTERN", "VAR_NAME", "VAR_ZONEFILE", "VAR_NOTIFY",
719 1.6 christos "VAR_PROVIDE_XFR", "VAR_AXFR", "VAR_UDP", "VAR_NOTIFY_RETRY",
720 1.6 christos "VAR_ALLOW_NOTIFY", "VAR_REQUEST_XFR", "VAR_ALLOW_AXFR_FALLBACK",
721 1.6 christos "VAR_OUTGOING_INTERFACE", "VAR_MAX_REFRESH_TIME", "VAR_MIN_REFRESH_TIME",
722 1.6 christos "VAR_MAX_RETRY_TIME", "VAR_MIN_RETRY_TIME", "VAR_MULTI_MASTER_CHECK",
723 1.6 christos "VAR_SIZE_LIMIT_XFR", "VAR_ZONESTATS", "VAR_INCLUDE_PATTERN", "VAR_ZONE",
724 1.6 christos "VAR_RRL_WHITELIST", "$accept", "blocks", "block", "server",
725 1.6 christos "server_block", "server_option", "dnstap", "dnstap_block",
726 1.6 christos "dnstap_option", "remote_control", "remote_control_block",
727 1.6 christos "remote_control_option", "key", "$@1", "key_block", "key_option", "zone",
728 1.6 christos "$@2", "zone_block", "zone_option", "pattern", "$@3", "pattern_block",
729 1.6 christos "pattern_option", "pattern_or_zone_option", "ip_address", "number",
730 1.6 christos "boolean", YY_NULLPTR
731 1.1 christos };
732 1.1 christos #endif
733 1.1 christos
734 1.1 christos # ifdef YYPRINT
735 1.1 christos /* YYTOKNUM[NUM] -- (External) token number corresponding to the
736 1.1 christos (internal) symbol number NUM (which must be that of a token). */
737 1.1 christos static const yytype_uint16 yytoknum[] =
738 1.1 christos {
739 1.1 christos 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
740 1.1 christos 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
741 1.1 christos 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
742 1.1 christos 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
743 1.1 christos 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
744 1.1 christos 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
745 1.1 christos 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
746 1.1 christos 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
747 1.3 christos 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
748 1.4 prlw1 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
749 1.6 christos 355, 356, 357, 358
750 1.1 christos };
751 1.1 christos # endif
752 1.1 christos
753 1.6 christos #define YYPACT_NINF -52
754 1.1 christos
755 1.1 christos #define yypact_value_is_default(Yystate) \
756 1.6 christos (!!((Yystate) == (-52)))
757 1.1 christos
758 1.1 christos #define YYTABLE_NINF -1
759 1.1 christos
760 1.1 christos #define yytable_value_is_error(Yytable_value) \
761 1.1 christos 0
762 1.1 christos
763 1.1 christos /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
764 1.1 christos STATE-NUM. */
765 1.1 christos static const yytype_int16 yypact[] =
766 1.1 christos {
767 1.6 christos -52, 20, -52, -52, -52, -52, -52, -52, -52, -52,
768 1.6 christos -52, -52, -52, -52, -52, -52, 205, -51, -43, -52,
769 1.6 christos -52, -52, -1, 0, 6, 6, 6, -1, -1, 6,
770 1.6 christos 6, 6, 6, 6, -1, 6, -1, 18, 22, 23,
771 1.6 christos 24, 33, 44, 46, 48, 50, 51, 6, 6, 53,
772 1.6 christos 56, 57, -1, 6, -1, -1, -1, -1, -1, -1,
773 1.6 christos -1, -1, 6, 6, 6, 6, 6, 6, -1, -1,
774 1.6 christos -1, -1, -1, -1, -1, 60, 62, 63, -1, -52,
775 1.6 christos 6, 64, 6, 6, 66, 75, 6, 6, -52, 6,
776 1.6 christos 0, -1, 76, 77, 78, 80, -52, -35, 34, 55,
777 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
778 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
779 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
780 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
781 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
782 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
783 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
784 1.6 christos -52, -52, -52, -52, -52, 89, 90, 94, -52, 95,
785 1.6 christos 97, 98, 100, -1, 101, 8, 6, 102, -1, -1,
786 1.6 christos -1, -1, 6, -1, 103, 105, 106, -52, -52, 107,
787 1.6 christos -52, -52, -52, -52, -52, -52, -52, 108, 109, -52,
788 1.6 christos 110, 111, 112, 113, -52, -52, -52, -52, -52, -52,
789 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
790 1.6 christos 118, 133, -52, -52
791 1.1 christos };
792 1.1 christos
793 1.1 christos /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
794 1.1 christos Performed when YYTABLE does not specify something else to do. Zero
795 1.1 christos means the default is an error. */
796 1.1 christos static const yytype_uint8 yydefact[] =
797 1.1 christos {
798 1.6 christos 2, 0, 1, 12, 72, 83, 91, 104, 98, 3,
799 1.6 christos 4, 5, 6, 7, 9, 8, 10, 70, 81, 94,
800 1.6 christos 107, 101, 0, 0, 0, 0, 0, 0, 0, 0,
801 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
802 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
803 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
804 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
805 1.4 prlw1 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
806 1.6 christos 0, 0, 0, 0, 0, 0, 0, 0, 71, 0,
807 1.6 christos 0, 0, 0, 0, 0, 0, 82, 92, 105, 99,
808 1.6 christos 130, 14, 129, 13, 131, 15, 16, 42, 17, 18,
809 1.6 christos 19, 23, 24, 25, 26, 41, 20, 52, 45, 44,
810 1.6 christos 46, 47, 27, 31, 40, 48, 49, 50, 21, 22,
811 1.6 christos 29, 28, 30, 32, 33, 34, 35, 36, 37, 38,
812 1.6 christos 39, 43, 51, 61, 62, 63, 64, 65, 59, 60,
813 1.6 christos 53, 54, 55, 56, 57, 58, 66, 68, 67, 69,
814 1.6 christos 73, 74, 75, 76, 77, 78, 79, 80, 84, 85,
815 1.6 christos 86, 87, 88, 89, 90, 0, 0, 0, 93, 0,
816 1.6 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
817 1.6 christos 0, 0, 0, 0, 0, 0, 0, 106, 109, 0,
818 1.6 christos 100, 103, 96, 97, 95, 108, 111, 0, 0, 124,
819 1.6 christos 0, 0, 0, 0, 123, 122, 125, 126, 127, 128,
820 1.6 christos 114, 113, 112, 115, 110, 102, 120, 121, 119, 116,
821 1.6 christos 0, 0, 117, 118
822 1.1 christos };
823 1.1 christos
824 1.1 christos /* YYPGOTO[NTERM-NUM]. */
825 1.4 prlw1 static const yytype_int8 yypgoto[] =
826 1.1 christos {
827 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
828 1.6 christos -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
829 1.6 christos -52, -52, -52, -52, 43, 67, 16, -25
830 1.1 christos };
831 1.1 christos
832 1.1 christos /* YYDEFGOTO[NTERM-NUM]. */
833 1.1 christos static const yytype_int16 yydefgoto[] =
834 1.1 christos {
835 1.6 christos -1, 1, 9, 10, 16, 79, 11, 17, 88, 12,
836 1.6 christos 18, 96, 13, 19, 97, 178, 14, 21, 99, 200,
837 1.6 christos 15, 20, 98, 197, 198, 103, 101, 105
838 1.1 christos };
839 1.1 christos
840 1.1 christos /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
841 1.1 christos positive, shift that token. If negative, reduce the rule whose
842 1.1 christos number is the opposite. If YYTABLE_NINF, syntax error. */
843 1.6 christos static const yytype_uint8 yytable[] =
844 1.1 christos {
845 1.6 christos 106, 107, 100, 102, 110, 111, 112, 113, 114, 104,
846 1.6 christos 116, 211, 80, 81, 82, 83, 84, 85, 86, 87,
847 1.6 christos 2, 118, 128, 129, 3, 119, 120, 121, 134, 89,
848 1.6 christos 90, 91, 92, 93, 94, 95, 122, 143, 144, 145,
849 1.6 christos 146, 147, 148, 108, 109, 175, 176, 123, 177, 124,
850 1.6 christos 115, 125, 117, 126, 127, 160, 130, 162, 163, 131,
851 1.6 christos 132, 166, 167, 156, 168, 157, 158, 161, 133, 164,
852 1.6 christos 135, 136, 137, 138, 139, 140, 141, 142, 165, 171,
853 1.6 christos 172, 173, 4, 174, 149, 150, 151, 152, 153, 154,
854 1.6 christos 155, 5, 202, 203, 159, 212, 213, 204, 205, 6,
855 1.6 christos 206, 207, 7, 208, 210, 215, 222, 170, 223, 224,
856 1.6 christos 225, 226, 227, 228, 229, 230, 231, 179, 180, 181,
857 1.6 christos 182, 232, 8, 183, 184, 185, 186, 187, 188, 189,
858 1.6 christos 190, 191, 192, 193, 194, 195, 233, 196, 199, 180,
859 1.6 christos 181, 182, 201, 0, 183, 184, 185, 186, 187, 188,
860 1.6 christos 189, 190, 191, 192, 193, 194, 195, 169, 196, 0,
861 1.6 christos 0, 214, 0, 0, 0, 0, 0, 220, 0, 0,
862 1.6 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
863 1.6 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
864 1.6 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 209,
865 1.6 christos 0, 0, 0, 0, 216, 217, 218, 219, 0, 221,
866 1.6 christos 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
867 1.6 christos 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
868 1.6 christos 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
869 1.6 christos 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
870 1.6 christos 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
871 1.6 christos 72, 73, 74, 75, 76, 77, 78
872 1.1 christos };
873 1.1 christos
874 1.6 christos static const yytype_int16 yycheck[] =
875 1.1 christos {
876 1.6 christos 25, 26, 3, 3, 29, 30, 31, 32, 33, 3,
877 1.6 christos 35, 3, 63, 64, 65, 66, 67, 68, 69, 70,
878 1.6 christos 0, 3, 47, 48, 4, 3, 3, 3, 53, 72,
879 1.6 christos 73, 74, 75, 76, 77, 78, 3, 62, 63, 64,
880 1.6 christos 65, 66, 67, 27, 28, 80, 81, 3, 83, 3,
881 1.6 christos 34, 3, 36, 3, 3, 80, 3, 82, 83, 3,
882 1.6 christos 3, 86, 87, 3, 89, 3, 3, 3, 52, 3,
883 1.6 christos 54, 55, 56, 57, 58, 59, 60, 61, 3, 3,
884 1.6 christos 3, 3, 62, 3, 68, 69, 70, 71, 72, 73,
885 1.6 christos 74, 71, 3, 3, 78, 87, 88, 3, 3, 79,
886 1.6 christos 3, 3, 82, 3, 3, 3, 3, 91, 3, 3,
887 1.6 christos 3, 3, 3, 3, 3, 3, 3, 83, 84, 85,
888 1.6 christos 86, 3, 102, 89, 90, 91, 92, 93, 94, 95,
889 1.6 christos 96, 97, 98, 99, 100, 101, 3, 103, 83, 84,
890 1.6 christos 85, 86, 99, -1, 89, 90, 91, 92, 93, 94,
891 1.6 christos 95, 96, 97, 98, 99, 100, 101, 90, 103, -1,
892 1.6 christos -1, 186, -1, -1, -1, -1, -1, 192, -1, -1,
893 1.6 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
894 1.6 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
895 1.6 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, 183,
896 1.6 christos -1, -1, -1, -1, 188, 189, 190, 191, -1, 193,
897 1.6 christos 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
898 1.6 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
899 1.6 christos 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
900 1.6 christos 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
901 1.6 christos 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
902 1.6 christos 55, 56, 57, 58, 59, 60, 61
903 1.1 christos };
904 1.1 christos
905 1.1 christos /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
906 1.1 christos symbol of state STATE-NUM. */
907 1.1 christos static const yytype_uint8 yystos[] =
908 1.1 christos {
909 1.6 christos 0, 105, 0, 4, 62, 71, 79, 82, 102, 106,
910 1.6 christos 107, 110, 113, 116, 120, 124, 108, 111, 114, 117,
911 1.6 christos 125, 121, 5, 6, 7, 8, 9, 10, 11, 12,
912 1.6 christos 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
913 1.6 christos 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
914 1.6 christos 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
915 1.6 christos 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
916 1.6 christos 53, 54, 55, 56, 57, 58, 59, 60, 61, 109,
917 1.6 christos 63, 64, 65, 66, 67, 68, 69, 70, 112, 72,
918 1.6 christos 73, 74, 75, 76, 77, 78, 115, 118, 126, 122,
919 1.6 christos 3, 130, 3, 129, 3, 131, 131, 131, 130, 130,
920 1.6 christos 131, 131, 131, 131, 131, 130, 131, 130, 3, 3,
921 1.6 christos 3, 3, 3, 3, 3, 3, 3, 3, 131, 131,
922 1.6 christos 3, 3, 3, 130, 131, 130, 130, 130, 130, 130,
923 1.6 christos 130, 130, 130, 131, 131, 131, 131, 131, 131, 130,
924 1.6 christos 130, 130, 130, 130, 130, 130, 3, 3, 3, 130,
925 1.6 christos 131, 3, 131, 131, 3, 3, 131, 131, 131, 129,
926 1.6 christos 130, 3, 3, 3, 3, 80, 81, 83, 119, 83,
927 1.6 christos 84, 85, 86, 89, 90, 91, 92, 93, 94, 95,
928 1.6 christos 96, 97, 98, 99, 100, 101, 103, 127, 128, 83,
929 1.6 christos 123, 128, 3, 3, 3, 3, 3, 3, 3, 130,
930 1.6 christos 3, 3, 87, 88, 131, 3, 130, 130, 130, 130,
931 1.6 christos 131, 130, 3, 3, 3, 3, 3, 3, 3, 3,
932 1.6 christos 3, 3, 3, 3
933 1.1 christos };
934 1.1 christos
935 1.1 christos /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
936 1.1 christos static const yytype_uint8 yyr1[] =
937 1.1 christos {
938 1.6 christos 0, 104, 105, 105, 106, 106, 106, 106, 106, 106,
939 1.6 christos 107, 108, 108, 109, 109, 109, 109, 109, 109, 109,
940 1.6 christos 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
941 1.6 christos 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
942 1.6 christos 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
943 1.6 christos 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
944 1.6 christos 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
945 1.6 christos 110, 111, 111, 112, 112, 112, 112, 112, 112, 112,
946 1.6 christos 112, 113, 114, 114, 115, 115, 115, 115, 115, 115,
947 1.6 christos 115, 117, 116, 118, 118, 119, 119, 119, 121, 120,
948 1.6 christos 122, 122, 123, 123, 125, 124, 126, 126, 127, 127,
949 1.6 christos 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
950 1.6 christos 128, 128, 128, 128, 128, 128, 128, 128, 128, 129,
951 1.6 christos 130, 131
952 1.1 christos };
953 1.1 christos
954 1.1 christos /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
955 1.1 christos static const yytype_uint8 yyr2[] =
956 1.1 christos {
957 1.6 christos 0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
958 1.6 christos 2, 2, 0, 2, 2, 2, 2, 2, 2, 2,
959 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
960 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
961 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
962 1.6 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
963 1.6 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
964 1.6 christos 2, 2, 0, 2, 2, 2, 2, 2, 2, 2,
965 1.6 christos 2, 2, 2, 0, 2, 2, 2, 2, 2, 2,
966 1.6 christos 2, 0, 3, 2, 0, 2, 2, 2, 0, 3,
967 1.6 christos 2, 0, 2, 1, 0, 3, 2, 0, 2, 1,
968 1.6 christos 2, 2, 2, 2, 2, 2, 3, 4, 4, 3,
969 1.6 christos 3, 3, 2, 2, 2, 2, 2, 2, 2, 1,
970 1.6 christos 1, 1
971 1.1 christos };
972 1.1 christos
973 1.1 christos
974 1.1 christos #define yyerrok (yyerrstatus = 0)
975 1.1 christos #define yyclearin (yychar = YYEMPTY)
976 1.1 christos #define YYEMPTY (-2)
977 1.1 christos #define YYEOF 0
978 1.1 christos
979 1.1 christos #define YYACCEPT goto yyacceptlab
980 1.1 christos #define YYABORT goto yyabortlab
981 1.1 christos #define YYERROR goto yyerrorlab
982 1.1 christos
983 1.1 christos
984 1.1 christos #define YYRECOVERING() (!!yyerrstatus)
985 1.1 christos
986 1.1 christos #define YYBACKUP(Token, Value) \
987 1.1 christos do \
988 1.1 christos if (yychar == YYEMPTY) \
989 1.1 christos { \
990 1.1 christos yychar = (Token); \
991 1.1 christos yylval = (Value); \
992 1.1 christos YYPOPSTACK (yylen); \
993 1.1 christos yystate = *yyssp; \
994 1.1 christos goto yybackup; \
995 1.1 christos } \
996 1.1 christos else \
997 1.1 christos { \
998 1.1 christos yyerror (YY_("syntax error: cannot back up")); \
999 1.1 christos YYERROR; \
1000 1.1 christos } \
1001 1.1 christos while (0)
1002 1.1 christos
1003 1.1 christos /* Error token number */
1004 1.1 christos #define YYTERROR 1
1005 1.1 christos #define YYERRCODE 256
1006 1.1 christos
1007 1.1 christos
1008 1.1 christos
1009 1.1 christos /* Enable debugging if requested. */
1010 1.1 christos #if YYDEBUG
1011 1.1 christos
1012 1.1 christos # ifndef YYFPRINTF
1013 1.1 christos # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1014 1.1 christos # define YYFPRINTF fprintf
1015 1.1 christos # endif
1016 1.1 christos
1017 1.1 christos # define YYDPRINTF(Args) \
1018 1.1 christos do { \
1019 1.1 christos if (yydebug) \
1020 1.1 christos YYFPRINTF Args; \
1021 1.1 christos } while (0)
1022 1.1 christos
1023 1.1 christos /* This macro is provided for backward compatibility. */
1024 1.1 christos #ifndef YY_LOCATION_PRINT
1025 1.1 christos # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1026 1.1 christos #endif
1027 1.1 christos
1028 1.1 christos
1029 1.1 christos # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1030 1.1 christos do { \
1031 1.1 christos if (yydebug) \
1032 1.1 christos { \
1033 1.1 christos YYFPRINTF (stderr, "%s ", Title); \
1034 1.1 christos yy_symbol_print (stderr, \
1035 1.1 christos Type, Value); \
1036 1.1 christos YYFPRINTF (stderr, "\n"); \
1037 1.1 christos } \
1038 1.1 christos } while (0)
1039 1.1 christos
1040 1.1 christos
1041 1.1 christos /*----------------------------------------.
1042 1.1 christos | Print this symbol's value on YYOUTPUT. |
1043 1.1 christos `----------------------------------------*/
1044 1.1 christos
1045 1.1 christos static void
1046 1.1 christos yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1047 1.1 christos {
1048 1.1 christos FILE *yyo = yyoutput;
1049 1.1 christos YYUSE (yyo);
1050 1.1 christos if (!yyvaluep)
1051 1.1 christos return;
1052 1.1 christos # ifdef YYPRINT
1053 1.1 christos if (yytype < YYNTOKENS)
1054 1.1 christos YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1055 1.1 christos # endif
1056 1.1 christos YYUSE (yytype);
1057 1.1 christos }
1058 1.1 christos
1059 1.1 christos
1060 1.1 christos /*--------------------------------.
1061 1.1 christos | Print this symbol on YYOUTPUT. |
1062 1.1 christos `--------------------------------*/
1063 1.1 christos
1064 1.1 christos static void
1065 1.1 christos yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1066 1.1 christos {
1067 1.1 christos YYFPRINTF (yyoutput, "%s %s (",
1068 1.1 christos yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1069 1.1 christos
1070 1.1 christos yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1071 1.1 christos YYFPRINTF (yyoutput, ")");
1072 1.1 christos }
1073 1.1 christos
1074 1.1 christos /*------------------------------------------------------------------.
1075 1.1 christos | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1076 1.1 christos | TOP (included). |
1077 1.1 christos `------------------------------------------------------------------*/
1078 1.1 christos
1079 1.1 christos static void
1080 1.1 christos yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1081 1.1 christos {
1082 1.1 christos YYFPRINTF (stderr, "Stack now");
1083 1.1 christos for (; yybottom <= yytop; yybottom++)
1084 1.1 christos {
1085 1.1 christos int yybot = *yybottom;
1086 1.1 christos YYFPRINTF (stderr, " %d", yybot);
1087 1.1 christos }
1088 1.1 christos YYFPRINTF (stderr, "\n");
1089 1.1 christos }
1090 1.1 christos
1091 1.1 christos # define YY_STACK_PRINT(Bottom, Top) \
1092 1.1 christos do { \
1093 1.1 christos if (yydebug) \
1094 1.1 christos yy_stack_print ((Bottom), (Top)); \
1095 1.1 christos } while (0)
1096 1.1 christos
1097 1.1 christos
1098 1.1 christos /*------------------------------------------------.
1099 1.1 christos | Report that the YYRULE is going to be reduced. |
1100 1.1 christos `------------------------------------------------*/
1101 1.1 christos
1102 1.1 christos static void
1103 1.1 christos yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1104 1.1 christos {
1105 1.1 christos unsigned long int yylno = yyrline[yyrule];
1106 1.1 christos int yynrhs = yyr2[yyrule];
1107 1.1 christos int yyi;
1108 1.1 christos YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1109 1.1 christos yyrule - 1, yylno);
1110 1.1 christos /* The symbols being reduced. */
1111 1.1 christos for (yyi = 0; yyi < yynrhs; yyi++)
1112 1.1 christos {
1113 1.1 christos YYFPRINTF (stderr, " $%d = ", yyi + 1);
1114 1.1 christos yy_symbol_print (stderr,
1115 1.1 christos yystos[yyssp[yyi + 1 - yynrhs]],
1116 1.1 christos &(yyvsp[(yyi + 1) - (yynrhs)])
1117 1.1 christos );
1118 1.1 christos YYFPRINTF (stderr, "\n");
1119 1.1 christos }
1120 1.1 christos }
1121 1.1 christos
1122 1.1 christos # define YY_REDUCE_PRINT(Rule) \
1123 1.1 christos do { \
1124 1.1 christos if (yydebug) \
1125 1.1 christos yy_reduce_print (yyssp, yyvsp, Rule); \
1126 1.1 christos } while (0)
1127 1.1 christos
1128 1.1 christos /* Nonzero means print parse trace. It is left uninitialized so that
1129 1.1 christos multiple parsers can coexist. */
1130 1.1 christos int yydebug;
1131 1.1 christos #else /* !YYDEBUG */
1132 1.1 christos # define YYDPRINTF(Args)
1133 1.1 christos # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1134 1.1 christos # define YY_STACK_PRINT(Bottom, Top)
1135 1.1 christos # define YY_REDUCE_PRINT(Rule)
1136 1.1 christos #endif /* !YYDEBUG */
1137 1.1 christos
1138 1.1 christos
1139 1.1 christos /* YYINITDEPTH -- initial size of the parser's stacks. */
1140 1.1 christos #ifndef YYINITDEPTH
1141 1.1 christos # define YYINITDEPTH 200
1142 1.1 christos #endif
1143 1.1 christos
1144 1.1 christos /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1145 1.1 christos if the built-in stack extension method is used).
1146 1.1 christos
1147 1.1 christos Do not make this value too large; the results are undefined if
1148 1.1 christos YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1149 1.1 christos evaluated with infinite-precision integer arithmetic. */
1150 1.1 christos
1151 1.1 christos #ifndef YYMAXDEPTH
1152 1.1 christos # define YYMAXDEPTH 10000
1153 1.1 christos #endif
1154 1.1 christos
1155 1.1 christos
1156 1.1 christos #if YYERROR_VERBOSE
1157 1.1 christos
1158 1.1 christos # ifndef yystrlen
1159 1.1 christos # if defined __GLIBC__ && defined _STRING_H
1160 1.1 christos # define yystrlen strlen
1161 1.1 christos # else
1162 1.1 christos /* Return the length of YYSTR. */
1163 1.1 christos static YYSIZE_T
1164 1.1 christos yystrlen (const char *yystr)
1165 1.1 christos {
1166 1.1 christos YYSIZE_T yylen;
1167 1.1 christos for (yylen = 0; yystr[yylen]; yylen++)
1168 1.1 christos continue;
1169 1.1 christos return yylen;
1170 1.1 christos }
1171 1.1 christos # endif
1172 1.1 christos # endif
1173 1.1 christos
1174 1.1 christos # ifndef yystpcpy
1175 1.1 christos # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1176 1.1 christos # define yystpcpy stpcpy
1177 1.1 christos # else
1178 1.1 christos /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1179 1.1 christos YYDEST. */
1180 1.1 christos static char *
1181 1.1 christos yystpcpy (char *yydest, const char *yysrc)
1182 1.1 christos {
1183 1.1 christos char *yyd = yydest;
1184 1.1 christos const char *yys = yysrc;
1185 1.1 christos
1186 1.1 christos while ((*yyd++ = *yys++) != '\0')
1187 1.1 christos continue;
1188 1.1 christos
1189 1.1 christos return yyd - 1;
1190 1.1 christos }
1191 1.1 christos # endif
1192 1.1 christos # endif
1193 1.1 christos
1194 1.1 christos # ifndef yytnamerr
1195 1.1 christos /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1196 1.1 christos quotes and backslashes, so that it's suitable for yyerror. The
1197 1.1 christos heuristic is that double-quoting is unnecessary unless the string
1198 1.1 christos contains an apostrophe, a comma, or backslash (other than
1199 1.1 christos backslash-backslash). YYSTR is taken from yytname. If YYRES is
1200 1.1 christos null, do not copy; instead, return the length of what the result
1201 1.1 christos would have been. */
1202 1.1 christos static YYSIZE_T
1203 1.1 christos yytnamerr (char *yyres, const char *yystr)
1204 1.1 christos {
1205 1.1 christos if (*yystr == '"')
1206 1.1 christos {
1207 1.1 christos YYSIZE_T yyn = 0;
1208 1.1 christos char const *yyp = yystr;
1209 1.1 christos
1210 1.1 christos for (;;)
1211 1.1 christos switch (*++yyp)
1212 1.1 christos {
1213 1.1 christos case '\'':
1214 1.1 christos case ',':
1215 1.1 christos goto do_not_strip_quotes;
1216 1.1 christos
1217 1.1 christos case '\\':
1218 1.1 christos if (*++yyp != '\\')
1219 1.1 christos goto do_not_strip_quotes;
1220 1.1 christos /* Fall through. */
1221 1.1 christos default:
1222 1.1 christos if (yyres)
1223 1.1 christos yyres[yyn] = *yyp;
1224 1.1 christos yyn++;
1225 1.1 christos break;
1226 1.1 christos
1227 1.1 christos case '"':
1228 1.1 christos if (yyres)
1229 1.1 christos yyres[yyn] = '\0';
1230 1.1 christos return yyn;
1231 1.1 christos }
1232 1.1 christos do_not_strip_quotes: ;
1233 1.1 christos }
1234 1.1 christos
1235 1.1 christos if (! yyres)
1236 1.1 christos return yystrlen (yystr);
1237 1.1 christos
1238 1.1 christos return yystpcpy (yyres, yystr) - yyres;
1239 1.1 christos }
1240 1.1 christos # endif
1241 1.1 christos
1242 1.1 christos /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1243 1.1 christos about the unexpected token YYTOKEN for the state stack whose top is
1244 1.1 christos YYSSP.
1245 1.1 christos
1246 1.1 christos Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1247 1.1 christos not large enough to hold the message. In that case, also set
1248 1.1 christos *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1249 1.1 christos required number of bytes is too large to store. */
1250 1.1 christos static int
1251 1.1 christos yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1252 1.1 christos yytype_int16 *yyssp, int yytoken)
1253 1.1 christos {
1254 1.1 christos YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1255 1.1 christos YYSIZE_T yysize = yysize0;
1256 1.1 christos enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1257 1.1 christos /* Internationalized format string. */
1258 1.1 christos const char *yyformat = YY_NULLPTR;
1259 1.1 christos /* Arguments of yyformat. */
1260 1.1 christos char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1261 1.1 christos /* Number of reported tokens (one for the "unexpected", one per
1262 1.1 christos "expected"). */
1263 1.1 christos int yycount = 0;
1264 1.1 christos
1265 1.1 christos /* There are many possibilities here to consider:
1266 1.1 christos - If this state is a consistent state with a default action, then
1267 1.1 christos the only way this function was invoked is if the default action
1268 1.1 christos is an error action. In that case, don't check for expected
1269 1.1 christos tokens because there are none.
1270 1.1 christos - The only way there can be no lookahead present (in yychar) is if
1271 1.1 christos this state is a consistent state with a default action. Thus,
1272 1.1 christos detecting the absence of a lookahead is sufficient to determine
1273 1.1 christos that there is no unexpected or expected token to report. In that
1274 1.1 christos case, just report a simple "syntax error".
1275 1.1 christos - Don't assume there isn't a lookahead just because this state is a
1276 1.1 christos consistent state with a default action. There might have been a
1277 1.1 christos previous inconsistent state, consistent state with a non-default
1278 1.1 christos action, or user semantic action that manipulated yychar.
1279 1.1 christos - Of course, the expected token list depends on states to have
1280 1.1 christos correct lookahead information, and it depends on the parser not
1281 1.1 christos to perform extra reductions after fetching a lookahead from the
1282 1.1 christos scanner and before detecting a syntax error. Thus, state merging
1283 1.1 christos (from LALR or IELR) and default reductions corrupt the expected
1284 1.1 christos token list. However, the list is correct for canonical LR with
1285 1.1 christos one exception: it will still contain any token that will not be
1286 1.1 christos accepted due to an error action in a later state.
1287 1.1 christos */
1288 1.1 christos if (yytoken != YYEMPTY)
1289 1.1 christos {
1290 1.1 christos int yyn = yypact[*yyssp];
1291 1.1 christos yyarg[yycount++] = yytname[yytoken];
1292 1.1 christos if (!yypact_value_is_default (yyn))
1293 1.1 christos {
1294 1.1 christos /* Start YYX at -YYN if negative to avoid negative indexes in
1295 1.1 christos YYCHECK. In other words, skip the first -YYN actions for
1296 1.1 christos this state because they are default actions. */
1297 1.1 christos int yyxbegin = yyn < 0 ? -yyn : 0;
1298 1.1 christos /* Stay within bounds of both yycheck and yytname. */
1299 1.1 christos int yychecklim = YYLAST - yyn + 1;
1300 1.1 christos int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1301 1.1 christos int yyx;
1302 1.1 christos
1303 1.1 christos for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1304 1.1 christos if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1305 1.1 christos && !yytable_value_is_error (yytable[yyx + yyn]))
1306 1.1 christos {
1307 1.1 christos if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1308 1.1 christos {
1309 1.1 christos yycount = 1;
1310 1.1 christos yysize = yysize0;
1311 1.1 christos break;
1312 1.1 christos }
1313 1.1 christos yyarg[yycount++] = yytname[yyx];
1314 1.1 christos {
1315 1.1 christos YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1316 1.1 christos if (! (yysize <= yysize1
1317 1.1 christos && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1318 1.1 christos return 2;
1319 1.1 christos yysize = yysize1;
1320 1.1 christos }
1321 1.1 christos }
1322 1.1 christos }
1323 1.1 christos }
1324 1.1 christos
1325 1.1 christos switch (yycount)
1326 1.1 christos {
1327 1.1 christos # define YYCASE_(N, S) \
1328 1.1 christos case N: \
1329 1.1 christos yyformat = S; \
1330 1.1 christos break
1331 1.5 christos default: /* Avoid compiler warnings. */
1332 1.1 christos YYCASE_(0, YY_("syntax error"));
1333 1.1 christos YYCASE_(1, YY_("syntax error, unexpected %s"));
1334 1.1 christos YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1335 1.1 christos YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1336 1.1 christos YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1337 1.1 christos YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1338 1.1 christos # undef YYCASE_
1339 1.1 christos }
1340 1.1 christos
1341 1.1 christos {
1342 1.1 christos YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1343 1.1 christos if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1344 1.1 christos return 2;
1345 1.1 christos yysize = yysize1;
1346 1.1 christos }
1347 1.1 christos
1348 1.1 christos if (*yymsg_alloc < yysize)
1349 1.1 christos {
1350 1.1 christos *yymsg_alloc = 2 * yysize;
1351 1.1 christos if (! (yysize <= *yymsg_alloc
1352 1.1 christos && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1353 1.1 christos *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1354 1.1 christos return 1;
1355 1.1 christos }
1356 1.1 christos
1357 1.1 christos /* Avoid sprintf, as that infringes on the user's name space.
1358 1.1 christos Don't have undefined behavior even if the translation
1359 1.1 christos produced a string with the wrong number of "%s"s. */
1360 1.1 christos {
1361 1.1 christos char *yyp = *yymsg;
1362 1.1 christos int yyi = 0;
1363 1.1 christos while ((*yyp = *yyformat) != '\0')
1364 1.1 christos if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1365 1.1 christos {
1366 1.1 christos yyp += yytnamerr (yyp, yyarg[yyi++]);
1367 1.1 christos yyformat += 2;
1368 1.1 christos }
1369 1.1 christos else
1370 1.1 christos {
1371 1.1 christos yyp++;
1372 1.1 christos yyformat++;
1373 1.1 christos }
1374 1.1 christos }
1375 1.1 christos return 0;
1376 1.1 christos }
1377 1.1 christos #endif /* YYERROR_VERBOSE */
1378 1.1 christos
1379 1.1 christos /*-----------------------------------------------.
1380 1.1 christos | Release the memory associated to this symbol. |
1381 1.1 christos `-----------------------------------------------*/
1382 1.1 christos
1383 1.1 christos static void
1384 1.1 christos yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1385 1.1 christos {
1386 1.1 christos YYUSE (yyvaluep);
1387 1.1 christos if (!yymsg)
1388 1.1 christos yymsg = "Deleting";
1389 1.1 christos YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1390 1.1 christos
1391 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1392 1.1 christos YYUSE (yytype);
1393 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
1394 1.1 christos }
1395 1.1 christos
1396 1.1 christos
1397 1.1 christos
1398 1.1 christos
1399 1.1 christos /* The lookahead symbol. */
1400 1.1 christos int yychar;
1401 1.1 christos
1402 1.1 christos /* The semantic value of the lookahead symbol. */
1403 1.1 christos YYSTYPE yylval;
1404 1.1 christos /* Number of syntax errors so far. */
1405 1.1 christos int yynerrs;
1406 1.1 christos
1407 1.1 christos
1408 1.1 christos /*----------.
1409 1.1 christos | yyparse. |
1410 1.1 christos `----------*/
1411 1.1 christos
1412 1.1 christos int
1413 1.1 christos yyparse (void)
1414 1.1 christos {
1415 1.1 christos int yystate;
1416 1.1 christos /* Number of tokens to shift before error messages enabled. */
1417 1.1 christos int yyerrstatus;
1418 1.1 christos
1419 1.1 christos /* The stacks and their tools:
1420 1.1 christos 'yyss': related to states.
1421 1.1 christos 'yyvs': related to semantic values.
1422 1.1 christos
1423 1.1 christos Refer to the stacks through separate pointers, to allow yyoverflow
1424 1.1 christos to reallocate them elsewhere. */
1425 1.1 christos
1426 1.1 christos /* The state stack. */
1427 1.1 christos yytype_int16 yyssa[YYINITDEPTH];
1428 1.1 christos yytype_int16 *yyss;
1429 1.1 christos yytype_int16 *yyssp;
1430 1.1 christos
1431 1.1 christos /* The semantic value stack. */
1432 1.1 christos YYSTYPE yyvsa[YYINITDEPTH];
1433 1.1 christos YYSTYPE *yyvs;
1434 1.1 christos YYSTYPE *yyvsp;
1435 1.1 christos
1436 1.1 christos YYSIZE_T yystacksize;
1437 1.1 christos
1438 1.1 christos int yyn;
1439 1.1 christos int yyresult;
1440 1.1 christos /* Lookahead token as an internal (translated) token number. */
1441 1.1 christos int yytoken = 0;
1442 1.1 christos /* The variables used to return semantic value and location from the
1443 1.1 christos action routines. */
1444 1.1 christos YYSTYPE yyval;
1445 1.1 christos
1446 1.1 christos #if YYERROR_VERBOSE
1447 1.1 christos /* Buffer for error messages, and its allocated size. */
1448 1.1 christos char yymsgbuf[128];
1449 1.1 christos char *yymsg = yymsgbuf;
1450 1.1 christos YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1451 1.1 christos #endif
1452 1.1 christos
1453 1.1 christos #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1454 1.1 christos
1455 1.1 christos /* The number of symbols on the RHS of the reduced rule.
1456 1.1 christos Keep to zero when no symbol should be popped. */
1457 1.1 christos int yylen = 0;
1458 1.1 christos
1459 1.1 christos yyssp = yyss = yyssa;
1460 1.1 christos yyvsp = yyvs = yyvsa;
1461 1.1 christos yystacksize = YYINITDEPTH;
1462 1.1 christos
1463 1.1 christos YYDPRINTF ((stderr, "Starting parse\n"));
1464 1.1 christos
1465 1.1 christos yystate = 0;
1466 1.1 christos yyerrstatus = 0;
1467 1.1 christos yynerrs = 0;
1468 1.1 christos yychar = YYEMPTY; /* Cause a token to be read. */
1469 1.1 christos goto yysetstate;
1470 1.1 christos
1471 1.1 christos /*------------------------------------------------------------.
1472 1.1 christos | yynewstate -- Push a new state, which is found in yystate. |
1473 1.1 christos `------------------------------------------------------------*/
1474 1.1 christos yynewstate:
1475 1.1 christos /* In all cases, when you get here, the value and location stacks
1476 1.1 christos have just been pushed. So pushing a state here evens the stacks. */
1477 1.1 christos yyssp++;
1478 1.1 christos
1479 1.1 christos yysetstate:
1480 1.1 christos *yyssp = yystate;
1481 1.1 christos
1482 1.1 christos if (yyss + yystacksize - 1 <= yyssp)
1483 1.1 christos {
1484 1.1 christos /* Get the current used size of the three stacks, in elements. */
1485 1.1 christos YYSIZE_T yysize = yyssp - yyss + 1;
1486 1.1 christos
1487 1.1 christos #ifdef yyoverflow
1488 1.1 christos {
1489 1.1 christos /* Give user a chance to reallocate the stack. Use copies of
1490 1.1 christos these so that the &'s don't force the real ones into
1491 1.1 christos memory. */
1492 1.1 christos YYSTYPE *yyvs1 = yyvs;
1493 1.1 christos yytype_int16 *yyss1 = yyss;
1494 1.1 christos
1495 1.1 christos /* Each stack pointer address is followed by the size of the
1496 1.1 christos data in use in that stack, in bytes. This used to be a
1497 1.1 christos conditional around just the two extra args, but that might
1498 1.1 christos be undefined if yyoverflow is a macro. */
1499 1.1 christos yyoverflow (YY_("memory exhausted"),
1500 1.1 christos &yyss1, yysize * sizeof (*yyssp),
1501 1.1 christos &yyvs1, yysize * sizeof (*yyvsp),
1502 1.1 christos &yystacksize);
1503 1.1 christos
1504 1.1 christos yyss = yyss1;
1505 1.1 christos yyvs = yyvs1;
1506 1.1 christos }
1507 1.1 christos #else /* no yyoverflow */
1508 1.1 christos # ifndef YYSTACK_RELOCATE
1509 1.1 christos goto yyexhaustedlab;
1510 1.1 christos # else
1511 1.1 christos /* Extend the stack our own way. */
1512 1.1 christos if (YYMAXDEPTH <= yystacksize)
1513 1.1 christos goto yyexhaustedlab;
1514 1.1 christos yystacksize *= 2;
1515 1.1 christos if (YYMAXDEPTH < yystacksize)
1516 1.1 christos yystacksize = YYMAXDEPTH;
1517 1.1 christos
1518 1.1 christos {
1519 1.1 christos yytype_int16 *yyss1 = yyss;
1520 1.1 christos union yyalloc *yyptr =
1521 1.1 christos (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1522 1.1 christos if (! yyptr)
1523 1.1 christos goto yyexhaustedlab;
1524 1.1 christos YYSTACK_RELOCATE (yyss_alloc, yyss);
1525 1.1 christos YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1526 1.1 christos # undef YYSTACK_RELOCATE
1527 1.1 christos if (yyss1 != yyssa)
1528 1.1 christos YYSTACK_FREE (yyss1);
1529 1.1 christos }
1530 1.1 christos # endif
1531 1.1 christos #endif /* no yyoverflow */
1532 1.1 christos
1533 1.1 christos yyssp = yyss + yysize - 1;
1534 1.1 christos yyvsp = yyvs + yysize - 1;
1535 1.1 christos
1536 1.1 christos YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1537 1.1 christos (unsigned long int) yystacksize));
1538 1.1 christos
1539 1.1 christos if (yyss + yystacksize - 1 <= yyssp)
1540 1.1 christos YYABORT;
1541 1.1 christos }
1542 1.1 christos
1543 1.1 christos YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1544 1.1 christos
1545 1.1 christos if (yystate == YYFINAL)
1546 1.1 christos YYACCEPT;
1547 1.1 christos
1548 1.1 christos goto yybackup;
1549 1.1 christos
1550 1.1 christos /*-----------.
1551 1.1 christos | yybackup. |
1552 1.1 christos `-----------*/
1553 1.1 christos yybackup:
1554 1.1 christos
1555 1.1 christos /* Do appropriate processing given the current state. Read a
1556 1.1 christos lookahead token if we need one and don't already have one. */
1557 1.1 christos
1558 1.1 christos /* First try to decide what to do without reference to lookahead token. */
1559 1.1 christos yyn = yypact[yystate];
1560 1.1 christos if (yypact_value_is_default (yyn))
1561 1.1 christos goto yydefault;
1562 1.1 christos
1563 1.1 christos /* Not known => get a lookahead token if don't already have one. */
1564 1.1 christos
1565 1.1 christos /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1566 1.1 christos if (yychar == YYEMPTY)
1567 1.1 christos {
1568 1.1 christos YYDPRINTF ((stderr, "Reading a token: "));
1569 1.1 christos yychar = yylex ();
1570 1.1 christos }
1571 1.1 christos
1572 1.1 christos if (yychar <= YYEOF)
1573 1.1 christos {
1574 1.1 christos yychar = yytoken = YYEOF;
1575 1.1 christos YYDPRINTF ((stderr, "Now at end of input.\n"));
1576 1.1 christos }
1577 1.1 christos else
1578 1.1 christos {
1579 1.1 christos yytoken = YYTRANSLATE (yychar);
1580 1.1 christos YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1581 1.1 christos }
1582 1.1 christos
1583 1.1 christos /* If the proper action on seeing token YYTOKEN is to reduce or to
1584 1.1 christos detect an error, take that action. */
1585 1.1 christos yyn += yytoken;
1586 1.1 christos if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1587 1.1 christos goto yydefault;
1588 1.1 christos yyn = yytable[yyn];
1589 1.1 christos if (yyn <= 0)
1590 1.1 christos {
1591 1.1 christos if (yytable_value_is_error (yyn))
1592 1.1 christos goto yyerrlab;
1593 1.1 christos yyn = -yyn;
1594 1.1 christos goto yyreduce;
1595 1.1 christos }
1596 1.1 christos
1597 1.1 christos /* Count tokens shifted since error; after three, turn off error
1598 1.1 christos status. */
1599 1.1 christos if (yyerrstatus)
1600 1.1 christos yyerrstatus--;
1601 1.1 christos
1602 1.1 christos /* Shift the lookahead token. */
1603 1.1 christos YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1604 1.1 christos
1605 1.1 christos /* Discard the shifted token. */
1606 1.1 christos yychar = YYEMPTY;
1607 1.1 christos
1608 1.1 christos yystate = yyn;
1609 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1610 1.1 christos *++yyvsp = yylval;
1611 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
1612 1.1 christos
1613 1.1 christos goto yynewstate;
1614 1.1 christos
1615 1.1 christos
1616 1.1 christos /*-----------------------------------------------------------.
1617 1.1 christos | yydefault -- do the default action for the current state. |
1618 1.1 christos `-----------------------------------------------------------*/
1619 1.1 christos yydefault:
1620 1.1 christos yyn = yydefact[yystate];
1621 1.1 christos if (yyn == 0)
1622 1.1 christos goto yyerrlab;
1623 1.1 christos goto yyreduce;
1624 1.1 christos
1625 1.1 christos
1626 1.1 christos /*-----------------------------.
1627 1.1 christos | yyreduce -- Do a reduction. |
1628 1.1 christos `-----------------------------*/
1629 1.1 christos yyreduce:
1630 1.1 christos /* yyn is the number of a rule to reduce with. */
1631 1.1 christos yylen = yyr2[yyn];
1632 1.1 christos
1633 1.1 christos /* If YYLEN is nonzero, implement the default value of the action:
1634 1.1 christos '$$ = $1'.
1635 1.1 christos
1636 1.1 christos Otherwise, the following line sets YYVAL to garbage.
1637 1.1 christos This behavior is undocumented and Bison
1638 1.1 christos users should not rely upon it. Assigning to YYVAL
1639 1.1 christos unconditionally makes the parser a bit smaller, and it avoids a
1640 1.1 christos GCC warning that YYVAL may be used uninitialized. */
1641 1.1 christos yyval = yyvsp[1-yylen];
1642 1.1 christos
1643 1.1 christos
1644 1.1 christos YY_REDUCE_PRINT (yyn);
1645 1.1 christos switch (yyn)
1646 1.1 christos {
1647 1.6 christos case 13:
1648 1.6 christos #line 183 "configparser.y" /* yacc.c:1648 */
1649 1.6 christos {
1650 1.6 christos struct ip_address_option *ip = cfg_parser->opt->ip_addresses;
1651 1.6 christos if(ip == NULL) {
1652 1.6 christos cfg_parser->opt->ip_addresses = (yyvsp[0].ip);
1653 1.6 christos } else {
1654 1.6 christos while(ip->next) { ip = ip->next; }
1655 1.6 christos ip->next = (yyvsp[0].ip);
1656 1.6 christos }
1657 1.6 christos }
1658 1.6 christos #line 1659 "configparser.c" /* yacc.c:1648 */
1659 1.1 christos break;
1660 1.1 christos
1661 1.6 christos case 14:
1662 1.6 christos #line 193 "configparser.y" /* yacc.c:1648 */
1663 1.6 christos {
1664 1.6 christos if ((yyvsp[0].llng) > 0) {
1665 1.6 christos cfg_parser->opt->server_count = (int)(yyvsp[0].llng);
1666 1.6 christos } else {
1667 1.6 christos yyerror("expected a number greater than zero");
1668 1.6 christos }
1669 1.6 christos }
1670 1.6 christos #line 1671 "configparser.c" /* yacc.c:1648 */
1671 1.1 christos break;
1672 1.1 christos
1673 1.6 christos case 15:
1674 1.6 christos #line 201 "configparser.y" /* yacc.c:1648 */
1675 1.6 christos { cfg_parser->opt->ip_transparent = (int)(yyvsp[0].bln); }
1676 1.6 christos #line 1677 "configparser.c" /* yacc.c:1648 */
1677 1.1 christos break;
1678 1.1 christos
1679 1.6 christos case 16:
1680 1.6 christos #line 203 "configparser.y" /* yacc.c:1648 */
1681 1.6 christos { cfg_parser->opt->ip_freebind = (yyvsp[0].bln); }
1682 1.6 christos #line 1683 "configparser.c" /* yacc.c:1648 */
1683 1.1 christos break;
1684 1.1 christos
1685 1.6 christos case 17:
1686 1.6 christos #line 205 "configparser.y" /* yacc.c:1648 */
1687 1.6 christos { cfg_parser->opt->send_buffer_size = (int)(yyvsp[0].llng); }
1688 1.6 christos #line 1689 "configparser.c" /* yacc.c:1648 */
1689 1.3 christos break;
1690 1.3 christos
1691 1.6 christos case 18:
1692 1.6 christos #line 207 "configparser.y" /* yacc.c:1648 */
1693 1.6 christos { cfg_parser->opt->receive_buffer_size = (int)(yyvsp[0].llng); }
1694 1.6 christos #line 1695 "configparser.c" /* yacc.c:1648 */
1695 1.1 christos break;
1696 1.1 christos
1697 1.6 christos case 19:
1698 1.6 christos #line 209 "configparser.y" /* yacc.c:1648 */
1699 1.6 christos { cfg_parser->opt->debug_mode = (yyvsp[0].bln); }
1700 1.6 christos #line 1701 "configparser.c" /* yacc.c:1648 */
1701 1.1 christos break;
1702 1.1 christos
1703 1.6 christos case 20:
1704 1.6 christos #line 211 "configparser.y" /* yacc.c:1648 */
1705 1.6 christos { /* ignored, deprecated */ }
1706 1.6 christos #line 1707 "configparser.c" /* yacc.c:1648 */
1707 1.1 christos break;
1708 1.1 christos
1709 1.6 christos case 21:
1710 1.6 christos #line 213 "configparser.y" /* yacc.c:1648 */
1711 1.6 christos { cfg_parser->opt->hide_version = (yyvsp[0].bln); }
1712 1.6 christos #line 1713 "configparser.c" /* yacc.c:1648 */
1713 1.1 christos break;
1714 1.1 christos
1715 1.6 christos case 22:
1716 1.6 christos #line 215 "configparser.y" /* yacc.c:1648 */
1717 1.6 christos { cfg_parser->opt->hide_identity = (yyvsp[0].bln); }
1718 1.6 christos #line 1719 "configparser.c" /* yacc.c:1648 */
1719 1.1 christos break;
1720 1.1 christos
1721 1.6 christos case 23:
1722 1.6 christos #line 217 "configparser.y" /* yacc.c:1648 */
1723 1.6 christos { if((yyvsp[0].bln)) { cfg_parser->opt->do_ip4 = 1; cfg_parser->opt->do_ip6 = 0; } }
1724 1.6 christos #line 1725 "configparser.c" /* yacc.c:1648 */
1725 1.1 christos break;
1726 1.1 christos
1727 1.6 christos case 24:
1728 1.5 christos #line 219 "configparser.y" /* yacc.c:1648 */
1729 1.6 christos { if((yyvsp[0].bln)) { cfg_parser->opt->do_ip4 = 0; cfg_parser->opt->do_ip6 = 1; } }
1730 1.6 christos #line 1731 "configparser.c" /* yacc.c:1648 */
1731 1.1 christos break;
1732 1.1 christos
1733 1.6 christos case 25:
1734 1.6 christos #line 221 "configparser.y" /* yacc.c:1648 */
1735 1.6 christos { cfg_parser->opt->do_ip4 = (yyvsp[0].bln); }
1736 1.6 christos #line 1737 "configparser.c" /* yacc.c:1648 */
1737 1.1 christos break;
1738 1.1 christos
1739 1.6 christos case 26:
1740 1.6 christos #line 223 "configparser.y" /* yacc.c:1648 */
1741 1.6 christos { cfg_parser->opt->do_ip6 = (yyvsp[0].bln); }
1742 1.6 christos #line 1743 "configparser.c" /* yacc.c:1648 */
1743 1.1 christos break;
1744 1.1 christos
1745 1.6 christos case 27:
1746 1.6 christos #line 225 "configparser.y" /* yacc.c:1648 */
1747 1.6 christos {
1748 1.6 christos cfg_parser->opt->database = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
1749 1.6 christos if(cfg_parser->opt->database[0] == 0 &&
1750 1.6 christos cfg_parser->opt->zonefiles_write == 0)
1751 1.6 christos {
1752 1.6 christos cfg_parser->opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL;
1753 1.6 christos }
1754 1.6 christos }
1755 1.6 christos #line 1756 "configparser.c" /* yacc.c:1648 */
1756 1.1 christos break;
1757 1.1 christos
1758 1.6 christos case 28:
1759 1.6 christos #line 234 "configparser.y" /* yacc.c:1648 */
1760 1.6 christos { cfg_parser->opt->identity = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1761 1.6 christos #line 1762 "configparser.c" /* yacc.c:1648 */
1762 1.1 christos break;
1763 1.1 christos
1764 1.6 christos case 29:
1765 1.6 christos #line 236 "configparser.y" /* yacc.c:1648 */
1766 1.6 christos { cfg_parser->opt->version = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1767 1.6 christos #line 1768 "configparser.c" /* yacc.c:1648 */
1768 1.1 christos break;
1769 1.1 christos
1770 1.6 christos case 30:
1771 1.6 christos #line 238 "configparser.y" /* yacc.c:1648 */
1772 1.6 christos {
1773 1.6 christos unsigned char* nsid = 0;
1774 1.6 christos size_t nsid_len = strlen((yyvsp[0].str));
1775 1.6 christos
1776 1.6 christos if (strncasecmp((yyvsp[0].str), "ascii_", 6) == 0) {
1777 1.6 christos nsid_len -= 6; /* discard "ascii_" */
1778 1.6 christos if(nsid_len < 65535) {
1779 1.6 christos cfg_parser->opt->nsid = region_alloc(cfg_parser->opt->region, nsid_len*2+1);
1780 1.6 christos hex_ntop((uint8_t*)(yyvsp[0].str)+6, nsid_len, (char*)cfg_parser->opt->nsid, nsid_len*2+1);
1781 1.6 christos } else {
1782 1.6 christos yyerror("NSID too long");
1783 1.6 christos }
1784 1.6 christos } else if (nsid_len % 2 != 0) {
1785 1.6 christos yyerror("the NSID must be a hex string of an even length.");
1786 1.6 christos } else {
1787 1.6 christos nsid_len = nsid_len / 2;
1788 1.6 christos if(nsid_len < 65535) {
1789 1.6 christos nsid = xalloc(nsid_len);
1790 1.6 christos if (hex_pton((yyvsp[0].str), nsid, nsid_len) == -1) {
1791 1.6 christos yyerror("hex string cannot be parsed in NSID.");
1792 1.6 christos } else {
1793 1.6 christos cfg_parser->opt->nsid = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
1794 1.6 christos }
1795 1.6 christos free(nsid);
1796 1.6 christos } else {
1797 1.6 christos yyerror("NSID too long");
1798 1.6 christos }
1799 1.6 christos }
1800 1.6 christos }
1801 1.6 christos #line 1802 "configparser.c" /* yacc.c:1648 */
1802 1.1 christos break;
1803 1.1 christos
1804 1.6 christos case 31:
1805 1.6 christos #line 268 "configparser.y" /* yacc.c:1648 */
1806 1.6 christos { cfg_parser->opt->logfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1807 1.6 christos #line 1808 "configparser.c" /* yacc.c:1648 */
1808 1.3 christos break;
1809 1.3 christos
1810 1.6 christos case 32:
1811 1.6 christos #line 270 "configparser.y" /* yacc.c:1648 */
1812 1.6 christos {
1813 1.6 christos if ((yyvsp[0].llng) > 0) {
1814 1.6 christos cfg_parser->opt->tcp_count = (int)(yyvsp[0].llng);
1815 1.6 christos } else {
1816 1.6 christos yyerror("expected a number greater than zero");
1817 1.6 christos }
1818 1.6 christos }
1819 1.6 christos #line 1820 "configparser.c" /* yacc.c:1648 */
1820 1.3 christos break;
1821 1.3 christos
1822 1.6 christos case 33:
1823 1.6 christos #line 278 "configparser.y" /* yacc.c:1648 */
1824 1.6 christos { cfg_parser->opt->tcp_reject_overflow = (yyvsp[0].bln); }
1825 1.6 christos #line 1826 "configparser.c" /* yacc.c:1648 */
1826 1.1 christos break;
1827 1.1 christos
1828 1.6 christos case 34:
1829 1.6 christos #line 280 "configparser.y" /* yacc.c:1648 */
1830 1.6 christos { cfg_parser->opt->tcp_query_count = (int)(yyvsp[0].llng); }
1831 1.6 christos #line 1832 "configparser.c" /* yacc.c:1648 */
1832 1.1 christos break;
1833 1.1 christos
1834 1.6 christos case 35:
1835 1.6 christos #line 282 "configparser.y" /* yacc.c:1648 */
1836 1.6 christos { cfg_parser->opt->tcp_timeout = (int)(yyvsp[0].llng); }
1837 1.6 christos #line 1838 "configparser.c" /* yacc.c:1648 */
1838 1.1 christos break;
1839 1.1 christos
1840 1.6 christos case 36:
1841 1.6 christos #line 284 "configparser.y" /* yacc.c:1648 */
1842 1.6 christos { cfg_parser->opt->tcp_mss = (int)(yyvsp[0].llng); }
1843 1.6 christos #line 1844 "configparser.c" /* yacc.c:1648 */
1844 1.1 christos break;
1845 1.1 christos
1846 1.6 christos case 37:
1847 1.6 christos #line 286 "configparser.y" /* yacc.c:1648 */
1848 1.6 christos { cfg_parser->opt->outgoing_tcp_mss = (int)(yyvsp[0].llng); }
1849 1.6 christos #line 1850 "configparser.c" /* yacc.c:1648 */
1850 1.1 christos break;
1851 1.1 christos
1852 1.6 christos case 38:
1853 1.6 christos #line 288 "configparser.y" /* yacc.c:1648 */
1854 1.6 christos { cfg_parser->opt->ipv4_edns_size = (size_t)(yyvsp[0].llng); }
1855 1.6 christos #line 1856 "configparser.c" /* yacc.c:1648 */
1856 1.1 christos break;
1857 1.1 christos
1858 1.6 christos case 39:
1859 1.6 christos #line 290 "configparser.y" /* yacc.c:1648 */
1860 1.6 christos { cfg_parser->opt->ipv6_edns_size = (size_t)(yyvsp[0].llng); }
1861 1.6 christos #line 1862 "configparser.c" /* yacc.c:1648 */
1862 1.1 christos break;
1863 1.1 christos
1864 1.6 christos case 40:
1865 1.6 christos #line 292 "configparser.y" /* yacc.c:1648 */
1866 1.6 christos { cfg_parser->opt->pidfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1867 1.6 christos #line 1868 "configparser.c" /* yacc.c:1648 */
1868 1.1 christos break;
1869 1.1 christos
1870 1.6 christos case 41:
1871 1.6 christos #line 294 "configparser.y" /* yacc.c:1648 */
1872 1.6 christos {
1873 1.6 christos /* port number, stored as a string */
1874 1.6 christos char buf[16];
1875 1.6 christos (void)snprintf(buf, sizeof(buf), "%lld", (yyvsp[0].llng));
1876 1.6 christos cfg_parser->opt->port = region_strdup(cfg_parser->opt->region, buf);
1877 1.6 christos }
1878 1.6 christos #line 1879 "configparser.c" /* yacc.c:1648 */
1879 1.1 christos break;
1880 1.1 christos
1881 1.6 christos case 42:
1882 1.6 christos #line 301 "configparser.y" /* yacc.c:1648 */
1883 1.6 christos { cfg_parser->opt->reuseport = (yyvsp[0].bln); }
1884 1.6 christos #line 1885 "configparser.c" /* yacc.c:1648 */
1885 1.1 christos break;
1886 1.1 christos
1887 1.6 christos case 43:
1888 1.6 christos #line 303 "configparser.y" /* yacc.c:1648 */
1889 1.6 christos { cfg_parser->opt->statistics = (int)(yyvsp[0].llng); }
1890 1.6 christos #line 1891 "configparser.c" /* yacc.c:1648 */
1891 1.1 christos break;
1892 1.1 christos
1893 1.6 christos case 44:
1894 1.6 christos #line 305 "configparser.y" /* yacc.c:1648 */
1895 1.6 christos { cfg_parser->opt->chroot = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1896 1.6 christos #line 1897 "configparser.c" /* yacc.c:1648 */
1897 1.1 christos break;
1898 1.1 christos
1899 1.6 christos case 45:
1900 1.6 christos #line 307 "configparser.y" /* yacc.c:1648 */
1901 1.6 christos { cfg_parser->opt->username = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1902 1.6 christos #line 1903 "configparser.c" /* yacc.c:1648 */
1903 1.1 christos break;
1904 1.1 christos
1905 1.6 christos case 46:
1906 1.6 christos #line 309 "configparser.y" /* yacc.c:1648 */
1907 1.6 christos { cfg_parser->opt->zonesdir = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1908 1.6 christos #line 1909 "configparser.c" /* yacc.c:1648 */
1909 1.1 christos break;
1910 1.1 christos
1911 1.6 christos case 47:
1912 1.6 christos #line 311 "configparser.y" /* yacc.c:1648 */
1913 1.6 christos { cfg_parser->opt->zonelistfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1914 1.6 christos #line 1915 "configparser.c" /* yacc.c:1648 */
1915 1.1 christos break;
1916 1.1 christos
1917 1.6 christos case 48:
1918 1.6 christos #line 313 "configparser.y" /* yacc.c:1648 */
1919 1.6 christos { /* ignored, deprecated */ }
1920 1.6 christos #line 1921 "configparser.c" /* yacc.c:1648 */
1921 1.1 christos break;
1922 1.1 christos
1923 1.6 christos case 49:
1924 1.6 christos #line 315 "configparser.y" /* yacc.c:1648 */
1925 1.6 christos { cfg_parser->opt->xfrdfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1926 1.6 christos #line 1927 "configparser.c" /* yacc.c:1648 */
1927 1.1 christos break;
1928 1.1 christos
1929 1.6 christos case 50:
1930 1.6 christos #line 317 "configparser.y" /* yacc.c:1648 */
1931 1.6 christos { cfg_parser->opt->xfrdir = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1932 1.6 christos #line 1933 "configparser.c" /* yacc.c:1648 */
1933 1.1 christos break;
1934 1.1 christos
1935 1.6 christos case 51:
1936 1.6 christos #line 319 "configparser.y" /* yacc.c:1648 */
1937 1.6 christos { cfg_parser->opt->xfrd_reload_timeout = (int)(yyvsp[0].llng); }
1938 1.6 christos #line 1939 "configparser.c" /* yacc.c:1648 */
1939 1.1 christos break;
1940 1.1 christos
1941 1.6 christos case 52:
1942 1.6 christos #line 321 "configparser.y" /* yacc.c:1648 */
1943 1.6 christos { cfg_parser->opt->verbosity = (int)(yyvsp[0].llng); }
1944 1.6 christos #line 1945 "configparser.c" /* yacc.c:1648 */
1945 1.1 christos break;
1946 1.1 christos
1947 1.6 christos case 53:
1948 1.6 christos #line 323 "configparser.y" /* yacc.c:1648 */
1949 1.6 christos {
1950 1.1 christos #ifdef RATELIMIT
1951 1.6 christos if ((yyvsp[0].llng) > 0) {
1952 1.6 christos cfg_parser->opt->rrl_size = (size_t)(yyvsp[0].llng);
1953 1.6 christos } else {
1954 1.6 christos yyerror("expected a number greater than zero");
1955 1.6 christos }
1956 1.1 christos #endif
1957 1.6 christos }
1958 1.6 christos #line 1959 "configparser.c" /* yacc.c:1648 */
1959 1.1 christos break;
1960 1.1 christos
1961 1.6 christos case 54:
1962 1.6 christos #line 333 "configparser.y" /* yacc.c:1648 */
1963 1.6 christos {
1964 1.1 christos #ifdef RATELIMIT
1965 1.6 christos cfg_parser->opt->rrl_ratelimit = (size_t)(yyvsp[0].llng);
1966 1.1 christos #endif
1967 1.6 christos }
1968 1.6 christos #line 1969 "configparser.c" /* yacc.c:1648 */
1969 1.1 christos break;
1970 1.1 christos
1971 1.6 christos case 55:
1972 1.6 christos #line 339 "configparser.y" /* yacc.c:1648 */
1973 1.6 christos {
1974 1.1 christos #ifdef RATELIMIT
1975 1.6 christos cfg_parser->opt->rrl_slip = (size_t)(yyvsp[0].llng);
1976 1.1 christos #endif
1977 1.6 christos }
1978 1.6 christos #line 1979 "configparser.c" /* yacc.c:1648 */
1979 1.1 christos break;
1980 1.1 christos
1981 1.6 christos case 56:
1982 1.6 christos #line 345 "configparser.y" /* yacc.c:1648 */
1983 1.1 christos {
1984 1.1 christos #ifdef RATELIMIT
1985 1.6 christos if ((yyvsp[0].llng) > 32) {
1986 1.6 christos yyerror("invalid IPv4 prefix length");
1987 1.6 christos } else {
1988 1.6 christos cfg_parser->opt->rrl_ipv4_prefix_length = (size_t)(yyvsp[0].llng);
1989 1.6 christos }
1990 1.1 christos #endif
1991 1.6 christos }
1992 1.6 christos #line 1993 "configparser.c" /* yacc.c:1648 */
1993 1.1 christos break;
1994 1.1 christos
1995 1.6 christos case 57:
1996 1.6 christos #line 355 "configparser.y" /* yacc.c:1648 */
1997 1.1 christos {
1998 1.1 christos #ifdef RATELIMIT
1999 1.6 christos if ((yyvsp[0].llng) > 64) {
2000 1.6 christos yyerror("invalid IPv6 prefix length");
2001 1.6 christos } else {
2002 1.6 christos cfg_parser->opt->rrl_ipv6_prefix_length = (size_t)(yyvsp[0].llng);
2003 1.6 christos }
2004 1.1 christos #endif
2005 1.6 christos }
2006 1.6 christos #line 2007 "configparser.c" /* yacc.c:1648 */
2007 1.1 christos break;
2008 1.1 christos
2009 1.6 christos case 58:
2010 1.6 christos #line 365 "configparser.y" /* yacc.c:1648 */
2011 1.6 christos {
2012 1.1 christos #ifdef RATELIMIT
2013 1.6 christos cfg_parser->opt->rrl_whitelist_ratelimit = (size_t)(yyvsp[0].llng);
2014 1.1 christos #endif
2015 1.6 christos }
2016 1.6 christos #line 2017 "configparser.c" /* yacc.c:1648 */
2017 1.1 christos break;
2018 1.1 christos
2019 1.6 christos case 59:
2020 1.6 christos #line 371 "configparser.y" /* yacc.c:1648 */
2021 1.6 christos { cfg_parser->opt->zonefiles_check = (yyvsp[0].bln); }
2022 1.6 christos #line 2023 "configparser.c" /* yacc.c:1648 */
2023 1.1 christos break;
2024 1.1 christos
2025 1.6 christos case 60:
2026 1.6 christos #line 373 "configparser.y" /* yacc.c:1648 */
2027 1.6 christos { cfg_parser->opt->zonefiles_write = (int)(yyvsp[0].llng); }
2028 1.6 christos #line 2029 "configparser.c" /* yacc.c:1648 */
2029 1.1 christos break;
2030 1.1 christos
2031 1.6 christos case 61:
2032 1.6 christos #line 375 "configparser.y" /* yacc.c:1648 */
2033 1.1 christos {
2034 1.6 christos cfg_parser->opt->log_time_ascii = (yyvsp[0].bln);
2035 1.6 christos log_time_asc = cfg_parser->opt->log_time_ascii;
2036 1.6 christos }
2037 1.6 christos #line 2038 "configparser.c" /* yacc.c:1648 */
2038 1.1 christos break;
2039 1.1 christos
2040 1.6 christos case 62:
2041 1.6 christos #line 380 "configparser.y" /* yacc.c:1648 */
2042 1.1 christos {
2043 1.6 christos cfg_parser->opt->round_robin = (yyvsp[0].bln);
2044 1.6 christos round_robin = cfg_parser->opt->round_robin;
2045 1.6 christos }
2046 1.6 christos #line 2047 "configparser.c" /* yacc.c:1648 */
2047 1.1 christos break;
2048 1.1 christos
2049 1.6 christos case 63:
2050 1.6 christos #line 385 "configparser.y" /* yacc.c:1648 */
2051 1.1 christos {
2052 1.6 christos cfg_parser->opt->minimal_responses = (yyvsp[0].bln);
2053 1.6 christos minimal_responses = cfg_parser->opt->minimal_responses;
2054 1.6 christos }
2055 1.6 christos #line 2056 "configparser.c" /* yacc.c:1648 */
2056 1.6 christos break;
2057 1.6 christos
2058 1.6 christos case 64:
2059 1.6 christos #line 390 "configparser.y" /* yacc.c:1648 */
2060 1.6 christos { cfg_parser->opt->confine_to_zone = (yyvsp[0].bln); }
2061 1.6 christos #line 2062 "configparser.c" /* yacc.c:1648 */
2062 1.6 christos break;
2063 1.6 christos
2064 1.6 christos case 65:
2065 1.6 christos #line 392 "configparser.y" /* yacc.c:1648 */
2066 1.6 christos { cfg_parser->opt->refuse_any = (yyvsp[0].bln); }
2067 1.6 christos #line 2068 "configparser.c" /* yacc.c:1648 */
2068 1.6 christos break;
2069 1.6 christos
2070 1.6 christos case 66:
2071 1.6 christos #line 394 "configparser.y" /* yacc.c:1648 */
2072 1.6 christos { cfg_parser->opt->tls_service_key = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2073 1.6 christos #line 2074 "configparser.c" /* yacc.c:1648 */
2074 1.6 christos break;
2075 1.6 christos
2076 1.6 christos case 67:
2077 1.6 christos #line 396 "configparser.y" /* yacc.c:1648 */
2078 1.6 christos { cfg_parser->opt->tls_service_ocsp = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2079 1.6 christos #line 2080 "configparser.c" /* yacc.c:1648 */
2080 1.6 christos break;
2081 1.6 christos
2082 1.6 christos case 68:
2083 1.6 christos #line 398 "configparser.y" /* yacc.c:1648 */
2084 1.6 christos { cfg_parser->opt->tls_service_pem = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2085 1.6 christos #line 2086 "configparser.c" /* yacc.c:1648 */
2086 1.1 christos break;
2087 1.1 christos
2088 1.6 christos case 69:
2089 1.6 christos #line 400 "configparser.y" /* yacc.c:1648 */
2090 1.1 christos {
2091 1.6 christos /* port number, stored as string */
2092 1.6 christos char buf[16];
2093 1.6 christos (void)snprintf(buf, sizeof(buf), "%lld", (yyvsp[0].llng));
2094 1.6 christos cfg_parser->opt->tls_port = region_strdup(cfg_parser->opt->region, buf);
2095 1.6 christos }
2096 1.6 christos #line 2097 "configparser.c" /* yacc.c:1648 */
2097 1.6 christos break;
2098 1.6 christos
2099 1.6 christos case 73:
2100 1.6 christos #line 416 "configparser.y" /* yacc.c:1648 */
2101 1.6 christos { cfg_parser->opt->dnstap_enable = (yyvsp[0].bln); }
2102 1.6 christos #line 2103 "configparser.c" /* yacc.c:1648 */
2103 1.6 christos break;
2104 1.6 christos
2105 1.6 christos case 74:
2106 1.6 christos #line 418 "configparser.y" /* yacc.c:1648 */
2107 1.6 christos { cfg_parser->opt->dnstap_socket_path = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2108 1.6 christos #line 2109 "configparser.c" /* yacc.c:1648 */
2109 1.6 christos break;
2110 1.6 christos
2111 1.6 christos case 75:
2112 1.6 christos #line 420 "configparser.y" /* yacc.c:1648 */
2113 1.6 christos { cfg_parser->opt->dnstap_send_identity = (yyvsp[0].bln); }
2114 1.6 christos #line 2115 "configparser.c" /* yacc.c:1648 */
2115 1.6 christos break;
2116 1.6 christos
2117 1.6 christos case 76:
2118 1.6 christos #line 422 "configparser.y" /* yacc.c:1648 */
2119 1.6 christos { cfg_parser->opt->dnstap_send_version = (yyvsp[0].bln); }
2120 1.6 christos #line 2121 "configparser.c" /* yacc.c:1648 */
2121 1.6 christos break;
2122 1.6 christos
2123 1.6 christos case 77:
2124 1.6 christos #line 424 "configparser.y" /* yacc.c:1648 */
2125 1.6 christos { cfg_parser->opt->dnstap_identity = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2126 1.6 christos #line 2127 "configparser.c" /* yacc.c:1648 */
2127 1.6 christos break;
2128 1.6 christos
2129 1.6 christos case 78:
2130 1.6 christos #line 426 "configparser.y" /* yacc.c:1648 */
2131 1.6 christos { cfg_parser->opt->dnstap_version = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2132 1.6 christos #line 2133 "configparser.c" /* yacc.c:1648 */
2133 1.6 christos break;
2134 1.6 christos
2135 1.6 christos case 79:
2136 1.6 christos #line 428 "configparser.y" /* yacc.c:1648 */
2137 1.6 christos { cfg_parser->opt->dnstap_log_auth_query_messages = (yyvsp[0].bln); }
2138 1.6 christos #line 2139 "configparser.c" /* yacc.c:1648 */
2139 1.6 christos break;
2140 1.6 christos
2141 1.6 christos case 80:
2142 1.6 christos #line 430 "configparser.y" /* yacc.c:1648 */
2143 1.6 christos { cfg_parser->opt->dnstap_log_auth_response_messages = (yyvsp[0].bln); }
2144 1.6 christos #line 2145 "configparser.c" /* yacc.c:1648 */
2145 1.1 christos break;
2146 1.1 christos
2147 1.6 christos case 84:
2148 1.6 christos #line 441 "configparser.y" /* yacc.c:1648 */
2149 1.6 christos { cfg_parser->opt->control_enable = (yyvsp[0].bln); }
2150 1.6 christos #line 2151 "configparser.c" /* yacc.c:1648 */
2151 1.1 christos break;
2152 1.1 christos
2153 1.6 christos case 85:
2154 1.6 christos #line 443 "configparser.y" /* yacc.c:1648 */
2155 1.1 christos {
2156 1.6 christos struct ip_address_option *ip = cfg_parser->opt->control_interface;
2157 1.6 christos if(ip == NULL) {
2158 1.6 christos cfg_parser->opt->control_interface = (yyvsp[0].ip);
2159 1.6 christos } else {
2160 1.6 christos while(ip->next != NULL) { ip = ip->next; }
2161 1.6 christos ip->next = (yyvsp[0].ip);
2162 1.6 christos }
2163 1.6 christos }
2164 1.6 christos #line 2165 "configparser.c" /* yacc.c:1648 */
2165 1.1 christos break;
2166 1.1 christos
2167 1.6 christos case 86:
2168 1.6 christos #line 453 "configparser.y" /* yacc.c:1648 */
2169 1.1 christos {
2170 1.6 christos if((yyvsp[0].llng) == 0) {
2171 1.6 christos yyerror("control port number expected");
2172 1.6 christos } else {
2173 1.6 christos cfg_parser->opt->control_port = (int)(yyvsp[0].llng);
2174 1.6 christos }
2175 1.6 christos }
2176 1.6 christos #line 2177 "configparser.c" /* yacc.c:1648 */
2177 1.1 christos break;
2178 1.1 christos
2179 1.6 christos case 87:
2180 1.6 christos #line 461 "configparser.y" /* yacc.c:1648 */
2181 1.6 christos { cfg_parser->opt->server_key_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2182 1.6 christos #line 2183 "configparser.c" /* yacc.c:1648 */
2183 1.1 christos break;
2184 1.1 christos
2185 1.6 christos case 88:
2186 1.6 christos #line 463 "configparser.y" /* yacc.c:1648 */
2187 1.6 christos { cfg_parser->opt->server_cert_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2188 1.6 christos #line 2189 "configparser.c" /* yacc.c:1648 */
2189 1.4 prlw1 break;
2190 1.4 prlw1
2191 1.6 christos case 89:
2192 1.6 christos #line 465 "configparser.y" /* yacc.c:1648 */
2193 1.6 christos { cfg_parser->opt->control_key_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2194 1.6 christos #line 2195 "configparser.c" /* yacc.c:1648 */
2195 1.4 prlw1 break;
2196 1.4 prlw1
2197 1.6 christos case 90:
2198 1.6 christos #line 467 "configparser.y" /* yacc.c:1648 */
2199 1.6 christos { cfg_parser->opt->control_cert_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2200 1.6 christos #line 2201 "configparser.c" /* yacc.c:1648 */
2201 1.4 prlw1 break;
2202 1.4 prlw1
2203 1.6 christos case 91:
2204 1.6 christos #line 472 "configparser.y" /* yacc.c:1648 */
2205 1.4 prlw1 {
2206 1.6 christos key_options_type *key = key_options_create(cfg_parser->opt->region);
2207 1.6 christos key->algorithm = region_strdup(cfg_parser->opt->region, "sha256");
2208 1.6 christos assert(cfg_parser->key == NULL);
2209 1.6 christos cfg_parser->key = key;
2210 1.6 christos }
2211 1.6 christos #line 2212 "configparser.c" /* yacc.c:1648 */
2212 1.4 prlw1 break;
2213 1.4 prlw1
2214 1.6 christos case 92:
2215 1.6 christos #line 479 "configparser.y" /* yacc.c:1648 */
2216 1.4 prlw1 {
2217 1.6 christos struct key_options *key = cfg_parser->key;
2218 1.6 christos if(key->name == NULL) {
2219 1.6 christos yyerror("tsig key has no name");
2220 1.6 christos } else if(key->algorithm == NULL) {
2221 1.6 christos yyerror("tsig key %s has no algorithm", key->name);
2222 1.6 christos } else if(key->secret == NULL) {
2223 1.6 christos yyerror("tsig key %s has no secret blob", key->name);
2224 1.6 christos } else if(key_options_find(cfg_parser->opt, key->name)) {
2225 1.6 christos yyerror("duplicate tsig key %s", key->name);
2226 1.6 christos } else {
2227 1.6 christos key_options_insert(cfg_parser->opt, key);
2228 1.6 christos cfg_parser->key = NULL;
2229 1.6 christos }
2230 1.6 christos }
2231 1.6 christos #line 2232 "configparser.c" /* yacc.c:1648 */
2232 1.4 prlw1 break;
2233 1.4 prlw1
2234 1.6 christos case 95:
2235 1.6 christos #line 500 "configparser.y" /* yacc.c:1648 */
2236 1.4 prlw1 {
2237 1.6 christos dname_type *dname;
2238 1.6 christos
2239 1.6 christos dname = (dname_type *)dname_parse(cfg_parser->opt->region, (yyvsp[0].str));
2240 1.6 christos cfg_parser->key->name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2241 1.6 christos if(dname == NULL) {
2242 1.6 christos yyerror("bad tsig key name %s", (yyvsp[0].str));
2243 1.6 christos } else {
2244 1.6 christos region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname));
2245 1.6 christos }
2246 1.6 christos }
2247 1.6 christos #line 2248 "configparser.c" /* yacc.c:1648 */
2248 1.4 prlw1 break;
2249 1.4 prlw1
2250 1.6 christos case 96:
2251 1.6 christos #line 512 "configparser.y" /* yacc.c:1648 */
2252 1.4 prlw1 {
2253 1.6 christos if(tsig_get_algorithm_by_name((yyvsp[0].str)) == NULL) {
2254 1.6 christos yyerror("bad tsig key algorithm %s", (yyvsp[0].str));
2255 1.6 christos } else {
2256 1.6 christos cfg_parser->key->algorithm = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2257 1.6 christos }
2258 1.6 christos }
2259 1.6 christos #line 2260 "configparser.c" /* yacc.c:1648 */
2260 1.4 prlw1 break;
2261 1.4 prlw1
2262 1.6 christos case 97:
2263 1.6 christos #line 520 "configparser.y" /* yacc.c:1648 */
2264 1.4 prlw1 {
2265 1.6 christos uint8_t data[16384];
2266 1.6 christos int size;
2267 1.6 christos
2268 1.6 christos cfg_parser->key->secret = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2269 1.6 christos size = b64_pton((yyvsp[0].str), data, sizeof(data));
2270 1.6 christos if(size == -1) {
2271 1.6 christos yyerror("cannot base64 decode tsig secret %s",
2272 1.6 christos cfg_parser->key->name?
2273 1.6 christos cfg_parser->key->name:"");
2274 1.6 christos } else if(size != 0) {
2275 1.6 christos memset(data, 0xdd, size); /* wipe secret */
2276 1.6 christos }
2277 1.6 christos }
2278 1.6 christos #line 2279 "configparser.c" /* yacc.c:1648 */
2279 1.4 prlw1 break;
2280 1.4 prlw1
2281 1.6 christos case 98:
2282 1.6 christos #line 538 "configparser.y" /* yacc.c:1648 */
2283 1.4 prlw1 {
2284 1.6 christos assert(cfg_parser->pattern == NULL);
2285 1.6 christos assert(cfg_parser->zone == NULL);
2286 1.6 christos cfg_parser->zone = zone_options_create(cfg_parser->opt->region);
2287 1.6 christos cfg_parser->zone->part_of_config = 1;
2288 1.6 christos cfg_parser->zone->pattern = cfg_parser->pattern =
2289 1.6 christos pattern_options_create(cfg_parser->opt->region);
2290 1.6 christos cfg_parser->zone->pattern->implicit = 1;
2291 1.6 christos }
2292 1.6 christos #line 2293 "configparser.c" /* yacc.c:1648 */
2293 1.4 prlw1 break;
2294 1.4 prlw1
2295 1.6 christos case 99:
2296 1.6 christos #line 548 "configparser.y" /* yacc.c:1648 */
2297 1.6 christos {
2298 1.6 christos assert(cfg_parser->zone != NULL);
2299 1.6 christos if(cfg_parser->zone->name == NULL) {
2300 1.6 christos yyerror("zone has no name");
2301 1.6 christos } else if(!nsd_options_insert_zone(cfg_parser->opt, cfg_parser->zone)) {
2302 1.6 christos yyerror("duplicate zone %s", cfg_parser->zone->name);
2303 1.6 christos } else if(!nsd_options_insert_pattern(cfg_parser->opt, cfg_parser->zone->pattern)) {
2304 1.6 christos yyerror("duplicate pattern %s", cfg_parser->zone->pattern->pname);
2305 1.6 christos }
2306 1.6 christos cfg_parser->pattern = NULL;
2307 1.6 christos cfg_parser->zone = NULL;
2308 1.6 christos }
2309 1.6 christos #line 2310 "configparser.c" /* yacc.c:1648 */
2310 1.1 christos break;
2311 1.1 christos
2312 1.6 christos case 102:
2313 1.6 christos #line 566 "configparser.y" /* yacc.c:1648 */
2314 1.6 christos {
2315 1.6 christos const char *marker = PATTERN_IMPLICIT_MARKER;
2316 1.6 christos char *pname = region_alloc(cfg_parser->opt->region, strlen((yyvsp[0].str)) + strlen(marker) + 1);
2317 1.6 christos memmove(pname, marker, strlen(marker));
2318 1.6 christos memmove(pname + strlen(marker), (yyvsp[0].str), strlen((yyvsp[0].str)) + 1);
2319 1.6 christos cfg_parser->zone->pattern->pname = pname;
2320 1.6 christos cfg_parser->zone->name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2321 1.6 christos if(pattern_options_find(cfg_parser->opt, pname)) {
2322 1.6 christos yyerror("zone %s cannot be created because implicit pattern %s "
2323 1.6 christos "already exists", (yyvsp[0].str), pname);
2324 1.6 christos }
2325 1.6 christos }
2326 1.6 christos #line 2327 "configparser.c" /* yacc.c:1648 */
2327 1.1 christos break;
2328 1.1 christos
2329 1.6 christos case 104:
2330 1.6 christos #line 582 "configparser.y" /* yacc.c:1648 */
2331 1.1 christos {
2332 1.6 christos assert(cfg_parser->pattern == NULL);
2333 1.6 christos cfg_parser->pattern = pattern_options_create(cfg_parser->opt->region);
2334 1.6 christos }
2335 1.6 christos #line 2336 "configparser.c" /* yacc.c:1648 */
2336 1.1 christos break;
2337 1.1 christos
2338 1.6 christos case 105:
2339 1.6 christos #line 587 "configparser.y" /* yacc.c:1648 */
2340 1.6 christos {
2341 1.6 christos pattern_options_type *pattern = cfg_parser->pattern;
2342 1.6 christos if(pattern->pname == NULL) {
2343 1.6 christos yyerror("pattern has no name");
2344 1.6 christos } else if(!nsd_options_insert_pattern(cfg_parser->opt, pattern)) {
2345 1.6 christos yyerror("duplicate pattern %s", pattern->pname);
2346 1.6 christos }
2347 1.6 christos cfg_parser->pattern = NULL;
2348 1.6 christos }
2349 1.6 christos #line 2350 "configparser.c" /* yacc.c:1648 */
2350 1.1 christos break;
2351 1.1 christos
2352 1.6 christos case 108:
2353 1.6 christos #line 602 "configparser.y" /* yacc.c:1648 */
2354 1.6 christos {
2355 1.6 christos if(strchr((yyvsp[0].str), ' ')) {
2356 1.6 christos yyerror("space is not allowed in pattern name: '%s'", (yyvsp[0].str));
2357 1.6 christos }
2358 1.6 christos cfg_parser->pattern->pname = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2359 1.6 christos }
2360 1.6 christos #line 2361 "configparser.c" /* yacc.c:1648 */
2361 1.1 christos break;
2362 1.1 christos
2363 1.6 christos case 110:
2364 1.6 christos #line 612 "configparser.y" /* yacc.c:1648 */
2365 1.6 christos {
2366 1.6 christos #ifdef RATELIMIT
2367 1.6 christos cfg_parser->pattern->rrl_whitelist |= rrlstr2type((yyvsp[0].str));
2368 1.1 christos #endif
2369 1.6 christos }
2370 1.6 christos #line 2371 "configparser.c" /* yacc.c:1648 */
2371 1.1 christos break;
2372 1.1 christos
2373 1.6 christos case 111:
2374 1.6 christos #line 618 "configparser.y" /* yacc.c:1648 */
2375 1.6 christos { cfg_parser->pattern->zonefile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2376 1.6 christos #line 2377 "configparser.c" /* yacc.c:1648 */
2377 1.1 christos break;
2378 1.1 christos
2379 1.6 christos case 112:
2380 1.6 christos #line 620 "configparser.y" /* yacc.c:1648 */
2381 1.6 christos { cfg_parser->pattern->zonestats = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2382 1.6 christos #line 2383 "configparser.c" /* yacc.c:1648 */
2383 1.1 christos break;
2384 1.1 christos
2385 1.6 christos case 113:
2386 1.6 christos #line 622 "configparser.y" /* yacc.c:1648 */
2387 1.1 christos {
2388 1.6 christos if((yyvsp[0].llng) > 0) {
2389 1.6 christos cfg_parser->pattern->size_limit_xfr = (int)(yyvsp[0].llng);
2390 1.6 christos } else {
2391 1.6 christos yyerror("expected a number greater than zero");
2392 1.6 christos }
2393 1.6 christos }
2394 1.6 christos #line 2395 "configparser.c" /* yacc.c:1648 */
2395 1.1 christos break;
2396 1.1 christos
2397 1.6 christos case 114:
2398 1.6 christos #line 630 "configparser.y" /* yacc.c:1648 */
2399 1.6 christos { cfg_parser->pattern->multi_master_check = (int)(yyvsp[0].bln); }
2400 1.6 christos #line 2401 "configparser.c" /* yacc.c:1648 */
2401 1.1 christos break;
2402 1.1 christos
2403 1.6 christos case 115:
2404 1.6 christos #line 632 "configparser.y" /* yacc.c:1648 */
2405 1.6 christos { config_apply_pattern(cfg_parser->pattern, (yyvsp[0].str)); }
2406 1.6 christos #line 2407 "configparser.c" /* yacc.c:1648 */
2407 1.1 christos break;
2408 1.1 christos
2409 1.6 christos case 116:
2410 1.6 christos #line 634 "configparser.y" /* yacc.c:1648 */
2411 1.6 christos {
2412 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2413 1.6 christos if(acl->blocked)
2414 1.6 christos yyerror("blocked address used for request-xfr");
2415 1.6 christos if(acl->rangetype != acl_range_single)
2416 1.6 christos yyerror("address range used for request-xfr");
2417 1.6 christos append_acl(&cfg_parser->pattern->request_xfr, acl);
2418 1.6 christos }
2419 1.6 christos #line 2420 "configparser.c" /* yacc.c:1648 */
2420 1.1 christos break;
2421 1.1 christos
2422 1.6 christos case 117:
2423 1.6 christos #line 643 "configparser.y" /* yacc.c:1648 */
2424 1.6 christos {
2425 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2426 1.6 christos acl->use_axfr_only = 1;
2427 1.6 christos if(acl->blocked)
2428 1.6 christos yyerror("blocked address used for request-xfr");
2429 1.6 christos if(acl->rangetype != acl_range_single)
2430 1.6 christos yyerror("address range used for request-xfr");
2431 1.6 christos append_acl(&cfg_parser->pattern->request_xfr, acl);
2432 1.6 christos }
2433 1.6 christos #line 2434 "configparser.c" /* yacc.c:1648 */
2434 1.1 christos break;
2435 1.1 christos
2436 1.6 christos case 118:
2437 1.6 christos #line 653 "configparser.y" /* yacc.c:1648 */
2438 1.6 christos {
2439 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2440 1.6 christos acl->allow_udp = 1;
2441 1.6 christos if(acl->blocked)
2442 1.6 christos yyerror("blocked address used for request-xfr");
2443 1.6 christos if(acl->rangetype != acl_range_single)
2444 1.6 christos yyerror("address range used for request-xfr");
2445 1.6 christos append_acl(&cfg_parser->pattern->request_xfr, acl);
2446 1.6 christos }
2447 1.6 christos #line 2448 "configparser.c" /* yacc.c:1648 */
2448 1.1 christos break;
2449 1.1 christos
2450 1.6 christos case 119:
2451 1.6 christos #line 663 "configparser.y" /* yacc.c:1648 */
2452 1.6 christos {
2453 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2454 1.6 christos append_acl(&cfg_parser->pattern->allow_notify, acl);
2455 1.6 christos }
2456 1.6 christos #line 2457 "configparser.c" /* yacc.c:1648 */
2457 1.1 christos break;
2458 1.1 christos
2459 1.6 christos case 120:
2460 1.6 christos #line 668 "configparser.y" /* yacc.c:1648 */
2461 1.6 christos {
2462 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2463 1.6 christos if(acl->blocked)
2464 1.6 christos yyerror("blocked address used for notify");
2465 1.6 christos if(acl->rangetype != acl_range_single)
2466 1.6 christos yyerror("address range used for notify");
2467 1.6 christos append_acl(&cfg_parser->pattern->notify, acl);
2468 1.6 christos }
2469 1.6 christos #line 2470 "configparser.c" /* yacc.c:1648 */
2470 1.1 christos break;
2471 1.1 christos
2472 1.6 christos case 121:
2473 1.6 christos #line 677 "configparser.y" /* yacc.c:1648 */
2474 1.6 christos {
2475 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2476 1.6 christos append_acl(&cfg_parser->pattern->provide_xfr, acl);
2477 1.6 christos }
2478 1.6 christos #line 2479 "configparser.c" /* yacc.c:1648 */
2479 1.1 christos break;
2480 1.1 christos
2481 1.6 christos case 122:
2482 1.6 christos #line 682 "configparser.y" /* yacc.c:1648 */
2483 1.6 christos {
2484 1.6 christos acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[0].str), "NOKEY");
2485 1.6 christos append_acl(&cfg_parser->pattern->outgoing_interface, acl);
2486 1.6 christos }
2487 1.6 christos #line 2488 "configparser.c" /* yacc.c:1648 */
2488 1.1 christos break;
2489 1.1 christos
2490 1.6 christos case 123:
2491 1.6 christos #line 687 "configparser.y" /* yacc.c:1648 */
2492 1.6 christos {
2493 1.6 christos cfg_parser->pattern->allow_axfr_fallback = (yyvsp[0].bln);
2494 1.6 christos cfg_parser->pattern->allow_axfr_fallback_is_default = 0;
2495 1.6 christos }
2496 1.6 christos #line 2497 "configparser.c" /* yacc.c:1648 */
2497 1.1 christos break;
2498 1.1 christos
2499 1.6 christos case 124:
2500 1.6 christos #line 692 "configparser.y" /* yacc.c:1648 */
2501 1.1 christos {
2502 1.6 christos cfg_parser->pattern->notify_retry = (yyvsp[0].llng);
2503 1.6 christos cfg_parser->pattern->notify_retry_is_default = 0;
2504 1.6 christos }
2505 1.6 christos #line 2506 "configparser.c" /* yacc.c:1648 */
2506 1.1 christos break;
2507 1.1 christos
2508 1.6 christos case 125:
2509 1.6 christos #line 697 "configparser.y" /* yacc.c:1648 */
2510 1.1 christos {
2511 1.6 christos cfg_parser->pattern->max_refresh_time = (yyvsp[0].llng);
2512 1.6 christos cfg_parser->pattern->max_refresh_time_is_default = 0;
2513 1.6 christos }
2514 1.6 christos #line 2515 "configparser.c" /* yacc.c:1648 */
2515 1.1 christos break;
2516 1.1 christos
2517 1.6 christos case 126:
2518 1.6 christos #line 702 "configparser.y" /* yacc.c:1648 */
2519 1.1 christos {
2520 1.6 christos cfg_parser->pattern->min_refresh_time = (yyvsp[0].llng);
2521 1.6 christos cfg_parser->pattern->min_refresh_time_is_default = 0;
2522 1.6 christos }
2523 1.6 christos #line 2524 "configparser.c" /* yacc.c:1648 */
2524 1.1 christos break;
2525 1.1 christos
2526 1.6 christos case 127:
2527 1.6 christos #line 707 "configparser.y" /* yacc.c:1648 */
2528 1.1 christos {
2529 1.6 christos cfg_parser->pattern->max_retry_time = (yyvsp[0].llng);
2530 1.6 christos cfg_parser->pattern->max_retry_time_is_default = 0;
2531 1.6 christos }
2532 1.6 christos #line 2533 "configparser.c" /* yacc.c:1648 */
2533 1.1 christos break;
2534 1.1 christos
2535 1.6 christos case 128:
2536 1.6 christos #line 712 "configparser.y" /* yacc.c:1648 */
2537 1.1 christos {
2538 1.6 christos cfg_parser->pattern->min_retry_time = (yyvsp[0].llng);
2539 1.6 christos cfg_parser->pattern->min_retry_time_is_default = 0;
2540 1.6 christos }
2541 1.6 christos #line 2542 "configparser.c" /* yacc.c:1648 */
2542 1.1 christos break;
2543 1.1 christos
2544 1.6 christos case 129:
2545 1.6 christos #line 719 "configparser.y" /* yacc.c:1648 */
2546 1.6 christos {
2547 1.6 christos struct ip_address_option *ip = region_alloc_zero(
2548 1.6 christos cfg_parser->opt->region, sizeof(*ip));
2549 1.6 christos ip->address = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2550 1.6 christos (yyval.ip) = ip;
2551 1.6 christos }
2552 1.6 christos #line 2553 "configparser.c" /* yacc.c:1648 */
2553 1.1 christos break;
2554 1.1 christos
2555 1.6 christos case 130:
2556 1.6 christos #line 728 "configparser.y" /* yacc.c:1648 */
2557 1.6 christos {
2558 1.6 christos /* ensure string consists entirely of digits */
2559 1.6 christos const char *str = (yyvsp[0].str);
2560 1.6 christos size_t pos = 0;
2561 1.6 christos while(str[pos] >= '0' && str[pos] <= '9') {
2562 1.6 christos pos++;
2563 1.6 christos }
2564 1.1 christos
2565 1.6 christos (yyval.llng) = 0;
2566 1.6 christos if(pos > 0 && str[pos] == '\0') {
2567 1.6 christos int err = errno;
2568 1.6 christos errno = 0;
2569 1.6 christos (yyval.llng) = strtoll(str, NULL, 10);
2570 1.6 christos errno = err;
2571 1.6 christos } else {
2572 1.6 christos yyerror("expected a number");
2573 1.6 christos YYABORT; /* trigger a parser error */
2574 1.6 christos }
2575 1.6 christos }
2576 1.6 christos #line 2577 "configparser.c" /* yacc.c:1648 */
2577 1.1 christos break;
2578 1.1 christos
2579 1.6 christos case 131:
2580 1.6 christos #line 750 "configparser.y" /* yacc.c:1648 */
2581 1.6 christos {
2582 1.6 christos (yyval.bln) = 0;
2583 1.6 christos if(strcmp((yyvsp[0].str), "yes") == 0) {
2584 1.6 christos (yyval.bln) = 1;
2585 1.6 christos } else if(strcmp((yyvsp[0].str), "no") == 0) {
2586 1.6 christos (yyval.bln) = 0;
2587 1.6 christos } else {
2588 1.6 christos yyerror("expected yes or no");
2589 1.6 christos YYABORT; /* trigger a parser error */
2590 1.6 christos }
2591 1.6 christos }
2592 1.6 christos #line 2593 "configparser.c" /* yacc.c:1648 */
2593 1.1 christos break;
2594 1.1 christos
2595 1.1 christos
2596 1.6 christos #line 2597 "configparser.c" /* yacc.c:1648 */
2597 1.1 christos default: break;
2598 1.1 christos }
2599 1.1 christos /* User semantic actions sometimes alter yychar, and that requires
2600 1.1 christos that yytoken be updated with the new translation. We take the
2601 1.1 christos approach of translating immediately before every use of yytoken.
2602 1.1 christos One alternative is translating here after every semantic action,
2603 1.1 christos but that translation would be missed if the semantic action invokes
2604 1.1 christos YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2605 1.1 christos if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2606 1.1 christos incorrect destructor might then be invoked immediately. In the
2607 1.1 christos case of YYERROR or YYBACKUP, subsequent parser actions might lead
2608 1.1 christos to an incorrect destructor call or verbose syntax error message
2609 1.1 christos before the lookahead is translated. */
2610 1.1 christos YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2611 1.1 christos
2612 1.1 christos YYPOPSTACK (yylen);
2613 1.1 christos yylen = 0;
2614 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2615 1.1 christos
2616 1.1 christos *++yyvsp = yyval;
2617 1.1 christos
2618 1.1 christos /* Now 'shift' the result of the reduction. Determine what state
2619 1.1 christos that goes to, based on the state we popped back to and the rule
2620 1.1 christos number reduced by. */
2621 1.1 christos
2622 1.1 christos yyn = yyr1[yyn];
2623 1.1 christos
2624 1.1 christos yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2625 1.1 christos if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2626 1.1 christos yystate = yytable[yystate];
2627 1.1 christos else
2628 1.1 christos yystate = yydefgoto[yyn - YYNTOKENS];
2629 1.1 christos
2630 1.1 christos goto yynewstate;
2631 1.1 christos
2632 1.1 christos
2633 1.1 christos /*--------------------------------------.
2634 1.1 christos | yyerrlab -- here on detecting error. |
2635 1.1 christos `--------------------------------------*/
2636 1.1 christos yyerrlab:
2637 1.1 christos /* Make sure we have latest lookahead translation. See comments at
2638 1.1 christos user semantic actions for why this is necessary. */
2639 1.1 christos yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2640 1.1 christos
2641 1.1 christos /* If not already recovering from an error, report this error. */
2642 1.1 christos if (!yyerrstatus)
2643 1.1 christos {
2644 1.1 christos ++yynerrs;
2645 1.1 christos #if ! YYERROR_VERBOSE
2646 1.1 christos yyerror (YY_("syntax error"));
2647 1.1 christos #else
2648 1.1 christos # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2649 1.1 christos yyssp, yytoken)
2650 1.1 christos {
2651 1.1 christos char const *yymsgp = YY_("syntax error");
2652 1.1 christos int yysyntax_error_status;
2653 1.1 christos yysyntax_error_status = YYSYNTAX_ERROR;
2654 1.1 christos if (yysyntax_error_status == 0)
2655 1.1 christos yymsgp = yymsg;
2656 1.1 christos else if (yysyntax_error_status == 1)
2657 1.1 christos {
2658 1.1 christos if (yymsg != yymsgbuf)
2659 1.1 christos YYSTACK_FREE (yymsg);
2660 1.1 christos yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2661 1.1 christos if (!yymsg)
2662 1.1 christos {
2663 1.1 christos yymsg = yymsgbuf;
2664 1.1 christos yymsg_alloc = sizeof yymsgbuf;
2665 1.1 christos yysyntax_error_status = 2;
2666 1.1 christos }
2667 1.1 christos else
2668 1.1 christos {
2669 1.1 christos yysyntax_error_status = YYSYNTAX_ERROR;
2670 1.1 christos yymsgp = yymsg;
2671 1.1 christos }
2672 1.1 christos }
2673 1.1 christos yyerror (yymsgp);
2674 1.1 christos if (yysyntax_error_status == 2)
2675 1.1 christos goto yyexhaustedlab;
2676 1.1 christos }
2677 1.1 christos # undef YYSYNTAX_ERROR
2678 1.1 christos #endif
2679 1.1 christos }
2680 1.1 christos
2681 1.1 christos
2682 1.1 christos
2683 1.1 christos if (yyerrstatus == 3)
2684 1.1 christos {
2685 1.1 christos /* If just tried and failed to reuse lookahead token after an
2686 1.1 christos error, discard it. */
2687 1.1 christos
2688 1.1 christos if (yychar <= YYEOF)
2689 1.1 christos {
2690 1.1 christos /* Return failure if at end of input. */
2691 1.1 christos if (yychar == YYEOF)
2692 1.1 christos YYABORT;
2693 1.1 christos }
2694 1.1 christos else
2695 1.1 christos {
2696 1.1 christos yydestruct ("Error: discarding",
2697 1.1 christos yytoken, &yylval);
2698 1.1 christos yychar = YYEMPTY;
2699 1.1 christos }
2700 1.1 christos }
2701 1.1 christos
2702 1.1 christos /* Else will try to reuse lookahead token after shifting the error
2703 1.1 christos token. */
2704 1.1 christos goto yyerrlab1;
2705 1.1 christos
2706 1.1 christos
2707 1.1 christos /*---------------------------------------------------.
2708 1.1 christos | yyerrorlab -- error raised explicitly by YYERROR. |
2709 1.1 christos `---------------------------------------------------*/
2710 1.1 christos yyerrorlab:
2711 1.1 christos
2712 1.1 christos /* Pacify compilers like GCC when the user code never invokes
2713 1.1 christos YYERROR and the label yyerrorlab therefore never appears in user
2714 1.1 christos code. */
2715 1.1 christos if (/*CONSTCOND*/ 0)
2716 1.1 christos goto yyerrorlab;
2717 1.1 christos
2718 1.1 christos /* Do not reclaim the symbols of the rule whose action triggered
2719 1.1 christos this YYERROR. */
2720 1.1 christos YYPOPSTACK (yylen);
2721 1.1 christos yylen = 0;
2722 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2723 1.1 christos yystate = *yyssp;
2724 1.1 christos goto yyerrlab1;
2725 1.1 christos
2726 1.1 christos
2727 1.1 christos /*-------------------------------------------------------------.
2728 1.1 christos | yyerrlab1 -- common code for both syntax error and YYERROR. |
2729 1.1 christos `-------------------------------------------------------------*/
2730 1.1 christos yyerrlab1:
2731 1.1 christos yyerrstatus = 3; /* Each real token shifted decrements this. */
2732 1.1 christos
2733 1.1 christos for (;;)
2734 1.1 christos {
2735 1.1 christos yyn = yypact[yystate];
2736 1.1 christos if (!yypact_value_is_default (yyn))
2737 1.1 christos {
2738 1.1 christos yyn += YYTERROR;
2739 1.1 christos if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2740 1.1 christos {
2741 1.1 christos yyn = yytable[yyn];
2742 1.1 christos if (0 < yyn)
2743 1.1 christos break;
2744 1.1 christos }
2745 1.1 christos }
2746 1.1 christos
2747 1.1 christos /* Pop the current state because it cannot handle the error token. */
2748 1.1 christos if (yyssp == yyss)
2749 1.1 christos YYABORT;
2750 1.1 christos
2751 1.1 christos
2752 1.1 christos yydestruct ("Error: popping",
2753 1.1 christos yystos[yystate], yyvsp);
2754 1.1 christos YYPOPSTACK (1);
2755 1.1 christos yystate = *yyssp;
2756 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2757 1.1 christos }
2758 1.1 christos
2759 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2760 1.1 christos *++yyvsp = yylval;
2761 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
2762 1.1 christos
2763 1.1 christos
2764 1.1 christos /* Shift the error token. */
2765 1.1 christos YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2766 1.1 christos
2767 1.1 christos yystate = yyn;
2768 1.1 christos goto yynewstate;
2769 1.1 christos
2770 1.1 christos
2771 1.1 christos /*-------------------------------------.
2772 1.1 christos | yyacceptlab -- YYACCEPT comes here. |
2773 1.1 christos `-------------------------------------*/
2774 1.1 christos yyacceptlab:
2775 1.1 christos yyresult = 0;
2776 1.1 christos goto yyreturn;
2777 1.1 christos
2778 1.1 christos /*-----------------------------------.
2779 1.1 christos | yyabortlab -- YYABORT comes here. |
2780 1.1 christos `-----------------------------------*/
2781 1.1 christos yyabortlab:
2782 1.1 christos yyresult = 1;
2783 1.1 christos goto yyreturn;
2784 1.1 christos
2785 1.1 christos #if !defined yyoverflow || YYERROR_VERBOSE
2786 1.1 christos /*-------------------------------------------------.
2787 1.1 christos | yyexhaustedlab -- memory exhaustion comes here. |
2788 1.1 christos `-------------------------------------------------*/
2789 1.1 christos yyexhaustedlab:
2790 1.1 christos yyerror (YY_("memory exhausted"));
2791 1.1 christos yyresult = 2;
2792 1.1 christos /* Fall through. */
2793 1.1 christos #endif
2794 1.1 christos
2795 1.1 christos yyreturn:
2796 1.1 christos if (yychar != YYEMPTY)
2797 1.1 christos {
2798 1.1 christos /* Make sure we have latest lookahead translation. See comments at
2799 1.1 christos user semantic actions for why this is necessary. */
2800 1.1 christos yytoken = YYTRANSLATE (yychar);
2801 1.1 christos yydestruct ("Cleanup: discarding lookahead",
2802 1.1 christos yytoken, &yylval);
2803 1.1 christos }
2804 1.1 christos /* Do not reclaim the symbols of the rule whose action triggered
2805 1.1 christos this YYABORT or YYACCEPT. */
2806 1.1 christos YYPOPSTACK (yylen);
2807 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2808 1.1 christos while (yyssp != yyss)
2809 1.1 christos {
2810 1.1 christos yydestruct ("Cleanup: popping",
2811 1.1 christos yystos[*yyssp], yyvsp);
2812 1.1 christos YYPOPSTACK (1);
2813 1.1 christos }
2814 1.1 christos #ifndef yyoverflow
2815 1.1 christos if (yyss != yyssa)
2816 1.1 christos YYSTACK_FREE (yyss);
2817 1.1 christos #endif
2818 1.1 christos #if YYERROR_VERBOSE
2819 1.1 christos if (yymsg != yymsgbuf)
2820 1.1 christos YYSTACK_FREE (yymsg);
2821 1.1 christos #endif
2822 1.1 christos return yyresult;
2823 1.1 christos }
2824 1.6 christos #line 762 "configparser.y" /* yacc.c:1907 */
2825 1.1 christos
2826 1.1 christos
2827 1.6 christos static void
2828 1.6 christos append_acl(struct acl_options **list, struct acl_options *acl)
2829 1.6 christos {
2830 1.6 christos assert(list != NULL);
2831 1.6 christos
2832 1.6 christos if(*list == NULL) {
2833 1.6 christos *list = acl;
2834 1.6 christos } else {
2835 1.6 christos struct acl_options *tail = *list;
2836 1.6 christos while(tail->next != NULL)
2837 1.6 christos tail = tail->next;
2838 1.6 christos tail->next = acl;
2839 1.6 christos }
2840 1.6 christos }
2841 1.6 christos
2842