xref: /netbsd-src/external/bsd/nsd/dist/zparser.c (revision e89934bbf778a6d6d6894877c4da59d0c7835b0f)
1 /* A Bison parser, made by GNU Bison 3.0.4.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19 
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29 
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42 
43 /* Identify Bison output.  */
44 #define YYBISON 1
45 
46 /* Bison version.  */
47 #define YYBISON_VERSION "3.0.4"
48 
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers.  */
53 #define YYPURE 0
54 
55 /* Push parsers.  */
56 #define YYPUSH 0
57 
58 /* Pull parsers.  */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations.  */
65 #line 1 "zparser.y" /* yacc.c:339  */
66 
67 /*
68  * zyparser.y -- yacc grammar for (DNS) zone files
69  *
70  * Copyright (c) 2001-2006, NLnet Labs. All rights reserved.
71  *
72  * See LICENSE for the license.
73  *
74  */
75 
76 #include "config.h"
77 
78 #include <stdarg.h>
79 #include <stdio.h>
80 #include <string.h>
81 
82 #include "dname.h"
83 #include "namedb.h"
84 #include "zonec.h"
85 
86 /* these need to be global, otherwise they cannot be used inside yacc */
87 zparser_type *parser;
88 
89 #ifdef __cplusplus
90 extern "C"
91 #endif /* __cplusplus */
92 int yywrap(void);
93 
94 /* this hold the nxt bits */
95 static uint8_t nxtbits[16];
96 static int dlv_warn = 1;
97 
98 /* 256 windows of 256 bits (32 bytes) */
99 /* still need to reset the bastard somewhere */
100 static uint8_t nsecbits[NSEC_WINDOW_COUNT][NSEC_WINDOW_BITS_SIZE];
101 
102 /* hold the highest rcode seen in a NSEC rdata , BUG #106 */
103 uint16_t nsec_highest_rcode;
104 
105 void yyerror(const char *message);
106 
107 #ifdef NSEC3
108 /* parse nsec3 parameters and add the (first) rdata elements */
109 static void
110 nsec3_add_params(const char* hash_algo_str, const char* flag_str,
111 	const char* iter_str, const char* salt_str, int salt_len);
112 #endif /* NSEC3 */
113 
114 
115 #line 116 "zparser.c" /* yacc.c:339  */
116 
117 # ifndef YY_NULLPTR
118 #  if defined __cplusplus && 201103L <= __cplusplus
119 #   define YY_NULLPTR nullptr
120 #  else
121 #   define YY_NULLPTR 0
122 #  endif
123 # endif
124 
125 /* Enabling verbose error messages.  */
126 #ifdef YYERROR_VERBOSE
127 # undef YYERROR_VERBOSE
128 # define YYERROR_VERBOSE 1
129 #else
130 # define YYERROR_VERBOSE 0
131 #endif
132 
133 /* In a future release of Bison, this section will be replaced
134    by #include "zparser.h".  */
135 #ifndef YY_YY_ZPARSER_H_INCLUDED
136 # define YY_YY_ZPARSER_H_INCLUDED
137 /* Debug traces.  */
138 #ifndef YYDEBUG
139 # define YYDEBUG 0
140 #endif
141 #if YYDEBUG
142 extern int yydebug;
143 #endif
144 
145 /* Token type.  */
146 #ifndef YYTOKENTYPE
147 # define YYTOKENTYPE
148   enum yytokentype
149   {
150     T_A = 258,
151     T_NS = 259,
152     T_MX = 260,
153     T_TXT = 261,
154     T_CNAME = 262,
155     T_AAAA = 263,
156     T_PTR = 264,
157     T_NXT = 265,
158     T_KEY = 266,
159     T_SOA = 267,
160     T_SIG = 268,
161     T_SRV = 269,
162     T_CERT = 270,
163     T_LOC = 271,
164     T_MD = 272,
165     T_MF = 273,
166     T_MB = 274,
167     T_MG = 275,
168     T_MR = 276,
169     T_NULL = 277,
170     T_WKS = 278,
171     T_HINFO = 279,
172     T_MINFO = 280,
173     T_RP = 281,
174     T_AFSDB = 282,
175     T_X25 = 283,
176     T_ISDN = 284,
177     T_RT = 285,
178     T_NSAP = 286,
179     T_NSAP_PTR = 287,
180     T_PX = 288,
181     T_GPOS = 289,
182     T_EID = 290,
183     T_NIMLOC = 291,
184     T_ATMA = 292,
185     T_NAPTR = 293,
186     T_KX = 294,
187     T_A6 = 295,
188     T_DNAME = 296,
189     T_SINK = 297,
190     T_OPT = 298,
191     T_APL = 299,
192     T_UINFO = 300,
193     T_UID = 301,
194     T_GID = 302,
195     T_UNSPEC = 303,
196     T_TKEY = 304,
197     T_TSIG = 305,
198     T_IXFR = 306,
199     T_AXFR = 307,
200     T_MAILB = 308,
201     T_MAILA = 309,
202     T_DS = 310,
203     T_DLV = 311,
204     T_SSHFP = 312,
205     T_RRSIG = 313,
206     T_NSEC = 314,
207     T_DNSKEY = 315,
208     T_SPF = 316,
209     T_NSEC3 = 317,
210     T_IPSECKEY = 318,
211     T_DHCID = 319,
212     T_NSEC3PARAM = 320,
213     T_TLSA = 321,
214     T_URI = 322,
215     T_NID = 323,
216     T_L32 = 324,
217     T_L64 = 325,
218     T_LP = 326,
219     T_EUI48 = 327,
220     T_EUI64 = 328,
221     T_CAA = 329,
222     T_CDS = 330,
223     T_CDNSKEY = 331,
224     T_OPENPGPKEY = 332,
225     T_CSYNC = 333,
226     DOLLAR_TTL = 334,
227     DOLLAR_ORIGIN = 335,
228     NL = 336,
229     SP = 337,
230     STR = 338,
231     PREV = 339,
232     BITLAB = 340,
233     T_TTL = 341,
234     T_RRCLASS = 342,
235     URR = 343,
236     T_UTYPE = 344
237   };
238 #endif
239 /* Tokens.  */
240 #define T_A 258
241 #define T_NS 259
242 #define T_MX 260
243 #define T_TXT 261
244 #define T_CNAME 262
245 #define T_AAAA 263
246 #define T_PTR 264
247 #define T_NXT 265
248 #define T_KEY 266
249 #define T_SOA 267
250 #define T_SIG 268
251 #define T_SRV 269
252 #define T_CERT 270
253 #define T_LOC 271
254 #define T_MD 272
255 #define T_MF 273
256 #define T_MB 274
257 #define T_MG 275
258 #define T_MR 276
259 #define T_NULL 277
260 #define T_WKS 278
261 #define T_HINFO 279
262 #define T_MINFO 280
263 #define T_RP 281
264 #define T_AFSDB 282
265 #define T_X25 283
266 #define T_ISDN 284
267 #define T_RT 285
268 #define T_NSAP 286
269 #define T_NSAP_PTR 287
270 #define T_PX 288
271 #define T_GPOS 289
272 #define T_EID 290
273 #define T_NIMLOC 291
274 #define T_ATMA 292
275 #define T_NAPTR 293
276 #define T_KX 294
277 #define T_A6 295
278 #define T_DNAME 296
279 #define T_SINK 297
280 #define T_OPT 298
281 #define T_APL 299
282 #define T_UINFO 300
283 #define T_UID 301
284 #define T_GID 302
285 #define T_UNSPEC 303
286 #define T_TKEY 304
287 #define T_TSIG 305
288 #define T_IXFR 306
289 #define T_AXFR 307
290 #define T_MAILB 308
291 #define T_MAILA 309
292 #define T_DS 310
293 #define T_DLV 311
294 #define T_SSHFP 312
295 #define T_RRSIG 313
296 #define T_NSEC 314
297 #define T_DNSKEY 315
298 #define T_SPF 316
299 #define T_NSEC3 317
300 #define T_IPSECKEY 318
301 #define T_DHCID 319
302 #define T_NSEC3PARAM 320
303 #define T_TLSA 321
304 #define T_URI 322
305 #define T_NID 323
306 #define T_L32 324
307 #define T_L64 325
308 #define T_LP 326
309 #define T_EUI48 327
310 #define T_EUI64 328
311 #define T_CAA 329
312 #define T_CDS 330
313 #define T_CDNSKEY 331
314 #define T_OPENPGPKEY 332
315 #define T_CSYNC 333
316 #define DOLLAR_TTL 334
317 #define DOLLAR_ORIGIN 335
318 #define NL 336
319 #define SP 337
320 #define STR 338
321 #define PREV 339
322 #define BITLAB 340
323 #define T_TTL 341
324 #define T_RRCLASS 342
325 #define URR 343
326 #define T_UTYPE 344
327 
328 /* Value type.  */
329 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
330 
331 union YYSTYPE
332 {
333 #line 50 "zparser.y" /* yacc.c:355  */
334 
335 	domain_type	 *domain;
336 	const dname_type *dname;
337 	struct lex_data	  data;
338 	uint32_t	  ttl;
339 	uint16_t	  klass;
340 	uint16_t	  type;
341 	uint16_t	 *unknown;
342 
343 #line 344 "zparser.c" /* yacc.c:355  */
344 };
345 
346 typedef union YYSTYPE YYSTYPE;
347 # define YYSTYPE_IS_TRIVIAL 1
348 # define YYSTYPE_IS_DECLARED 1
349 #endif
350 
351 
352 extern YYSTYPE yylval;
353 
354 int yyparse (void);
355 
356 #endif /* !YY_YY_ZPARSER_H_INCLUDED  */
357 
358 /* Copy the second part of user declarations.  */
359 
360 #line 361 "zparser.c" /* yacc.c:358  */
361 
362 #ifdef short
363 # undef short
364 #endif
365 
366 #ifdef YYTYPE_UINT8
367 typedef YYTYPE_UINT8 yytype_uint8;
368 #else
369 typedef unsigned char yytype_uint8;
370 #endif
371 
372 #ifdef YYTYPE_INT8
373 typedef YYTYPE_INT8 yytype_int8;
374 #else
375 typedef signed char yytype_int8;
376 #endif
377 
378 #ifdef YYTYPE_UINT16
379 typedef YYTYPE_UINT16 yytype_uint16;
380 #else
381 typedef unsigned short int yytype_uint16;
382 #endif
383 
384 #ifdef YYTYPE_INT16
385 typedef YYTYPE_INT16 yytype_int16;
386 #else
387 typedef short int yytype_int16;
388 #endif
389 
390 #ifndef YYSIZE_T
391 # ifdef __SIZE_TYPE__
392 #  define YYSIZE_T __SIZE_TYPE__
393 # elif defined size_t
394 #  define YYSIZE_T size_t
395 # elif ! defined YYSIZE_T
396 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
397 #  define YYSIZE_T size_t
398 # else
399 #  define YYSIZE_T unsigned int
400 # endif
401 #endif
402 
403 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
404 
405 #ifndef YY_
406 # if defined YYENABLE_NLS && YYENABLE_NLS
407 #  if ENABLE_NLS
408 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
409 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
410 #  endif
411 # endif
412 # ifndef YY_
413 #  define YY_(Msgid) Msgid
414 # endif
415 #endif
416 
417 #ifndef YY_ATTRIBUTE
418 # if (defined __GNUC__                                               \
419       && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
420      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
421 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
422 # else
423 #  define YY_ATTRIBUTE(Spec) /* empty */
424 # endif
425 #endif
426 
427 #ifndef YY_ATTRIBUTE_PURE
428 # define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
429 #endif
430 
431 #ifndef YY_ATTRIBUTE_UNUSED
432 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
433 #endif
434 
435 #if !defined _Noreturn \
436      && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
437 # if defined _MSC_VER && 1200 <= _MSC_VER
438 #  define _Noreturn __declspec (noreturn)
439 # else
440 #  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
441 # endif
442 #endif
443 
444 /* Suppress unused-variable warnings by "using" E.  */
445 #if ! defined lint || defined __GNUC__
446 # define YYUSE(E) ((void) (E))
447 #else
448 # define YYUSE(E) /* empty */
449 #endif
450 
451 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
452 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
453 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
454     _Pragma ("GCC diagnostic push") \
455     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
456     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
457 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
458     _Pragma ("GCC diagnostic pop")
459 #else
460 # define YY_INITIAL_VALUE(Value) Value
461 #endif
462 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
463 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
464 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
465 #endif
466 #ifndef YY_INITIAL_VALUE
467 # define YY_INITIAL_VALUE(Value) /* Nothing. */
468 #endif
469 
470 
471 #if ! defined yyoverflow || YYERROR_VERBOSE
472 
473 /* The parser invokes alloca or malloc; define the necessary symbols.  */
474 
475 # ifdef YYSTACK_USE_ALLOCA
476 #  if YYSTACK_USE_ALLOCA
477 #   ifdef __GNUC__
478 #    define YYSTACK_ALLOC __builtin_alloca
479 #   elif defined __BUILTIN_VA_ARG_INCR
480 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
481 #   elif defined _AIX
482 #    define YYSTACK_ALLOC __alloca
483 #   elif defined _MSC_VER
484 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
485 #    define alloca _alloca
486 #   else
487 #    define YYSTACK_ALLOC alloca
488 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
489 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
490       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
491 #     ifndef EXIT_SUCCESS
492 #      define EXIT_SUCCESS 0
493 #     endif
494 #    endif
495 #   endif
496 #  endif
497 # endif
498 
499 # ifdef YYSTACK_ALLOC
500    /* Pacify GCC's 'empty if-body' warning.  */
501 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
502 #  ifndef YYSTACK_ALLOC_MAXIMUM
503     /* The OS might guarantee only one guard page at the bottom of the stack,
504        and a page size can be as small as 4096 bytes.  So we cannot safely
505        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
506        to allow for a few compiler-allocated temporary stack slots.  */
507 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
508 #  endif
509 # else
510 #  define YYSTACK_ALLOC YYMALLOC
511 #  define YYSTACK_FREE YYFREE
512 #  ifndef YYSTACK_ALLOC_MAXIMUM
513 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
514 #  endif
515 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
516        && ! ((defined YYMALLOC || defined malloc) \
517              && (defined YYFREE || defined free)))
518 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
519 #   ifndef EXIT_SUCCESS
520 #    define EXIT_SUCCESS 0
521 #   endif
522 #  endif
523 #  ifndef YYMALLOC
524 #   define YYMALLOC malloc
525 #   if ! defined malloc && ! defined EXIT_SUCCESS
526 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
527 #   endif
528 #  endif
529 #  ifndef YYFREE
530 #   define YYFREE free
531 #   if ! defined free && ! defined EXIT_SUCCESS
532 void free (void *); /* INFRINGES ON USER NAME SPACE */
533 #   endif
534 #  endif
535 # endif
536 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
537 
538 
539 #if (! defined yyoverflow \
540      && (! defined __cplusplus \
541          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
542 
543 /* A type that is properly aligned for any stack member.  */
544 union yyalloc
545 {
546   yytype_int16 yyss_alloc;
547   YYSTYPE yyvs_alloc;
548 };
549 
550 /* The size of the maximum gap between one aligned stack and the next.  */
551 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
552 
553 /* The size of an array large to enough to hold all stacks, each with
554    N elements.  */
555 # define YYSTACK_BYTES(N) \
556      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
557       + YYSTACK_GAP_MAXIMUM)
558 
559 # define YYCOPY_NEEDED 1
560 
561 /* Relocate STACK from its old location to the new one.  The
562    local variables YYSIZE and YYSTACKSIZE give the old and new number of
563    elements in the stack, and YYPTR gives the new location of the
564    stack.  Advance YYPTR to a properly aligned location for the next
565    stack.  */
566 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
567     do                                                                  \
568       {                                                                 \
569         YYSIZE_T yynewbytes;                                            \
570         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
571         Stack = &yyptr->Stack_alloc;                                    \
572         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
573         yyptr += yynewbytes / sizeof (*yyptr);                          \
574       }                                                                 \
575     while (0)
576 
577 #endif
578 
579 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
580 /* Copy COUNT objects from SRC to DST.  The source and destination do
581    not overlap.  */
582 # ifndef YYCOPY
583 #  if defined __GNUC__ && 1 < __GNUC__
584 #   define YYCOPY(Dst, Src, Count) \
585       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
586 #  else
587 #   define YYCOPY(Dst, Src, Count)              \
588       do                                        \
589         {                                       \
590           YYSIZE_T yyi;                         \
591           for (yyi = 0; yyi < (Count); yyi++)   \
592             (Dst)[yyi] = (Src)[yyi];            \
593         }                                       \
594       while (0)
595 #  endif
596 # endif
597 #endif /* !YYCOPY_NEEDED */
598 
599 /* YYFINAL -- State number of the termination state.  */
600 #define YYFINAL  2
601 /* YYLAST -- Last index in YYTABLE.  */
602 #define YYLAST   923
603 
604 /* YYNTOKENS -- Number of terminals.  */
605 #define YYNTOKENS  92
606 /* YYNNTS -- Number of nonterminals.  */
607 #define YYNNTS  74
608 /* YYNRULES -- Number of rules.  */
609 #define YYNRULES  231
610 /* YYNSTATES -- Number of states.  */
611 #define YYNSTATES  570
612 
613 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
614    by yylex, with out-of-bounds checking.  */
615 #define YYUNDEFTOK  2
616 #define YYMAXUTOK   344
617 
618 #define YYTRANSLATE(YYX)                                                \
619   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
620 
621 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
622    as returned by yylex, without out-of-bounds checking.  */
623 static const yytype_uint8 yytranslate[] =
624 {
625        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
626        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
627        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
628        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
629        2,     2,     2,     2,     2,     2,    90,     2,     2,     2,
630        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
631        2,     2,     2,     2,    91,     2,     2,     2,     2,     2,
632        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
633        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
634        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
635        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
636        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
637        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
638        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
639        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
640        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
641        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
642        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
643        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
644        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
645        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
646        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
647        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
648        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
649        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
650        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
651        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
652       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
653       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
654       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
655       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
656       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
657       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
658       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
659       85,    86,    87,    88,    89
660 };
661 
662 #if YYDEBUG
663   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
664 static const yytype_uint16 yyrline[] =
665 {
666        0,    92,    92,    93,    96,    97,    98,    99,   107,   115,
667      135,   139,   140,   143,   144,   147,   157,   168,   174,   181,
668      186,   193,   197,   202,   207,   212,   219,   220,   241,   245,
669      249,   259,   273,   280,   281,   299,   300,   303,   311,   323,
670      340,   341,   356,   360,   370,   371,   376,   385,   397,   406,
671      417,   420,   423,   437,   438,   445,   446,   462,   463,   478,
672      479,   484,   494,   512,   513,   514,   515,   516,   517,   522,
673      523,   529,   530,   531,   532,   533,   534,   540,   541,   542,
674      543,   545,   546,   547,   548,   549,   550,   551,   552,   553,
675      554,   555,   556,   557,   558,   559,   560,   561,   562,   563,
676      564,   565,   566,   567,   568,   569,   570,   571,   572,   573,
677      574,   575,   576,   577,   578,   579,   580,   581,   582,   583,
678      584,   585,   586,   587,   588,   589,   590,   591,   592,   593,
679      594,   595,   596,   597,   598,   599,   600,   601,   602,   603,
680      604,   605,   606,   607,   608,   609,   610,   611,   612,   613,
681      614,   615,   616,   617,   618,   619,   620,   621,   622,   623,
682      624,   625,   626,   627,   628,   629,   630,   631,   632,   633,
683      634,   635,   636,   637,   638,   639,   640,   641,   642,   643,
684      655,   661,   668,   681,   688,   695,   703,   710,   717,   725,
685      733,   740,   744,   752,   760,   772,   780,   786,   792,   800,
686      810,   822,   830,   840,   843,   847,   853,   862,   871,   879,
687      885,   900,   910,   925,   935,   944,   953,   992,   996,  1000,
688     1007,  1014,  1021,  1028,  1034,  1041,  1050,  1059,  1066,  1076,
689     1082,  1086
690 };
691 #endif
692 
693 #if YYDEBUG || YYERROR_VERBOSE || 0
694 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
695    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
696 static const char *const yytname[] =
697 {
698   "$end", "error", "$undefined", "T_A", "T_NS", "T_MX", "T_TXT",
699   "T_CNAME", "T_AAAA", "T_PTR", "T_NXT", "T_KEY", "T_SOA", "T_SIG",
700   "T_SRV", "T_CERT", "T_LOC", "T_MD", "T_MF", "T_MB", "T_MG", "T_MR",
701   "T_NULL", "T_WKS", "T_HINFO", "T_MINFO", "T_RP", "T_AFSDB", "T_X25",
702   "T_ISDN", "T_RT", "T_NSAP", "T_NSAP_PTR", "T_PX", "T_GPOS", "T_EID",
703   "T_NIMLOC", "T_ATMA", "T_NAPTR", "T_KX", "T_A6", "T_DNAME", "T_SINK",
704   "T_OPT", "T_APL", "T_UINFO", "T_UID", "T_GID", "T_UNSPEC", "T_TKEY",
705   "T_TSIG", "T_IXFR", "T_AXFR", "T_MAILB", "T_MAILA", "T_DS", "T_DLV",
706   "T_SSHFP", "T_RRSIG", "T_NSEC", "T_DNSKEY", "T_SPF", "T_NSEC3",
707   "T_IPSECKEY", "T_DHCID", "T_NSEC3PARAM", "T_TLSA", "T_URI", "T_NID",
708   "T_L32", "T_L64", "T_LP", "T_EUI48", "T_EUI64", "T_CAA", "T_CDS",
709   "T_CDNSKEY", "T_OPENPGPKEY", "T_CSYNC", "DOLLAR_TTL", "DOLLAR_ORIGIN",
710   "NL", "SP", "STR", "PREV", "BITLAB", "T_TTL", "T_RRCLASS", "URR",
711   "T_UTYPE", "'.'", "'@'", "$accept", "lines", "line", "sp", "trail",
712   "ttl_directive", "origin_directive", "rr", "owner", "classttl", "dname",
713   "abs_dname", "label", "rel_dname", "wire_dname", "wire_abs_dname",
714   "wire_label", "wire_rel_dname", "str_seq", "concatenated_str_seq",
715   "nxt_seq", "nsec_more", "nsec_seq", "str_sp_seq", "str_dot_seq",
716   "dotted_str", "type_and_rdata", "rdata_a", "rdata_domain_name",
717   "rdata_soa", "rdata_wks", "rdata_hinfo", "rdata_minfo", "rdata_mx",
718   "rdata_txt", "rdata_rp", "rdata_afsdb", "rdata_x25", "rdata_isdn",
719   "rdata_rt", "rdata_nsap", "rdata_px", "rdata_aaaa", "rdata_loc",
720   "rdata_nxt", "rdata_srv", "rdata_naptr", "rdata_kx", "rdata_cert",
721   "rdata_apl", "rdata_apl_seq", "rdata_ds", "rdata_dlv", "rdata_sshfp",
722   "rdata_dhcid", "rdata_rrsig", "rdata_nsec", "rdata_nsec3",
723   "rdata_nsec3_param", "rdata_tlsa", "rdata_dnskey", "rdata_ipsec_base",
724   "rdata_ipseckey", "rdata_nid", "rdata_l32", "rdata_l64", "rdata_lp",
725   "rdata_eui48", "rdata_eui64", "rdata_uri", "rdata_caa",
726   "rdata_openpgpkey", "rdata_csync", "rdata_unknown", YY_NULLPTR
727 };
728 #endif
729 
730 # ifdef YYPRINT
731 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
732    (internal) symbol number NUM (which must be that of a token).  */
733 static const yytype_uint16 yytoknum[] =
734 {
735        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
736      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
737      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
738      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
739      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
740      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
741      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
742      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
743      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
744       46,    64
745 };
746 # endif
747 
748 #define YYPACT_NINF -434
749 
750 #define yypact_value_is_default(Yystate) \
751   (!!((Yystate) == (-434)))
752 
753 #define YYTABLE_NINF -1
754 
755 #define yytable_value_is_error(Yytable_value) \
756   0
757 
758   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
759      STATE-NUM.  */
760 static const yytype_int16 yypact[] =
761 {
762     -434,   106,  -434,   -76,   -55,   -55,  -434,  -434,  -434,   -47,
763     -434,  -434,  -434,  -434,    98,  -434,  -434,  -434,   161,   -55,
764     -434,  -434,    12,  -434,   157,    18,  -434,  -434,  -434,   -55,
765      -55,   775,    40,    30,   263,   263,    53,   -52,   -70,   -55,
766      -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,
767      -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,
768      -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,
769      -55,   263,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,
770      -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,   -55,
771      -55,   -55,   -55,   -55,   -55,   -55,   155,   -55,  -434,  -434,
772     -434,   305,  -434,  -434,  -434,   -55,   -55,    59,    42,   -51,
773       59,    42,    59,    42,    42,    38,    42,   111,   120,   123,
774       69,    42,    42,    42,    42,    42,    59,   127,    42,    42,
775      131,   134,   138,   141,   150,   153,   169,   172,    42,   -75,
776     -434,   179,   181,   190,   111,    72,    38,    59,   193,   200,
777      202,   204,   215,   218,   227,   236,   239,   243,   250,   258,
778      260,   179,    38,   202,   269,    77,    35,  -434,    40,    40,
779     -434,    13,  -434,    56,  -434,  -434,   263,  -434,  -434,   -55,
780     -434,  -434,   263,    71,  -434,  -434,  -434,  -434,    56,  -434,
781     -434,  -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,   -55,
782     -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,   -55,  -434,
783     -434,  -434,  -434,    58,  -434,  -434,  -434,  -434,  -434,  -434,
784     -434,  -434,  -434,  -434,  -434,  -434,   -57,  -434,  -434,   -55,
785     -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,   -55,  -434,
786     -434,   263,  -434,  -434,   263,  -434,  -434,   -55,  -434,  -434,
787     -434,    63,  -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,
788      -55,  -434,  -434,  -434,  -434,    71,  -434,   263,  -434,   -55,
789     -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,  -434,  -434,
790     -434,  -434,   307,  -434,  -434,    81,  -434,  -434,  -434,  -434,
791     -434,  -434,   -55,  -434,  -434,   -55,   263,  -434,  -434,  -434,
792      263,  -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,   -55,
793     -434,  -434,   -55,  -434,  -434,   -55,  -434,  -434,   -55,  -434,
794     -434,   -55,  -434,  -434,   263,  -434,  -434,   263,  -434,  -434,
795      -55,  -434,  -434,  -434,  -434,  -434,  -434,   263,  -434,  -434,
796      -55,  -434,  -434,  -434,  -434,    92,   310,    94,  -434,  -434,
797       18,    29,  -434,  -434,   312,   317,    18,   320,   323,   325,
798      117,    16,  -434,   333,   341,    18,    18,    18,  -434,   101,
799     -434,    18,   135,  -434,    18,   350,    18,    29,  -434,   352,
800      362,   364,  -434,   272,  -434,   144,   369,   372,   277,  -434,
801      280,  -434,   374,   376,   379,    82,    82,    82,    18,  -434,
802     -434,   381,  -434,   383,  -434,   263,  -434,   263,    71,  -434,
803      263,   -55,   -55,   -55,   -55,   -55,  -434,  -434,   -55,   263,
804      263,   263,   263,   263,   263,  -434,   -55,   -55,   263,    71,
805      -55,   -55,   -55,  -434,   272,   307,  -434,  -434,   -55,   -55,
806      263,  -434,   -55,   -55,   -55,    56,    56,    56,   263,   -55,
807      307,   277,  -434,  -434,   298,  -434,   387,   389,   391,   395,
808      397,    84,  -434,  -434,  -434,  -434,  -434,  -434,    18,   399,
809     -434,   401,   403,   424,  -434,  -434,   430,   432,  -434,   434,
810      436,   438,  -434,  -434,  -434,  -434,   440,  -434,   263,  -434,
811      -55,   -55,   -55,   -55,   -55,    58,   263,   -55,   -55,   -55,
812      263,   -55,   -55,   -55,   -55,   263,   263,  -434,   424,   455,
813      457,    18,   424,  -434,  -434,   459,   424,   424,  -434,   468,
814       82,   470,   424,  -434,  -434,   263,   -55,   -55,   263,   263,
815      -55,   263,   263,   -55,    71,   263,   263,  -434,   475,   477,
816     -434,  -434,   481,  -434,  -434,   486,  -434,  -434,   -55,   -55,
817      -55,   307,   488,   490,    18,  -434,   -55,   -55,   263,   492,
818      494,  -434,   263,   -55,  -434,    86,   -55,   424,   263,  -434
819 };
820 
821   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
822      Performed when YYTABLE does not specify something else to do.  Zero
823      means the default is an error.  */
824 static const yytype_uint8 yydefact[] =
825 {
826        2,     0,     1,     0,     0,     0,     4,    11,    31,    20,
827       32,    28,    29,     3,     0,     7,     8,     9,    21,     0,
828       26,    33,    27,    10,     0,     0,     6,     5,    12,     0,
829        0,     0,    19,    30,     0,     0,     0,    23,    22,     0,
830        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
831        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
832        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
833        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
834        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
835        0,     0,     0,     0,     0,     0,     0,     0,    18,    34,
836       13,     0,    15,    16,    17,     0,     0,     0,     0,     0,
837        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
838        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
839        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
840      133,     0,     0,     0,     0,     0,     0,     0,     0,     0,
841        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
842        0,     0,     0,     0,     0,     0,     0,    14,    24,    25,
843       59,     0,    60,     0,    63,    64,     0,    65,    66,     0,
844       89,    90,     0,    42,    91,    92,    71,    72,     0,   117,
845      118,    83,    84,     0,   121,   122,     0,   113,   114,     0,
846       73,    74,     0,   111,   112,     0,   123,   124,     0,   129,
847      130,    44,    45,     0,   119,   120,    67,    68,    69,    70,
848       75,    76,    77,    78,    79,    80,     0,    81,    82,     0,
849       85,    86,     0,    87,    88,     0,    95,    96,     0,    97,
850       98,     0,    99,   100,     0,   101,   102,     0,   107,   108,
851       57,     0,   109,   110,     0,   115,   116,     0,   125,   126,
852        0,   127,   128,   131,   132,   204,   134,     0,   135,     0,
853      136,   137,     0,   138,   139,     0,   140,   141,   142,   143,
854       39,    37,     0,    35,    40,    36,   144,   145,   150,   151,
855       93,    94,     0,   146,   147,     0,     0,   103,   104,    55,
856        0,   105,   106,     0,   148,   149,     0,   152,   153,     0,
857      176,   177,     0,   154,   155,     0,   156,   157,     0,   158,
858      159,     0,   160,   161,     0,   162,   163,     0,   164,   165,
859        0,   166,   167,   168,   169,   170,   171,     0,   172,   173,
860        0,   174,   175,   179,   178,     0,     0,    61,   180,   181,
861        0,     0,   187,   196,     0,     0,     0,     0,     0,     0,
862        0,     0,   197,     0,     0,     0,     0,     0,   190,     0,
863      191,     0,     0,   194,     0,     0,     0,     0,   203,     0,
864        0,     0,    53,     0,   211,    38,     0,     0,     0,   218,
865        0,   209,     0,     0,     0,     0,     0,     0,     0,   223,
866      224,     0,   227,     0,   231,     0,    62,     0,    43,    48,
867        0,     0,     0,     0,     0,     0,    47,    46,     0,     0,
868        0,     0,     0,     0,     0,    58,     0,     0,     0,   205,
869        0,     0,     0,    51,     0,     0,    54,    41,     0,     0,
870        0,    56,     0,     0,     0,     0,     0,     0,     0,     0,
871        0,     0,   230,   186,     0,   198,     0,     0,     0,     0,
872        0,     0,   184,   185,   188,   189,   192,   193,     0,     0,
873      201,     0,     0,     0,    50,    52,     0,     0,   217,     0,
874        0,     0,   219,   220,   221,   222,     0,   228,     0,    49,
875        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
876        0,     0,     0,     0,     0,     0,     0,   229,     0,     0,
877        0,     0,     0,   183,   195,     0,     0,     0,   208,     0,
878        0,     0,     0,   225,   226,     0,     0,     0,     0,     0,
879        0,     0,     0,     0,   216,     0,     0,   215,     0,     0,
880      199,   202,     0,   206,   207,     0,   213,   214,     0,     0,
881        0,     0,     0,     0,     0,   212,     0,     0,     0,     0,
882        0,   200,     0,     0,   182,     0,     0,     0,     0,   210
883 };
884 
885   /* YYPGOTO[NTERM-NUM].  */
886 static const yytype_int16 yypgoto[] =
887 {
888     -434,  -434,  -434,    -1,   209,  -434,  -434,  -434,  -434,  -434,
889        0,   205,   142,   217,  -315,  -434,  -127,  -434,  -434,  -196,
890     -434,  -164,  -433,  -139,  -434,    24,  -434,  -434,  -102,  -434,
891     -434,  -434,  -434,  -434,   130,  -434,  -434,  -434,  -434,  -434,
892     -434,  -434,  -434,  -434,  -434,  -434,  -434,  -434,  -434,  -434,
893     -434,   118,  -434,  -434,  -434,   145,  -434,  -434,  -434,  -434,
894     -136,  -434,  -434,  -434,  -434,  -434,  -434,  -434,  -434,  -434,
895     -434,  -434,  -434,   757
896 };
897 
898   /* YYDEFGOTO[NTERM-NUM].  */
899 static const yytype_int16 yydefgoto[] =
900 {
901       -1,     1,    13,   101,   102,    15,    16,    17,    18,    31,
902      176,    20,    21,    22,   282,   283,   284,   285,   182,   213,
903      410,   436,   384,   300,   251,   183,    98,   174,   177,   200,
904      227,   230,   233,   180,   184,   236,   239,   242,   245,   248,
905      252,   255,   189,   214,   194,   206,   258,   261,   209,   266,
906      267,   270,   273,   276,   301,   203,   286,   293,   304,   307,
907      197,   296,   297,   313,   316,   319,   322,   325,   328,   310,
908      331,   338,   341,   175
909 };
910 
911   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
912      positive, shift that token.  If negative, reduce the rule whose
913      number is the opposite.  If YYTABLE_NINF, syntax error.  */
914 static const yytype_uint16 yytable[] =
915 {
916       14,    19,   475,    24,    25,    23,   167,    28,   170,   186,
917      288,   191,    28,   171,   345,   172,   106,   487,    32,   216,
918      218,   220,   222,   224,   337,     7,   335,     7,    37,    38,
919       28,    28,   179,   347,    26,   105,   263,   171,   107,   108,
920      109,   110,   111,   112,   113,   114,   115,   116,   117,   118,
921      119,   120,   121,   122,   123,   124,   125,   126,   127,   128,
922      129,   130,   131,   132,   133,   134,   135,   136,   137,   138,
923      139,   141,   142,   143,   144,   145,   146,   147,   148,   149,
924      150,   151,   152,   153,   154,   155,   156,   157,   158,   159,
925      160,   161,   162,   163,   164,     7,   166,   167,    28,   417,
926       28,     8,    33,    10,   168,   169,     2,     3,    11,    12,
927      167,    28,   170,     8,   193,    10,   199,    28,   555,   172,
928       28,   196,    28,   171,    28,     8,   171,    10,   232,   235,
929      171,   173,    11,    12,   100,     7,   188,   100,     7,   100,
930        7,    28,   170,    33,   100,     7,   347,   171,   360,   172,
931      226,    28,   211,   372,    28,   280,   165,   171,   343,   212,
932      171,   347,   281,   265,    28,   170,    28,   211,    28,   280,
933      346,   385,   172,   404,   212,    99,   281,   406,   350,    27,
934       28,   351,   167,    28,   423,     4,     5,     6,     7,     8,
935        9,    10,   354,    28,   202,   355,    11,    12,   356,   171,
936      416,   357,    28,   205,   358,    28,   208,   359,   171,    28,
937      229,   171,   361,    28,   238,   171,    28,   241,   425,   171,
938       28,   244,   171,    28,   247,   363,   171,   280,   364,   171,
939       35,   365,    28,   250,   366,    28,   254,   367,   171,    28,
940       34,   171,    36,   369,   103,   104,   371,    29,    30,   440,
941      566,    28,   257,   374,    28,   260,   375,   171,   437,   376,
942      171,    28,   269,    28,   272,   495,   377,   171,   379,   171,
943      474,   380,    28,   275,   381,    28,   292,   290,   171,   333,
944      140,   171,    28,   295,    28,   299,    28,   303,   171,   278,
945      171,   386,   171,     0,   387,   388,     0,    28,   306,   390,
946       28,   309,   392,   171,     0,   393,   171,     0,   394,    28,
947      312,   395,   488,     0,   396,   171,     0,   397,    28,   315,
948      398,    28,   318,     0,   171,    28,   321,   171,     0,   401,
949        0,   171,    28,   324,   500,     0,   390,     0,   171,   403,
950       28,   327,    28,   330,   100,     7,   171,     0,   171,     0,
951      407,    28,   340,   433,   434,   435,   412,   171,   167,    28,
952      299,   167,    28,   441,     0,   420,   421,   422,     0,   525,
953        0,   424,     0,   529,   426,   408,   428,   531,   532,   167,
954       28,   489,   348,   536,     0,   349,   167,    28,   382,   383,
955        0,   352,    28,   405,    28,   409,     0,   353,   448,    28,
956      411,   429,    28,   413,   451,    28,   414,    28,   415,   454,
957      456,   457,   458,   459,   460,    28,   418,   461,     0,   445,
958      446,   447,   362,    28,   419,   468,   469,     0,   568,   471,
959      472,   473,    28,   427,    28,   430,     0,   476,   477,   390,
960        0,   479,   480,   481,    28,   431,    28,   432,   486,     0,
961      368,    28,   438,   370,    28,   439,    28,   442,    28,   443,
962      373,    28,   444,    28,   449,    28,   450,     0,   496,    28,
963      490,    28,   491,    28,   492,     0,   378,    28,   493,    28,
964      494,    28,   497,    28,   498,    28,   499,   390,     0,   508,
965      509,   510,   511,   512,   361,     0,   515,   516,   517,   390,
966      519,   520,   521,   522,     0,   389,    28,   299,     0,   391,
967        0,   528,    28,   501,    28,   502,    28,   503,    28,   504,
968       28,   505,    28,   506,   390,   538,   539,     0,   390,   542,
969      390,   390,   545,   399,     0,   390,   400,    28,   526,    28,
970      527,    28,   530,     0,   534,     0,   402,   552,   553,   554,
971       28,   533,    28,   535,   558,   559,   560,    28,   548,    28,
972      549,     0,   565,    28,   550,   567,     0,   390,    28,   551,
973       28,   556,    28,   557,    28,   562,    28,   563,     0,     0,
974        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
975        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
976        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
977        0,     0,     0,     0,   452,     0,   453,     0,     0,   455,
978        0,     0,     0,     0,     0,     0,     0,     0,   462,   463,
979      464,   465,   466,   467,     0,     0,     0,   470,     0,     0,
980        0,     0,     0,     0,     0,     0,     0,     0,     0,   478,
981        0,     0,     0,     0,   482,   483,   484,   485,     0,     0,
982        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
983        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
984        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
985        0,     0,     0,     0,     0,     0,     0,   507,     0,     0,
986        0,     0,     0,     0,   513,   514,     0,     0,     0,   518,
987        0,     0,     0,     0,   523,   524,     0,     0,     0,     0,
988        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
989        0,     0,     0,     0,   537,     0,     0,   540,   541,     0,
990      543,   544,     0,     0,   546,   547,     0,     0,     0,     0,
991        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
992        0,     0,     0,     0,     0,     0,     0,   561,     0,     0,
993        0,   564,     0,     0,     0,     0,     0,   569,    39,    40,
994       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
995       51,    52,    53,    54,    55,    56,    57,     0,    58,    59,
996       60,    61,    62,    63,    64,    65,    66,     0,    67,     0,
997        0,     0,     0,    68,    69,     0,    70,     0,     0,    71,
998        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
999       72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
1000       82,    83,    84,    85,    86,    87,    88,    89,    90,    91,
1001       92,    93,    94,    95,     0,     0,     0,     0,    96,     0,
1002        0,     0,     0,     0,    97,   178,   181,   185,   187,   190,
1003      192,   195,   198,   201,   204,   207,   210,   215,   217,   219,
1004      221,   223,   225,   228,   231,   234,   237,   240,   243,   246,
1005      249,   253,   256,   259,   262,   264,   268,     0,   271,   274,
1006      277,   279,   287,   289,   291,   294,   298,   302,   305,   308,
1007      311,   314,   317,   320,   323,   326,   329,   332,   334,   336,
1008      339,   342,     0,   344
1009 };
1010 
1011 static const yytype_int16 yycheck[] =
1012 {
1013        1,     1,   435,     4,     5,    81,    81,    82,    83,   111,
1014      146,   113,    82,    88,     1,    90,    86,   450,    19,   121,
1015      122,   123,   124,   125,   163,    82,   162,    82,    29,    30,
1016       82,    82,    83,    90,    81,    87,   138,    88,    39,    40,
1017       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
1018       51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
1019       61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
1020       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
1021       81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
1022       91,    92,    93,    94,    95,    82,    97,    81,    82,    83,
1023       82,    83,    90,    85,   105,   106,     0,     1,    90,    91,
1024       81,    82,    83,    83,   114,    85,   116,    82,   551,    90,
1025       82,    83,    82,    88,    82,    83,    88,    85,   128,   129,
1026       88,   107,    90,    91,    81,    82,   112,    81,    82,    81,
1027       82,    82,    83,    90,    81,    82,    90,    88,    90,    90,
1028      126,    82,    83,    90,    82,    83,     1,    88,    81,    90,
1029       88,    90,    90,   139,    82,    83,    82,    83,    82,    83,
1030      171,    90,    90,    81,    90,    33,    90,    83,   179,    81,
1031       82,   182,    81,    82,    83,    79,    80,    81,    82,    83,
1032       84,    85,   193,    82,    83,   196,    90,    91,   199,    88,
1033       83,   202,    82,    83,   205,    82,    83,   208,    88,    82,
1034       83,    88,   213,    82,    83,    88,    82,    83,    83,    88,
1035       82,    83,    88,    82,    83,   226,    88,    83,   229,    88,
1036       25,   232,    82,    83,   235,    82,    83,   238,    88,    82,
1037       83,    88,    25,   244,    35,    36,   247,    86,    87,   388,
1038      565,    82,    83,   254,    82,    83,   257,    88,   385,   260,
1039       88,    82,    83,    82,    83,   461,   267,    88,   269,    88,
1040      434,   272,    82,    83,   275,    82,    83,   147,    88,   161,
1041       71,    88,    82,    83,    82,    83,    82,    83,    88,   144,
1042       88,   292,    88,    -1,   295,   296,    -1,    82,    83,   300,
1043       82,    83,   303,    88,    -1,   306,    88,    -1,   309,    82,
1044       83,   312,   451,    -1,   315,    88,    -1,   318,    82,    83,
1045      321,    82,    83,    -1,    88,    82,    83,    88,    -1,   330,
1046       -1,    88,    82,    83,   473,    -1,   337,    -1,    88,   340,
1047       82,    83,    82,    83,    81,    82,    88,    -1,    88,    -1,
1048      350,    82,    83,    81,    82,    83,   356,    88,    81,    82,
1049       83,    81,    82,    83,    -1,   365,   366,   367,    -1,   508,
1050       -1,   371,    -1,   512,   374,   351,   376,   516,   517,    81,
1051       82,    83,   173,   522,    -1,   176,    81,    82,    81,    82,
1052       -1,   182,    82,    83,    82,    83,    -1,   188,   398,    82,
1053       83,   377,    82,    83,   405,    82,    83,    82,    83,   410,
1054      411,   412,   413,   414,   415,    82,    83,   418,    -1,   395,
1055      396,   397,   213,    82,    83,   426,   427,    -1,   567,   430,
1056      431,   432,    82,    83,    82,    83,    -1,   438,   439,   440,
1057       -1,   442,   443,   444,    82,    83,    82,    83,   449,    -1,
1058      241,    82,    83,   244,    82,    83,    82,    83,    82,    83,
1059      251,    82,    83,    82,    83,    82,    83,    -1,   468,    82,
1060       83,    82,    83,    82,    83,    -1,   267,    82,    83,    82,
1061       83,    82,    83,    82,    83,    82,    83,   488,    -1,   490,
1062      491,   492,   493,   494,   495,    -1,   497,   498,   499,   500,
1063      501,   502,   503,   504,    -1,   296,    82,    83,    -1,   300,
1064       -1,   511,    82,    83,    82,    83,    82,    83,    82,    83,
1065       82,    83,    82,    83,   525,   526,   527,    -1,   529,   530,
1066      531,   532,   533,   324,    -1,   536,   327,    82,    83,    82,
1067       83,    82,    83,    -1,   520,    -1,   337,   548,   549,   550,
1068       82,    83,    82,    83,   554,   556,   557,    82,    83,    82,
1069       83,    -1,   563,    82,    83,   566,    -1,   568,    82,    83,
1070       82,    83,    82,    83,    82,    83,    82,    83,    -1,    -1,
1071       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1072       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1073       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1074       -1,    -1,    -1,    -1,   405,    -1,   407,    -1,    -1,   410,
1075       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   419,   420,
1076      421,   422,   423,   424,    -1,    -1,    -1,   428,    -1,    -1,
1077       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   440,
1078       -1,    -1,    -1,    -1,   445,   446,   447,   448,    -1,    -1,
1079       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1080       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1081       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1082       -1,    -1,    -1,    -1,    -1,    -1,    -1,   488,    -1,    -1,
1083       -1,    -1,    -1,    -1,   495,   496,    -1,    -1,    -1,   500,
1084       -1,    -1,    -1,    -1,   505,   506,    -1,    -1,    -1,    -1,
1085       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1086       -1,    -1,    -1,    -1,   525,    -1,    -1,   528,   529,    -1,
1087      531,   532,    -1,    -1,   535,   536,    -1,    -1,    -1,    -1,
1088       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1089       -1,    -1,    -1,    -1,    -1,    -1,    -1,   558,    -1,    -1,
1090       -1,   562,    -1,    -1,    -1,    -1,    -1,   568,     3,     4,
1091        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1092       15,    16,    17,    18,    19,    20,    21,    -1,    23,    24,
1093       25,    26,    27,    28,    29,    30,    31,    -1,    33,    -1,
1094       -1,    -1,    -1,    38,    39,    -1,    41,    -1,    -1,    44,
1095       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1096       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1097       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
1098       75,    76,    77,    78,    -1,    -1,    -1,    -1,    83,    -1,
1099       -1,    -1,    -1,    -1,    89,   108,   109,   110,   111,   112,
1100      113,   114,   115,   116,   117,   118,   119,   120,   121,   122,
1101      123,   124,   125,   126,   127,   128,   129,   130,   131,   132,
1102      133,   134,   135,   136,   137,   138,   139,    -1,   141,   142,
1103      143,   144,   145,   146,   147,   148,   149,   150,   151,   152,
1104      153,   154,   155,   156,   157,   158,   159,   160,   161,   162,
1105      163,   164,    -1,   166
1106 };
1107 
1108   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1109      symbol of state STATE-NUM.  */
1110 static const yytype_uint8 yystos[] =
1111 {
1112        0,    93,     0,     1,    79,    80,    81,    82,    83,    84,
1113       85,    90,    91,    94,    95,    97,    98,    99,   100,   102,
1114      103,   104,   105,    81,    95,    95,    81,    81,    82,    86,
1115       87,   101,    95,    90,    83,   103,   105,    95,    95,     3,
1116        4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
1117       14,    15,    16,    17,    18,    19,    20,    21,    23,    24,
1118       25,    26,    27,    28,    29,    30,    31,    33,    38,    39,
1119       41,    44,    55,    56,    57,    58,    59,    60,    61,    62,
1120       63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
1121       73,    74,    75,    76,    77,    78,    83,    89,   118,   104,
1122       81,    95,    96,    96,    96,    87,    86,    95,    95,    95,
1123       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
1124       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
1125       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
1126       96,    95,    95,    95,    95,    95,    95,    95,    95,    95,
1127       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
1128       95,    95,    95,    95,    95,     1,    95,    81,    95,    95,
1129       83,    88,    90,   117,   119,   165,   102,   120,   165,    83,
1130      125,   165,   110,   117,   126,   165,   120,   165,   117,   134,
1131      165,   120,   165,   102,   136,   165,    83,   152,   165,   102,
1132      121,   165,    83,   147,   165,    83,   137,   165,    83,   140,
1133      165,    83,    90,   111,   135,   165,   120,   165,   120,   165,
1134      120,   165,   120,   165,   120,   165,   117,   122,   165,    83,
1135      123,   165,   102,   124,   165,   102,   127,   165,    83,   128,
1136      165,    83,   129,   165,    83,   130,   165,    83,   131,   165,
1137       83,   116,   132,   165,    83,   133,   165,    83,   138,   165,
1138       83,   139,   165,   120,   165,   117,   141,   142,   165,    83,
1139      143,   165,    83,   144,   165,    83,   145,   165,   147,   165,
1140       83,    90,   106,   107,   108,   109,   148,   165,   152,   165,
1141      126,   165,    83,   149,   165,    83,   153,   154,   165,    83,
1142      115,   146,   165,    83,   150,   165,    83,   151,   165,    83,
1143      161,   165,    83,   155,   165,    83,   156,   165,    83,   157,
1144      165,    83,   158,   165,    83,   159,   165,    83,   160,   165,
1145       83,   162,   165,   143,   165,   152,   165,   115,   163,   165,
1146       83,   164,   165,    81,   165,     1,    95,    90,    96,    96,
1147       95,    95,    96,    96,    95,    95,    95,    95,    95,    95,
1148       90,    95,    96,    95,    95,    95,    95,    95,    96,    95,
1149       96,    95,    90,    96,    95,    95,    95,    95,    96,    95,
1150       95,    95,    81,    82,   114,    90,    95,    95,    95,    96,
1151       95,    96,    95,    95,    95,    95,    95,    95,    95,    96,
1152       96,    95,    96,    95,    81,    83,    83,   102,   117,    83,
1153      112,    83,   102,    83,    83,    83,    83,    83,    83,    83,
1154      102,   102,   102,    83,   102,    83,   102,    83,   102,   117,
1155       83,    83,    83,    81,    82,    83,   113,   108,    83,    83,
1156      115,    83,    83,    83,    83,   117,   117,   117,   102,    83,
1157       83,    95,    96,    96,    95,    96,    95,    95,    95,    95,
1158       95,    95,    96,    96,    96,    96,    96,    96,    95,    95,
1159       96,    95,    95,    95,   113,   114,    95,    95,    96,    95,
1160       95,    95,    96,    96,    96,    96,    95,   114,   115,    83,
1161       83,    83,    83,    83,    83,   111,   102,    83,    83,    83,
1162      115,    83,    83,    83,    83,    83,    83,    96,    95,    95,
1163       95,    95,    95,    96,    96,    95,    95,    95,    96,    95,
1164       95,    95,    95,    96,    96,   115,    83,    83,   102,   115,
1165       83,   115,   115,    83,   117,    83,   115,    96,    95,    95,
1166       96,    96,    95,    96,    96,    95,    96,    96,    83,    83,
1167       83,    83,    95,    95,    95,   114,    83,    83,   102,    95,
1168       95,    96,    83,    83,    96,    95,   106,    95,   115,    96
1169 };
1170 
1171   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1172 static const yytype_uint8 yyr1[] =
1173 {
1174        0,    92,    93,    93,    94,    94,    94,    94,    94,    94,
1175       94,    95,    95,    96,    96,    97,    98,    98,    99,   100,
1176      100,   101,   101,   101,   101,   101,   102,   102,   103,   103,
1177      103,   104,   104,   105,   105,   106,   106,   107,   107,   108,
1178      109,   109,   110,   110,   111,   111,   111,   111,   112,   112,
1179      113,   113,   113,   114,   114,   115,   115,   116,   116,   117,
1180      117,   117,   117,   118,   118,   118,   118,   118,   118,   118,
1181      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1182      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1183      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1184      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1185      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1186      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1187      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1188      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1189      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1190      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1191      118,   118,   118,   118,   118,   118,   118,   118,   118,   118,
1192      119,   120,   121,   122,   123,   124,   125,   126,   127,   128,
1193      129,   130,   130,   131,   132,   133,   134,   135,   136,   137,
1194      138,   139,   140,   141,   142,   142,   143,   144,   145,   146,
1195      147,   148,   149,   150,   151,   152,   153,   154,   154,   155,
1196      156,   157,   158,   159,   160,   161,   162,   163,   164,   165,
1197      165,   165
1198 };
1199 
1200   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
1201 static const yytype_uint8 yyr2[] =
1202 {
1203        0,     2,     0,     2,     1,     2,     2,     1,     1,     1,
1204        2,     1,     2,     1,     2,     4,     4,     4,     3,     2,
1205        1,     0,     2,     2,     4,     4,     1,     1,     1,     1,
1206        2,     1,     1,     1,     3,     1,     1,     1,     2,     1,
1207        1,     3,     1,     3,     1,     1,     3,     3,     1,     3,
1208        2,     1,     2,     1,     2,     1,     3,     1,     3,     1,
1209        1,     2,     3,     3,     3,     3,     3,     3,     3,     3,
1210        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1211        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1212        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1213        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1214        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1215        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1216        3,     3,     3,     2,     3,     3,     3,     3,     3,     3,
1217        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1218        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1219        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1220        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1221        2,     2,    14,     6,     4,     4,     4,     2,     4,     4,
1222        2,     2,     4,     4,     2,     6,     2,     2,     4,     8,
1223       12,     4,     8,     2,     1,     3,     8,     8,     6,     2,
1224       18,     2,    10,     8,     8,     8,     7,     4,     2,     4,
1225        4,     4,     4,     2,     2,     6,     6,     2,     4,     6,
1226        4,     3
1227 };
1228 
1229 
1230 #define yyerrok         (yyerrstatus = 0)
1231 #define yyclearin       (yychar = YYEMPTY)
1232 #define YYEMPTY         (-2)
1233 #define YYEOF           0
1234 
1235 #define YYACCEPT        goto yyacceptlab
1236 #define YYABORT         goto yyabortlab
1237 #define YYERROR         goto yyerrorlab
1238 
1239 
1240 #define YYRECOVERING()  (!!yyerrstatus)
1241 
1242 #define YYBACKUP(Token, Value)                                  \
1243 do                                                              \
1244   if (yychar == YYEMPTY)                                        \
1245     {                                                           \
1246       yychar = (Token);                                         \
1247       yylval = (Value);                                         \
1248       YYPOPSTACK (yylen);                                       \
1249       yystate = *yyssp;                                         \
1250       goto yybackup;                                            \
1251     }                                                           \
1252   else                                                          \
1253     {                                                           \
1254       yyerror (YY_("syntax error: cannot back up")); \
1255       YYERROR;                                                  \
1256     }                                                           \
1257 while (0)
1258 
1259 /* Error token number */
1260 #define YYTERROR        1
1261 #define YYERRCODE       256
1262 
1263 
1264 
1265 /* Enable debugging if requested.  */
1266 #if YYDEBUG
1267 
1268 # ifndef YYFPRINTF
1269 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1270 #  define YYFPRINTF fprintf
1271 # endif
1272 
1273 # define YYDPRINTF(Args)                        \
1274 do {                                            \
1275   if (yydebug)                                  \
1276     YYFPRINTF Args;                             \
1277 } while (0)
1278 
1279 /* This macro is provided for backward compatibility. */
1280 #ifndef YY_LOCATION_PRINT
1281 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1282 #endif
1283 
1284 
1285 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1286 do {                                                                      \
1287   if (yydebug)                                                            \
1288     {                                                                     \
1289       YYFPRINTF (stderr, "%s ", Title);                                   \
1290       yy_symbol_print (stderr,                                            \
1291                   Type, Value); \
1292       YYFPRINTF (stderr, "\n");                                           \
1293     }                                                                     \
1294 } while (0)
1295 
1296 
1297 /*----------------------------------------.
1298 | Print this symbol's value on YYOUTPUT.  |
1299 `----------------------------------------*/
1300 
1301 static void
1302 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1303 {
1304   FILE *yyo = yyoutput;
1305   YYUSE (yyo);
1306   if (!yyvaluep)
1307     return;
1308 # ifdef YYPRINT
1309   if (yytype < YYNTOKENS)
1310     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1311 # endif
1312   YYUSE (yytype);
1313 }
1314 
1315 
1316 /*--------------------------------.
1317 | Print this symbol on YYOUTPUT.  |
1318 `--------------------------------*/
1319 
1320 static void
1321 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1322 {
1323   YYFPRINTF (yyoutput, "%s %s (",
1324              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1325 
1326   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1327   YYFPRINTF (yyoutput, ")");
1328 }
1329 
1330 /*------------------------------------------------------------------.
1331 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1332 | TOP (included).                                                   |
1333 `------------------------------------------------------------------*/
1334 
1335 static void
1336 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1337 {
1338   YYFPRINTF (stderr, "Stack now");
1339   for (; yybottom <= yytop; yybottom++)
1340     {
1341       int yybot = *yybottom;
1342       YYFPRINTF (stderr, " %d", yybot);
1343     }
1344   YYFPRINTF (stderr, "\n");
1345 }
1346 
1347 # define YY_STACK_PRINT(Bottom, Top)                            \
1348 do {                                                            \
1349   if (yydebug)                                                  \
1350     yy_stack_print ((Bottom), (Top));                           \
1351 } while (0)
1352 
1353 
1354 /*------------------------------------------------.
1355 | Report that the YYRULE is going to be reduced.  |
1356 `------------------------------------------------*/
1357 
1358 static void
1359 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1360 {
1361   unsigned long int yylno = yyrline[yyrule];
1362   int yynrhs = yyr2[yyrule];
1363   int yyi;
1364   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1365              yyrule - 1, yylno);
1366   /* The symbols being reduced.  */
1367   for (yyi = 0; yyi < yynrhs; yyi++)
1368     {
1369       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1370       yy_symbol_print (stderr,
1371                        yystos[yyssp[yyi + 1 - yynrhs]],
1372                        &(yyvsp[(yyi + 1) - (yynrhs)])
1373                                               );
1374       YYFPRINTF (stderr, "\n");
1375     }
1376 }
1377 
1378 # define YY_REDUCE_PRINT(Rule)          \
1379 do {                                    \
1380   if (yydebug)                          \
1381     yy_reduce_print (yyssp, yyvsp, Rule); \
1382 } while (0)
1383 
1384 /* Nonzero means print parse trace.  It is left uninitialized so that
1385    multiple parsers can coexist.  */
1386 int yydebug;
1387 #else /* !YYDEBUG */
1388 # define YYDPRINTF(Args)
1389 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1390 # define YY_STACK_PRINT(Bottom, Top)
1391 # define YY_REDUCE_PRINT(Rule)
1392 #endif /* !YYDEBUG */
1393 
1394 
1395 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1396 #ifndef YYINITDEPTH
1397 # define YYINITDEPTH 200
1398 #endif
1399 
1400 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1401    if the built-in stack extension method is used).
1402 
1403    Do not make this value too large; the results are undefined if
1404    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1405    evaluated with infinite-precision integer arithmetic.  */
1406 
1407 #ifndef YYMAXDEPTH
1408 # define YYMAXDEPTH 10000
1409 #endif
1410 
1411 
1412 #if YYERROR_VERBOSE
1413 
1414 # ifndef yystrlen
1415 #  if defined __GLIBC__ && defined _STRING_H
1416 #   define yystrlen strlen
1417 #  else
1418 /* Return the length of YYSTR.  */
1419 static YYSIZE_T
1420 yystrlen (const char *yystr)
1421 {
1422   YYSIZE_T yylen;
1423   for (yylen = 0; yystr[yylen]; yylen++)
1424     continue;
1425   return yylen;
1426 }
1427 #  endif
1428 # endif
1429 
1430 # ifndef yystpcpy
1431 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1432 #   define yystpcpy stpcpy
1433 #  else
1434 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1435    YYDEST.  */
1436 static char *
1437 yystpcpy (char *yydest, const char *yysrc)
1438 {
1439   char *yyd = yydest;
1440   const char *yys = yysrc;
1441 
1442   while ((*yyd++ = *yys++) != '\0')
1443     continue;
1444 
1445   return yyd - 1;
1446 }
1447 #  endif
1448 # endif
1449 
1450 # ifndef yytnamerr
1451 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1452    quotes and backslashes, so that it's suitable for yyerror.  The
1453    heuristic is that double-quoting is unnecessary unless the string
1454    contains an apostrophe, a comma, or backslash (other than
1455    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1456    null, do not copy; instead, return the length of what the result
1457    would have been.  */
1458 static YYSIZE_T
1459 yytnamerr (char *yyres, const char *yystr)
1460 {
1461   if (*yystr == '"')
1462     {
1463       YYSIZE_T yyn = 0;
1464       char const *yyp = yystr;
1465 
1466       for (;;)
1467         switch (*++yyp)
1468           {
1469           case '\'':
1470           case ',':
1471             goto do_not_strip_quotes;
1472 
1473           case '\\':
1474             if (*++yyp != '\\')
1475               goto do_not_strip_quotes;
1476             /* Fall through.  */
1477           default:
1478             if (yyres)
1479               yyres[yyn] = *yyp;
1480             yyn++;
1481             break;
1482 
1483           case '"':
1484             if (yyres)
1485               yyres[yyn] = '\0';
1486             return yyn;
1487           }
1488     do_not_strip_quotes: ;
1489     }
1490 
1491   if (! yyres)
1492     return yystrlen (yystr);
1493 
1494   return yystpcpy (yyres, yystr) - yyres;
1495 }
1496 # endif
1497 
1498 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1499    about the unexpected token YYTOKEN for the state stack whose top is
1500    YYSSP.
1501 
1502    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1503    not large enough to hold the message.  In that case, also set
1504    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1505    required number of bytes is too large to store.  */
1506 static int
1507 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1508                 yytype_int16 *yyssp, int yytoken)
1509 {
1510   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1511   YYSIZE_T yysize = yysize0;
1512   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1513   /* Internationalized format string. */
1514   const char *yyformat = YY_NULLPTR;
1515   /* Arguments of yyformat. */
1516   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1517   /* Number of reported tokens (one for the "unexpected", one per
1518      "expected"). */
1519   int yycount = 0;
1520 
1521   /* There are many possibilities here to consider:
1522      - If this state is a consistent state with a default action, then
1523        the only way this function was invoked is if the default action
1524        is an error action.  In that case, don't check for expected
1525        tokens because there are none.
1526      - The only way there can be no lookahead present (in yychar) is if
1527        this state is a consistent state with a default action.  Thus,
1528        detecting the absence of a lookahead is sufficient to determine
1529        that there is no unexpected or expected token to report.  In that
1530        case, just report a simple "syntax error".
1531      - Don't assume there isn't a lookahead just because this state is a
1532        consistent state with a default action.  There might have been a
1533        previous inconsistent state, consistent state with a non-default
1534        action, or user semantic action that manipulated yychar.
1535      - Of course, the expected token list depends on states to have
1536        correct lookahead information, and it depends on the parser not
1537        to perform extra reductions after fetching a lookahead from the
1538        scanner and before detecting a syntax error.  Thus, state merging
1539        (from LALR or IELR) and default reductions corrupt the expected
1540        token list.  However, the list is correct for canonical LR with
1541        one exception: it will still contain any token that will not be
1542        accepted due to an error action in a later state.
1543   */
1544   if (yytoken != YYEMPTY)
1545     {
1546       int yyn = yypact[*yyssp];
1547       yyarg[yycount++] = yytname[yytoken];
1548       if (!yypact_value_is_default (yyn))
1549         {
1550           /* Start YYX at -YYN if negative to avoid negative indexes in
1551              YYCHECK.  In other words, skip the first -YYN actions for
1552              this state because they are default actions.  */
1553           int yyxbegin = yyn < 0 ? -yyn : 0;
1554           /* Stay within bounds of both yycheck and yytname.  */
1555           int yychecklim = YYLAST - yyn + 1;
1556           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1557           int yyx;
1558 
1559           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1560             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1561                 && !yytable_value_is_error (yytable[yyx + yyn]))
1562               {
1563                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1564                   {
1565                     yycount = 1;
1566                     yysize = yysize0;
1567                     break;
1568                   }
1569                 yyarg[yycount++] = yytname[yyx];
1570                 {
1571                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1572                   if (! (yysize <= yysize1
1573                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1574                     return 2;
1575                   yysize = yysize1;
1576                 }
1577               }
1578         }
1579     }
1580 
1581   switch (yycount)
1582     {
1583 # define YYCASE_(N, S)                      \
1584       case N:                               \
1585         yyformat = S;                       \
1586       break
1587       YYCASE_(0, YY_("syntax error"));
1588       YYCASE_(1, YY_("syntax error, unexpected %s"));
1589       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1590       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1591       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1592       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1593 # undef YYCASE_
1594     }
1595 
1596   {
1597     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1598     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1599       return 2;
1600     yysize = yysize1;
1601   }
1602 
1603   if (*yymsg_alloc < yysize)
1604     {
1605       *yymsg_alloc = 2 * yysize;
1606       if (! (yysize <= *yymsg_alloc
1607              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1608         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1609       return 1;
1610     }
1611 
1612   /* Avoid sprintf, as that infringes on the user's name space.
1613      Don't have undefined behavior even if the translation
1614      produced a string with the wrong number of "%s"s.  */
1615   {
1616     char *yyp = *yymsg;
1617     int yyi = 0;
1618     while ((*yyp = *yyformat) != '\0')
1619       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1620         {
1621           yyp += yytnamerr (yyp, yyarg[yyi++]);
1622           yyformat += 2;
1623         }
1624       else
1625         {
1626           yyp++;
1627           yyformat++;
1628         }
1629   }
1630   return 0;
1631 }
1632 #endif /* YYERROR_VERBOSE */
1633 
1634 /*-----------------------------------------------.
1635 | Release the memory associated to this symbol.  |
1636 `-----------------------------------------------*/
1637 
1638 static void
1639 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1640 {
1641   YYUSE (yyvaluep);
1642   if (!yymsg)
1643     yymsg = "Deleting";
1644   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1645 
1646   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1647   YYUSE (yytype);
1648   YY_IGNORE_MAYBE_UNINITIALIZED_END
1649 }
1650 
1651 
1652 
1653 
1654 /* The lookahead symbol.  */
1655 int yychar;
1656 
1657 /* The semantic value of the lookahead symbol.  */
1658 YYSTYPE yylval;
1659 /* Number of syntax errors so far.  */
1660 int yynerrs;
1661 
1662 
1663 /*----------.
1664 | yyparse.  |
1665 `----------*/
1666 
1667 int
1668 yyparse (void)
1669 {
1670     int yystate;
1671     /* Number of tokens to shift before error messages enabled.  */
1672     int yyerrstatus;
1673 
1674     /* The stacks and their tools:
1675        'yyss': related to states.
1676        'yyvs': related to semantic values.
1677 
1678        Refer to the stacks through separate pointers, to allow yyoverflow
1679        to reallocate them elsewhere.  */
1680 
1681     /* The state stack.  */
1682     yytype_int16 yyssa[YYINITDEPTH];
1683     yytype_int16 *yyss;
1684     yytype_int16 *yyssp;
1685 
1686     /* The semantic value stack.  */
1687     YYSTYPE yyvsa[YYINITDEPTH];
1688     YYSTYPE *yyvs;
1689     YYSTYPE *yyvsp;
1690 
1691     YYSIZE_T yystacksize;
1692 
1693   int yyn;
1694   int yyresult;
1695   /* Lookahead token as an internal (translated) token number.  */
1696   int yytoken = 0;
1697   /* The variables used to return semantic value and location from the
1698      action routines.  */
1699   YYSTYPE yyval;
1700 
1701 #if YYERROR_VERBOSE
1702   /* Buffer for error messages, and its allocated size.  */
1703   char yymsgbuf[128];
1704   char *yymsg = yymsgbuf;
1705   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1706 #endif
1707 
1708 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1709 
1710   /* The number of symbols on the RHS of the reduced rule.
1711      Keep to zero when no symbol should be popped.  */
1712   int yylen = 0;
1713 
1714   yyssp = yyss = yyssa;
1715   yyvsp = yyvs = yyvsa;
1716   yystacksize = YYINITDEPTH;
1717 
1718   YYDPRINTF ((stderr, "Starting parse\n"));
1719 
1720   yystate = 0;
1721   yyerrstatus = 0;
1722   yynerrs = 0;
1723   yychar = YYEMPTY; /* Cause a token to be read.  */
1724   goto yysetstate;
1725 
1726 /*------------------------------------------------------------.
1727 | yynewstate -- Push a new state, which is found in yystate.  |
1728 `------------------------------------------------------------*/
1729  yynewstate:
1730   /* In all cases, when you get here, the value and location stacks
1731      have just been pushed.  So pushing a state here evens the stacks.  */
1732   yyssp++;
1733 
1734  yysetstate:
1735   *yyssp = yystate;
1736 
1737   if (yyss + yystacksize - 1 <= yyssp)
1738     {
1739       /* Get the current used size of the three stacks, in elements.  */
1740       YYSIZE_T yysize = yyssp - yyss + 1;
1741 
1742 #ifdef yyoverflow
1743       {
1744         /* Give user a chance to reallocate the stack.  Use copies of
1745            these so that the &'s don't force the real ones into
1746            memory.  */
1747         YYSTYPE *yyvs1 = yyvs;
1748         yytype_int16 *yyss1 = yyss;
1749 
1750         /* Each stack pointer address is followed by the size of the
1751            data in use in that stack, in bytes.  This used to be a
1752            conditional around just the two extra args, but that might
1753            be undefined if yyoverflow is a macro.  */
1754         yyoverflow (YY_("memory exhausted"),
1755                     &yyss1, yysize * sizeof (*yyssp),
1756                     &yyvs1, yysize * sizeof (*yyvsp),
1757                     &yystacksize);
1758 
1759         yyss = yyss1;
1760         yyvs = yyvs1;
1761       }
1762 #else /* no yyoverflow */
1763 # ifndef YYSTACK_RELOCATE
1764       goto yyexhaustedlab;
1765 # else
1766       /* Extend the stack our own way.  */
1767       if (YYMAXDEPTH <= yystacksize)
1768         goto yyexhaustedlab;
1769       yystacksize *= 2;
1770       if (YYMAXDEPTH < yystacksize)
1771         yystacksize = YYMAXDEPTH;
1772 
1773       {
1774         yytype_int16 *yyss1 = yyss;
1775         union yyalloc *yyptr =
1776           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1777         if (! yyptr)
1778           goto yyexhaustedlab;
1779         YYSTACK_RELOCATE (yyss_alloc, yyss);
1780         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1781 #  undef YYSTACK_RELOCATE
1782         if (yyss1 != yyssa)
1783           YYSTACK_FREE (yyss1);
1784       }
1785 # endif
1786 #endif /* no yyoverflow */
1787 
1788       yyssp = yyss + yysize - 1;
1789       yyvsp = yyvs + yysize - 1;
1790 
1791       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1792                   (unsigned long int) yystacksize));
1793 
1794       if (yyss + yystacksize - 1 <= yyssp)
1795         YYABORT;
1796     }
1797 
1798   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1799 
1800   if (yystate == YYFINAL)
1801     YYACCEPT;
1802 
1803   goto yybackup;
1804 
1805 /*-----------.
1806 | yybackup.  |
1807 `-----------*/
1808 yybackup:
1809 
1810   /* Do appropriate processing given the current state.  Read a
1811      lookahead token if we need one and don't already have one.  */
1812 
1813   /* First try to decide what to do without reference to lookahead token.  */
1814   yyn = yypact[yystate];
1815   if (yypact_value_is_default (yyn))
1816     goto yydefault;
1817 
1818   /* Not known => get a lookahead token if don't already have one.  */
1819 
1820   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1821   if (yychar == YYEMPTY)
1822     {
1823       YYDPRINTF ((stderr, "Reading a token: "));
1824       yychar = yylex ();
1825     }
1826 
1827   if (yychar <= YYEOF)
1828     {
1829       yychar = yytoken = YYEOF;
1830       YYDPRINTF ((stderr, "Now at end of input.\n"));
1831     }
1832   else
1833     {
1834       yytoken = YYTRANSLATE (yychar);
1835       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1836     }
1837 
1838   /* If the proper action on seeing token YYTOKEN is to reduce or to
1839      detect an error, take that action.  */
1840   yyn += yytoken;
1841   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1842     goto yydefault;
1843   yyn = yytable[yyn];
1844   if (yyn <= 0)
1845     {
1846       if (yytable_value_is_error (yyn))
1847         goto yyerrlab;
1848       yyn = -yyn;
1849       goto yyreduce;
1850     }
1851 
1852   /* Count tokens shifted since error; after three, turn off error
1853      status.  */
1854   if (yyerrstatus)
1855     yyerrstatus--;
1856 
1857   /* Shift the lookahead token.  */
1858   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1859 
1860   /* Discard the shifted token.  */
1861   yychar = YYEMPTY;
1862 
1863   yystate = yyn;
1864   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1865   *++yyvsp = yylval;
1866   YY_IGNORE_MAYBE_UNINITIALIZED_END
1867 
1868   goto yynewstate;
1869 
1870 
1871 /*-----------------------------------------------------------.
1872 | yydefault -- do the default action for the current state.  |
1873 `-----------------------------------------------------------*/
1874 yydefault:
1875   yyn = yydefact[yystate];
1876   if (yyn == 0)
1877     goto yyerrlab;
1878   goto yyreduce;
1879 
1880 
1881 /*-----------------------------.
1882 | yyreduce -- Do a reduction.  |
1883 `-----------------------------*/
1884 yyreduce:
1885   /* yyn is the number of a rule to reduce with.  */
1886   yylen = yyr2[yyn];
1887 
1888   /* If YYLEN is nonzero, implement the default value of the action:
1889      '$$ = $1'.
1890 
1891      Otherwise, the following line sets YYVAL to garbage.
1892      This behavior is undocumented and Bison
1893      users should not rely upon it.  Assigning to YYVAL
1894      unconditionally makes the parser a bit smaller, and it avoids a
1895      GCC warning that YYVAL may be used uninitialized.  */
1896   yyval = yyvsp[1-yylen];
1897 
1898 
1899   YY_REDUCE_PRINT (yyn);
1900   switch (yyn)
1901     {
1902         case 6:
1903 #line 98 "zparser.y" /* yacc.c:1646  */
1904     {}
1905 #line 1906 "zparser.c" /* yacc.c:1646  */
1906     break;
1907 
1908   case 7:
1909 #line 100 "zparser.y" /* yacc.c:1646  */
1910     {
1911 	    region_free_all(parser->rr_region);
1912 	    parser->current_rr.type = 0;
1913 	    parser->current_rr.rdata_count = 0;
1914 	    parser->current_rr.rdatas = parser->temporary_rdatas;
1915 	    parser->error_occurred = 0;
1916     }
1917 #line 1918 "zparser.c" /* yacc.c:1646  */
1918     break;
1919 
1920   case 8:
1921 #line 108 "zparser.y" /* yacc.c:1646  */
1922     {
1923 	    region_free_all(parser->rr_region);
1924 	    parser->current_rr.type = 0;
1925 	    parser->current_rr.rdata_count = 0;
1926 	    parser->current_rr.rdatas = parser->temporary_rdatas;
1927 	    parser->error_occurred = 0;
1928     }
1929 #line 1930 "zparser.c" /* yacc.c:1646  */
1930     break;
1931 
1932   case 9:
1933 #line 116 "zparser.y" /* yacc.c:1646  */
1934     {	/* rr should be fully parsed */
1935 	    if (!parser->error_occurred) {
1936 			    parser->current_rr.rdatas
1937 				    =(rdata_atom_type *)region_alloc_array_init(
1938 					    parser->region,
1939 					    parser->current_rr.rdatas,
1940 					    parser->current_rr.rdata_count,
1941 					    sizeof(rdata_atom_type));
1942 
1943 			    process_rr();
1944 	    }
1945 
1946 	    region_free_all(parser->rr_region);
1947 
1948 	    parser->current_rr.type = 0;
1949 	    parser->current_rr.rdata_count = 0;
1950 	    parser->current_rr.rdatas = parser->temporary_rdatas;
1951 	    parser->error_occurred = 0;
1952     }
1953 #line 1954 "zparser.c" /* yacc.c:1646  */
1954     break;
1955 
1956   case 15:
1957 #line 148 "zparser.y" /* yacc.c:1646  */
1958     {
1959 	    parser->default_ttl = zparser_ttl2int((yyvsp[-1].data).str, &(parser->error_occurred));
1960 	    if (parser->error_occurred == 1) {
1961 		    parser->default_ttl = DEFAULT_TTL;
1962 			parser->error_occurred = 0;
1963 	    }
1964     }
1965 #line 1966 "zparser.c" /* yacc.c:1646  */
1966     break;
1967 
1968   case 16:
1969 #line 158 "zparser.y" /* yacc.c:1646  */
1970     {
1971 	    /* if previous origin is unused, remove it, do not leak it */
1972 	    if(parser->origin != error_domain && parser->origin != (yyvsp[-1].domain)) {
1973 		/* protect $3 from deletion, because deldomain walks up */
1974 		(yyvsp[-1].domain)->usage ++;
1975 	    	domain_table_deldomain(parser->db, parser->origin);
1976 		(yyvsp[-1].domain)->usage --;
1977 	    }
1978 	    parser->origin = (yyvsp[-1].domain);
1979     }
1980 #line 1981 "zparser.c" /* yacc.c:1646  */
1981     break;
1982 
1983   case 17:
1984 #line 169 "zparser.y" /* yacc.c:1646  */
1985     {
1986 	    zc_error_prev_line("$ORIGIN directive requires absolute domain name");
1987     }
1988 #line 1989 "zparser.c" /* yacc.c:1646  */
1989     break;
1990 
1991   case 18:
1992 #line 175 "zparser.y" /* yacc.c:1646  */
1993     {
1994 	    parser->current_rr.owner = (yyvsp[-2].domain);
1995 	    parser->current_rr.type = (yyvsp[0].type);
1996     }
1997 #line 1998 "zparser.c" /* yacc.c:1646  */
1998     break;
1999 
2000   case 19:
2001 #line 182 "zparser.y" /* yacc.c:1646  */
2002     {
2003 	    parser->prev_dname = (yyvsp[-1].domain);
2004 	    (yyval.domain) = (yyvsp[-1].domain);
2005     }
2006 #line 2007 "zparser.c" /* yacc.c:1646  */
2007     break;
2008 
2009   case 20:
2010 #line 187 "zparser.y" /* yacc.c:1646  */
2011     {
2012 	    (yyval.domain) = parser->prev_dname;
2013     }
2014 #line 2015 "zparser.c" /* yacc.c:1646  */
2015     break;
2016 
2017   case 21:
2018 #line 193 "zparser.y" /* yacc.c:1646  */
2019     {
2020 	    parser->current_rr.ttl = parser->default_ttl;
2021 	    parser->current_rr.klass = parser->default_class;
2022     }
2023 #line 2024 "zparser.c" /* yacc.c:1646  */
2024     break;
2025 
2026   case 22:
2027 #line 198 "zparser.y" /* yacc.c:1646  */
2028     {
2029 	    parser->current_rr.ttl = parser->default_ttl;
2030 	    parser->current_rr.klass = (yyvsp[-1].klass);
2031     }
2032 #line 2033 "zparser.c" /* yacc.c:1646  */
2033     break;
2034 
2035   case 23:
2036 #line 203 "zparser.y" /* yacc.c:1646  */
2037     {
2038 	    parser->current_rr.ttl = (yyvsp[-1].ttl);
2039 	    parser->current_rr.klass = parser->default_class;
2040     }
2041 #line 2042 "zparser.c" /* yacc.c:1646  */
2042     break;
2043 
2044   case 24:
2045 #line 208 "zparser.y" /* yacc.c:1646  */
2046     {
2047 	    parser->current_rr.ttl = (yyvsp[-3].ttl);
2048 	    parser->current_rr.klass = (yyvsp[-1].klass);
2049     }
2050 #line 2051 "zparser.c" /* yacc.c:1646  */
2051     break;
2052 
2053   case 25:
2054 #line 213 "zparser.y" /* yacc.c:1646  */
2055     {
2056 	    parser->current_rr.ttl = (yyvsp[-1].ttl);
2057 	    parser->current_rr.klass = (yyvsp[-3].klass);
2058     }
2059 #line 2060 "zparser.c" /* yacc.c:1646  */
2060     break;
2061 
2062   case 27:
2063 #line 221 "zparser.y" /* yacc.c:1646  */
2064     {
2065 	    if ((yyvsp[0].dname) == error_dname) {
2066 		    (yyval.domain) = error_domain;
2067 	    } else if(parser->origin == error_domain) {
2068 		    zc_error("cannot concatenate origin to domain name, because origin failed to parse");
2069 		    (yyval.domain) = error_domain;
2070 	    } else if ((yyvsp[0].dname)->name_size + domain_dname(parser->origin)->name_size - 1 > MAXDOMAINLEN) {
2071 		    zc_error("domain name exceeds %d character limit", MAXDOMAINLEN);
2072 		    (yyval.domain) = error_domain;
2073 	    } else {
2074 		    (yyval.domain) = domain_table_insert(
2075 			    parser->db->domains,
2076 			    dname_concatenate(
2077 				    parser->rr_region,
2078 				    (yyvsp[0].dname),
2079 				    domain_dname(parser->origin)));
2080 	    }
2081     }
2082 #line 2083 "zparser.c" /* yacc.c:1646  */
2083     break;
2084 
2085   case 28:
2086 #line 242 "zparser.y" /* yacc.c:1646  */
2087     {
2088 	    (yyval.domain) = parser->db->domains->root;
2089     }
2090 #line 2091 "zparser.c" /* yacc.c:1646  */
2091     break;
2092 
2093   case 29:
2094 #line 246 "zparser.y" /* yacc.c:1646  */
2095     {
2096 	    (yyval.domain) = parser->origin;
2097     }
2098 #line 2099 "zparser.c" /* yacc.c:1646  */
2099     break;
2100 
2101   case 30:
2102 #line 250 "zparser.y" /* yacc.c:1646  */
2103     {
2104 	    if ((yyvsp[-1].dname) != error_dname) {
2105 		    (yyval.domain) = domain_table_insert(parser->db->domains, (yyvsp[-1].dname));
2106 	    } else {
2107 		    (yyval.domain) = error_domain;
2108 	    }
2109     }
2110 #line 2111 "zparser.c" /* yacc.c:1646  */
2111     break;
2112 
2113   case 31:
2114 #line 260 "zparser.y" /* yacc.c:1646  */
2115     {
2116 	    if ((yyvsp[0].data).len > MAXLABELLEN) {
2117 		    zc_error("label exceeds %d character limit", MAXLABELLEN);
2118 		    (yyval.dname) = error_dname;
2119 	    } else if ((yyvsp[0].data).len <= 0) {
2120 		    zc_error("zero label length");
2121 		    (yyval.dname) = error_dname;
2122 	    } else {
2123 		    (yyval.dname) = dname_make_from_label(parser->rr_region,
2124 					       (uint8_t *) (yyvsp[0].data).str,
2125 					       (yyvsp[0].data).len);
2126 	    }
2127     }
2128 #line 2129 "zparser.c" /* yacc.c:1646  */
2129     break;
2130 
2131   case 32:
2132 #line 274 "zparser.y" /* yacc.c:1646  */
2133     {
2134 	    zc_error("bitlabels are now deprecated. RFC2673 is obsoleted.");
2135 	    (yyval.dname) = error_dname;
2136     }
2137 #line 2138 "zparser.c" /* yacc.c:1646  */
2138     break;
2139 
2140   case 34:
2141 #line 282 "zparser.y" /* yacc.c:1646  */
2142     {
2143 	    if ((yyvsp[-2].dname) == error_dname || (yyvsp[0].dname) == error_dname) {
2144 		    (yyval.dname) = error_dname;
2145 	    } else if ((yyvsp[-2].dname)->name_size + (yyvsp[0].dname)->name_size - 1 > MAXDOMAINLEN) {
2146 		    zc_error("domain name exceeds %d character limit",
2147 			     MAXDOMAINLEN);
2148 		    (yyval.dname) = error_dname;
2149 	    } else {
2150 		    (yyval.dname) = dname_concatenate(parser->rr_region, (yyvsp[-2].dname), (yyvsp[0].dname));
2151 	    }
2152     }
2153 #line 2154 "zparser.c" /* yacc.c:1646  */
2154     break;
2155 
2156   case 37:
2157 #line 304 "zparser.y" /* yacc.c:1646  */
2158     {
2159 	    char *result = (char *) region_alloc(parser->rr_region, 2);
2160 	    result[0] = 0;
2161 	    result[1] = '\0';
2162 	    (yyval.data).str = result;
2163 	    (yyval.data).len = 1;
2164     }
2165 #line 2166 "zparser.c" /* yacc.c:1646  */
2166     break;
2167 
2168   case 38:
2169 #line 312 "zparser.y" /* yacc.c:1646  */
2170     {
2171 	    char *result = (char *) region_alloc(parser->rr_region,
2172 						 (yyvsp[-1].data).len + 2);
2173 	    memcpy(result, (yyvsp[-1].data).str, (yyvsp[-1].data).len);
2174 	    result[(yyvsp[-1].data).len] = 0;
2175 	    result[(yyvsp[-1].data).len+1] = '\0';
2176 	    (yyval.data).str = result;
2177 	    (yyval.data).len = (yyvsp[-1].data).len + 1;
2178     }
2179 #line 2180 "zparser.c" /* yacc.c:1646  */
2180     break;
2181 
2182   case 39:
2183 #line 324 "zparser.y" /* yacc.c:1646  */
2184     {
2185 	    char *result = (char *) region_alloc(parser->rr_region,
2186 						 (yyvsp[0].data).len + 1);
2187 
2188 	    if ((yyvsp[0].data).len > MAXLABELLEN)
2189 		    zc_error("label exceeds %d character limit", MAXLABELLEN);
2190 
2191 	    /* make label anyway */
2192 	    result[0] = (yyvsp[0].data).len;
2193 	    memcpy(result+1, (yyvsp[0].data).str, (yyvsp[0].data).len);
2194 
2195 	    (yyval.data).str = result;
2196 	    (yyval.data).len = (yyvsp[0].data).len + 1;
2197     }
2198 #line 2199 "zparser.c" /* yacc.c:1646  */
2199     break;
2200 
2201   case 41:
2202 #line 342 "zparser.y" /* yacc.c:1646  */
2203     {
2204 	    if ((yyvsp[-2].data).len + (yyvsp[0].data).len - 3 > MAXDOMAINLEN)
2205 		    zc_error("domain name exceeds %d character limit",
2206 			     MAXDOMAINLEN);
2207 
2208 	    /* make dname anyway */
2209 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len;
2210 	    (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len + 1);
2211 	    memcpy((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2212 	    memcpy((yyval.data).str + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len);
2213 	    (yyval.data).str[(yyval.data).len] = '\0';
2214     }
2215 #line 2216 "zparser.c" /* yacc.c:1646  */
2216     break;
2217 
2218   case 42:
2219 #line 357 "zparser.y" /* yacc.c:1646  */
2220     {
2221 	    zadd_rdata_txt_wireformat(zparser_conv_text(parser->rr_region, (yyvsp[0].data).str, (yyvsp[0].data).len), 1);
2222     }
2223 #line 2224 "zparser.c" /* yacc.c:1646  */
2224     break;
2225 
2226   case 43:
2227 #line 361 "zparser.y" /* yacc.c:1646  */
2228     {
2229 	    zadd_rdata_txt_wireformat(zparser_conv_text(parser->rr_region, (yyvsp[0].data).str, (yyvsp[0].data).len), 0);
2230     }
2231 #line 2232 "zparser.c" /* yacc.c:1646  */
2232     break;
2233 
2234   case 45:
2235 #line 372 "zparser.y" /* yacc.c:1646  */
2236     {
2237 	    (yyval.data).len = 1;
2238 	    (yyval.data).str = region_strdup(parser->rr_region, ".");
2239     }
2240 #line 2241 "zparser.c" /* yacc.c:1646  */
2241     break;
2242 
2243   case 46:
2244 #line 377 "zparser.y" /* yacc.c:1646  */
2245     {
2246 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1;
2247 	    (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len + 1);
2248 	    memcpy((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2249 	    memcpy((yyval.data).str + (yyvsp[-2].data).len, " ", 1);
2250 	    memcpy((yyval.data).str + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len);
2251 	    (yyval.data).str[(yyval.data).len] = '\0';
2252     }
2253 #line 2254 "zparser.c" /* yacc.c:1646  */
2254     break;
2255 
2256   case 47:
2257 #line 386 "zparser.y" /* yacc.c:1646  */
2258     {
2259 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1;
2260 	    (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len + 1);
2261 	    memcpy((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2262 	    memcpy((yyval.data).str + (yyvsp[-2].data).len, ".", 1);
2263 	    memcpy((yyval.data).str + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len);
2264 	    (yyval.data).str[(yyval.data).len] = '\0';
2265     }
2266 #line 2267 "zparser.c" /* yacc.c:1646  */
2267     break;
2268 
2269   case 48:
2270 #line 398 "zparser.y" /* yacc.c:1646  */
2271     {
2272 	    uint16_t type = rrtype_from_string((yyvsp[0].data).str);
2273 	    if (type != 0 && type < 128) {
2274 		    set_bit(nxtbits, type);
2275 	    } else {
2276 		    zc_error("bad type %d in NXT record", (int) type);
2277 	    }
2278     }
2279 #line 2280 "zparser.c" /* yacc.c:1646  */
2280     break;
2281 
2282   case 49:
2283 #line 407 "zparser.y" /* yacc.c:1646  */
2284     {
2285 	    uint16_t type = rrtype_from_string((yyvsp[0].data).str);
2286 	    if (type != 0 && type < 128) {
2287 		    set_bit(nxtbits, type);
2288 	    } else {
2289 		    zc_error("bad type %d in NXT record", (int) type);
2290 	    }
2291     }
2292 #line 2293 "zparser.c" /* yacc.c:1646  */
2293     break;
2294 
2295   case 50:
2296 #line 418 "zparser.y" /* yacc.c:1646  */
2297     {
2298     }
2299 #line 2300 "zparser.c" /* yacc.c:1646  */
2300     break;
2301 
2302   case 51:
2303 #line 421 "zparser.y" /* yacc.c:1646  */
2304     {
2305     }
2306 #line 2307 "zparser.c" /* yacc.c:1646  */
2307     break;
2308 
2309   case 52:
2310 #line 424 "zparser.y" /* yacc.c:1646  */
2311     {
2312 	    uint16_t type = rrtype_from_string((yyvsp[-1].data).str);
2313 	    if (type != 0) {
2314                     if (type > nsec_highest_rcode) {
2315                             nsec_highest_rcode = type;
2316                     }
2317 		    set_bitnsec(nsecbits, type);
2318 	    } else {
2319 		    zc_error("bad type %d in NSEC record", (int) type);
2320 	    }
2321     }
2322 #line 2323 "zparser.c" /* yacc.c:1646  */
2323     break;
2324 
2325   case 56:
2326 #line 447 "zparser.y" /* yacc.c:1646  */
2327     {
2328 	    char *result = (char *) region_alloc(parser->rr_region,
2329 						 (yyvsp[-2].data).len + (yyvsp[0].data).len + 1);
2330 	    memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2331 	    memcpy(result + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len);
2332 	    (yyval.data).str = result;
2333 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len;
2334 	    (yyval.data).str[(yyval.data).len] = '\0';
2335     }
2336 #line 2337 "zparser.c" /* yacc.c:1646  */
2337     break;
2338 
2339   case 58:
2340 #line 464 "zparser.y" /* yacc.c:1646  */
2341     {
2342 	    char *result = (char *) region_alloc(parser->rr_region,
2343 						 (yyvsp[-2].data).len + (yyvsp[0].data).len + 1);
2344 	    memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2345 	    memcpy(result + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len);
2346 	    (yyval.data).str = result;
2347 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len;
2348 	    (yyval.data).str[(yyval.data).len] = '\0';
2349     }
2350 #line 2351 "zparser.c" /* yacc.c:1646  */
2351     break;
2352 
2353   case 60:
2354 #line 480 "zparser.y" /* yacc.c:1646  */
2355     {
2356 	(yyval.data).str = ".";
2357 	(yyval.data).len = 1;
2358     }
2359 #line 2360 "zparser.c" /* yacc.c:1646  */
2360     break;
2361 
2362   case 61:
2363 #line 485 "zparser.y" /* yacc.c:1646  */
2364     {
2365 	    char *result = (char *) region_alloc(parser->rr_region,
2366 						 (yyvsp[-1].data).len + 2);
2367 	    memcpy(result, (yyvsp[-1].data).str, (yyvsp[-1].data).len);
2368 	    result[(yyvsp[-1].data).len] = '.';
2369 	    (yyval.data).str = result;
2370 	    (yyval.data).len = (yyvsp[-1].data).len + 1;
2371 	    (yyval.data).str[(yyval.data).len] = '\0';
2372     }
2373 #line 2374 "zparser.c" /* yacc.c:1646  */
2374     break;
2375 
2376   case 62:
2377 #line 495 "zparser.y" /* yacc.c:1646  */
2378     {
2379 	    char *result = (char *) region_alloc(parser->rr_region,
2380 						 (yyvsp[-2].data).len + (yyvsp[0].data).len + 2);
2381 	    memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len);
2382 	    result[(yyvsp[-2].data).len] = '.';
2383 	    memcpy(result + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len);
2384 	    (yyval.data).str = result;
2385 	    (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1;
2386 	    (yyval.data).str[(yyval.data).len] = '\0';
2387     }
2388 #line 2389 "zparser.c" /* yacc.c:1646  */
2389     break;
2390 
2391   case 64:
2392 #line 513 "zparser.y" /* yacc.c:1646  */
2393     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2394 #line 2395 "zparser.c" /* yacc.c:1646  */
2395     break;
2396 
2397   case 66:
2398 #line 515 "zparser.y" /* yacc.c:1646  */
2399     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2400 #line 2401 "zparser.c" /* yacc.c:1646  */
2401     break;
2402 
2403   case 67:
2404 #line 516 "zparser.y" /* yacc.c:1646  */
2405     { zc_warning_prev_line("MD is obsolete"); }
2406 #line 2407 "zparser.c" /* yacc.c:1646  */
2407     break;
2408 
2409   case 68:
2410 #line 518 "zparser.y" /* yacc.c:1646  */
2411     {
2412 	    zc_warning_prev_line("MD is obsolete");
2413 	    (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown));
2414     }
2415 #line 2416 "zparser.c" /* yacc.c:1646  */
2416     break;
2417 
2418   case 69:
2419 #line 522 "zparser.y" /* yacc.c:1646  */
2420     { zc_warning_prev_line("MF is obsolete"); }
2421 #line 2422 "zparser.c" /* yacc.c:1646  */
2422     break;
2423 
2424   case 70:
2425 #line 524 "zparser.y" /* yacc.c:1646  */
2426     {
2427 	    zc_warning_prev_line("MF is obsolete");
2428 	    (yyval.type) = (yyvsp[-2].type);
2429 	    parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown));
2430     }
2431 #line 2432 "zparser.c" /* yacc.c:1646  */
2432     break;
2433 
2434   case 72:
2435 #line 530 "zparser.y" /* yacc.c:1646  */
2436     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2437 #line 2438 "zparser.c" /* yacc.c:1646  */
2438     break;
2439 
2440   case 74:
2441 #line 532 "zparser.y" /* yacc.c:1646  */
2442     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2443 #line 2444 "zparser.c" /* yacc.c:1646  */
2444     break;
2445 
2446   case 75:
2447 #line 533 "zparser.y" /* yacc.c:1646  */
2448     { zc_warning_prev_line("MB is obsolete"); }
2449 #line 2450 "zparser.c" /* yacc.c:1646  */
2450     break;
2451 
2452   case 76:
2453 #line 535 "zparser.y" /* yacc.c:1646  */
2454     {
2455 	    zc_warning_prev_line("MB is obsolete");
2456 	    (yyval.type) = (yyvsp[-2].type);
2457 	    parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown));
2458     }
2459 #line 2460 "zparser.c" /* yacc.c:1646  */
2460     break;
2461 
2462   case 78:
2463 #line 541 "zparser.y" /* yacc.c:1646  */
2464     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2465 #line 2466 "zparser.c" /* yacc.c:1646  */
2466     break;
2467 
2468   case 80:
2469 #line 543 "zparser.y" /* yacc.c:1646  */
2470     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2471 #line 2472 "zparser.c" /* yacc.c:1646  */
2472     break;
2473 
2474   case 82:
2475 #line 546 "zparser.y" /* yacc.c:1646  */
2476     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2477 #line 2478 "zparser.c" /* yacc.c:1646  */
2478     break;
2479 
2480   case 84:
2481 #line 548 "zparser.y" /* yacc.c:1646  */
2482     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2483 #line 2484 "zparser.c" /* yacc.c:1646  */
2484     break;
2485 
2486   case 86:
2487 #line 550 "zparser.y" /* yacc.c:1646  */
2488     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2489 #line 2490 "zparser.c" /* yacc.c:1646  */
2490     break;
2491 
2492   case 88:
2493 #line 552 "zparser.y" /* yacc.c:1646  */
2494     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2495 #line 2496 "zparser.c" /* yacc.c:1646  */
2496     break;
2497 
2498   case 90:
2499 #line 554 "zparser.y" /* yacc.c:1646  */
2500     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2501 #line 2502 "zparser.c" /* yacc.c:1646  */
2502     break;
2503 
2504   case 92:
2505 #line 556 "zparser.y" /* yacc.c:1646  */
2506     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2507 #line 2508 "zparser.c" /* yacc.c:1646  */
2508     break;
2509 
2510   case 94:
2511 #line 558 "zparser.y" /* yacc.c:1646  */
2512     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2513 #line 2514 "zparser.c" /* yacc.c:1646  */
2514     break;
2515 
2516   case 96:
2517 #line 560 "zparser.y" /* yacc.c:1646  */
2518     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2519 #line 2520 "zparser.c" /* yacc.c:1646  */
2520     break;
2521 
2522   case 98:
2523 #line 562 "zparser.y" /* yacc.c:1646  */
2524     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2525 #line 2526 "zparser.c" /* yacc.c:1646  */
2526     break;
2527 
2528   case 100:
2529 #line 564 "zparser.y" /* yacc.c:1646  */
2530     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2531 #line 2532 "zparser.c" /* yacc.c:1646  */
2532     break;
2533 
2534   case 102:
2535 #line 566 "zparser.y" /* yacc.c:1646  */
2536     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2537 #line 2538 "zparser.c" /* yacc.c:1646  */
2538     break;
2539 
2540   case 104:
2541 #line 568 "zparser.y" /* yacc.c:1646  */
2542     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2543 #line 2544 "zparser.c" /* yacc.c:1646  */
2544     break;
2545 
2546   case 106:
2547 #line 570 "zparser.y" /* yacc.c:1646  */
2548     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2549 #line 2550 "zparser.c" /* yacc.c:1646  */
2550     break;
2551 
2552   case 108:
2553 #line 572 "zparser.y" /* yacc.c:1646  */
2554     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2555 #line 2556 "zparser.c" /* yacc.c:1646  */
2556     break;
2557 
2558   case 110:
2559 #line 574 "zparser.y" /* yacc.c:1646  */
2560     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2561 #line 2562 "zparser.c" /* yacc.c:1646  */
2562     break;
2563 
2564   case 112:
2565 #line 576 "zparser.y" /* yacc.c:1646  */
2566     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2567 #line 2568 "zparser.c" /* yacc.c:1646  */
2568     break;
2569 
2570   case 114:
2571 #line 578 "zparser.y" /* yacc.c:1646  */
2572     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2573 #line 2574 "zparser.c" /* yacc.c:1646  */
2574     break;
2575 
2576   case 116:
2577 #line 580 "zparser.y" /* yacc.c:1646  */
2578     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2579 #line 2580 "zparser.c" /* yacc.c:1646  */
2580     break;
2581 
2582   case 118:
2583 #line 582 "zparser.y" /* yacc.c:1646  */
2584     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2585 #line 2586 "zparser.c" /* yacc.c:1646  */
2586     break;
2587 
2588   case 120:
2589 #line 584 "zparser.y" /* yacc.c:1646  */
2590     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2591 #line 2592 "zparser.c" /* yacc.c:1646  */
2592     break;
2593 
2594   case 122:
2595 #line 586 "zparser.y" /* yacc.c:1646  */
2596     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2597 #line 2598 "zparser.c" /* yacc.c:1646  */
2598     break;
2599 
2600   case 124:
2601 #line 588 "zparser.y" /* yacc.c:1646  */
2602     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2603 #line 2604 "zparser.c" /* yacc.c:1646  */
2604     break;
2605 
2606   case 126:
2607 #line 590 "zparser.y" /* yacc.c:1646  */
2608     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2609 #line 2610 "zparser.c" /* yacc.c:1646  */
2610     break;
2611 
2612   case 128:
2613 #line 592 "zparser.y" /* yacc.c:1646  */
2614     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2615 #line 2616 "zparser.c" /* yacc.c:1646  */
2616     break;
2617 
2618   case 130:
2619 #line 594 "zparser.y" /* yacc.c:1646  */
2620     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2621 #line 2622 "zparser.c" /* yacc.c:1646  */
2622     break;
2623 
2624   case 132:
2625 #line 596 "zparser.y" /* yacc.c:1646  */
2626     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2627 #line 2628 "zparser.c" /* yacc.c:1646  */
2628     break;
2629 
2630   case 135:
2631 #line 599 "zparser.y" /* yacc.c:1646  */
2632     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2633 #line 2634 "zparser.c" /* yacc.c:1646  */
2634     break;
2635 
2636   case 137:
2637 #line 601 "zparser.y" /* yacc.c:1646  */
2638     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2639 #line 2640 "zparser.c" /* yacc.c:1646  */
2640     break;
2641 
2642   case 138:
2643 #line 602 "zparser.y" /* yacc.c:1646  */
2644     { if (dlv_warn) { dlv_warn = 0; zc_warning_prev_line("DLV is experimental"); } }
2645 #line 2646 "zparser.c" /* yacc.c:1646  */
2646     break;
2647 
2648   case 139:
2649 #line 603 "zparser.y" /* yacc.c:1646  */
2650     { if (dlv_warn) { dlv_warn = 0; zc_warning_prev_line("DLV is experimental"); } (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2651 #line 2652 "zparser.c" /* yacc.c:1646  */
2652     break;
2653 
2654   case 141:
2655 #line 605 "zparser.y" /* yacc.c:1646  */
2656     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2657 #line 2658 "zparser.c" /* yacc.c:1646  */
2658     break;
2659 
2660   case 143:
2661 #line 607 "zparser.y" /* yacc.c:1646  */
2662     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2663 #line 2664 "zparser.c" /* yacc.c:1646  */
2664     break;
2665 
2666   case 145:
2667 #line 609 "zparser.y" /* yacc.c:1646  */
2668     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2669 #line 2670 "zparser.c" /* yacc.c:1646  */
2670     break;
2671 
2672   case 147:
2673 #line 611 "zparser.y" /* yacc.c:1646  */
2674     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2675 #line 2676 "zparser.c" /* yacc.c:1646  */
2676     break;
2677 
2678   case 149:
2679 #line 613 "zparser.y" /* yacc.c:1646  */
2680     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2681 #line 2682 "zparser.c" /* yacc.c:1646  */
2682     break;
2683 
2684   case 151:
2685 #line 615 "zparser.y" /* yacc.c:1646  */
2686     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2687 #line 2688 "zparser.c" /* yacc.c:1646  */
2688     break;
2689 
2690   case 153:
2691 #line 617 "zparser.y" /* yacc.c:1646  */
2692     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2693 #line 2694 "zparser.c" /* yacc.c:1646  */
2694     break;
2695 
2696   case 155:
2697 #line 619 "zparser.y" /* yacc.c:1646  */
2698     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2699 #line 2700 "zparser.c" /* yacc.c:1646  */
2700     break;
2701 
2702   case 157:
2703 #line 621 "zparser.y" /* yacc.c:1646  */
2704     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2705 #line 2706 "zparser.c" /* yacc.c:1646  */
2706     break;
2707 
2708   case 159:
2709 #line 623 "zparser.y" /* yacc.c:1646  */
2710     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2711 #line 2712 "zparser.c" /* yacc.c:1646  */
2712     break;
2713 
2714   case 161:
2715 #line 625 "zparser.y" /* yacc.c:1646  */
2716     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2717 #line 2718 "zparser.c" /* yacc.c:1646  */
2718     break;
2719 
2720   case 163:
2721 #line 627 "zparser.y" /* yacc.c:1646  */
2722     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2723 #line 2724 "zparser.c" /* yacc.c:1646  */
2724     break;
2725 
2726   case 165:
2727 #line 629 "zparser.y" /* yacc.c:1646  */
2728     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2729 #line 2730 "zparser.c" /* yacc.c:1646  */
2730     break;
2731 
2732   case 167:
2733 #line 631 "zparser.y" /* yacc.c:1646  */
2734     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2735 #line 2736 "zparser.c" /* yacc.c:1646  */
2736     break;
2737 
2738   case 169:
2739 #line 633 "zparser.y" /* yacc.c:1646  */
2740     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2741 #line 2742 "zparser.c" /* yacc.c:1646  */
2742     break;
2743 
2744   case 171:
2745 #line 635 "zparser.y" /* yacc.c:1646  */
2746     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2747 #line 2748 "zparser.c" /* yacc.c:1646  */
2748     break;
2749 
2750   case 173:
2751 #line 637 "zparser.y" /* yacc.c:1646  */
2752     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2753 #line 2754 "zparser.c" /* yacc.c:1646  */
2754     break;
2755 
2756   case 175:
2757 #line 639 "zparser.y" /* yacc.c:1646  */
2758     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2759 #line 2760 "zparser.c" /* yacc.c:1646  */
2760     break;
2761 
2762   case 177:
2763 #line 641 "zparser.y" /* yacc.c:1646  */
2764     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2765 #line 2766 "zparser.c" /* yacc.c:1646  */
2766     break;
2767 
2768   case 178:
2769 #line 642 "zparser.y" /* yacc.c:1646  */
2770     { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); }
2771 #line 2772 "zparser.c" /* yacc.c:1646  */
2772     break;
2773 
2774   case 179:
2775 #line 644 "zparser.y" /* yacc.c:1646  */
2776     {
2777 	    zc_error_prev_line("unrecognized RR type '%s'", (yyvsp[-2].data).str);
2778     }
2779 #line 2780 "zparser.c" /* yacc.c:1646  */
2780     break;
2781 
2782   case 180:
2783 #line 656 "zparser.y" /* yacc.c:1646  */
2784     {
2785 	    zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-1].data).str));
2786     }
2787 #line 2788 "zparser.c" /* yacc.c:1646  */
2788     break;
2789 
2790   case 181:
2791 #line 662 "zparser.y" /* yacc.c:1646  */
2792     {
2793 	    /* convert a single dname record */
2794 	    zadd_rdata_domain((yyvsp[-1].domain));
2795     }
2796 #line 2797 "zparser.c" /* yacc.c:1646  */
2797     break;
2798 
2799   case 182:
2800 #line 669 "zparser.y" /* yacc.c:1646  */
2801     {
2802 	    /* convert the soa data */
2803 	    zadd_rdata_domain((yyvsp[-13].domain));	/* prim. ns */
2804 	    zadd_rdata_domain((yyvsp[-11].domain));	/* email */
2805 	    zadd_rdata_wireformat(zparser_conv_serial(parser->region, (yyvsp[-9].data).str)); /* serial */
2806 	    zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-7].data).str)); /* refresh */
2807 	    zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-5].data).str)); /* retry */
2808 	    zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-3].data).str)); /* expire */
2809 	    zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-1].data).str)); /* minimum */
2810     }
2811 #line 2812 "zparser.c" /* yacc.c:1646  */
2812     break;
2813 
2814   case 183:
2815 #line 682 "zparser.y" /* yacc.c:1646  */
2816     {
2817 	    zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-5].data).str)); /* address */
2818 	    zadd_rdata_wireformat(zparser_conv_services(parser->region, (yyvsp[-3].data).str, (yyvsp[-1].data).str)); /* protocol and services */
2819     }
2820 #line 2821 "zparser.c" /* yacc.c:1646  */
2821     break;
2822 
2823   case 184:
2824 #line 689 "zparser.y" /* yacc.c:1646  */
2825     {
2826 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* CPU */
2827 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* OS*/
2828     }
2829 #line 2830 "zparser.c" /* yacc.c:1646  */
2830     break;
2831 
2832   case 185:
2833 #line 696 "zparser.y" /* yacc.c:1646  */
2834     {
2835 	    /* convert a single dname record */
2836 	    zadd_rdata_domain((yyvsp[-3].domain));
2837 	    zadd_rdata_domain((yyvsp[-1].domain));
2838     }
2839 #line 2840 "zparser.c" /* yacc.c:1646  */
2840     break;
2841 
2842   case 186:
2843 #line 704 "zparser.y" /* yacc.c:1646  */
2844     {
2845 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str));  /* priority */
2846 	    zadd_rdata_domain((yyvsp[-1].domain));	/* MX host */
2847     }
2848 #line 2849 "zparser.c" /* yacc.c:1646  */
2849     break;
2850 
2851   case 187:
2852 #line 711 "zparser.y" /* yacc.c:1646  */
2853     {
2854 	zadd_rdata_txt_clean_wireformat();
2855     }
2856 #line 2857 "zparser.c" /* yacc.c:1646  */
2857     break;
2858 
2859   case 188:
2860 #line 718 "zparser.y" /* yacc.c:1646  */
2861     {
2862 	    zadd_rdata_domain((yyvsp[-3].domain)); /* mbox d-name */
2863 	    zadd_rdata_domain((yyvsp[-1].domain)); /* txt d-name */
2864     }
2865 #line 2866 "zparser.c" /* yacc.c:1646  */
2866     break;
2867 
2868   case 189:
2869 #line 726 "zparser.y" /* yacc.c:1646  */
2870     {
2871 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* subtype */
2872 	    zadd_rdata_domain((yyvsp[-1].domain)); /* domain name */
2873     }
2874 #line 2875 "zparser.c" /* yacc.c:1646  */
2875     break;
2876 
2877   case 190:
2878 #line 734 "zparser.y" /* yacc.c:1646  */
2879     {
2880 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* X.25 address. */
2881     }
2882 #line 2883 "zparser.c" /* yacc.c:1646  */
2883     break;
2884 
2885   case 191:
2886 #line 741 "zparser.y" /* yacc.c:1646  */
2887     {
2888 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* address */
2889     }
2890 #line 2891 "zparser.c" /* yacc.c:1646  */
2891     break;
2892 
2893   case 192:
2894 #line 745 "zparser.y" /* yacc.c:1646  */
2895     {
2896 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* address */
2897 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* sub-address */
2898     }
2899 #line 2900 "zparser.c" /* yacc.c:1646  */
2900     break;
2901 
2902   case 193:
2903 #line 753 "zparser.y" /* yacc.c:1646  */
2904     {
2905 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */
2906 	    zadd_rdata_domain((yyvsp[-1].domain)); /* intermediate host */
2907     }
2908 #line 2909 "zparser.c" /* yacc.c:1646  */
2909     break;
2910 
2911   case 194:
2912 #line 761 "zparser.y" /* yacc.c:1646  */
2913     {
2914 	    /* String must start with "0x" or "0X".	 */
2915 	    if (strncasecmp((yyvsp[-1].data).str, "0x", 2) != 0) {
2916 		    zc_error_prev_line("NSAP rdata must start with '0x'");
2917 	    } else {
2918 		    zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str + 2, (yyvsp[-1].data).len - 2)); /* NSAP */
2919 	    }
2920     }
2921 #line 2922 "zparser.c" /* yacc.c:1646  */
2922     break;
2923 
2924   case 195:
2925 #line 773 "zparser.y" /* yacc.c:1646  */
2926     {
2927 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* preference */
2928 	    zadd_rdata_domain((yyvsp[-3].domain)); /* MAP822 */
2929 	    zadd_rdata_domain((yyvsp[-1].domain)); /* MAPX400 */
2930     }
2931 #line 2932 "zparser.c" /* yacc.c:1646  */
2932     break;
2933 
2934   case 196:
2935 #line 781 "zparser.y" /* yacc.c:1646  */
2936     {
2937 	    zadd_rdata_wireformat(zparser_conv_aaaa(parser->region, (yyvsp[-1].data).str));  /* IPv6 address */
2938     }
2939 #line 2940 "zparser.c" /* yacc.c:1646  */
2940     break;
2941 
2942   case 197:
2943 #line 787 "zparser.y" /* yacc.c:1646  */
2944     {
2945 	    zadd_rdata_wireformat(zparser_conv_loc(parser->region, (yyvsp[-1].data).str)); /* Location */
2946     }
2947 #line 2948 "zparser.c" /* yacc.c:1646  */
2948     break;
2949 
2950   case 198:
2951 #line 793 "zparser.y" /* yacc.c:1646  */
2952     {
2953 	    zadd_rdata_domain((yyvsp[-3].domain)); /* nxt name */
2954 	    zadd_rdata_wireformat(zparser_conv_nxt(parser->region, nxtbits)); /* nxt bitlist */
2955 	    memset(nxtbits, 0, sizeof(nxtbits));
2956     }
2957 #line 2958 "zparser.c" /* yacc.c:1646  */
2958     break;
2959 
2960   case 199:
2961 #line 801 "zparser.y" /* yacc.c:1646  */
2962     {
2963 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* prio */
2964 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* weight */
2965 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* port */
2966 	    zadd_rdata_domain((yyvsp[-1].domain)); /* target name */
2967     }
2968 #line 2969 "zparser.c" /* yacc.c:1646  */
2969     break;
2970 
2971   case 200:
2972 #line 811 "zparser.y" /* yacc.c:1646  */
2973     {
2974 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-11].data).str)); /* order */
2975 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-9].data).str)); /* preference */
2976 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-7].data).str, (yyvsp[-7].data).len)); /* flags */
2977 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-5].data).str, (yyvsp[-5].data).len)); /* service */
2978 	    zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* regexp */
2979 	    zadd_rdata_domain((yyvsp[-1].domain)); /* target name */
2980     }
2981 #line 2982 "zparser.c" /* yacc.c:1646  */
2982     break;
2983 
2984   case 201:
2985 #line 823 "zparser.y" /* yacc.c:1646  */
2986     {
2987 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */
2988 	    zadd_rdata_domain((yyvsp[-1].domain)); /* exchanger */
2989     }
2990 #line 2991 "zparser.c" /* yacc.c:1646  */
2991     break;
2992 
2993   case 202:
2994 #line 831 "zparser.y" /* yacc.c:1646  */
2995     {
2996 	    zadd_rdata_wireformat(zparser_conv_certificate_type(parser->region, (yyvsp[-7].data).str)); /* type */
2997 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* key tag */
2998 	    zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-3].data).str)); /* algorithm */
2999 	    zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* certificate or CRL */
3000     }
3001 #line 3002 "zparser.c" /* yacc.c:1646  */
3002     break;
3003 
3004   case 204:
3005 #line 844 "zparser.y" /* yacc.c:1646  */
3006     {
3007 	    zadd_rdata_wireformat(zparser_conv_apl_rdata(parser->region, (yyvsp[0].data).str));
3008     }
3009 #line 3010 "zparser.c" /* yacc.c:1646  */
3010     break;
3011 
3012   case 205:
3013 #line 848 "zparser.y" /* yacc.c:1646  */
3014     {
3015 	    zadd_rdata_wireformat(zparser_conv_apl_rdata(parser->region, (yyvsp[0].data).str));
3016     }
3017 #line 3018 "zparser.c" /* yacc.c:1646  */
3018     break;
3019 
3020   case 206:
3021 #line 854 "zparser.y" /* yacc.c:1646  */
3022     {
3023 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* keytag */
3024 	    zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-5].data).str)); /* alg */
3025 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* type */
3026 	    zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */
3027     }
3028 #line 3029 "zparser.c" /* yacc.c:1646  */
3029     break;
3030 
3031   case 207:
3032 #line 863 "zparser.y" /* yacc.c:1646  */
3033     {
3034 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* keytag */
3035 	    zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-5].data).str)); /* alg */
3036 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* type */
3037 	    zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */
3038     }
3039 #line 3040 "zparser.c" /* yacc.c:1646  */
3040     break;
3041 
3042   case 208:
3043 #line 872 "zparser.y" /* yacc.c:1646  */
3044     {
3045 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* alg */
3046 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* fp type */
3047 	    zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */
3048     }
3049 #line 3050 "zparser.c" /* yacc.c:1646  */
3050     break;
3051 
3052   case 209:
3053 #line 880 "zparser.y" /* yacc.c:1646  */
3054     {
3055 	    zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* data blob */
3056     }
3057 #line 3058 "zparser.c" /* yacc.c:1646  */
3058     break;
3059 
3060   case 210:
3061 #line 886 "zparser.y" /* yacc.c:1646  */
3062     {
3063 	    zadd_rdata_wireformat(zparser_conv_rrtype(parser->region, (yyvsp[-17].data).str)); /* rr covered */
3064 	    zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-15].data).str)); /* alg */
3065 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-13].data).str)); /* # labels */
3066 	    zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-11].data).str)); /* # orig TTL */
3067 	    zadd_rdata_wireformat(zparser_conv_time(parser->region, (yyvsp[-9].data).str)); /* sig exp */
3068 	    zadd_rdata_wireformat(zparser_conv_time(parser->region, (yyvsp[-7].data).str)); /* sig inc */
3069 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* key id */
3070 	    zadd_rdata_wireformat(zparser_conv_dns_name(parser->region,
3071 				(const uint8_t*) (yyvsp[-3].data).str,(yyvsp[-3].data).len)); /* sig name */
3072 	    zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* sig data */
3073     }
3074 #line 3075 "zparser.c" /* yacc.c:1646  */
3075     break;
3076 
3077   case 211:
3078 #line 901 "zparser.y" /* yacc.c:1646  */
3079     {
3080 	    zadd_rdata_wireformat(zparser_conv_dns_name(parser->region,
3081 				(const uint8_t*) (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* nsec name */
3082 	    zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */
3083 	    memset(nsecbits, 0, sizeof(nsecbits));
3084             nsec_highest_rcode = 0;
3085     }
3086 #line 3087 "zparser.c" /* yacc.c:1646  */
3087     break;
3088 
3089   case 212:
3090 #line 911 "zparser.y" /* yacc.c:1646  */
3091     {
3092 #ifdef NSEC3
3093 	    nsec3_add_params((yyvsp[-9].data).str, (yyvsp[-7].data).str, (yyvsp[-5].data).str, (yyvsp[-3].data).str, (yyvsp[-3].data).len);
3094 
3095 	    zadd_rdata_wireformat(zparser_conv_b32(parser->region, (yyvsp[-1].data).str)); /* next hashed name */
3096 	    zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */
3097 	    memset(nsecbits, 0, sizeof(nsecbits));
3098 	    nsec_highest_rcode = 0;
3099 #else
3100 	    zc_error_prev_line("nsec3 not supported");
3101 #endif /* NSEC3 */
3102     }
3103 #line 3104 "zparser.c" /* yacc.c:1646  */
3104     break;
3105 
3106   case 213:
3107 #line 926 "zparser.y" /* yacc.c:1646  */
3108     {
3109 #ifdef NSEC3
3110 	    nsec3_add_params((yyvsp[-7].data).str, (yyvsp[-5].data).str, (yyvsp[-3].data).str, (yyvsp[-1].data).str, (yyvsp[-1].data).len);
3111 #else
3112 	    zc_error_prev_line("nsec3 not supported");
3113 #endif /* NSEC3 */
3114     }
3115 #line 3116 "zparser.c" /* yacc.c:1646  */
3116     break;
3117 
3118   case 214:
3119 #line 936 "zparser.y" /* yacc.c:1646  */
3120     {
3121 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-7].data).str)); /* usage */
3122 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* selector */
3123 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* matching type */
3124 	    zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* ca data */
3125     }
3126 #line 3127 "zparser.c" /* yacc.c:1646  */
3127     break;
3128 
3129   case 215:
3130 #line 945 "zparser.y" /* yacc.c:1646  */
3131     {
3132 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* flags */
3133 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* proto */
3134 	    zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-3].data).str)); /* alg */
3135 	    zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* hash */
3136     }
3137 #line 3138 "zparser.c" /* yacc.c:1646  */
3138     break;
3139 
3140   case 216:
3141 #line 954 "zparser.y" /* yacc.c:1646  */
3142     {
3143 	    const dname_type* name = 0;
3144 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-6].data).str)); /* precedence */
3145 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-4].data).str)); /* gateway type */
3146 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-2].data).str)); /* algorithm */
3147 	    switch(atoi((yyvsp[-4].data).str)) {
3148 		case IPSECKEY_NOGATEWAY:
3149 			zadd_rdata_wireformat(alloc_rdata_init(parser->region, "", 0));
3150 			break;
3151 		case IPSECKEY_IP4:
3152 			zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[0].data).str));
3153 			break;
3154 		case IPSECKEY_IP6:
3155 			zadd_rdata_wireformat(zparser_conv_aaaa(parser->region, (yyvsp[0].data).str));
3156 			break;
3157 		case IPSECKEY_DNAME:
3158 			/* convert and insert the dname */
3159 			if(strlen((yyvsp[0].data).str) == 0)
3160 				zc_error_prev_line("IPSECKEY must specify gateway name");
3161 			if(!(name = dname_parse(parser->region, (yyvsp[0].data).str)))
3162 				zc_error_prev_line("IPSECKEY bad gateway dname %s", (yyvsp[0].data).str);
3163 			if((yyvsp[0].data).str[strlen((yyvsp[0].data).str)-1] != '.') {
3164 				if(parser->origin == error_domain) {
3165 		    			zc_error("cannot concatenate origin to domain name, because origin failed to parse");
3166 					break;
3167 				}
3168 				name = dname_concatenate(parser->rr_region, name,
3169 					domain_dname(parser->origin));
3170 			}
3171 			zadd_rdata_wireformat(alloc_rdata_init(parser->region,
3172 				dname_name(name), name->name_size));
3173 			break;
3174 		default:
3175 			zc_error_prev_line("unknown IPSECKEY gateway type");
3176 	    }
3177     }
3178 #line 3179 "zparser.c" /* yacc.c:1646  */
3179     break;
3180 
3181   case 217:
3182 #line 993 "zparser.y" /* yacc.c:1646  */
3183     {
3184 	   zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* public key */
3185     }
3186 #line 3187 "zparser.c" /* yacc.c:1646  */
3187     break;
3188 
3189   case 219:
3190 #line 1001 "zparser.y" /* yacc.c:1646  */
3191     {
3192 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str));  /* preference */
3193 	    zadd_rdata_wireformat(zparser_conv_ilnp64(parser->region, (yyvsp[-1].data).str));  /* NodeID */
3194     }
3195 #line 3196 "zparser.c" /* yacc.c:1646  */
3196     break;
3197 
3198   case 220:
3199 #line 1008 "zparser.y" /* yacc.c:1646  */
3200     {
3201 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str));  /* preference */
3202 	    zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-1].data).str));  /* Locator32 */
3203     }
3204 #line 3205 "zparser.c" /* yacc.c:1646  */
3205     break;
3206 
3207   case 221:
3208 #line 1015 "zparser.y" /* yacc.c:1646  */
3209     {
3210 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str));  /* preference */
3211 	    zadd_rdata_wireformat(zparser_conv_ilnp64(parser->region, (yyvsp[-1].data).str));  /* Locator64 */
3212     }
3213 #line 3214 "zparser.c" /* yacc.c:1646  */
3214     break;
3215 
3216   case 222:
3217 #line 1022 "zparser.y" /* yacc.c:1646  */
3218     {
3219 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str));  /* preference */
3220 	    zadd_rdata_domain((yyvsp[-1].domain));  /* FQDN */
3221     }
3222 #line 3223 "zparser.c" /* yacc.c:1646  */
3223     break;
3224 
3225   case 223:
3226 #line 1029 "zparser.y" /* yacc.c:1646  */
3227     {
3228 	    zadd_rdata_wireformat(zparser_conv_eui(parser->region, (yyvsp[-1].data).str, 48));
3229     }
3230 #line 3231 "zparser.c" /* yacc.c:1646  */
3231     break;
3232 
3233   case 224:
3234 #line 1035 "zparser.y" /* yacc.c:1646  */
3235     {
3236 	    zadd_rdata_wireformat(zparser_conv_eui(parser->region, (yyvsp[-1].data).str, 64));
3237     }
3238 #line 3239 "zparser.c" /* yacc.c:1646  */
3239     break;
3240 
3241   case 225:
3242 #line 1042 "zparser.y" /* yacc.c:1646  */
3243     {
3244 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* priority */
3245 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* weight */
3246 	    zadd_rdata_wireformat(zparser_conv_long_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* target */
3247     }
3248 #line 3249 "zparser.c" /* yacc.c:1646  */
3249     break;
3250 
3251   case 226:
3252 #line 1051 "zparser.y" /* yacc.c:1646  */
3253     {
3254 	    zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* Flags */
3255 	    zadd_rdata_wireformat(zparser_conv_tag(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* Tag */
3256 	    zadd_rdata_wireformat(zparser_conv_long_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* Value */
3257     }
3258 #line 3259 "zparser.c" /* yacc.c:1646  */
3259     break;
3260 
3261   case 227:
3262 #line 1060 "zparser.y" /* yacc.c:1646  */
3263     {
3264 	    zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str));
3265     }
3266 #line 3267 "zparser.c" /* yacc.c:1646  */
3267     break;
3268 
3269   case 228:
3270 #line 1067 "zparser.y" /* yacc.c:1646  */
3271     {
3272 	    zadd_rdata_wireformat(zparser_conv_serial(parser->region, (yyvsp[-3].data).str));
3273 	    zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-1].data).str));
3274 	    zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */
3275 	    memset(nsecbits, 0, sizeof(nsecbits));
3276             nsec_highest_rcode = 0;
3277     }
3278 #line 3279 "zparser.c" /* yacc.c:1646  */
3279     break;
3280 
3281   case 229:
3282 #line 1077 "zparser.y" /* yacc.c:1646  */
3283     {
3284 	    /* $2 is the number of octets, currently ignored */
3285 	    (yyval.unknown) = zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len);
3286 
3287     }
3288 #line 3289 "zparser.c" /* yacc.c:1646  */
3289     break;
3290 
3291   case 230:
3292 #line 1083 "zparser.y" /* yacc.c:1646  */
3293     {
3294 	    (yyval.unknown) = zparser_conv_hex(parser->region, "", 0);
3295     }
3296 #line 3297 "zparser.c" /* yacc.c:1646  */
3297     break;
3298 
3299   case 231:
3300 #line 1087 "zparser.y" /* yacc.c:1646  */
3301     {
3302 	    (yyval.unknown) = zparser_conv_hex(parser->region, "", 0);
3303     }
3304 #line 3305 "zparser.c" /* yacc.c:1646  */
3305     break;
3306 
3307 
3308 #line 3309 "zparser.c" /* yacc.c:1646  */
3309       default: break;
3310     }
3311   /* User semantic actions sometimes alter yychar, and that requires
3312      that yytoken be updated with the new translation.  We take the
3313      approach of translating immediately before every use of yytoken.
3314      One alternative is translating here after every semantic action,
3315      but that translation would be missed if the semantic action invokes
3316      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3317      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
3318      incorrect destructor might then be invoked immediately.  In the
3319      case of YYERROR or YYBACKUP, subsequent parser actions might lead
3320      to an incorrect destructor call or verbose syntax error message
3321      before the lookahead is translated.  */
3322   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3323 
3324   YYPOPSTACK (yylen);
3325   yylen = 0;
3326   YY_STACK_PRINT (yyss, yyssp);
3327 
3328   *++yyvsp = yyval;
3329 
3330   /* Now 'shift' the result of the reduction.  Determine what state
3331      that goes to, based on the state we popped back to and the rule
3332      number reduced by.  */
3333 
3334   yyn = yyr1[yyn];
3335 
3336   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3337   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3338     yystate = yytable[yystate];
3339   else
3340     yystate = yydefgoto[yyn - YYNTOKENS];
3341 
3342   goto yynewstate;
3343 
3344 
3345 /*--------------------------------------.
3346 | yyerrlab -- here on detecting error.  |
3347 `--------------------------------------*/
3348 yyerrlab:
3349   /* Make sure we have latest lookahead translation.  See comments at
3350      user semantic actions for why this is necessary.  */
3351   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3352 
3353   /* If not already recovering from an error, report this error.  */
3354   if (!yyerrstatus)
3355     {
3356       ++yynerrs;
3357 #if ! YYERROR_VERBOSE
3358       yyerror (YY_("syntax error"));
3359 #else
3360 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3361                                         yyssp, yytoken)
3362       {
3363         char const *yymsgp = YY_("syntax error");
3364         int yysyntax_error_status;
3365         yysyntax_error_status = YYSYNTAX_ERROR;
3366         if (yysyntax_error_status == 0)
3367           yymsgp = yymsg;
3368         else if (yysyntax_error_status == 1)
3369           {
3370             if (yymsg != yymsgbuf)
3371               YYSTACK_FREE (yymsg);
3372             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3373             if (!yymsg)
3374               {
3375                 yymsg = yymsgbuf;
3376                 yymsg_alloc = sizeof yymsgbuf;
3377                 yysyntax_error_status = 2;
3378               }
3379             else
3380               {
3381                 yysyntax_error_status = YYSYNTAX_ERROR;
3382                 yymsgp = yymsg;
3383               }
3384           }
3385         yyerror (yymsgp);
3386         if (yysyntax_error_status == 2)
3387           goto yyexhaustedlab;
3388       }
3389 # undef YYSYNTAX_ERROR
3390 #endif
3391     }
3392 
3393 
3394 
3395   if (yyerrstatus == 3)
3396     {
3397       /* If just tried and failed to reuse lookahead token after an
3398          error, discard it.  */
3399 
3400       if (yychar <= YYEOF)
3401         {
3402           /* Return failure if at end of input.  */
3403           if (yychar == YYEOF)
3404             YYABORT;
3405         }
3406       else
3407         {
3408           yydestruct ("Error: discarding",
3409                       yytoken, &yylval);
3410           yychar = YYEMPTY;
3411         }
3412     }
3413 
3414   /* Else will try to reuse lookahead token after shifting the error
3415      token.  */
3416   goto yyerrlab1;
3417 
3418 
3419 /*---------------------------------------------------.
3420 | yyerrorlab -- error raised explicitly by YYERROR.  |
3421 `---------------------------------------------------*/
3422 yyerrorlab:
3423 
3424   /* Pacify compilers like GCC when the user code never invokes
3425      YYERROR and the label yyerrorlab therefore never appears in user
3426      code.  */
3427   if (/*CONSTCOND*/ 0)
3428      goto yyerrorlab;
3429 
3430   /* Do not reclaim the symbols of the rule whose action triggered
3431      this YYERROR.  */
3432   YYPOPSTACK (yylen);
3433   yylen = 0;
3434   YY_STACK_PRINT (yyss, yyssp);
3435   yystate = *yyssp;
3436   goto yyerrlab1;
3437 
3438 
3439 /*-------------------------------------------------------------.
3440 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
3441 `-------------------------------------------------------------*/
3442 yyerrlab1:
3443   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3444 
3445   for (;;)
3446     {
3447       yyn = yypact[yystate];
3448       if (!yypact_value_is_default (yyn))
3449         {
3450           yyn += YYTERROR;
3451           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3452             {
3453               yyn = yytable[yyn];
3454               if (0 < yyn)
3455                 break;
3456             }
3457         }
3458 
3459       /* Pop the current state because it cannot handle the error token.  */
3460       if (yyssp == yyss)
3461         YYABORT;
3462 
3463 
3464       yydestruct ("Error: popping",
3465                   yystos[yystate], yyvsp);
3466       YYPOPSTACK (1);
3467       yystate = *yyssp;
3468       YY_STACK_PRINT (yyss, yyssp);
3469     }
3470 
3471   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3472   *++yyvsp = yylval;
3473   YY_IGNORE_MAYBE_UNINITIALIZED_END
3474 
3475 
3476   /* Shift the error token.  */
3477   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3478 
3479   yystate = yyn;
3480   goto yynewstate;
3481 
3482 
3483 /*-------------------------------------.
3484 | yyacceptlab -- YYACCEPT comes here.  |
3485 `-------------------------------------*/
3486 yyacceptlab:
3487   yyresult = 0;
3488   goto yyreturn;
3489 
3490 /*-----------------------------------.
3491 | yyabortlab -- YYABORT comes here.  |
3492 `-----------------------------------*/
3493 yyabortlab:
3494   yyresult = 1;
3495   goto yyreturn;
3496 
3497 #if !defined yyoverflow || YYERROR_VERBOSE
3498 /*-------------------------------------------------.
3499 | yyexhaustedlab -- memory exhaustion comes here.  |
3500 `-------------------------------------------------*/
3501 yyexhaustedlab:
3502   yyerror (YY_("memory exhausted"));
3503   yyresult = 2;
3504   /* Fall through.  */
3505 #endif
3506 
3507 yyreturn:
3508   if (yychar != YYEMPTY)
3509     {
3510       /* Make sure we have latest lookahead translation.  See comments at
3511          user semantic actions for why this is necessary.  */
3512       yytoken = YYTRANSLATE (yychar);
3513       yydestruct ("Cleanup: discarding lookahead",
3514                   yytoken, &yylval);
3515     }
3516   /* Do not reclaim the symbols of the rule whose action triggered
3517      this YYABORT or YYACCEPT.  */
3518   YYPOPSTACK (yylen);
3519   YY_STACK_PRINT (yyss, yyssp);
3520   while (yyssp != yyss)
3521     {
3522       yydestruct ("Cleanup: popping",
3523                   yystos[*yyssp], yyvsp);
3524       YYPOPSTACK (1);
3525     }
3526 #ifndef yyoverflow
3527   if (yyss != yyssa)
3528     YYSTACK_FREE (yyss);
3529 #endif
3530 #if YYERROR_VERBOSE
3531   if (yymsg != yymsgbuf)
3532     YYSTACK_FREE (yymsg);
3533 #endif
3534   return yyresult;
3535 }
3536 #line 1091 "zparser.y" /* yacc.c:1906  */
3537 
3538 
3539 int
3540 yywrap(void)
3541 {
3542 	return 1;
3543 }
3544 
3545 /*
3546  * Create the parser.
3547  */
3548 zparser_type *
3549 zparser_create(region_type *region, region_type *rr_region, namedb_type *db)
3550 {
3551 	zparser_type *result;
3552 
3553 	result = (zparser_type *) region_alloc(region, sizeof(zparser_type));
3554 	result->region = region;
3555 	result->rr_region = rr_region;
3556 	result->db = db;
3557 
3558 	result->filename = NULL;
3559 	result->current_zone = NULL;
3560 	result->origin = NULL;
3561 	result->prev_dname = NULL;
3562 	result->default_apex = NULL;
3563 
3564 	result->temporary_rdatas = (rdata_atom_type *) region_alloc_array(
3565 		result->region, MAXRDATALEN, sizeof(rdata_atom_type));
3566 
3567 	return result;
3568 }
3569 
3570 /*
3571  * Initialize the parser for a new zone file.
3572  */
3573 void
3574 zparser_init(const char *filename, uint32_t ttl, uint16_t klass,
3575 	     const dname_type *origin)
3576 {
3577 	memset(nxtbits, 0, sizeof(nxtbits));
3578 	memset(nsecbits, 0, sizeof(nsecbits));
3579         nsec_highest_rcode = 0;
3580 
3581 	parser->default_ttl = ttl;
3582 	parser->default_class = klass;
3583 	parser->current_zone = NULL;
3584 	parser->origin = domain_table_insert(parser->db->domains, origin);
3585 	parser->prev_dname = parser->origin;
3586 	parser->default_apex = parser->origin;
3587 	parser->error_occurred = 0;
3588 	parser->errors = 0;
3589 	parser->line = 1;
3590 	parser->filename = filename;
3591 	parser->current_rr.rdata_count = 0;
3592 	parser->current_rr.rdatas = parser->temporary_rdatas;
3593 }
3594 
3595 void
3596 yyerror(const char *message)
3597 {
3598 	zc_error("%s", message);
3599 }
3600 
3601 static void
3602 error_va_list(unsigned line, const char *fmt, va_list args)
3603 {
3604 	if (parser->filename) {
3605 		char message[MAXSYSLOGMSGLEN];
3606 		vsnprintf(message, sizeof(message), fmt, args);
3607 		log_msg(LOG_ERR, "%s:%u: %s", parser->filename, line, message);
3608 	}
3609 	else log_vmsg(LOG_ERR, fmt, args);
3610 
3611 	++parser->errors;
3612 	parser->error_occurred = 1;
3613 }
3614 
3615 /* the line counting sux, to say the least
3616  * with this grose hack we try do give sane
3617  * numbers back */
3618 void
3619 zc_error_prev_line(const char *fmt, ...)
3620 {
3621 	va_list args;
3622 	va_start(args, fmt);
3623 	error_va_list(parser->line - 1, fmt, args);
3624 	va_end(args);
3625 }
3626 
3627 void
3628 zc_error(const char *fmt, ...)
3629 {
3630 	/* send an error message to stderr */
3631 	va_list args;
3632 	va_start(args, fmt);
3633 	error_va_list(parser->line, fmt, args);
3634 	va_end(args);
3635 }
3636 
3637 static void
3638 warning_va_list(unsigned line, const char *fmt, va_list args)
3639 {
3640 	if (parser->filename) {
3641 		char m[MAXSYSLOGMSGLEN];
3642 		vsnprintf(m, sizeof(m), fmt, args);
3643 		log_msg(LOG_WARNING, "%s:%u: %s", parser->filename, line, m);
3644 	}
3645 	else log_vmsg(LOG_WARNING, fmt, args);
3646 }
3647 
3648 void
3649 zc_warning_prev_line(const char *fmt, ...)
3650 {
3651 	va_list args;
3652 	va_start(args, fmt);
3653 	warning_va_list(parser->line - 1, fmt, args);
3654 	va_end(args);
3655 }
3656 
3657 void
3658 zc_warning(const char *fmt, ... )
3659 {
3660 	va_list args;
3661 	va_start(args, fmt);
3662 	warning_va_list(parser->line, fmt, args);
3663 	va_end(args);
3664 }
3665 
3666 #ifdef NSEC3
3667 static void
3668 nsec3_add_params(const char* hashalgo_str, const char* flag_str,
3669 	const char* iter_str, const char* salt_str, int salt_len)
3670 {
3671 	zadd_rdata_wireformat(zparser_conv_byte(parser->region, hashalgo_str));
3672 	zadd_rdata_wireformat(zparser_conv_byte(parser->region, flag_str));
3673 	zadd_rdata_wireformat(zparser_conv_short(parser->region, iter_str));
3674 
3675 	/* salt */
3676 	if(strcmp(salt_str, "-") != 0)
3677 		zadd_rdata_wireformat(zparser_conv_hex_length(parser->region,
3678 			salt_str, salt_len));
3679 	else
3680 		zadd_rdata_wireformat(alloc_rdata_init(parser->region, "", 1));
3681 }
3682 #endif /* NSEC3 */
3683