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