d2_parser.cc 70.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// A Bison parser, made by GNU Bison 3.0.4.

// Skeleton implementation for Bison LALR(1) parsers in C++

// Copyright (C) 2002-2015 Free Software Foundation, Inc.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton.  Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.

// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.

// Take the name prefix into account.
#define yylex   d2_parser_lex

// First part of user declarations.

#line 39 "d2_parser.cc" // lalr1.cc:404

# ifndef YY_NULLPTR
#  if defined __cplusplus && 201103L <= __cplusplus
#   define YY_NULLPTR nullptr
#  else
#   define YY_NULLPTR 0
#  endif
# endif

#include "d2_parser.h"

// User implementation prologue.

#line 53 "d2_parser.cc" // lalr1.cc:412
// Unqualified %code blocks.
#line 34 "d2_parser.yy" // lalr1.cc:413

#include <d2/parser_context.h>

#line 59 "d2_parser.cc" // lalr1.cc:413


#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

# ifndef YYLLOC_DEFAULT
#  define YYLLOC_DEFAULT(Current, Rhs, N)                               \
    do                                                                  \
      if (N)                                                            \
        {                                                               \
          (Current).begin  = YYRHSLOC (Rhs, 1).begin;                   \
          (Current).end    = YYRHSLOC (Rhs, N).end;                     \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;      \
        }                                                               \
    while (/*CONSTCOND*/ false)
# endif


// Suppress unused-variable warnings by "using" E.
#define YYUSE(E) ((void) (E))

// Enable debugging if requested.
#if D2_PARSER_DEBUG

// A pseudo ostream that takes yydebug_ into account.
# define YYCDEBUG if (yydebug_) (*yycdebug_)

# define YY_SYMBOL_PRINT(Title, Symbol)         \
  do {                                          \
    if (yydebug_)                               \
    {                                           \
      *yycdebug_ << Title << ' ';               \
      yy_print_ (*yycdebug_, Symbol);           \
      *yycdebug_ << std::endl;                  \
    }                                           \
  } while (false)

# define YY_REDUCE_PRINT(Rule)          \
  do {                                  \
    if (yydebug_)                       \
      yy_reduce_print_ (Rule);          \
  } while (false)

# define YY_STACK_PRINT()               \
  do {                                  \
    if (yydebug_)                       \
      yystack_print_ ();                \
  } while (false)

#else // !D2_PARSER_DEBUG

# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol)  YYUSE(Symbol)
# define YY_REDUCE_PRINT(Rule)           static_cast<void>(0)
# define YY_STACK_PRINT()                static_cast<void>(0)

#endif // !D2_PARSER_DEBUG

#define yyerrok         (yyerrstatus_ = 0)
#define yyclearin       (yyla.clear ())

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYRECOVERING()  (!!yyerrstatus_)

#line 14 "d2_parser.yy" // lalr1.cc:479
namespace isc { namespace d2 {
#line 145 "d2_parser.cc" // lalr1.cc:479

  /* Return YYSTR after stripping away unnecessary quotes and
     backslashes, so that it's suitable for yyerror.  The heuristic is
     that double-quoting is unnecessary unless the string contains an
     apostrophe, a comma, or backslash (other than backslash-backslash).
     YYSTR is taken from yytname.  */
  std::string
  D2Parser::yytnamerr_ (const char *yystr)
  {
    if (*yystr == '"')
      {
        std::string yyr = "";
        char const *yyp = yystr;

        for (;;)
          switch (*++yyp)
            {
            case '\'':
            case ',':
              goto do_not_strip_quotes;

            case '\\':
              if (*++yyp != '\\')
                goto do_not_strip_quotes;
              // Fall through.
            default:
              yyr += *yyp;
              break;

            case '"':
              return yyr;
            }
      do_not_strip_quotes: ;
      }

    return yystr;
  }


  /// Build a parser object.
  D2Parser::D2Parser (isc::d2::D2ParserContext& ctx_yyarg)
    :
#if D2_PARSER_DEBUG
      yydebug_ (false),
      yycdebug_ (&std::cerr),
#endif
      ctx (ctx_yyarg)
  {}

  D2Parser::~D2Parser ()
  {}


  /*---------------.
  | Symbol types.  |
  `---------------*/



  // by_state.
  inline
  D2Parser::by_state::by_state ()
    : state (empty_state)
  {}

  inline
  D2Parser::by_state::by_state (const by_state& other)
    : state (other.state)
  {}

  inline
  void
  D2Parser::by_state::clear ()
  {
    state = empty_state;
  }

  inline
  void
  D2Parser::by_state::move (by_state& that)
  {
    state = that.state;
    that.clear ();
  }

  inline
  D2Parser::by_state::by_state (state_type s)
    : state (s)
  {}

  inline
  D2Parser::symbol_number_type
  D2Parser::by_state::type_get () const
  {
    if (state == empty_state)
      return empty_symbol;
    else
      return yystos_[state];
  }

  inline
  D2Parser::stack_symbol_type::stack_symbol_type ()
  {}


  inline
  D2Parser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
    : super_type (s, that.location)
  {
      switch (that.type_get ())
    {
256
257
      case 66: // value
      case 93: // ncr_protocol_value
258
259
260
        value.move< ElementPtr > (that.value);
        break;

261
      case 54: // "boolean"
262
263
264
        value.move< bool > (that.value);
        break;

265
      case 53: // "floating point"
266
267
268
        value.move< double > (that.value);
        break;

269
      case 52: // "integer"
270
271
272
        value.move< int64_t > (that.value);
        break;

273
      case 51: // "constant string"
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
        value.move< std::string > (that.value);
        break;

      default:
        break;
    }

    // that is emptied.
    that.type = empty_symbol;
  }

  inline
  D2Parser::stack_symbol_type&
  D2Parser::stack_symbol_type::operator= (const stack_symbol_type& that)
  {
    state = that.state;
      switch (that.type_get ())
    {
292
293
      case 66: // value
      case 93: // ncr_protocol_value
294
295
296
        value.copy< ElementPtr > (that.value);
        break;

297
      case 54: // "boolean"
298
299
300
        value.copy< bool > (that.value);
        break;

301
      case 53: // "floating point"
302
303
304
        value.copy< double > (that.value);
        break;

305
      case 52: // "integer"
306
307
308
        value.copy< int64_t > (that.value);
        break;

309
      case 51: // "constant string"
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
        value.copy< std::string > (that.value);
        break;

      default:
        break;
    }

    location = that.location;
    return *this;
  }


  template <typename Base>
  inline
  void
  D2Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {
    if (yymsg)
      YY_SYMBOL_PRINT (yymsg, yysym);
  }

#if D2_PARSER_DEBUG
  template <typename Base>
  void
  D2Parser::yy_print_ (std::ostream& yyo,
                                     const basic_symbol<Base>& yysym) const
  {
    std::ostream& yyoutput = yyo;
    YYUSE (yyoutput);
    symbol_number_type yytype = yysym.type_get ();
    // Avoid a (spurious) G++ 4.8 warning about "array subscript is
    // below array bounds".
    if (yysym.empty ())
      std::abort ();
    yyo << (yytype < yyntokens_ ? "token" : "nterm")
        << ' ' << yytname_[yytype] << " ("
        << yysym.location << ": ";
    switch (yytype)
    {
349
            case 51: // "constant string"
350

351
#line 108 "d2_parser.yy" // lalr1.cc:636
352
353
354
355
        { yyoutput << yysym.value.template as< std::string > (); }
#line 354 "d2_parser.cc" // lalr1.cc:636
        break;

356
      case 52: // "integer"
357

358
#line 108 "d2_parser.yy" // lalr1.cc:636
359
360
361
362
        { yyoutput << yysym.value.template as< int64_t > (); }
#line 361 "d2_parser.cc" // lalr1.cc:636
        break;

363
      case 53: // "floating point"
364

365
#line 108 "d2_parser.yy" // lalr1.cc:636
366
367
368
369
        { yyoutput << yysym.value.template as< double > (); }
#line 368 "d2_parser.cc" // lalr1.cc:636
        break;

370
      case 54: // "boolean"
371

372
#line 108 "d2_parser.yy" // lalr1.cc:636
373
374
375
376
        { yyoutput << yysym.value.template as< bool > (); }
#line 375 "d2_parser.cc" // lalr1.cc:636
        break;

377
      case 66: // value
378

379
#line 108 "d2_parser.yy" // lalr1.cc:636
380
381
382
383
        { yyoutput << yysym.value.template as< ElementPtr > (); }
#line 382 "d2_parser.cc" // lalr1.cc:636
        break;

384
      case 93: // ncr_protocol_value
385

386
#line 108 "d2_parser.yy" // lalr1.cc:636
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
        { yyoutput << yysym.value.template as< ElementPtr > (); }
#line 389 "d2_parser.cc" // lalr1.cc:636
        break;


      default:
        break;
    }
    yyo << ')';
  }
#endif

  inline
  void
  D2Parser::yypush_ (const char* m, state_type s, symbol_type& sym)
  {
    stack_symbol_type t (s, sym);
    yypush_ (m, t);
  }

  inline
  void
  D2Parser::yypush_ (const char* m, stack_symbol_type& s)
  {
    if (m)
      YY_SYMBOL_PRINT (m, s);
    yystack_.push (s);
  }

  inline
  void
  D2Parser::yypop_ (unsigned int n)
  {
    yystack_.pop (n);
  }

#if D2_PARSER_DEBUG
  std::ostream&
  D2Parser::debug_stream () const
  {
    return *yycdebug_;
  }

  void
  D2Parser::set_debug_stream (std::ostream& o)
  {
    yycdebug_ = &o;
  }


  D2Parser::debug_level_type
  D2Parser::debug_level () const
  {
    return yydebug_;
  }

  void
  D2Parser::set_debug_level (debug_level_type l)
  {
    yydebug_ = l;
  }
#endif // D2_PARSER_DEBUG

  inline D2Parser::state_type
  D2Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
  {
    int yyr = yypgoto_[yysym - yyntokens_] + yystate;
    if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
      return yytable_[yyr];
    else
      return yydefgoto_[yysym - yyntokens_];
  }

  inline bool
  D2Parser::yy_pact_value_is_default_ (int yyvalue)
  {
    return yyvalue == yypact_ninf_;
  }

  inline bool
  D2Parser::yy_table_value_is_error_ (int yyvalue)
  {
    return yyvalue == yytable_ninf_;
  }

  int
  D2Parser::parse ()
  {
    // State.
    int yyn;
    /// Length of the RHS of the rule being reduced.
    int yylen = 0;

    // Error handling.
    int yynerrs_ = 0;
    int yyerrstatus_ = 0;

    /// The lookahead symbol.
    symbol_type yyla;

    /// The locations where the error started and ended.
    stack_symbol_type yyerror_range[3];

    /// The return value of parse ().
    int yyresult;

Josh Soref's avatar
Josh Soref committed
493
    // FIXME: This should be completely indented.  It is not yet to
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
    // avoid gratuitous conflicts when merging into the master branch.
    try
      {
    YYCDEBUG << "Starting parse" << std::endl;


    /* Initialize the stack.  The initial state will be set in
       yynewstate, since the latter expects the semantical and the
       location values to have been already stored, initialize these
       stacks with a primary value.  */
    yystack_.clear ();
    yypush_ (YY_NULLPTR, 0, yyla);

    // A new symbol was pushed on the stack.
  yynewstate:
    YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;

    // Accept?
    if (yystack_[0].state == yyfinal_)
      goto yyacceptlab;

    goto yybackup;

    // Backup.
  yybackup:

    // Try to take a decision without lookahead.
    yyn = yypact_[yystack_[0].state];
    if (yy_pact_value_is_default_ (yyn))
      goto yydefault;

    // Read a lookahead token.
    if (yyla.empty ())
      {
        YYCDEBUG << "Reading a token: ";
        try
          {
            symbol_type yylookahead (yylex (ctx));
            yyla.move (yylookahead);
          }
        catch (const syntax_error& yyexc)
          {
            error (yyexc);
            goto yyerrlab1;
          }
      }
    YY_SYMBOL_PRINT ("Next token is", yyla);

    /* If the proper action on seeing token YYLA.TYPE is to reduce or
       to detect an error, take that action.  */
    yyn += yyla.type_get ();
    if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
      goto yydefault;

    // Reduce or error.
    yyn = yytable_[yyn];
    if (yyn <= 0)
      {
        if (yy_table_value_is_error_ (yyn))
          goto yyerrlab;
        yyn = -yyn;
        goto yyreduce;
      }

    // Count tokens shifted since error; after three, turn off error status.
    if (yyerrstatus_)
      --yyerrstatus_;

    // Shift the lookahead token.
    yypush_ ("Shifting", yyn, yyla);
    goto yynewstate;

  /*-----------------------------------------------------------.
  | yydefault -- do the default action for the current state.  |
  `-----------------------------------------------------------*/
  yydefault:
    yyn = yydefact_[yystack_[0].state];
    if (yyn == 0)
      goto yyerrlab;
    goto yyreduce;

  /*-----------------------------.
  | yyreduce -- Do a reduction.  |
  `-----------------------------*/
  yyreduce:
    yylen = yyr2_[yyn];
    {
      stack_symbol_type yylhs;
      yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
      /* Variants are always initialized to an empty instance of the
         correct type. The default '$$ = $1' action is NOT applied
         when using variants.  */
        switch (yyr1_[yyn])
    {
588
589
      case 66: // value
      case 93: // ncr_protocol_value
590
591
592
        yylhs.value.build< ElementPtr > ();
        break;

593
      case 54: // "boolean"
594
595
596
        yylhs.value.build< bool > ();
        break;

597
      case 53: // "floating point"
598
599
600
        yylhs.value.build< double > ();
        break;

601
      case 52: // "integer"
602
603
604
        yylhs.value.build< int64_t > ();
        break;

605
      case 51: // "constant string"
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
        yylhs.value.build< std::string > ();
        break;

      default:
        break;
    }


      // Compute the default @$.
      {
        slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
        YYLLOC_DEFAULT (yylhs.location, slice, yylen);
      }

      // Perform the reduction.
      YY_REDUCE_PRINT (yyn);
      try
        {
          switch (yyn)
            {
  case 2:
627
#line 117 "d2_parser.yy" // lalr1.cc:859
628
629
630
631
632
    { ctx.ctx_ = ctx.NO_KEYWORD; }
#line 630 "d2_parser.cc" // lalr1.cc:859
    break;

  case 4:
633
#line 118 "d2_parser.yy" // lalr1.cc:859
634
635
636
637
638
    { ctx.ctx_ = ctx.CONFIG; }
#line 636 "d2_parser.cc" // lalr1.cc:859
    break;

  case 6:
639
#line 119 "d2_parser.yy" // lalr1.cc:859
640
641
642
643
644
    { ctx.ctx_ = ctx.DHCPDDNS; }
#line 642 "d2_parser.cc" // lalr1.cc:859
    break;

  case 8:
645
#line 120 "d2_parser.yy" // lalr1.cc:859
646
647
648
649
650
    { ctx.ctx_ = ctx.TSIG_KEY; }
#line 648 "d2_parser.cc" // lalr1.cc:859
    break;

  case 10:
651
#line 121 "d2_parser.yy" // lalr1.cc:859
652
653
654
655
656
    { ctx.ctx_ = ctx.TSIG_KEYS; }
#line 654 "d2_parser.cc" // lalr1.cc:859
    break;

  case 12:
657
#line 122 "d2_parser.yy" // lalr1.cc:859
658
659
660
661
662
    { ctx.ctx_ = ctx.DDNS_DOMAIN; }
#line 660 "d2_parser.cc" // lalr1.cc:859
    break;

  case 14:
663
#line 123 "d2_parser.yy" // lalr1.cc:859
664
665
666
667
668
    { ctx.ctx_ = ctx.DDNS_DOMAINS; }
#line 666 "d2_parser.cc" // lalr1.cc:859
    break;

  case 16:
669
#line 124 "d2_parser.yy" // lalr1.cc:859
670
671
672
673
674
    { ctx.ctx_ = ctx.DNS_SERVERS; }
#line 672 "d2_parser.cc" // lalr1.cc:859
    break;

  case 18:
675
#line 125 "d2_parser.yy" // lalr1.cc:859
676
677
678
679
680
    { ctx.ctx_ = ctx.DNS_SERVERS; }
#line 678 "d2_parser.cc" // lalr1.cc:859
    break;

  case 20:
681
#line 133 "d2_parser.yy" // lalr1.cc:859
682
683
684
685
686
    { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); }
#line 684 "d2_parser.cc" // lalr1.cc:859
    break;

  case 21:
687
#line 134 "d2_parser.yy" // lalr1.cc:859
688
689
690
691
692
    { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); }
#line 690 "d2_parser.cc" // lalr1.cc:859
    break;

  case 22:
693
#line 135 "d2_parser.yy" // lalr1.cc:859
694
695
696
697
698
    { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); }
#line 696 "d2_parser.cc" // lalr1.cc:859
    break;

  case 23:
699
#line 136 "d2_parser.yy" // lalr1.cc:859
700
701
702
703
704
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); }
#line 702 "d2_parser.cc" // lalr1.cc:859
    break;

  case 24:
705
#line 137 "d2_parser.yy" // lalr1.cc:859
706
707
708
709
710
    { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
#line 708 "d2_parser.cc" // lalr1.cc:859
    break;

  case 25:
711
#line 138 "d2_parser.yy" // lalr1.cc:859
712
713
714
715
716
    { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
#line 714 "d2_parser.cc" // lalr1.cc:859
    break;

  case 26:
717
#line 139 "d2_parser.yy" // lalr1.cc:859
718
719
720
721
722
    { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
#line 720 "d2_parser.cc" // lalr1.cc:859
    break;

  case 27:
723
#line 142 "d2_parser.yy" // lalr1.cc:859
724
725
726
727
728
729
730
731
    {
    // Push back the JSON value on the stack
    ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ());
}
#line 729 "d2_parser.cc" // lalr1.cc:859
    break;

  case 28:
732
#line 147 "d2_parser.yy" // lalr1.cc:859
733
734
735
736
737
738
739
740
741
742
    {
    // This code is executed when we're about to start parsing
    // the content of the map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 740 "d2_parser.cc" // lalr1.cc:859
    break;

  case 29:
743
#line 152 "d2_parser.yy" // lalr1.cc:859
744
745
746
747
748
749
750
751
752
    {
    // map parsing completed. If we ever want to do any wrap up
    // (maybe some sanity checking), this would be the best place
    // for it.
}
#line 750 "d2_parser.cc" // lalr1.cc:859
    break;

  case 32:
753
#line 163 "d2_parser.yy" // lalr1.cc:859
754
755
756
757
758
759
760
761
    {
                  // map containing a single entry
                  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
                  }
#line 759 "d2_parser.cc" // lalr1.cc:859
    break;

  case 33:
762
#line 167 "d2_parser.yy" // lalr1.cc:859
763
764
765
766
767
768
769
770
771
    {
                  // map consisting of a shorter map followed by
                  // comma and string:value
                  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
                  }
#line 769 "d2_parser.cc" // lalr1.cc:859
    break;

  case 34:
772
#line 174 "d2_parser.yy" // lalr1.cc:859
773
774
775
776
777
778
779
780
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(l);
}
#line 778 "d2_parser.cc" // lalr1.cc:859
    break;

  case 35:
781
#line 177 "d2_parser.yy" // lalr1.cc:859
782
783
784
785
786
787
788
    {
    // list parsing complete. Put any sanity checking here
}
#line 786 "d2_parser.cc" // lalr1.cc:859
    break;

  case 38:
789
#line 185 "d2_parser.yy" // lalr1.cc:859
790
791
792
793
794
795
796
797
    {
                  // List consisting of a single element.
                  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
                  }
#line 795 "d2_parser.cc" // lalr1.cc:859
    break;

  case 39:
798
#line 189 "d2_parser.yy" // lalr1.cc:859
799
800
801
802
803
804
805
806
    {
                  // List ending with , and a value.
                  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
                  }
#line 804 "d2_parser.cc" // lalr1.cc:859
    break;

  case 40:
807
#line 200 "d2_parser.yy" // lalr1.cc:859
808
809
810
811
812
813
814
815
816
817
    {
    const std::string& where = ctx.contextName();
    const std::string& keyword = yystack_[1].value.as< std::string > ();
    error(yystack_[1].location,
          "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
}
#line 815 "d2_parser.cc" // lalr1.cc:859
    break;

  case 41:
818
#line 210 "d2_parser.yy" // lalr1.cc:859
819
820
821
822
823
824
825
826
827
828
    {
    // This code is executed when we're about to start parsing
    // the content of the map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 826 "d2_parser.cc" // lalr1.cc:859
    break;

  case 42:
829
#line 215 "d2_parser.yy" // lalr1.cc:859
830
831
832
833
834
835
836
837
    {
    // map parsing completed. If we ever want to do any wrap up
    // (maybe some sanity checking), this would be the best place
    // for it.
}
#line 836 "d2_parser.cc" // lalr1.cc:859
    break;

838
839
  case 51:
#line 237 "d2_parser.yy" // lalr1.cc:859
840
841
842
843
844
845
846
847
848
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("DhcpDdns", m);
    ctx.stack_.push_back(m);
    ctx.enter(ctx.DHCPDDNS);
}
#line 847 "d2_parser.cc" // lalr1.cc:859
    break;

849
850
  case 52:
#line 242 "d2_parser.yy" // lalr1.cc:859
851
852
853
854
855
856
857
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 856 "d2_parser.cc" // lalr1.cc:859
    break;

858
859
  case 53:
#line 247 "d2_parser.yy" // lalr1.cc:859
860
861
862
863
864
865
866
867
    {
    // Parse the dhcpddns map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 866 "d2_parser.cc" // lalr1.cc:859
    break;

868
869
  case 54:
#line 251 "d2_parser.yy" // lalr1.cc:859
870
871
872
873
874
875
    {
    // parsing completed
}
#line 874 "d2_parser.cc" // lalr1.cc:859
    break;

876
877
  case 66:
#line 271 "d2_parser.yy" // lalr1.cc:859
878
879
880
881
882
883
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 882 "d2_parser.cc" // lalr1.cc:859
    break;

884
885
  case 67:
#line 273 "d2_parser.yy" // lalr1.cc:859
886
887
888
889
890
891
892
893
    {
    ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("ip-address", s);
    ctx.leave();
}
#line 892 "d2_parser.cc" // lalr1.cc:859
    break;

894
895
  case 68:
#line 279 "d2_parser.yy" // lalr1.cc:859
896
897
898
899
900
901
902
903
904
905
    {
    if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65536 ) {
        error(yystack_[0].location, "port must be greater than zero but less than 65536");
    }
    ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("port", i);
}
#line 904 "d2_parser.cc" // lalr1.cc:859
    break;

906
907
  case 69:
#line 287 "d2_parser.yy" // lalr1.cc:859
908
909
910
911
912
913
914
915
916
917
918
    {
    if (yystack_[0].value.as< int64_t > () <= 0) {
        error(yystack_[0].location, "dns-server-timeout must be greater than zero");
    } else {
        ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
        ctx.stack_.back()->set("dns-server-timeout", i);
    }
}
#line 917 "d2_parser.cc" // lalr1.cc:859
    break;

919
920
  case 70:
#line 296 "d2_parser.yy" // lalr1.cc:859
921
922
923
924
925
926
    {
    ctx.enter(ctx.NCR_PROTOCOL);
}
#line 925 "d2_parser.cc" // lalr1.cc:859
    break;

927
928
  case 71:
#line 298 "d2_parser.yy" // lalr1.cc:859
929
930
931
932
933
934
935
    {
    ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as< ElementPtr > ());
    ctx.leave();
}
#line 934 "d2_parser.cc" // lalr1.cc:859
    break;

936
937
  case 72:
#line 304 "d2_parser.yy" // lalr1.cc:859
938
939
940
941
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
#line 940 "d2_parser.cc" // lalr1.cc:859
    break;

942
943
  case 73:
#line 305 "d2_parser.yy" // lalr1.cc:859
944
945
946
947
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
#line 946 "d2_parser.cc" // lalr1.cc:859
    break;

948
949
  case 74:
#line 308 "d2_parser.yy" // lalr1.cc:859
950
951
952
953
954
955
    {
    ctx.enter(ctx.NCR_FORMAT);
}
#line 954 "d2_parser.cc" // lalr1.cc:859
    break;

956
957
  case 75:
#line 310 "d2_parser.yy" // lalr1.cc:859
958
959
960
961
962
963
964
965
    {
    ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("ncr-format", json);
    ctx.leave();
}
#line 964 "d2_parser.cc" // lalr1.cc:859
    break;

966
967
  case 76:
#line 316 "d2_parser.yy" // lalr1.cc:859
968
969
970
971
972
973
974
975
976
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("forward-ddns", m);
    ctx.stack_.push_back(m);
    ctx.enter(ctx.FORWARD_DDNS);
}
#line 975 "d2_parser.cc" // lalr1.cc:859
    break;

977
978
  case 77:
#line 321 "d2_parser.yy" // lalr1.cc:859
979
980
981
982
983
984
985
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 984 "d2_parser.cc" // lalr1.cc:859
    break;

986
987
  case 78:
#line 326 "d2_parser.yy" // lalr1.cc:859
988
989
990
991
992
993
994
995
996
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("reverse-ddns", m);
    ctx.stack_.push_back(m);
    ctx.enter(ctx.REVERSE_DDNS);
}
#line 995 "d2_parser.cc" // lalr1.cc:859
    break;

997
998
  case 79:
#line 331 "d2_parser.yy" // lalr1.cc:859
999
1000
1001
1002
1003
1004
1005
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 1004 "d2_parser.cc" // lalr1.cc:859
    break;

1006
1007
  case 86:
#line 350 "d2_parser.yy" // lalr1.cc:859
1008
1009
1010
1011
1012
1013
1014
1015
1016
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("ddns-domains", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.DDNS_DOMAINS);
}
#line 1015 "d2_parser.cc" // lalr1.cc:859
    break;

1017
1018
  case 87:
#line 355 "d2_parser.yy" // lalr1.cc:859
1019
1020
1021
1022
1023
1024
1025
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 1024 "d2_parser.cc" // lalr1.cc:859
    break;

1026
1027
  case 88:
#line 360 "d2_parser.yy" // lalr1.cc:859
1028
1029
1030
1031
1032
1033
1034
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(l);
}
#line 1033 "d2_parser.cc" // lalr1.cc:859
    break;

1035
1036
  case 89:
#line 363 "d2_parser.yy" // lalr1.cc:859
1037
1038
1039
1040
1041
1042
    {
    // parsing completed
}
#line 1041 "d2_parser.cc" // lalr1.cc:859
    break;

1043
1044
  case 94:
#line 375 "d2_parser.yy" // lalr1.cc:859
1045
1046
1047
1048
1049
1050
1051
1052
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->add(m);
    ctx.stack_.push_back(m);
}
#line 1051 "d2_parser.cc" // lalr1.cc:859
    break;

1053
1054
  case 95:
#line 379 "d2_parser.yy" // lalr1.cc:859
1055
1056
1057
1058
1059
1060
    {
    ctx.stack_.pop_back();
}
#line 1059 "d2_parser.cc" // lalr1.cc:859
    break;

1061
1062
  case 96:
#line 383 "d2_parser.yy" // lalr1.cc:859
1063
1064
1065
1066
1067
1068
1069
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 1068 "d2_parser.cc" // lalr1.cc:859
    break;

1070
1071
  case 97:
#line 386 "d2_parser.yy" // lalr1.cc:859
1072
1073
1074
1075
1076
1077
    {
    // parsing completed
}
#line 1076 "d2_parser.cc" // lalr1.cc:859
    break;

1078
1079
  case 104:
#line 401 "d2_parser.yy" // lalr1.cc:859
1080
1081
1082
1083
1084
1085
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1084 "d2_parser.cc" // lalr1.cc:859
    break;

1086
1087
  case 105:
#line 403 "d2_parser.yy" // lalr1.cc:859
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
    {
    if (yystack_[0].value.as< std::string > () == "") {
        error(yystack_[1].location, "Ddns domain name cannot be blank");
    }
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("name", name);
    ctx.leave();
}
#line 1098 "d2_parser.cc" // lalr1.cc:859
    break;

1100
1101
  case 106:
#line 413 "d2_parser.yy" // lalr1.cc:859
1102
1103
1104
1105
1106
1107
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1106 "d2_parser.cc" // lalr1.cc:859
    break;

1108
1109
  case 107:
#line 415 "d2_parser.yy" // lalr1.cc:859
1110
1111
1112
1113
1114
1115
1116
1117
1118
    {
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("key-name", name);
    ctx.leave();
}
#line 1117 "d2_parser.cc" // lalr1.cc:859
    break;

1119
1120
  case 108:
#line 425 "d2_parser.yy" // lalr1.cc:859
1121
1122
1123
1124
1125
1126
1127
1128
1129
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("dns-servers", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.DNS_SERVERS);
}
#line 1128 "d2_parser.cc" // lalr1.cc:859
    break;

1130
1131
  case 109:
#line 430 "d2_parser.yy" // lalr1.cc:859
1132
1133
1134
1135
1136
1137
1138
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 1137 "d2_parser.cc" // lalr1.cc:859
    break;

1139
1140
  case 110:
#line 435 "d2_parser.yy" // lalr1.cc:859
1141
1142
1143
1144
1145
1146
1147
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(l);
}
#line 1146 "d2_parser.cc" // lalr1.cc:859
    break;

1148
1149
  case 111:
#line 438 "d2_parser.yy" // lalr1.cc:859
1150
1151
1152
1153
1154
1155
    {
    // parsing completed
}
#line 1154 "d2_parser.cc" // lalr1.cc:859
    break;

1156
1157
  case 114:
#line 446 "d2_parser.yy" // lalr1.cc:859
1158
1159
1160
1161
1162
1163
1164
1165
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->add(m);
    ctx.stack_.push_back(m);
}
#line 1164 "d2_parser.cc" // lalr1.cc:859
    break;

1166
1167
  case 115:
#line 450 "d2_parser.yy" // lalr1.cc:859
1168
1169
1170
1171
1172
1173
    {
    ctx.stack_.pop_back();
}
#line 1172 "d2_parser.cc" // lalr1.cc:859
    break;

1174
1175
  case 116:
#line 454 "d2_parser.yy" // lalr1.cc:859
1176
1177
1178
1179
1180
1181
1182
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 1181 "d2_parser.cc" // lalr1.cc:859
    break;

1183
1184
  case 117:
#line 457 "d2_parser.yy" // lalr1.cc:859
1185
1186
1187
1188
1189
1190
    {
    // parsing completed
}
#line 1189 "d2_parser.cc" // lalr1.cc:859
    break;

1191
1192
  case 124:
#line 471 "d2_parser.yy" // lalr1.cc:859
1193
1194
1195
1196
1197
1198
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1197 "d2_parser.cc" // lalr1.cc:859
    break;

1199
1200
  case 125:
#line 473 "d2_parser.yy" // lalr1.cc:859
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
    {
    if (yystack_[0].value.as< std::string > () != "") {
        error(yystack_[1].location, "hostname is not yet supported");
    }
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("hostname", name);
    ctx.leave();
}
#line 1211 "d2_parser.cc" // lalr1.cc:859
    break;

1213
1214
  case 126:
#line 483 "d2_parser.yy" // lalr1.cc:859
1215
1216
1217
1218
1219
1220
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1219 "d2_parser.cc" // lalr1.cc:859
    break;

1221
1222
  case 127:
#line 485 "d2_parser.yy" // lalr1.cc:859
1223
1224
1225
1226
1227
1228
1229
1230
    {
    ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("ip-address", s);
    ctx.leave();
}
#line 1229 "d2_parser.cc" // lalr1.cc:859
    break;

1231
1232
  case 128:
#line 491 "d2_parser.yy" // lalr1.cc:859
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
    {
    if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65536 ) {
        error(yystack_[0].location, "port must be greater than zero but less than 65536");
    }
    ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("port", i);
}
#line 1241 "d2_parser.cc" // lalr1.cc:859
    break;

1243
1244
  case 129:
#line 505 "d2_parser.yy" // lalr1.cc:859
1245
1246
1247
1248
1249
1250
1251
1252
1253
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("tsig-keys", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.TSIG_KEYS);
}
#line 1252 "d2_parser.cc" // lalr1.cc:859
    break;

1254
1255
  case 130:
#line 510 "d2_parser.yy" // lalr1.cc:859
1256
1257
1258
1259
1260
1261
1262
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
#line 1261 "d2_parser.cc" // lalr1.cc:859
    break;

1263
1264
  case 131:
#line 515 "d2_parser.yy" // lalr1.cc:859
1265
1266
1267
1268
1269
1270
1271
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(l);
}
#line 1270 "d2_parser.cc" // lalr1.cc:859
    break;

1272
1273
  case 132:
#line 518 "d2_parser.yy" // lalr1.cc:859
1274
1275
1276
1277
1278
1279
    {
    // parsing completed
}
#line 1278 "d2_parser.cc" // lalr1.cc:859
    break;

1280
1281
  case 137:
#line 530 "d2_parser.yy" // lalr1.cc:859
1282
1283
1284
1285
1286
1287
1288
1289
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->add(m);
    ctx.stack_.push_back(m);
}
#line 1288 "d2_parser.cc" // lalr1.cc:859
    break;

1290
1291
  case 138:
#line 534 "d2_parser.yy" // lalr1.cc:859
1292
1293
1294
1295
1296
1297
    {
    ctx.stack_.pop_back();
}
#line 1296 "d2_parser.cc" // lalr1.cc:859
    break;

1298
1299
  case 139:
#line 538 "d2_parser.yy" // lalr1.cc:859
1300
1301
1302
1303
1304
1305
1306
1307
    {
    // Parse tsig key list entry map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
#line 1306 "d2_parser.cc" // lalr1.cc:859
    break;

1308
1309
  case 140:
#line 542 "d2_parser.yy" // lalr1.cc:859
1310
1311
1312
1313
1314
1315
    {
    // parsing completed
}
#line 1314 "d2_parser.cc" // lalr1.cc:859
    break;

1316
1317
  case 148:
#line 558 "d2_parser.yy" // lalr1.cc:859
1318
1319
1320
1321
1322
1323
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1322 "d2_parser.cc" // lalr1.cc:859
    break;

1324
1325
  case 149:
#line 560 "d2_parser.yy" // lalr1.cc:859
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
    {
    if (yystack_[0].value.as< std::string > () == "") {
        error(yystack_[1].location, "TSIG key name cannot be blank");
    }
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("name", name);
    ctx.leave();
}
#line 1336 "d2_parser.cc" // lalr1.cc:859
    break;

1338
1339
  case 150:
#line 570 "d2_parser.yy" // lalr1.cc:859
1340
1341
1342
1343
1344
1345
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1344 "d2_parser.cc" // lalr1.cc:859
    break;

1346
1347
  case 151:
#line 572 "d2_parser.yy" // lalr1.cc:859
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
    {
    if (yystack_[0].value.as< std::string > () == "") {
        error(yystack_[1].location, "TSIG key algorithm cannot be blank");
    }
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("algorithm", elem);
    ctx.leave();
}
#line 1357 "d2_parser.cc" // lalr1.cc:859
    break;

1359
1360
  case 152:
#line 581 "d2_parser.yy" // lalr1.cc:859
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
    {
    if (yystack_[0].value.as< int64_t > () < 0 || (yystack_[0].value.as< int64_t > () > 0  && (yystack_[0].value.as< int64_t > () % 8 != 0))) {
        error(yystack_[0].location, "TSIG key digest-bits must either be zero or a positive, multiple of eight");
    }
    ElementPtr elem(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("digest-bits", elem);
}
#line 1369 "d2_parser.cc" // lalr1.cc:859
    break;

1371
1372
  case 153:
#line 589 "d2_parser.yy" // lalr1.cc:859
1373
1374
1375
1376
1377
1378
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1377 "d2_parser.cc" // lalr1.cc:859
    break;

1379
1380
  case 154:
#line 591 "d2_parser.yy" // lalr1.cc:859
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
    {
    if (yystack_[0].value.as< std::string > () == "") {
        error(yystack_[1].location, "TSIG key secret cannot be blank");
    }
    ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("secret", elem);
    ctx.leave();
}
#line 1390 "d2_parser.cc" // lalr1.cc:859
    break;

1392
1393
  case 155:
#line 604 "d2_parser.yy" // lalr1.cc:859
1394
1395
1396
1397
1398
1399
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1398 "d2_parser.cc" // lalr1.cc:859
    break;

1400
1401
  case 156:
#line 606 "d2_parser.yy" // lalr1.cc:859
1402
1403
1404
1405
1406
1407
1408
    {
    ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ());
    ctx.leave();
}
#line 1407 "d2_parser.cc" // lalr1.cc:859
    break;

1409
1410
  case 157:
#line 611 "d2_parser.yy" // lalr1.cc:859
1411
1412
1413
1414
1415
1416
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1415 "d2_parser.cc" // lalr1.cc:859
    break;

1417
1418
  case 158:
#line 613 "d2_parser.yy" // lalr1.cc:859
1419
1420
1421
1422
1423
1424
1425
    {
    ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ());
    ctx.leave();
}
#line 1424 "d2_parser.cc" // lalr1.cc:859
    break;

1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
  case 159:
#line 618 "d2_parser.yy" // lalr1.cc:859
    {
    ctx.enter(ctx.NO_KEYWORD);
}
#line 1432 "d2_parser.cc" // lalr1.cc:859
    break;

  case 160:
#line 620 "d2_parser.yy" // lalr1.cc:859
    {
    ctx.stack_.back()->set("Control-agent", yystack_[0].value.as< ElementPtr > ());
    ctx.leave();
}
#line 1441 "d2_parser.cc" // lalr1.cc:859
    break;

  case 161:
#line 630 "d2_parser.yy" // lalr1.cc:859
1445
1446
1447
1448
1449
1450
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("Logging", m);
    ctx.stack_.push_back(m);
    ctx.enter(ctx.LOGGING);
}
1451
#line 1452 "d2_parser.cc" // lalr1.cc:859
1452
1453
    break;

1454
1455
  case 162:
#line 635 "d2_parser.yy" // lalr1.cc:859
1456
1457
1458
1459
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
1460
#line 1461 "d2_parser.cc" // lalr1.cc:859
1461
1462
    break;

1463
1464
  case 166:
#line 652 "d2_parser.yy" // lalr1.cc:859
1465
1466
1467
1468
1469
1470
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("loggers", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.LOGGERS);
}
1471
#line 1472 "d2_parser.cc" // lalr1.cc:859
1472
1473
    break;

1474
1475
  case 167:
#line 657 "d2_parser.yy" // lalr1.cc:859
1476
1477
1478
1479
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
1480
#line 1481 "d2_parser.cc" // lalr1.cc:859
1481
1482
    break;

1483
1484
  case 170:
#line 669 "d2_parser.yy" // lalr1.cc:859
1485
1486
1487
1488
1489
    {
    ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->add(l);
    ctx.stack_.push_back(l);
}
1490
#line 1491 "d2_parser.cc" // lalr1.cc:859
1491
1492
    break;

1493
1494
  case 171:
#line 673 "d2_parser.yy" // lalr1.cc:859
1495
1496
1497
    {
    ctx.stack_.pop_back();
}
1498
#line 1499 "d2_parser.cc" // lalr1.cc:859
1499
1500
    break;

1501
1502
  case 179:
#line 688 "d2_parser.yy" // lalr1.cc:859
1503
1504
1505
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1506
#line 1507 "d2_parser.cc" // lalr1.cc:859
1507
1508
    break;

1509
1510
  case 180:
#line 690 "d2_parser.yy" // lalr1.cc:859
1511
1512
1513
1514
1515
    {
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("name", name);
    ctx.leave();
}
1516
#line 1517 "d2_parser.cc" // lalr1.cc:859
1517
1518
    break;

1519
1520
  case 181:
#line 696 "d2_parser.yy" // lalr1.cc:859
1521
1522
1523
1524
    {
    ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("debuglevel", dl);
}
1525
#line 1526 "d2_parser.cc" // lalr1.cc:859
1526
1527
    break;

1528
1529
  case 182:
#line 700 "d2_parser.yy" // lalr1.cc:859
1530
1531
1532
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1533
#line 1534 "d2_parser.cc" // lalr1.cc:859
1534
1535
    break;

1536
1537
  case 183:
#line 702 "d2_parser.yy" // lalr1.cc:859
1538
1539
1540
1541
1542
    {
    ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("severity", sev);
    ctx.leave();
}
1543
#line 1544 "d2_parser.cc" // lalr1.cc:859
1544
1545
    break;

1546
1547
  case 184:
#line 708 "d2_parser.yy" // lalr1.cc:859
1548
1549
1550
1551
1552
1553
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("output_options", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.OUTPUT_OPTIONS);
}
1554
#line 1555 "d2_parser.cc" // lalr1.cc:859
1555
1556
    break;

1557
1558
  case 185:
#line 713 "d2_parser.yy" // lalr1.cc:859
1559
1560
1561
1562
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
1563
#line 1564 "d2_parser.cc" // lalr1.cc:859
1564
1565
    break;

1566
1567
  case 188:
#line 722 "d2_parser.yy" // lalr1.cc:859
1568
1569
1570
1571
1572
    {
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->add(m);
    ctx.stack_.push_back(m);
}
1573
#line 1574 "d2_parser.cc" // lalr1.cc:859
1574
1575
    break;

1576
1577
  case 189:
#line 726 "d2_parser.yy" // lalr1.cc:859
1578
1579
1580
    {
    ctx.stack_.pop_back();
}
1581
#line 1582 "d2_parser.cc" // lalr1.cc:859
1582
1583
    break;

1584
1585
  case 196:
#line 740 "d2_parser.yy" // lalr1.cc:859
1586
1587
1588
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1589
#line 1590 "d2_parser.cc" // lalr1.cc:859
1590
1591
    break;

1592
1593
  case 197:
#line 742 "d2_parser.yy" // lalr1.cc:859
1594
1595
1596
1597
1598
    {
    ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("output", sev);
    ctx.leave();
}
1599
#line 1600 "d2_parser.cc" // lalr1.cc:859
1600
1601
    break;

1602
1603
  case 198:
#line 748 "d2_parser.yy" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1604
1605
1606
1607
    {
    ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("flush", flush);
}
1608
#line 1609 "d2_parser.cc" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1609
1610
    break;

1611
1612
  case 199:
#line 753 "d2_parser.yy" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1613
1614
1615
1616
    {
    ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("maxsize", maxsize);
}
1617
#line 1618 "d2_parser.cc" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1618
1619
    break;

1620
1621
  case 200:
#line 758 "d2_parser.yy" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1622
1623
1624
1625
    {
    ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("maxver", maxver);
}
1626
#line 1627 "d2_parser.cc" // lalr1.cc:859
Tomek Mrugalski's avatar
Tomek Mrugalski committed
1627
1628
    break;

1629

1630
#line 1631 "d2_parser.cc" // lalr1.cc:859
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754