Kea  1.5.0
d2_parser.cc
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.2.1.
2 
3 // Skeleton implementation for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-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 // Undocumented macros, especially those whose name start with YY_,
34 // are private implementation details. Do not rely on them.
35 
36 
37 // Take the name prefix into account.
38 #define yylex d2_parser_lex
39 
40 
41 
42 #include "d2_parser.h"
43 
44 
45 // Unqualified %code blocks.
46 #line 34 "d2_parser.yy" // lalr1.cc:438
47 
48 #include <d2/parser_context.h>
49 
50 #line 51 "d2_parser.cc" // lalr1.cc:438
51 
52 
53 #ifndef YY_
54 # if defined YYENABLE_NLS && YYENABLE_NLS
55 # if ENABLE_NLS
56 # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
57 # define YY_(msgid) dgettext ("bison-runtime", msgid)
58 # endif
59 # endif
60 # ifndef YY_
61 # define YY_(msgid) msgid
62 # endif
63 #endif
64 
65 // Whether we are compiled with exception support.
66 #ifndef YY_EXCEPTIONS
67 # if defined __GNUC__ && !defined __EXCEPTIONS
68 # define YY_EXCEPTIONS 0
69 # else
70 # define YY_EXCEPTIONS 1
71 # endif
72 #endif
73 
74 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
75 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
76  If N is 0, then set CURRENT to the empty location which ends
77  the previous symbol: RHS[0] (always defined). */
78 
79 # ifndef YYLLOC_DEFAULT
80 # define YYLLOC_DEFAULT(Current, Rhs, N) \
81  do \
82  if (N) \
83  { \
84  (Current).begin = YYRHSLOC (Rhs, 1).begin; \
85  (Current).end = YYRHSLOC (Rhs, N).end; \
86  } \
87  else \
88  { \
89  (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
90  } \
91  while (/*CONSTCOND*/ false)
92 # endif
93 
94 
95 // Suppress unused-variable warnings by "using" E.
96 #define YYUSE(E) ((void) (E))
97 
98 // Enable debugging if requested.
99 #if D2_PARSER_DEBUG
100 
101 // A pseudo ostream that takes yydebug_ into account.
102 # define YYCDEBUG if (yydebug_) (*yycdebug_)
103 
104 # define YY_SYMBOL_PRINT(Title, Symbol) \
105  do { \
106  if (yydebug_) \
107  { \
108  *yycdebug_ << Title << ' '; \
109  yy_print_ (*yycdebug_, Symbol); \
110  *yycdebug_ << '\n'; \
111  } \
112  } while (false)
113 
114 # define YY_REDUCE_PRINT(Rule) \
115  do { \
116  if (yydebug_) \
117  yy_reduce_print_ (Rule); \
118  } while (false)
119 
120 # define YY_STACK_PRINT() \
121  do { \
122  if (yydebug_) \
123  yystack_print_ (); \
124  } while (false)
125 
126 #else // !D2_PARSER_DEBUG
127 
128 # define YYCDEBUG if (false) std::cerr
129 # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
130 # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
131 # define YY_STACK_PRINT() static_cast<void> (0)
132 
133 #endif // !D2_PARSER_DEBUG
134 
135 #define yyerrok (yyerrstatus_ = 0)
136 #define yyclearin (yyla.clear ())
137 
138 #define YYACCEPT goto yyacceptlab
139 #define YYABORT goto yyabortlab
140 #define YYERROR goto yyerrorlab
141 #define YYRECOVERING() (!!yyerrstatus_)
142 
143 #line 14 "d2_parser.yy" // lalr1.cc:513
144 namespace isc { namespace d2 {
145 #line 146 "d2_parser.cc" // lalr1.cc:513
146 
147  /* Return YYSTR after stripping away unnecessary quotes and
148  backslashes, so that it's suitable for yyerror. The heuristic is
149  that double-quoting is unnecessary unless the string contains an
150  apostrophe, a comma, or backslash (other than backslash-backslash).
151  YYSTR is taken from yytname. */
152  std::string
153  D2Parser::yytnamerr_ (const char *yystr)
154  {
155  if (*yystr == '"')
156  {
157  std::string yyr = "";
158  char const *yyp = yystr;
159 
160  for (;;)
161  switch (*++yyp)
162  {
163  case '\'':
164  case ',':
165  goto do_not_strip_quotes;
166 
167  case '\\':
168  if (*++yyp != '\\')
169  goto do_not_strip_quotes;
170  // Fall through.
171  default:
172  yyr += *yyp;
173  break;
174 
175  case '"':
176  return yyr;
177  }
178  do_not_strip_quotes: ;
179  }
180 
181  return yystr;
182  }
183 
184 
187  :
189  yydebug_ (false),
190  yycdebug_ (&std::cerr),
191 #endif
192  ctx (ctx_yyarg)
193  {}
194 
196  {}
197 
198 
199  /*---------------.
200  | Symbol types. |
201  `---------------*/
202 
203 
204 
205  // by_state.
206  D2Parser::by_state::by_state ()
207  : state (empty_state)
208  {}
209 
210  D2Parser::by_state::by_state (const by_state& other)
211  : state (other.state)
212  {}
213 
214  void
215  D2Parser::by_state::clear ()
216  {
217  state = empty_state;
218  }
219 
220  void
221  D2Parser::by_state::move (by_state& that)
222  {
223  state = that.state;
224  that.clear ();
225  }
226 
227  D2Parser::by_state::by_state (state_type s)
228  : state (s)
229  {}
230 
232  D2Parser::by_state::type_get () const
233  {
234  if (state == empty_state)
235  return empty_symbol;
236  else
237  return yystos_[state];
238  }
239 
240  D2Parser::stack_symbol_type::stack_symbol_type ()
241  {}
242 
243  D2Parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
244  : super_type (YY_MOVE (that.state), YY_MOVE (that.location))
245  {
246  switch (that.type_get ())
247  {
248  case 68: // value
249  case 72: // map_value
250  case 96: // ncr_protocol_value
251  value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
252  break;
253 
254  case 56: // "boolean"
255  value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
256  break;
257 
258  case 55: // "floating point"
259  value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
260  break;
261 
262  case 54: // "integer"
263  value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
264  break;
265 
266  case 53: // "constant string"
267  value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
268  break;
269 
270  default:
271  break;
272  }
273 
274 #if 201103L <= YY_CPLUSPLUS
275  // that is emptied.
276  that.state = empty_state;
277 #endif
278  }
279 
280  D2Parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
281  : super_type (s, YY_MOVE (that.location))
282  {
283  switch (that.type_get ())
284  {
285  case 68: // value
286  case 72: // map_value
287  case 96: // ncr_protocol_value
288  value.move< ElementPtr > (YY_MOVE (that.value));
289  break;
290 
291  case 56: // "boolean"
292  value.move< bool > (YY_MOVE (that.value));
293  break;
294 
295  case 55: // "floating point"
296  value.move< double > (YY_MOVE (that.value));
297  break;
298 
299  case 54: // "integer"
300  value.move< int64_t > (YY_MOVE (that.value));
301  break;
302 
303  case 53: // "constant string"
304  value.move< std::string > (YY_MOVE (that.value));
305  break;
306 
307  default:
308  break;
309  }
310 
311  // that is emptied.
312  that.type = empty_symbol;
313  }
314 
315 #if YY_CPLUSPLUS < 201103L
316  D2Parser::stack_symbol_type&
317  D2Parser::stack_symbol_type::operator= (stack_symbol_type& that)
318  {
319  state = that.state;
320  switch (that.type_get ())
321  {
322  case 68: // value
323  case 72: // map_value
324  case 96: // ncr_protocol_value
325  value.move< ElementPtr > (that.value);
326  break;
327 
328  case 56: // "boolean"
329  value.move< bool > (that.value);
330  break;
331 
332  case 55: // "floating point"
333  value.move< double > (that.value);
334  break;
335 
336  case 54: // "integer"
337  value.move< int64_t > (that.value);
338  break;
339 
340  case 53: // "constant string"
341  value.move< std::string > (that.value);
342  break;
343 
344  default:
345  break;
346  }
347 
348  location = that.location;
349  // that is emptied.
350  that.state = empty_state;
351  return *this;
352  }
353 #endif
354 
355  template <typename Base>
356  void
357  D2Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
358  {
359  if (yymsg)
360  YY_SYMBOL_PRINT (yymsg, yysym);
361  }
362 
363 #if D2_PARSER_DEBUG
364  template <typename Base>
365  void
366  D2Parser::yy_print_ (std::ostream& yyo,
367  const basic_symbol<Base>& yysym) const
368  {
369  std::ostream& yyoutput = yyo;
370  YYUSE (yyoutput);
371  symbol_number_type yytype = yysym.type_get ();
372  // Avoid a (spurious) G++ 4.8 warning about "array subscript is
373  // below array bounds".
374  if (yysym.empty ())
375  std::abort ();
376  yyo << (yytype < yyntokens_ ? "token" : "nterm")
377  << ' ' << yytname_[yytype] << " ("
378  << yysym.location << ": ";
379  switch (yytype)
380  {
381  case 53: // "constant string"
382 
383 #line 111 "d2_parser.yy" // lalr1.cc:672
384  { yyoutput << yysym.value.template as< std::string > (); }
385 #line 386 "d2_parser.cc" // lalr1.cc:672
386  break;
387 
388  case 54: // "integer"
389 
390 #line 111 "d2_parser.yy" // lalr1.cc:672
391  { yyoutput << yysym.value.template as< int64_t > (); }
392 #line 393 "d2_parser.cc" // lalr1.cc:672
393  break;
394 
395  case 55: // "floating point"
396 
397 #line 111 "d2_parser.yy" // lalr1.cc:672
398  { yyoutput << yysym.value.template as< double > (); }
399 #line 400 "d2_parser.cc" // lalr1.cc:672
400  break;
401 
402  case 56: // "boolean"
403 
404 #line 111 "d2_parser.yy" // lalr1.cc:672
405  { yyoutput << yysym.value.template as< bool > (); }
406 #line 407 "d2_parser.cc" // lalr1.cc:672
407  break;
408 
409  case 68: // value
410 
411 #line 111 "d2_parser.yy" // lalr1.cc:672
412  { yyoutput << yysym.value.template as< ElementPtr > (); }
413 #line 414 "d2_parser.cc" // lalr1.cc:672
414  break;
415 
416  case 72: // map_value
417 
418 #line 111 "d2_parser.yy" // lalr1.cc:672
419  { yyoutput << yysym.value.template as< ElementPtr > (); }
420 #line 421 "d2_parser.cc" // lalr1.cc:672
421  break;
422 
423  case 96: // ncr_protocol_value
424 
425 #line 111 "d2_parser.yy" // lalr1.cc:672
426  { yyoutput << yysym.value.template as< ElementPtr > (); }
427 #line 428 "d2_parser.cc" // lalr1.cc:672
428  break;
429 
430 
431  default:
432  break;
433  }
434  yyo << ')';
435  }
436 #endif
437 
438  void
439  D2Parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
440  {
441  if (m)
442  YY_SYMBOL_PRINT (m, sym);
443  yystack_.push (YY_MOVE (sym));
444  }
445 
446  void
447  D2Parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
448  {
449 #if 201103L <= YY_CPLUSPLUS
450  yypush_ (m, stack_symbol_type (s, std::move (sym)));
451 #else
452  stack_symbol_type ss (s, sym);
453  yypush_ (m, ss);
454 #endif
455  }
456 
457  void
458  D2Parser::yypop_ (int n)
459  {
460  yystack_.pop (n);
461  }
462 
463 #if D2_PARSER_DEBUG
464  std::ostream&
466  {
467  return *yycdebug_;
468  }
469 
470  void
471  D2Parser::set_debug_stream (std::ostream& o)
472  {
473  yycdebug_ = &o;
474  }
475 
476 
479  {
480  return yydebug_;
481  }
482 
483  void
485  {
486  yydebug_ = l;
487  }
488 #endif // D2_PARSER_DEBUG
489 
490  D2Parser::state_type
491  D2Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
492  {
493  int yyr = yypgoto_[yysym - yyntokens_] + yystate;
494  if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
495  return yytable_[yyr];
496  else
497  return yydefgoto_[yysym - yyntokens_];
498  }
499 
500  bool
501  D2Parser::yy_pact_value_is_default_ (int yyvalue)
502  {
503  return yyvalue == yypact_ninf_;
504  }
505 
506  bool
507  D2Parser::yy_table_value_is_error_ (int yyvalue)
508  {
509  return yyvalue == yytable_ninf_;
510  }
511 
512  int
514  {
515  return parse ();
516  }
517 
518  int
520  {
521  // State.
522  int yyn;
524  int yylen = 0;
525 
526  // Error handling.
527  int yynerrs_ = 0;
528  int yyerrstatus_ = 0;
529 
531  symbol_type yyla;
532 
534  stack_symbol_type yyerror_range[3];
535 
537  int yyresult;
538 
539 #if YY_EXCEPTIONS
540  try
541 #endif // YY_EXCEPTIONS
542  {
543  YYCDEBUG << "Starting parse\n";
544 
545 
546  /* Initialize the stack. The initial state will be set in
547  yynewstate, since the latter expects the semantical and the
548  location values to have been already stored, initialize these
549  stacks with a primary value. */
550  yystack_.clear ();
551  yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
552 
553  // A new symbol was pushed on the stack.
554  yynewstate:
555  YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
556 
557  // Accept?
558  if (yystack_[0].state == yyfinal_)
559  goto yyacceptlab;
560 
561  goto yybackup;
562 
563  // Backup.
564  yybackup:
565  // Try to take a decision without lookahead.
566  yyn = yypact_[yystack_[0].state];
567  if (yy_pact_value_is_default_ (yyn))
568  goto yydefault;
569 
570  // Read a lookahead token.
571  if (yyla.empty ())
572  {
573  YYCDEBUG << "Reading a token: ";
574 #if YY_EXCEPTIONS
575  try
576 #endif // YY_EXCEPTIONS
577  {
578  symbol_type yylookahead (yylex (ctx));
579  yyla.move (yylookahead);
580  }
581 #if YY_EXCEPTIONS
582  catch (const syntax_error& yyexc)
583  {
584  error (yyexc);
585  goto yyerrlab1;
586  }
587 #endif // YY_EXCEPTIONS
588  }
589  YY_SYMBOL_PRINT ("Next token is", yyla);
590 
591  /* If the proper action on seeing token YYLA.TYPE is to reduce or
592  to detect an error, take that action. */
593  yyn += yyla.type_get ();
594  if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
595  goto yydefault;
596 
597  // Reduce or error.
598  yyn = yytable_[yyn];
599  if (yyn <= 0)
600  {
601  if (yy_table_value_is_error_ (yyn))
602  goto yyerrlab;
603  yyn = -yyn;
604  goto yyreduce;
605  }
606 
607  // Count tokens shifted since error; after three, turn off error status.
608  if (yyerrstatus_)
609  --yyerrstatus_;
610 
611  // Shift the lookahead token.
612  yypush_ ("Shifting", yyn, YY_MOVE (yyla));
613  goto yynewstate;
614 
615  /*-----------------------------------------------------------.
616  | yydefault -- do the default action for the current state. |
617  `-----------------------------------------------------------*/
618  yydefault:
619  yyn = yydefact_[yystack_[0].state];
620  if (yyn == 0)
621  goto yyerrlab;
622  goto yyreduce;
623 
624  /*-----------------------------.
625  | yyreduce -- Do a reduction. |
626  `-----------------------------*/
627  yyreduce:
628  yylen = yyr2_[yyn];
629  {
630  stack_symbol_type yylhs;
631  yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
632  /* Variants are always initialized to an empty instance of the
633  correct type. The default '$$ = $1' action is NOT applied
634  when using variants. */
635  switch (yyr1_[yyn])
636  {
637  case 68: // value
638  case 72: // map_value
639  case 96: // ncr_protocol_value
640  yylhs.value.emplace< ElementPtr > ();
641  break;
642 
643  case 56: // "boolean"
644  yylhs.value.emplace< bool > ();
645  break;
646 
647  case 55: // "floating point"
648  yylhs.value.emplace< double > ();
649  break;
650 
651  case 54: // "integer"
652  yylhs.value.emplace< int64_t > ();
653  break;
654 
655  case 53: // "constant string"
656  yylhs.value.emplace< std::string > ();
657  break;
658 
659  default:
660  break;
661  }
662 
663 
664  // Default location.
665  {
667  YYLLOC_DEFAULT (yylhs.location, slice, yylen);
668  yyerror_range[1].location = yylhs.location;
669  }
670 
671  // Perform the reduction.
672  YY_REDUCE_PRINT (yyn);
673 #if YY_EXCEPTIONS
674  try
675 #endif // YY_EXCEPTIONS
676  {
677  switch (yyn)
678  {
679  case 2:
680 #line 120 "d2_parser.yy" // lalr1.cc:907
681  { ctx.ctx_ = ctx.NO_KEYWORD; }
682 #line 683 "d2_parser.cc" // lalr1.cc:907
683  break;
684 
685  case 4:
686 #line 121 "d2_parser.yy" // lalr1.cc:907
687  { ctx.ctx_ = ctx.CONFIG; }
688 #line 689 "d2_parser.cc" // lalr1.cc:907
689  break;
690 
691  case 6:
692 #line 122 "d2_parser.yy" // lalr1.cc:907
693  { ctx.ctx_ = ctx.DHCPDDNS; }
694 #line 695 "d2_parser.cc" // lalr1.cc:907
695  break;
696 
697  case 8:
698 #line 123 "d2_parser.yy" // lalr1.cc:907
699  { ctx.ctx_ = ctx.TSIG_KEY; }
700 #line 701 "d2_parser.cc" // lalr1.cc:907
701  break;
702 
703  case 10:
704 #line 124 "d2_parser.yy" // lalr1.cc:907
705  { ctx.ctx_ = ctx.TSIG_KEYS; }
706 #line 707 "d2_parser.cc" // lalr1.cc:907
707  break;
708 
709  case 12:
710 #line 125 "d2_parser.yy" // lalr1.cc:907
711  { ctx.ctx_ = ctx.DDNS_DOMAIN; }
712 #line 713 "d2_parser.cc" // lalr1.cc:907
713  break;
714 
715  case 14:
716 #line 126 "d2_parser.yy" // lalr1.cc:907
717  { ctx.ctx_ = ctx.DDNS_DOMAINS; }
718 #line 719 "d2_parser.cc" // lalr1.cc:907
719  break;
720 
721  case 16:
722 #line 127 "d2_parser.yy" // lalr1.cc:907
723  { ctx.ctx_ = ctx.DNS_SERVERS; }
724 #line 725 "d2_parser.cc" // lalr1.cc:907
725  break;
726 
727  case 18:
728 #line 128 "d2_parser.yy" // lalr1.cc:907
729  { ctx.ctx_ = ctx.DNS_SERVERS; }
730 #line 731 "d2_parser.cc" // lalr1.cc:907
731  break;
732 
733  case 20:
734 #line 136 "d2_parser.yy" // lalr1.cc:907
735  { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); }
736 #line 737 "d2_parser.cc" // lalr1.cc:907
737  break;
738 
739  case 21:
740 #line 137 "d2_parser.yy" // lalr1.cc:907
741  { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); }
742 #line 743 "d2_parser.cc" // lalr1.cc:907
743  break;
744 
745  case 22:
746 #line 138 "d2_parser.yy" // lalr1.cc:907
747  { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); }
748 #line 749 "d2_parser.cc" // lalr1.cc:907
749  break;
750 
751  case 23:
752 #line 139 "d2_parser.yy" // lalr1.cc:907
753  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); }
754 #line 755 "d2_parser.cc" // lalr1.cc:907
755  break;
756 
757  case 24:
758 #line 140 "d2_parser.yy" // lalr1.cc:907
759  { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
760 #line 761 "d2_parser.cc" // lalr1.cc:907
761  break;
762 
763  case 25:
764 #line 141 "d2_parser.yy" // lalr1.cc:907
765  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
766 #line 767 "d2_parser.cc" // lalr1.cc:907
767  break;
768 
769  case 26:
770 #line 142 "d2_parser.yy" // lalr1.cc:907
771  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
772 #line 773 "d2_parser.cc" // lalr1.cc:907
773  break;
774 
775  case 27:
776 #line 145 "d2_parser.yy" // lalr1.cc:907
777  {
778  // Push back the JSON value on the stack
779  ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ());
780 }
781 #line 782 "d2_parser.cc" // lalr1.cc:907
782  break;
783 
784  case 28:
785 #line 150 "d2_parser.yy" // lalr1.cc:907
786  {
787  // This code is executed when we're about to start parsing
788  // the content of the map
789  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
790  ctx.stack_.push_back(m);
791 }
792 #line 793 "d2_parser.cc" // lalr1.cc:907
793  break;
794 
795  case 29:
796 #line 155 "d2_parser.yy" // lalr1.cc:907
797  {
798  // map parsing completed. If we ever want to do any wrap up
799  // (maybe some sanity checking), this would be the best place
800  // for it.
801 }
802 #line 803 "d2_parser.cc" // lalr1.cc:907
803  break;
804 
805  case 30:
806 #line 161 "d2_parser.yy" // lalr1.cc:907
807  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
808 #line 809 "d2_parser.cc" // lalr1.cc:907
809  break;
810 
811  case 33:
812 #line 168 "d2_parser.yy" // lalr1.cc:907
813  {
814  // map containing a single entry
815  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
816  }
817 #line 818 "d2_parser.cc" // lalr1.cc:907
818  break;
819 
820  case 34:
821 #line 172 "d2_parser.yy" // lalr1.cc:907
822  {
823  // map consisting of a shorter map followed by
824  // comma and string:value
825  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
826  }
827 #line 828 "d2_parser.cc" // lalr1.cc:907
828  break;
829 
830  case 35:
831 #line 179 "d2_parser.yy" // lalr1.cc:907
832  {
833  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
834  ctx.stack_.push_back(l);
835 }
836 #line 837 "d2_parser.cc" // lalr1.cc:907
837  break;
838 
839  case 36:
840 #line 182 "d2_parser.yy" // lalr1.cc:907
841  {
842  // list parsing complete. Put any sanity checking here
843 }
844 #line 845 "d2_parser.cc" // lalr1.cc:907
845  break;
846 
847  case 39:
848 #line 190 "d2_parser.yy" // lalr1.cc:907
849  {
850  // List consisting of a single element.
851  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
852  }
853 #line 854 "d2_parser.cc" // lalr1.cc:907
854  break;
855 
856  case 40:
857 #line 194 "d2_parser.yy" // lalr1.cc:907
858  {
859  // List ending with , and a value.
860  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
861  }
862 #line 863 "d2_parser.cc" // lalr1.cc:907
863  break;
864 
865  case 41:
866 #line 205 "d2_parser.yy" // lalr1.cc:907
867  {
868  const std::string& where = ctx.contextName();
869  const std::string& keyword = yystack_[1].value.as< std::string > ();
870  error(yystack_[1].location,
871  "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
872 }
873 #line 874 "d2_parser.cc" // lalr1.cc:907
874  break;
875 
876  case 42:
877 #line 215 "d2_parser.yy" // lalr1.cc:907
878  {
879  // This code is executed when we're about to start parsing
880  // the content of the map
881  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
882  ctx.stack_.push_back(m);
883 }
884 #line 885 "d2_parser.cc" // lalr1.cc:907
885  break;
886 
887  case 43:
888 #line 220 "d2_parser.yy" // lalr1.cc:907
889  {
890  // map parsing completed. If we ever want to do any wrap up
891  // (maybe some sanity checking), this would be the best place
892  // for it.
893 }
894 #line 895 "d2_parser.cc" // lalr1.cc:907
895  break;
896 
897  case 52:
898 #line 242 "d2_parser.yy" // lalr1.cc:907
899  {
900  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
901  ctx.stack_.back()->set("DhcpDdns", m);
902  ctx.stack_.push_back(m);
903  ctx.enter(ctx.DHCPDDNS);
904 }
905 #line 906 "d2_parser.cc" // lalr1.cc:907
906  break;
907 
908  case 53:
909 #line 247 "d2_parser.yy" // lalr1.cc:907
910  {
911  ctx.stack_.pop_back();
912  ctx.leave();
913 }
914 #line 915 "d2_parser.cc" // lalr1.cc:907
915  break;
916 
917  case 54:
918 #line 252 "d2_parser.yy" // lalr1.cc:907
919  {
920  // Parse the dhcpddns map
921  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
922  ctx.stack_.push_back(m);
923 }
924 #line 925 "d2_parser.cc" // lalr1.cc:907
925  break;
926 
927  case 55:
928 #line 256 "d2_parser.yy" // lalr1.cc:907
929  {
930  // parsing completed
931 }
932 #line 933 "d2_parser.cc" // lalr1.cc:907
933  break;
934 
935  case 69:
936 #line 278 "d2_parser.yy" // lalr1.cc:907
937  {
938  ctx.enter(ctx.NO_KEYWORD);
939 }
940 #line 941 "d2_parser.cc" // lalr1.cc:907
941  break;
942 
943  case 70:
944 #line 280 "d2_parser.yy" // lalr1.cc:907
945  {
946  ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
947  ctx.stack_.back()->set("ip-address", s);
948  ctx.leave();
949 }
950 #line 951 "d2_parser.cc" // lalr1.cc:907
951  break;
952 
953  case 71:
954 #line 286 "d2_parser.yy" // lalr1.cc:907
955  {
956  if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65536 ) {
957  error(yystack_[0].location, "port must be greater than zero but less than 65536");
958  }
959  ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
960  ctx.stack_.back()->set("port", i);
961 }
962 #line 963 "d2_parser.cc" // lalr1.cc:907
963  break;
964 
965  case 72:
966 #line 294 "d2_parser.yy" // lalr1.cc:907
967  {
968  if (yystack_[0].value.as< int64_t > () <= 0) {
969  error(yystack_[0].location, "dns-server-timeout must be greater than zero");
970  } else {
971  ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
972  ctx.stack_.back()->set("dns-server-timeout", i);
973  }
974 }
975 #line 976 "d2_parser.cc" // lalr1.cc:907
976  break;
977 
978  case 73:
979 #line 303 "d2_parser.yy" // lalr1.cc:907
980  {
981  ctx.enter(ctx.NCR_PROTOCOL);
982 }
983 #line 984 "d2_parser.cc" // lalr1.cc:907
984  break;
985 
986  case 74:
987 #line 305 "d2_parser.yy" // lalr1.cc:907
988  {
989  ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as< ElementPtr > ());
990  ctx.leave();
991 }
992 #line 993 "d2_parser.cc" // lalr1.cc:907
993  break;
994 
995  case 75:
996 #line 311 "d2_parser.yy" // lalr1.cc:907
997  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
998 #line 999 "d2_parser.cc" // lalr1.cc:907
999  break;
1000 
1001  case 76:
1002 #line 312 "d2_parser.yy" // lalr1.cc:907
1003  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
1004 #line 1005 "d2_parser.cc" // lalr1.cc:907
1005  break;
1006 
1007  case 77:
1008 #line 315 "d2_parser.yy" // lalr1.cc:907
1009  {
1010  ctx.enter(ctx.NCR_FORMAT);
1011 }
1012 #line 1013 "d2_parser.cc" // lalr1.cc:907
1013  break;
1014 
1015  case 78:
1016 #line 317 "d2_parser.yy" // lalr1.cc:907
1017  {
1018  ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
1019  ctx.stack_.back()->set("ncr-format", json);
1020  ctx.leave();
1021 }
1022 #line 1023 "d2_parser.cc" // lalr1.cc:907
1023  break;
1024 
1025  case 79:
1026 #line 323 "d2_parser.yy" // lalr1.cc:907
1027  {
1028  ctx.enter(ctx.NO_KEYWORD);
1029 }
1030 #line 1031 "d2_parser.cc" // lalr1.cc:907
1031  break;
1032 
1033  case 80:
1034 #line 325 "d2_parser.yy" // lalr1.cc:907
1035  {
1036  ElementPtr parent = ctx.stack_.back();
1037  ElementPtr user_context = yystack_[0].value.as< ElementPtr > ();
1038  ConstElementPtr old = parent->get("user-context");
1039 
1040  // Handle already existing user context
1041  if (old) {
1042  // Check if it was a comment or a duplicate
1043  if ((old->size() != 1) || !old->contains("comment")) {
1044  std::stringstream msg;
1045  msg << "duplicate user-context entries (previous at "
1046  << old->getPosition().str() << ")";
1047  error(yystack_[3].location, msg.str());
1048  }
1049  // Merge the comment
1050  user_context->set("comment", old->get("comment"));
1051  }
1052 
1053  // Set the user context
1054  parent->set("user-context", user_context);
1055  ctx.leave();
1056 }
1057 #line 1058 "d2_parser.cc" // lalr1.cc:907
1058  break;
1059 
1060  case 81:
1061 #line 348 "d2_parser.yy" // lalr1.cc:907
1062  {
1063  ctx.enter(ctx.NO_KEYWORD);
1064 }
1065 #line 1066 "d2_parser.cc" // lalr1.cc:907
1066  break;
1067 
1068  case 82:
1069 #line 350 "d2_parser.yy" // lalr1.cc:907
1070  {
1071  ElementPtr parent = ctx.stack_.back();
1072  ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
1073  ElementPtr comment(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1074  user_context->set("comment", comment);
1075 
1076  // Handle already existing user context
1077  ConstElementPtr old = parent->get("user-context");
1078  if (old) {
1079  // Check for duplicate comment
1080  if (old->contains("comment")) {
1081  std::stringstream msg;
1082  msg << "duplicate user-context/comment entries (previous at "
1083  << old->getPosition().str() << ")";
1084  error(yystack_[3].location, msg.str());
1085  }
1086  // Merge the user context in the comment
1087  merge(user_context, old);
1088  }
1089 
1090  // Set the user context
1091  parent->set("user-context", user_context);
1092  ctx.leave();
1093 }
1094 #line 1095 "d2_parser.cc" // lalr1.cc:907
1095  break;
1096 
1097  case 83:
1098 #line 375 "d2_parser.yy" // lalr1.cc:907
1099  {
1100  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1101  ctx.stack_.back()->set("forward-ddns", m);
1102  ctx.stack_.push_back(m);
1103  ctx.enter(ctx.FORWARD_DDNS);
1104 }
1105 #line 1106 "d2_parser.cc" // lalr1.cc:907
1106  break;
1107 
1108  case 84:
1109 #line 380 "d2_parser.yy" // lalr1.cc:907
1110  {
1111  ctx.stack_.pop_back();
1112  ctx.leave();
1113 }
1114 #line 1115 "d2_parser.cc" // lalr1.cc:907
1115  break;
1116 
1117  case 85:
1118 #line 385 "d2_parser.yy" // lalr1.cc:907
1119  {
1120  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1121  ctx.stack_.back()->set("reverse-ddns", m);
1122  ctx.stack_.push_back(m);
1123  ctx.enter(ctx.REVERSE_DDNS);
1124 }
1125 #line 1126 "d2_parser.cc" // lalr1.cc:907
1126  break;
1127 
1128  case 86:
1129 #line 390 "d2_parser.yy" // lalr1.cc:907
1130  {
1131  ctx.stack_.pop_back();
1132  ctx.leave();
1133 }
1134 #line 1135 "d2_parser.cc" // lalr1.cc:907
1135  break;
1136 
1137  case 93:
1138 #line 409 "d2_parser.yy" // lalr1.cc:907
1139  {
1140  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1141  ctx.stack_.back()->set("ddns-domains", l);
1142  ctx.stack_.push_back(l);
1143  ctx.enter(ctx.DDNS_DOMAINS);
1144 }
1145 #line 1146 "d2_parser.cc" // lalr1.cc:907
1146  break;
1147 
1148  case 94:
1149 #line 414 "d2_parser.yy" // lalr1.cc:907
1150  {
1151  ctx.stack_.pop_back();
1152  ctx.leave();
1153 }
1154 #line 1155 "d2_parser.cc" // lalr1.cc:907
1155  break;
1156 
1157  case 95:
1158 #line 419 "d2_parser.yy" // lalr1.cc:907
1159  {
1160  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1161  ctx.stack_.push_back(l);
1162 }
1163 #line 1164 "d2_parser.cc" // lalr1.cc:907
1164  break;
1165 
1166  case 96:
1167 #line 422 "d2_parser.yy" // lalr1.cc:907
1168  {
1169  // parsing completed
1170 }
1171 #line 1172 "d2_parser.cc" // lalr1.cc:907
1172  break;
1173 
1174  case 101:
1175 #line 434 "d2_parser.yy" // lalr1.cc:907
1176  {
1177  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1178  ctx.stack_.back()->add(m);
1179  ctx.stack_.push_back(m);
1180 }
1181 #line 1182 "d2_parser.cc" // lalr1.cc:907
1182  break;
1183 
1184  case 102:
1185 #line 438 "d2_parser.yy" // lalr1.cc:907
1186  {
1187  ctx.stack_.pop_back();
1188 }
1189 #line 1190 "d2_parser.cc" // lalr1.cc:907
1190  break;
1191 
1192  case 103:
1193 #line 442 "d2_parser.yy" // lalr1.cc:907
1194  {
1195  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1196  ctx.stack_.push_back(m);
1197 }
1198 #line 1199 "d2_parser.cc" // lalr1.cc:907
1199  break;
1200 
1201  case 104:
1202 #line 445 "d2_parser.yy" // lalr1.cc:907
1203  {
1204  // parsing completed
1205 }
1206 #line 1207 "d2_parser.cc" // lalr1.cc:907
1207  break;
1208 
1209  case 113:
1210 #line 462 "d2_parser.yy" // lalr1.cc:907
1211  {
1212  ctx.enter(ctx.NO_KEYWORD);
1213 }
1214 #line 1215 "d2_parser.cc" // lalr1.cc:907
1215  break;
1216 
1217  case 114:
1218 #line 464 "d2_parser.yy" // lalr1.cc:907
1219  {
1220  if (yystack_[0].value.as< std::string > () == "") {
1221  error(yystack_[1].location, "Ddns domain name cannot be blank");
1222  }
1223  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1224  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1225  ctx.stack_.back()->set("name", name);
1226  ctx.leave();
1227 }
1228 #line 1229 "d2_parser.cc" // lalr1.cc:907
1229  break;
1230 
1231  case 115:
1232 #line 474 "d2_parser.yy" // lalr1.cc:907
1233  {
1234  ctx.enter(ctx.NO_KEYWORD);
1235 }
1236 #line 1237 "d2_parser.cc" // lalr1.cc:907
1237  break;
1238 
1239  case 116:
1240 #line 476 "d2_parser.yy" // lalr1.cc:907
1241  {
1242  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1243  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1244  ctx.stack_.back()->set("key-name", name);
1245  ctx.leave();
1246 }
1247 #line 1248 "d2_parser.cc" // lalr1.cc:907
1248  break;
1249 
1250  case 117:
1251 #line 486 "d2_parser.yy" // lalr1.cc:907
1252  {
1253  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1254  ctx.stack_.back()->set("dns-servers", l);
1255  ctx.stack_.push_back(l);
1256  ctx.enter(ctx.DNS_SERVERS);
1257 }
1258 #line 1259 "d2_parser.cc" // lalr1.cc:907
1259  break;
1260 
1261  case 118:
1262 #line 491 "d2_parser.yy" // lalr1.cc:907
1263  {
1264  ctx.stack_.pop_back();
1265  ctx.leave();
1266 }
1267 #line 1268 "d2_parser.cc" // lalr1.cc:907
1268  break;
1269 
1270  case 119:
1271 #line 496 "d2_parser.yy" // lalr1.cc:907
1272  {
1273  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1274  ctx.stack_.push_back(l);
1275 }
1276 #line 1277 "d2_parser.cc" // lalr1.cc:907
1277  break;
1278 
1279  case 120:
1280 #line 499 "d2_parser.yy" // lalr1.cc:907
1281  {
1282  // parsing completed
1283 }
1284 #line 1285 "d2_parser.cc" // lalr1.cc:907
1285  break;
1286 
1287  case 123:
1288 #line 507 "d2_parser.yy" // lalr1.cc:907
1289  {
1290  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1291  ctx.stack_.back()->add(m);
1292  ctx.stack_.push_back(m);
1293 }
1294 #line 1295 "d2_parser.cc" // lalr1.cc:907
1295  break;
1296 
1297  case 124:
1298 #line 511 "d2_parser.yy" // lalr1.cc:907
1299  {
1300  ctx.stack_.pop_back();
1301 }
1302 #line 1303 "d2_parser.cc" // lalr1.cc:907
1303  break;
1304 
1305  case 125:
1306 #line 515 "d2_parser.yy" // lalr1.cc:907
1307  {
1308  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1309  ctx.stack_.push_back(m);
1310 }
1311 #line 1312 "d2_parser.cc" // lalr1.cc:907
1312  break;
1313 
1314  case 126:
1315 #line 518 "d2_parser.yy" // lalr1.cc:907
1316  {
1317  // parsing completed
1318 }
1319 #line 1320 "d2_parser.cc" // lalr1.cc:907
1320  break;
1321 
1322  case 135:
1323 #line 534 "d2_parser.yy" // lalr1.cc:907
1324  {
1325  ctx.enter(ctx.NO_KEYWORD);
1326 }
1327 #line 1328 "d2_parser.cc" // lalr1.cc:907
1328  break;
1329 
1330  case 136:
1331 #line 536 "d2_parser.yy" // lalr1.cc:907
1332  {
1333  if (yystack_[0].value.as< std::string > () != "") {
1334  error(yystack_[1].location, "hostname is not yet supported");
1335  }
1336  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1337  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1338  ctx.stack_.back()->set("hostname", name);
1339  ctx.leave();
1340 }
1341 #line 1342 "d2_parser.cc" // lalr1.cc:907
1342  break;
1343 
1344  case 137:
1345 #line 546 "d2_parser.yy" // lalr1.cc:907
1346  {
1347  ctx.enter(ctx.NO_KEYWORD);
1348 }
1349 #line 1350 "d2_parser.cc" // lalr1.cc:907
1350  break;
1351 
1352  case 138:
1353 #line 548 "d2_parser.yy" // lalr1.cc:907
1354  {
1355  ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1356  ctx.stack_.back()->set("ip-address", s);
1357  ctx.leave();
1358 }
1359 #line 1360 "d2_parser.cc" // lalr1.cc:907
1360  break;
1361 
1362  case 139:
1363 #line 554 "d2_parser.yy" // lalr1.cc:907
1364  {
1365  if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65536 ) {
1366  error(yystack_[0].location, "port must be greater than zero but less than 65536");
1367  }
1368  ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1369  ctx.stack_.back()->set("port", i);
1370 }
1371 #line 1372 "d2_parser.cc" // lalr1.cc:907
1372  break;
1373 
1374  case 140:
1375 #line 568 "d2_parser.yy" // lalr1.cc:907
1376  {
1377  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1378  ctx.stack_.back()->set("tsig-keys", l);
1379  ctx.stack_.push_back(l);
1380  ctx.enter(ctx.TSIG_KEYS);
1381 }
1382 #line 1383 "d2_parser.cc" // lalr1.cc:907
1383  break;
1384 
1385  case 141:
1386 #line 573 "d2_parser.yy" // lalr1.cc:907
1387  {
1388  ctx.stack_.pop_back();
1389  ctx.leave();
1390 }
1391 #line 1392 "d2_parser.cc" // lalr1.cc:907
1392  break;
1393 
1394  case 142:
1395 #line 578 "d2_parser.yy" // lalr1.cc:907
1396  {
1397  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1398  ctx.stack_.push_back(l);
1399 }
1400 #line 1401 "d2_parser.cc" // lalr1.cc:907
1401  break;
1402 
1403  case 143:
1404 #line 581 "d2_parser.yy" // lalr1.cc:907
1405  {
1406  // parsing completed
1407 }
1408 #line 1409 "d2_parser.cc" // lalr1.cc:907
1409  break;
1410 
1411  case 148:
1412 #line 593 "d2_parser.yy" // lalr1.cc:907
1413  {
1414  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1415  ctx.stack_.back()->add(m);
1416  ctx.stack_.push_back(m);
1417 }
1418 #line 1419 "d2_parser.cc" // lalr1.cc:907
1419  break;
1420 
1421  case 149:
1422 #line 597 "d2_parser.yy" // lalr1.cc:907
1423  {
1424  ctx.stack_.pop_back();
1425 }
1426 #line 1427 "d2_parser.cc" // lalr1.cc:907
1427  break;
1428 
1429  case 150:
1430 #line 601 "d2_parser.yy" // lalr1.cc:907
1431  {
1432  // Parse tsig key list entry map
1433  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1434  ctx.stack_.push_back(m);
1435 }
1436 #line 1437 "d2_parser.cc" // lalr1.cc:907
1437  break;
1438 
1439  case 151:
1440 #line 605 "d2_parser.yy" // lalr1.cc:907
1441  {
1442  // parsing completed
1443 }
1444 #line 1445 "d2_parser.cc" // lalr1.cc:907
1445  break;
1446 
1447  case 161:
1448 #line 623 "d2_parser.yy" // lalr1.cc:907
1449  {
1450  ctx.enter(ctx.NO_KEYWORD);
1451 }
1452 #line 1453 "d2_parser.cc" // lalr1.cc:907
1453  break;
1454 
1455  case 162:
1456 #line 625 "d2_parser.yy" // lalr1.cc:907
1457  {
1458  if (yystack_[0].value.as< std::string > () == "") {
1459  error(yystack_[1].location, "TSIG key name cannot be blank");
1460  }
1461  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1462  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1463  ctx.stack_.back()->set("name", name);
1464  ctx.leave();
1465 }
1466 #line 1467 "d2_parser.cc" // lalr1.cc:907
1467  break;
1468 
1469  case 163:
1470 #line 635 "d2_parser.yy" // lalr1.cc:907
1471  {
1472  ctx.enter(ctx.NO_KEYWORD);
1473 }
1474 #line 1475 "d2_parser.cc" // lalr1.cc:907
1475  break;
1476 
1477  case 164:
1478 #line 637 "d2_parser.yy" // lalr1.cc:907
1479  {
1480  if (yystack_[0].value.as< std::string > () == "") {
1481  error(yystack_[1].location, "TSIG key algorithm cannot be blank");
1482  }
1483  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1484  ctx.stack_.back()->set("algorithm", elem);
1485  ctx.leave();
1486 }
1487 #line 1488 "d2_parser.cc" // lalr1.cc:907
1488  break;
1489 
1490  case 165:
1491 #line 646 "d2_parser.yy" // lalr1.cc:907
1492  {
1493  if (yystack_[0].value.as< int64_t > () < 0 || (yystack_[0].value.as< int64_t > () > 0 && (yystack_[0].value.as< int64_t > () % 8 != 0))) {
1494  error(yystack_[0].location, "TSIG key digest-bits must either be zero or a positive, multiple of eight");
1495  }
1496  ElementPtr elem(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1497  ctx.stack_.back()->set("digest-bits", elem);
1498 }
1499 #line 1500 "d2_parser.cc" // lalr1.cc:907
1500  break;
1501 
1502  case 166:
1503 #line 654 "d2_parser.yy" // lalr1.cc:907
1504  {
1505  ctx.enter(ctx.NO_KEYWORD);
1506 }
1507 #line 1508 "d2_parser.cc" // lalr1.cc:907
1508  break;
1509 
1510  case 167:
1511 #line 656 "d2_parser.yy" // lalr1.cc:907
1512  {
1513  if (yystack_[0].value.as< std::string > () == "") {
1514  error(yystack_[1].location, "TSIG key secret cannot be blank");
1515  }
1516  ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1517  ctx.stack_.back()->set("secret", elem);
1518  ctx.leave();
1519 }
1520 #line 1521 "d2_parser.cc" // lalr1.cc:907
1521  break;
1522 
1523  case 168:
1524 #line 669 "d2_parser.yy" // lalr1.cc:907
1525  {
1526  ctx.enter(ctx.NO_KEYWORD);
1527 }
1528 #line 1529 "d2_parser.cc" // lalr1.cc:907
1529  break;
1530 
1531  case 169:
1532 #line 671 "d2_parser.yy" // lalr1.cc:907
1533  {
1534  ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ());
1535  ctx.leave();
1536 }
1537 #line 1538 "d2_parser.cc" // lalr1.cc:907
1538  break;
1539 
1540  case 170:
1541 #line 676 "d2_parser.yy" // lalr1.cc:907
1542  {
1543  ctx.enter(ctx.NO_KEYWORD);
1544 }
1545 #line 1546 "d2_parser.cc" // lalr1.cc:907
1546  break;
1547 
1548  case 171:
1549 #line 678 "d2_parser.yy" // lalr1.cc:907
1550  {
1551  ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ());
1552  ctx.leave();
1553 }
1554 #line 1555 "d2_parser.cc" // lalr1.cc:907
1555  break;
1556 
1557  case 172:
1558 #line 683 "d2_parser.yy" // lalr1.cc:907
1559  {
1560  ctx.enter(ctx.NO_KEYWORD);
1561 }
1562 #line 1563 "d2_parser.cc" // lalr1.cc:907
1563  break;
1564 
1565  case 173:
1566 #line 685 "d2_parser.yy" // lalr1.cc:907
1567  {
1568  ctx.stack_.back()->set("Control-agent", yystack_[0].value.as< ElementPtr > ());
1569  ctx.leave();
1570 }
1571 #line 1572 "d2_parser.cc" // lalr1.cc:907
1572  break;
1573 
1574  case 174:
1575 #line 695 "d2_parser.yy" // lalr1.cc:907
1576  {
1577  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1578  ctx.stack_.back()->set("Logging", m);
1579  ctx.stack_.push_back(m);
1580  ctx.enter(ctx.LOGGING);
1581 }
1582 #line 1583 "d2_parser.cc" // lalr1.cc:907
1583  break;
1584 
1585  case 175:
1586 #line 700 "d2_parser.yy" // lalr1.cc:907
1587  {
1588  ctx.stack_.pop_back();
1589  ctx.leave();
1590 }
1591 #line 1592 "d2_parser.cc" // lalr1.cc:907
1592  break;
1593 
1594  case 179:
1595 #line 717 "d2_parser.yy" // lalr1.cc:907
1596  {
1597  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1598  ctx.stack_.back()->set("loggers", l);
1599  ctx.stack_.push_back(l);
1600  ctx.enter(ctx.LOGGERS);
1601 }
1602 #line 1603 "d2_parser.cc" // lalr1.cc:907
1603  break;
1604 
1605  case 180:
1606 #line 722 "d2_parser.yy" // lalr1.cc:907
1607  {
1608  ctx.stack_.pop_back();
1609  ctx.leave();
1610 }
1611 #line 1612 "d2_parser.cc" // lalr1.cc:907
1612  break;
1613 
1614  case 183:
1615 #line 734 "d2_parser.yy" // lalr1.cc:907
1616  {
1617  ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1618  ctx.stack_.back()->add(l);
1619  ctx.stack_.push_back(l);
1620 }
1621 #line 1622 "d2_parser.cc" // lalr1.cc:907
1622  break;
1623 
1624  case 184:
1625 #line 738 "d2_parser.yy" // lalr1.cc:907
1626  {
1627  ctx.stack_.pop_back();
1628 }
1629 #line 1630 "d2_parser.cc" // lalr1.cc:907
1630  break;
1631 
1632  case 194:
1633 #line 755 "d2_parser.yy" // lalr1.cc:907
1634  {
1635  ctx.enter(ctx.NO_KEYWORD);
1636 }
1637 #line 1638 "d2_parser.cc" // lalr1.cc:907
1638  break;
1639 
1640  case 195:
1641 #line 757 "d2_parser.yy" // lalr1.cc:907
1642  {
1643  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1644  ctx.stack_.back()->set("name", name);
1645  ctx.leave();
1646 }
1647 #line 1648 "d2_parser.cc" // lalr1.cc:907
1648  break;
1649 
1650  case 196:
1651 #line 763 "d2_parser.yy" // lalr1.cc:907
1652  {
1653  ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1654  ctx.stack_.back()->set("debuglevel", dl);
1655 }
1656 #line 1657 "d2_parser.cc" // lalr1.cc:907
1657  break;
1658 
1659  case 197:
1660 #line 767 "d2_parser.yy" // lalr1.cc:907
1661  {
1662  ctx.enter(ctx.NO_KEYWORD);
1663 }
1664 #line 1665 "d2_parser.cc" // lalr1.cc:907
1665  break;
1666 
1667  case 198:
1668 #line 769 "d2_parser.yy" // lalr1.cc:907
1669  {
1670  ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1671  ctx.stack_.back()->set("severity", sev);
1672  ctx.leave();
1673 }
1674 #line 1675 "d2_parser.cc" // lalr1.cc:907
1675  break;
1676 
1677  case 199:
1678 #line 775 "d2_parser.yy" // lalr1.cc:907
1679  {
1680  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1681  ctx.stack_.back()->set("output_options", l);
1682  ctx.stack_.push_back(l);
1683  ctx.enter(ctx.OUTPUT_OPTIONS);
1684 }
1685 #line 1686 "d2_parser.cc" // lalr1.cc:907
1686  break;
1687 
1688  case 200:
1689 #line 780 "d2_parser.yy" // lalr1.cc:907
1690  {
1691  ctx.stack_.pop_back();
1692  ctx.leave();
1693 }
1694 #line 1695 "d2_parser.cc" // lalr1.cc:907
1695  break;
1696 
1697  case 203:
1698 #line 789 "d2_parser.yy" // lalr1.cc:907
1699  {
1700  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1701  ctx.stack_.back()->add(m);
1702  ctx.stack_.push_back(m);
1703 }
1704 #line 1705 "d2_parser.cc" // lalr1.cc:907
1705  break;
1706 
1707  case 204:
1708 #line 793 "d2_parser.yy" // lalr1.cc:907
1709  {
1710  ctx.stack_.pop_back();
1711 }
1712 #line 1713 "d2_parser.cc" // lalr1.cc:907
1713  break;
1714 
1715  case 211:
1716 #line 807 "d2_parser.yy" // lalr1.cc:907
1717  {
1718  ctx.enter(ctx.NO_KEYWORD);
1719 }
1720 #line 1721 "d2_parser.cc" // lalr1.cc:907
1721  break;
1722 
1723  case 212:
1724 #line 809 "d2_parser.yy" // lalr1.cc:907
1725  {
1726  ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1727  ctx.stack_.back()->set("output", sev);
1728  ctx.leave();
1729 }
1730 #line 1731 "d2_parser.cc" // lalr1.cc:907
1731  break;
1732 
1733  case 213:
1734 #line 815 "d2_parser.yy" // lalr1.cc:907
1735  {
1736  ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
1737  ctx.stack_.back()->set("flush", flush);
1738 }
1739 #line 1740 "d2_parser.cc" // lalr1.cc:907
1740  break;
1741 
1742  case 214:
1743 #line 820 "d2_parser.yy" // lalr1.cc:907
1744  {
1745  ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1746  ctx.stack_.back()->set("maxsize", maxsize);
1747 }
1748 #line 1749 "d2_parser.cc" // lalr1.cc:907
1749  break;
1750 
1751  case 215:
1752 #line 825 "d2_parser.yy" // lalr1.cc:907
1753  {
1754  ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1755  ctx.stack_.back()->set("maxver", maxver);
1756 }
1757 #line 1758 "d2_parser.cc" // lalr1.cc:907
1758  break;
1759 
1760 
1761 #line 1762 "d2_parser.cc" // lalr1.cc:907
1762  default:
1763  break;
1764  }
1765  }
1766 #if YY_EXCEPTIONS
1767  catch (const syntax_error& yyexc)
1768  {
1769  error (yyexc);
1770  YYERROR;
1771  }
1772 #endif // YY_EXCEPTIONS
1773  YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1774  yypop_ (yylen);
1775  yylen = 0;
1776  YY_STACK_PRINT ();
1777 
1778  // Shift the result of the reduction.
1779  yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1780  }
1781  goto yynewstate;
1782 
1783  /*--------------------------------------.
1784  | yyerrlab -- here on detecting error. |
1785  `--------------------------------------*/
1786  yyerrlab:
1787  // If not already recovering from an error, report this error.
1788  if (!yyerrstatus_)
1789  {
1790  ++yynerrs_;
1791  error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla));
1792  }
1793 
1794 
1795  yyerror_range[1].location = yyla.location;
1796  if (yyerrstatus_ == 3)
1797  {
1798  /* If just tried and failed to reuse lookahead token after an
1799  error, discard it. */
1800 
1801  // Return failure if at end of input.
1802  if (yyla.type_get () == yyeof_)
1803  YYABORT;
1804  else if (!yyla.empty ())
1805  {
1806  yy_destroy_ ("Error: discarding", yyla);
1807  yyla.clear ();
1808  }
1809  }
1810 
1811  // Else will try to reuse lookahead token after shifting the error token.
1812  goto yyerrlab1;
1813 
1814 
1815  /*---------------------------------------------------.
1816  | yyerrorlab -- error raised explicitly by YYERROR. |
1817  `---------------------------------------------------*/
1818  yyerrorlab:
1819 
1820  /* Pacify compilers like GCC when the user code never invokes
1821  YYERROR and the label yyerrorlab therefore never appears in user
1822  code. */
1823  if (false)
1824  goto yyerrorlab;
1825  /* Do not reclaim the symbols of the rule whose action triggered
1826  this YYERROR. */
1827  yypop_ (yylen);
1828  yylen = 0;
1829  goto yyerrlab1;
1830 
1831  /*-------------------------------------------------------------.
1832  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1833  `-------------------------------------------------------------*/
1834  yyerrlab1:
1835  yyerrstatus_ = 3; // Each real token shifted decrements this.
1836  {
1837  stack_symbol_type error_token;
1838  for (;;)
1839  {
1840  yyn = yypact_[yystack_[0].state];
1841  if (!yy_pact_value_is_default_ (yyn))
1842  {
1843  yyn += yyterror_;
1844  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1845  {
1846  yyn = yytable_[yyn];
1847  if (0 < yyn)
1848  break;
1849  }
1850  }
1851 
1852  // Pop the current state because it cannot handle the error token.
1853  if (yystack_.size () == 1)
1854  YYABORT;
1855 
1856  yyerror_range[1].location = yystack_[0].location;
1857  yy_destroy_ ("Error: popping", yystack_[0]);
1858  yypop_ ();
1859  YY_STACK_PRINT ();
1860  }
1861 
1862  yyerror_range[2].location = yyla.location;
1863  YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1864 
1865  // Shift the error token.
1866  error_token.state = yyn;
1867  yypush_ ("Shifting", YY_MOVE (error_token));
1868  }
1869  goto yynewstate;
1870 
1871  // Accept.
1872  yyacceptlab:
1873  yyresult = 0;
1874  goto yyreturn;
1875 
1876  // Abort.
1877  yyabortlab:
1878  yyresult = 1;
1879  goto yyreturn;
1880 
1881  yyreturn:
1882  if (!yyla.empty ())
1883  yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1884 
1885  /* Do not reclaim the symbols of the rule whose action triggered
1886  this YYABORT or YYACCEPT. */
1887  yypop_ (yylen);
1888  while (1 < yystack_.size ())
1889  {
1890  yy_destroy_ ("Cleanup: popping", yystack_[0]);
1891  yypop_ ();
1892  }
1893 
1894  return yyresult;
1895  }
1896 #if YY_EXCEPTIONS
1897  catch (...)
1898  {
1899  YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1900  // Do not try to display the values of the reclaimed symbols,
1901  // as their printers might throw an exception.
1902  if (!yyla.empty ())
1903  yy_destroy_ (YY_NULLPTR, yyla);
1904 
1905  while (1 < yystack_.size ())
1906  {
1907  yy_destroy_ (YY_NULLPTR, yystack_[0]);
1908  yypop_ ();
1909  }
1910  throw;
1911  }
1912 #endif // YY_EXCEPTIONS
1913  }
1914 
1915  void
1917  {
1918  error (yyexc.location, yyexc.what ());
1919  }
1920 
1921  // Generate an error message.
1922  std::string
1923  D2Parser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const
1924  {
1925  // Number of reported tokens (one for the "unexpected", one per
1926  // "expected").
1927  size_t yycount = 0;
1928  // Its maximum.
1929  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1930  // Arguments of yyformat.
1931  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1932 
1933  /* There are many possibilities here to consider:
1934  - If this state is a consistent state with a default action, then
1935  the only way this function was invoked is if the default action
1936  is an error action. In that case, don't check for expected
1937  tokens because there are none.
1938  - The only way there can be no lookahead present (in yyla) is
1939  if this state is a consistent state with a default action.
1940  Thus, detecting the absence of a lookahead is sufficient to
1941  determine that there is no unexpected or expected token to
1942  report. In that case, just report a simple "syntax error".
1943  - Don't assume there isn't a lookahead just because this state is
1944  a consistent state with a default action. There might have
1945  been a previous inconsistent state, consistent state with a
1946  non-default action, or user semantic action that manipulated
1947  yyla. (However, yyla is currently not documented for users.)
1948  - Of course, the expected token list depends on states to have
1949  correct lookahead information, and it depends on the parser not
1950  to perform extra reductions after fetching a lookahead from the
1951  scanner and before detecting a syntax error. Thus, state
1952  merging (from LALR or IELR) and default reductions corrupt the
1953  expected token list. However, the list is correct for
1954  canonical LR with one exception: it will still contain any
1955  token that will not be accepted due to an error action in a
1956  later state.
1957  */
1958  if (!yyla.empty ())
1959  {
1960  int yytoken = yyla.type_get ();
1961  yyarg[yycount++] = yytname_[yytoken];
1962  int yyn = yypact_[yystate];
1963  if (!yy_pact_value_is_default_ (yyn))
1964  {
1965  /* Start YYX at -YYN if negative to avoid negative indexes in
1966  YYCHECK. In other words, skip the first -YYN actions for
1967  this state because they are default actions. */
1968  int yyxbegin = yyn < 0 ? -yyn : 0;
1969  // Stay within bounds of both yycheck and yytname.
1970  int yychecklim = yylast_ - yyn + 1;
1971  int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1972  for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1973  if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
1974  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1975  {
1976  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1977  {
1978  yycount = 1;
1979  break;
1980  }
1981  else
1982  yyarg[yycount++] = yytname_[yyx];
1983  }
1984  }
1985  }
1986 
1987  char const* yyformat = YY_NULLPTR;
1988  switch (yycount)
1989  {
1990 #define YYCASE_(N, S) \
1991  case N: \
1992  yyformat = S; \
1993  break
1994  default: // Avoid compiler warnings.
1995  YYCASE_ (0, YY_("syntax error"));
1996  YYCASE_ (1, YY_("syntax error, unexpected %s"));
1997  YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
1998  YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1999  YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2000  YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2001 #undef YYCASE_
2002  }
2003 
2004  std::string yyres;
2005  // Argument number.
2006  size_t yyi = 0;
2007  for (char const* yyp = yyformat; *yyp; ++yyp)
2008  if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
2009  {
2010  yyres += yytnamerr_ (yyarg[yyi++]);
2011  ++yyp;
2012  }
2013  else
2014  yyres += *yyp;
2015  return yyres;
2016  }
2017 
2018 
2019  const signed char D2Parser::yypact_ninf_ = -90;
2020 
2021  const signed char D2Parser::yytable_ninf_ = -1;
2022 
2023  const short
2024  D2Parser::yypact_[] =
2025  {
2026  47, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2027  12, 2, 1, 23, 33, 11, 38, 58, 64, 73,
2028  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2029  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2030  -90, -90, -90, -90, -90, -90, -90, -90, 2, -25,
2031  8, 9, 15, 96, 37, 115, 21, 116, -90, 124,
2032  113, 127, 130, 137, -90, -90, -90, -90, -90, 146,
2033  -90, 19, -90, -90, -90, -90, -90, -90, -90, 148,
2034  150, -90, -90, -90, -90, -90, -90, -90, -90, 46,
2035  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2036  -90, -90, 152, -90, -90, -90, -90, -90, 76, -90,
2037  -90, -90, -90, -90, -90, 151, 155, -90, -90, -90,
2038  -90, -90, -90, -90, 77, -90, -90, -90, -90, -90,
2039  153, 157, -90, -90, 161, -90, -90, -90, -90, 78,
2040  -90, -90, -90, -90, -90, 118, -90, -90, 2, 2,
2041  -90, 108, 162, 163, 164, 165, 166, -90, 8, -90,
2042  167, 119, 120, 168, 171, 172, 173, 174, 175, 176,
2043  9, -90, 177, 128, 179, 180, 15, -90, 15, -90,
2044  96, 181, 182, 183, 37, -90, 37, -90, 115, 184,
2045  135, 186, 21, -90, 21, 116, -90, -90, -90, 187,
2046  2, 2, 2, 185, 188, -90, 140, -90, -90, 70,
2047  178, 189, 141, 190, 195, 198, -90, 154, -90, 156,
2048  158, -90, 79, -90, 159, 199, 160, -90, 97, -90,
2049  169, -90, 170, -90, 98, -90, 2, -90, -90, -90,
2050  9, 191, -90, -90, -90, -90, -90, -90, -90, -90,
2051  -12, -12, 96, -90, -90, -90, -90, -90, 116, -90,
2052  -90, -90, -90, -90, -90, 99, -90, 101, -90, -90,
2053  -90, -90, 109, -90, -90, -90, 110, 200, 126, -90,
2054  201, 191, -90, 204, -12, -90, -90, -90, -90, 205,
2055  -90, 209, -90, 208, 115, -90, 143, -90, 210, 30,
2056  208, -90, -90, -90, -90, 213, -90, -90, -90, -90,
2057  111, -90, -90, -90, -90, -90, -90, 214, 215, 192,
2058  216, 30, -90, 194, 219, -90, 197, -90, -90, 218,
2059  -90, -90, 145, -90, 34, 218, -90, -90, 217, 223,
2060  224, 112, -90, -90, -90, -90, -90, -90, 225, 196,
2061  202, 203, 34, -90, 206, -90, -90, -90, -90, -90
2062  };
2063 
2064  const unsigned char
2065  D2Parser::yydefact_[] =
2066  {
2067  0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
2068  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2069  1, 35, 28, 24, 23, 20, 21, 22, 27, 3,
2070  25, 26, 42, 5, 54, 7, 150, 9, 142, 11,
2071  103, 13, 95, 15, 125, 17, 119, 19, 37, 31,
2072  0, 0, 0, 144, 0, 97, 0, 0, 39, 0,
2073  38, 0, 0, 32, 168, 170, 172, 52, 174, 0,
2074  51, 0, 44, 49, 46, 48, 50, 47, 69, 0,
2075  0, 73, 77, 79, 81, 83, 85, 140, 68, 0,
2076  56, 58, 59, 60, 61, 62, 66, 67, 63, 64,
2077  65, 163, 0, 166, 161, 160, 158, 159, 0, 152,
2078  154, 155, 156, 157, 148, 0, 145, 146, 115, 117,
2079  113, 112, 110, 111, 0, 105, 107, 108, 109, 101,
2080  0, 98, 99, 137, 0, 135, 134, 132, 133, 0,
2081  127, 129, 130, 131, 123, 0, 121, 36, 0, 0,
2082  29, 0, 0, 0, 0, 0, 0, 41, 0, 43,
2083  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2084  0, 55, 0, 0, 0, 0, 0, 151, 0, 143,
2085  0, 0, 0, 0, 0, 104, 0, 96, 0, 0,
2086  0, 0, 0, 126, 0, 0, 120, 40, 33, 0,
2087  0, 0, 0, 0, 0, 45, 0, 71, 72, 0,
2088  0, 0, 0, 0, 0, 0, 57, 0, 165, 0,
2089  0, 153, 0, 147, 0, 0, 0, 106, 0, 100,
2090  0, 139, 0, 128, 0, 122, 0, 169, 171, 173,
2091  0, 0, 70, 75, 76, 74, 78, 30, 80, 82,
2092  87, 87, 144, 164, 167, 162, 149, 116, 0, 114,
2093  102, 138, 136, 124, 34, 0, 179, 0, 176, 178,
2094  93, 92, 0, 88, 89, 91, 0, 0, 0, 53,
2095  0, 0, 175, 0, 0, 84, 86, 141, 118, 0,
2096  177, 0, 90, 0, 97, 183, 0, 181, 0, 0,
2097  0, 180, 94, 194, 199, 0, 197, 193, 191, 192,
2098  0, 185, 187, 189, 190, 188, 182, 0, 0, 0,
2099  0, 0, 184, 0, 0, 196, 0, 186, 195, 0,
2100  198, 203, 0, 201, 0, 0, 200, 211, 0, 0,
2101  0, 0, 205, 207, 208, 209, 210, 202, 0, 0,
2102  0, 0, 0, 204, 0, 213, 214, 215, 206, 212
2103  };
2104 
2105  const signed char
2106  D2Parser::yypgoto_[] =
2107  {
2108  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2109  -90, -38, -90, 20, -90, -90, -90, -90, -90, -90,
2110  -90, -90, -50, -90, -90, -90, 72, -90, -90, -90,
2111  -90, -8, 63, -90, -90, -90, -90, -90, -90, -90,
2112  -90, -90, -51, -90, -39, -90, -90, -90, -90, -90,
2113  -16, -90, -48, -90, -90, -90, -90, -57, -90, 50,
2114  -90, -90, -90, 53, 56, -90, -90, -90, -90, -90,
2115  -90, -90, -90, -17, 48, -90, -90, -90, 51, 52,
2116  -90, -90, -90, -90, -90, -90, -90, -90, -90, -10,
2117  -90, 71, -90, -90, -90, 75, 82, -90, -90, -90,
2118  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
2119  -90, -90, -90, -27, -90, -90, -90, -45, -90, -90,
2120  -60, -90, -90, -90, -90, -90, -90, -90, -90, -73,
2121  -90, -90, -89, -90, -90, -90, -90, -90
2122  };
2123 
2124  const short
2125  D2Parser::yydefgoto_[] =
2126  {
2127  -1, 10, 11, 12, 13, 14, 15, 16, 17, 18,
2128  19, 28, 29, 30, 49, 248, 62, 63, 31, 48,
2129  59, 60, 88, 33, 50, 71, 72, 73, 155, 35,
2130  51, 89, 90, 91, 160, 92, 93, 94, 163, 245,
2131  95, 164, 96, 165, 97, 166, 98, 167, 99, 168,
2132  272, 273, 274, 275, 283, 43, 55, 130, 131, 132,
2133  186, 41, 54, 124, 125, 126, 183, 127, 181, 128,
2134  182, 47, 57, 145, 146, 194, 45, 56, 139, 140,
2135  141, 191, 142, 189, 143, 100, 169, 39, 53, 115,
2136  116, 117, 178, 37, 52, 108, 109, 110, 175, 111,
2137  172, 112, 113, 174, 74, 152, 75, 153, 76, 154,
2138  77, 156, 267, 268, 269, 280, 296, 297, 299, 310,
2139  311, 312, 317, 313, 314, 320, 315, 318, 332, 333,
2140  334, 341, 342, 343, 348, 344, 345, 346
2141  };
2142 
2143  const unsigned short
2144  D2Parser::yytable_[] =
2145  {
2146  70, 106, 105, 122, 121, 137, 136, 21, 32, 22,
2147  58, 23, 20, 107, 270, 123, 38, 138, 64, 65,
2148  66, 67, 158, 78, 79, 80, 81, 159, 61, 82,
2149  34, 83, 84, 85, 86, 133, 134, 83, 84, 87,
2150  36, 69, 68, 83, 84, 40, 101, 102, 103, 170,
2151  135, 104, 83, 84, 171, 24, 25, 26, 27, 83,
2152  84, 69, 69, 42, 118, 119, 303, 304, 69, 305,
2153  306, 44, 337, 120, 69, 338, 339, 340, 46, 176,
2154  184, 192, 176, 69, 177, 185, 193, 256, 243, 244,
2155  69, 1, 2, 3, 4, 5, 6, 7, 8, 9,
2156  184, 192, 170, 114, 281, 260, 263, 279, 70, 282,
2157  197, 198, 284, 284, 321, 352, 148, 285, 286, 322,
2158  353, 195, 129, 144, 196, 106, 105, 106, 105, 195,
2159  147, 149, 288, 122, 121, 122, 121, 107, 150, 107,
2160  151, 137, 136, 137, 136, 123, 300, 123, 335, 301,
2161  157, 336, 161, 138, 162, 138, 173, 179, 180, 187,
2162  188, 199, 237, 238, 239, 190, 200, 201, 202, 203,
2163  204, 206, 209, 207, 208, 210, 211, 212, 213, 214,
2164  215, 217, 218, 219, 220, 224, 225, 226, 230, 231,
2165  232, 236, 240, 242, 249, 241, 22, 250, 264, 246,
2166  271, 271, 251, 252, 258, 289, 287, 253, 291, 254,
2167  293, 255, 257, 259, 294, 295, 302, 319, 323, 324,
2168  326, 349, 261, 262, 329, 331, 266, 350, 351, 354,
2169  205, 247, 265, 216, 271, 276, 292, 298, 229, 228,
2170  227, 278, 277, 235, 233, 234, 325, 328, 308, 307,
2171  330, 223, 355, 222, 290, 316, 356, 357, 221, 359,
2172  309, 327, 347, 358, 0, 0, 0, 0, 0, 0,
2173  308, 307, 0, 0, 0, 0, 0, 0, 0, 0,
2174  0, 0, 309
2175  };
2176 
2177  const short
2178  D2Parser::yycheck_[] =
2179  {
2180  50, 52, 52, 54, 54, 56, 56, 5, 7, 7,
2181  48, 9, 0, 52, 26, 54, 5, 56, 10, 11,
2182  12, 13, 3, 14, 15, 16, 17, 8, 53, 20,
2183  7, 22, 23, 24, 25, 14, 15, 22, 23, 30,
2184  7, 53, 34, 22, 23, 7, 31, 32, 33, 3,
2185  29, 36, 22, 23, 8, 53, 54, 55, 56, 22,
2186  23, 53, 53, 5, 27, 28, 36, 37, 53, 39,
2187  40, 7, 38, 36, 53, 41, 42, 43, 5, 3,
2188  3, 3, 3, 53, 8, 8, 8, 8, 18, 19,
2189  53, 44, 45, 46, 47, 48, 49, 50, 51, 52,
2190  3, 3, 3, 7, 3, 8, 8, 8, 158, 8,
2191  148, 149, 3, 3, 3, 3, 3, 8, 8, 8,
2192  8, 3, 7, 7, 6, 176, 176, 178, 178, 3,
2193  6, 4, 6, 184, 184, 186, 186, 176, 8, 178,
2194  3, 192, 192, 194, 194, 184, 3, 186, 3, 6,
2195  4, 6, 4, 192, 4, 194, 4, 6, 3, 6,
2196  3, 53, 200, 201, 202, 4, 4, 4, 4, 4,
2197  4, 4, 4, 54, 54, 4, 4, 4, 4, 4,
2198  4, 4, 54, 4, 4, 4, 4, 4, 4, 54,
2199  4, 4, 7, 53, 53, 7, 7, 7, 236, 21,
2200  250, 251, 7, 5, 5, 4, 6, 53, 4, 53,
2201  5, 53, 53, 53, 5, 7, 6, 4, 4, 4,
2202  4, 4, 53, 53, 5, 7, 35, 4, 4, 4,
2203  158, 211, 240, 170, 284, 251, 284, 294, 188, 186,
2204  184, 258, 252, 195, 192, 194, 54, 53, 299, 299,
2205  53, 180, 56, 178, 281, 300, 54, 54, 176, 53,
2206  299, 321, 335, 352, -1, -1, -1, -1, -1, -1,
2207  321, 321, -1, -1, -1, -1, -1, -1, -1, -1,
2208  -1, -1, 321
2209  };
2210 
2211  const unsigned char
2212  D2Parser::yystos_[] =
2213  {
2214  0, 44, 45, 46, 47, 48, 49, 50, 51, 52,
2215  58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
2216  0, 5, 7, 9, 53, 54, 55, 56, 68, 69,
2217  70, 75, 7, 80, 7, 86, 7, 150, 5, 144,
2218  7, 118, 5, 112, 7, 133, 5, 128, 76, 71,
2219  81, 87, 151, 145, 119, 113, 134, 129, 68, 77,
2220  78, 53, 73, 74, 10, 11, 12, 13, 34, 53,
2221  79, 82, 83, 84, 161, 163, 165, 167, 14, 15,
2222  16, 17, 20, 22, 23, 24, 25, 30, 79, 88,
2223  89, 90, 92, 93, 94, 97, 99, 101, 103, 105,
2224  142, 31, 32, 33, 36, 79, 99, 101, 152, 153,
2225  154, 156, 158, 159, 7, 146, 147, 148, 27, 28,
2226  36, 79, 99, 101, 120, 121, 122, 124, 126, 7,
2227  114, 115, 116, 14, 15, 29, 79, 99, 101, 135,
2228  136, 137, 139, 141, 7, 130, 131, 6, 3, 4,
2229  8, 3, 162, 164, 166, 85, 168, 4, 3, 8,
2230  91, 4, 4, 95, 98, 100, 102, 104, 106, 143,
2231  3, 8, 157, 4, 160, 155, 3, 8, 149, 6,
2232  3, 125, 127, 123, 3, 8, 117, 6, 3, 140,
2233  4, 138, 3, 8, 132, 3, 6, 68, 68, 53,
2234  4, 4, 4, 4, 4, 83, 4, 54, 54, 4,
2235  4, 4, 4, 4, 4, 4, 89, 4, 54, 4,
2236  4, 153, 152, 148, 4, 4, 4, 121, 120, 116,
2237  4, 54, 4, 136, 135, 131, 4, 68, 68, 68,
2238  7, 7, 53, 18, 19, 96, 21, 70, 72, 53,
2239  7, 7, 5, 53, 53, 53, 8, 53, 5, 53,
2240  8, 53, 53, 8, 68, 88, 35, 169, 170, 171,
2241  26, 79, 107, 108, 109, 110, 107, 146, 130, 8,
2242  172, 3, 8, 111, 3, 8, 8, 6, 6, 4,
2243  170, 4, 109, 5, 5, 7, 173, 174, 114, 175,
2244  3, 6, 6, 36, 37, 39, 40, 79, 99, 101,
2245  176, 177, 178, 180, 181, 183, 174, 179, 184, 4,
2246  182, 3, 8, 4, 4, 54, 4, 177, 53, 5,
2247  53, 7, 185, 186, 187, 3, 6, 38, 41, 42,
2248  43, 188, 189, 190, 192, 193, 194, 186, 191, 4,
2249  4, 4, 3, 8, 4, 56, 54, 54, 189, 53
2250  };
2251 
2252  const unsigned char
2253  D2Parser::yyr1_[] =
2254  {
2255  0, 57, 59, 58, 60, 58, 61, 58, 62, 58,
2256  63, 58, 64, 58, 65, 58, 66, 58, 67, 58,
2257  68, 68, 68, 68, 68, 68, 68, 69, 71, 70,
2258  72, 73, 73, 74, 74, 76, 75, 77, 77, 78,
2259  78, 79, 81, 80, 82, 82, 83, 83, 83, 83,
2260  83, 83, 85, 84, 87, 86, 88, 88, 89, 89,
2261  89, 89, 89, 89, 89, 89, 89, 89, 89, 91,
2262  90, 92, 93, 95, 94, 96, 96, 98, 97, 100,
2263  99, 102, 101, 104, 103, 106, 105, 107, 107, 108,
2264  108, 109, 109, 111, 110, 113, 112, 114, 114, 115,
2265  115, 117, 116, 119, 118, 120, 120, 121, 121, 121,
2266  121, 121, 121, 123, 122, 125, 124, 127, 126, 129,
2267  128, 130, 130, 132, 131, 134, 133, 135, 135, 136,
2268  136, 136, 136, 136, 136, 138, 137, 140, 139, 141,
2269  143, 142, 145, 144, 146, 146, 147, 147, 149, 148,
2270  151, 150, 152, 152, 153, 153, 153, 153, 153, 153,
2271  153, 155, 154, 157, 156, 158, 160, 159, 162, 161,
2272  164, 163, 166, 165, 168, 167, 169, 169, 170, 172,
2273  171, 173, 173, 175, 174, 176, 176, 177, 177, 177,
2274  177, 177, 177, 177, 179, 178, 180, 182, 181, 184,
2275  183, 185, 185, 187, 186, 188, 188, 189, 189, 189,
2276  189, 191, 190, 192, 193, 194
2277  };
2278 
2279  const unsigned char
2280  D2Parser::yyr2_[] =
2281  {
2282  0, 2, 0, 3, 0, 3, 0, 3, 0, 3,
2283  0, 3, 0, 3, 0, 3, 0, 3, 0, 3,
2284  1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
2285  1, 0, 1, 3, 5, 0, 4, 0, 1, 1,
2286  3, 2, 0, 4, 1, 3, 1, 1, 1, 1,
2287  1, 1, 0, 6, 0, 4, 1, 3, 1, 1,
2288  1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2289  4, 3, 3, 0, 4, 1, 1, 0, 4, 0,
2290  4, 0, 4, 0, 6, 0, 6, 0, 1, 1,
2291  3, 1, 1, 0, 6, 0, 4, 0, 1, 1,
2292  3, 0, 4, 0, 4, 1, 3, 1, 1, 1,
2293  1, 1, 1, 0, 4, 0, 4, 0, 6, 0,
2294  4, 1, 3, 0, 4, 0, 4, 1, 3, 1,
2295  1, 1, 1, 1, 1, 0, 4, 0, 4, 3,
2296  0, 6, 0, 4, 0, 1, 1, 3, 0, 4,
2297  0, 4, 1, 3, 1, 1, 1, 1, 1, 1,
2298  1, 0, 4, 0, 4, 3, 0, 4, 0, 4,
2299  0, 4, 0, 4, 0, 6, 1, 3, 1, 0,
2300  6, 1, 3, 0, 4, 1, 3, 1, 1, 1,
2301  1, 1, 1, 1, 0, 4, 3, 0, 4, 0,
2302  6, 1, 3, 0, 4, 1, 3, 1, 1, 1,
2303  1, 0, 4, 3, 3, 3
2304  };
2305 
2306 
2307 
2308  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2309  // First, the terminals, then, starting at \a yyntokens_, nonterminals.
2310  const char*
2311  const D2Parser::yytname_[] =
2312  {
2313  "\"end of file\"", "error", "$undefined", "\",\"", "\":\"", "\"[\"",
2314  "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Dhcp6\"", "\"Dhcp4\"",
2315  "\"Control-agent\"", "\"DhcpDdns\"", "\"ip-address\"", "\"port\"",
2316  "\"dns-server-timeout\"", "\"ncr-protocol\"", "\"UDP\"", "\"TCP\"",
2317  "\"ncr-format\"", "\"JSON\"", "\"user-context\"", "\"comment\"",
2318  "\"forward-ddns\"", "\"reverse-ddns\"", "\"ddns-domains\"",
2319  "\"key-name\"", "\"dns-servers\"", "\"hostname\"", "\"tsig-keys\"",
2320  "\"algorithm\"", "\"digest-bits\"", "\"secret\"", "\"Logging\"",
2321  "\"loggers\"", "\"name\"", "\"output_options\"", "\"output\"",
2322  "\"debuglevel\"", "\"severity\"", "\"flush\"", "\"maxsize\"",
2323  "\"maxver\"", "TOPLEVEL_JSON", "TOPLEVEL_DHCPDDNS", "SUB_DHCPDDNS",
2324  "SUB_TSIG_KEY", "SUB_TSIG_KEYS", "SUB_DDNS_DOMAIN", "SUB_DDNS_DOMAINS",
2325  "SUB_DNS_SERVER", "SUB_DNS_SERVERS", "\"constant string\"",
2326  "\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
2327  "$@1", "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "value",
2328  "sub_json", "map2", "$@10", "map_value", "map_content", "not_empty_map",
2329  "list_generic", "$@11", "list_content", "not_empty_list",
2330  "unknown_map_entry", "syntax_map", "$@12", "global_objects",
2331  "global_object", "dhcpddns_object", "$@13", "sub_dhcpddns", "$@14",
2332  "dhcpddns_params", "dhcpddns_param", "ip_address", "$@15", "port",
2333  "dns_server_timeout", "ncr_protocol", "$@16", "ncr_protocol_value",
2334  "ncr_format", "$@17", "user_context", "$@18", "comment", "$@19",
2335  "forward_ddns", "$@20", "reverse_ddns", "$@21", "ddns_mgr_params",
2336  "not_empty_ddns_mgr_params", "ddns_mgr_param", "ddns_domains", "$@22",
2337  "sub_ddns_domains", "$@23", "ddns_domain_list",
2338  "not_empty_ddns_domain_list", "ddns_domain", "$@24", "sub_ddns_domain",
2339  "$@25", "ddns_domain_params", "ddns_domain_param", "ddns_domain_name",
2340  "$@26", "ddns_domain_key_name", "$@27", "dns_servers", "$@28",
2341  "sub_dns_servers", "$@29", "dns_server_list", "dns_server", "$@30",
2342  "sub_dns_server", "$@31", "dns_server_params", "dns_server_param",
2343  "dns_server_hostname", "$@32", "dns_server_ip_address", "$@33",
2344  "dns_server_port", "tsig_keys", "$@34", "sub_tsig_keys", "$@35",
2345  "tsig_keys_list", "not_empty_tsig_keys_list", "tsig_key", "$@36",
2346  "sub_tsig_key", "$@37", "tsig_key_params", "tsig_key_param",
2347  "tsig_key_name", "$@38", "tsig_key_algorithm", "$@39",
2348  "tsig_key_digest_bits", "tsig_key_secret", "$@40", "dhcp6_json_object",
2349  "$@41", "dhcp4_json_object", "$@42", "control_agent_json_object", "$@43",
2350  "logging_object", "$@44", "logging_params", "logging_param", "loggers",
2351  "$@45", "loggers_entries", "logger_entry", "$@46", "logger_params",
2352  "logger_param", "name", "$@47", "debuglevel", "severity", "$@48",
2353  "output_options_list", "$@49", "output_options_list_content",
2354  "output_entry", "$@50", "output_params_list", "output_params", "output",
2355  "$@51", "flush", "maxsize", "maxver", YY_NULLPTR
2356  };
2357 
2358 #if D2_PARSER_DEBUG
2359  const unsigned short
2360  D2Parser::yyrline_[] =
2361  {
2362  0, 120, 120, 120, 121, 121, 122, 122, 123, 123,
2363  124, 124, 125, 125, 126, 126, 127, 127, 128, 128,
2364  136, 137, 138, 139, 140, 141, 142, 145, 150, 150,
2365  161, 164, 165, 168, 172, 179, 179, 186, 187, 190,
2366  194, 205, 215, 215, 227, 228, 232, 233, 234, 235,
2367  236, 237, 242, 242, 252, 252, 260, 261, 265, 266,
2368  267, 268, 269, 270, 271, 272, 273, 274, 275, 278,
2369  278, 286, 294, 303, 303, 311, 312, 315, 315, 323,
2370  323, 348, 348, 375, 375, 385, 385, 395, 396, 399,
2371  400, 403, 404, 409, 409, 419, 419, 426, 427, 430,
2372  431, 434, 434, 442, 442, 449, 450, 453, 454, 455,
2373  456, 457, 458, 462, 462, 474, 474, 486, 486, 496,
2374  496, 503, 504, 507, 507, 515, 515, 522, 523, 526,
2375  527, 528, 529, 530, 531, 534, 534, 546, 546, 554,
2376  568, 568, 578, 578, 585, 586, 589, 590, 593, 593,
2377  601, 601, 610, 611, 614, 615, 616, 617, 618, 619,
2378  620, 623, 623, 635, 635, 646, 654, 654, 669, 669,
2379  676, 676, 683, 683, 695, 695, 708, 709, 713, 717,
2380  717, 729, 730, 734, 734, 742, 743, 746, 747, 748,
2381  749, 750, 751, 752, 755, 755, 763, 767, 767, 775,
2382  775, 785, 786, 789, 789, 797, 798, 801, 802, 803,
2383  804, 807, 807, 815, 820, 825
2384  };
2385 
2386  // Print the state stack on the debug stream.
2387  void
2388  D2Parser::yystack_print_ ()
2389  {
2390  *yycdebug_ << "Stack now";
2392  i = yystack_.begin (),
2393  i_end = yystack_.end ();
2394  i != i_end; ++i)
2395  *yycdebug_ << ' ' << i->state;
2396  *yycdebug_ << '\n';
2397  }
2398 
2399  // Report on the debug stream that the rule \a yyrule is going to be reduced.
2400  void
2401  D2Parser::yy_reduce_print_ (int yyrule)
2402  {
2403  unsigned yylno = yyrline_[yyrule];
2404  int yynrhs = yyr2_[yyrule];
2405  // Print the symbols being reduced, and their result.
2406  *yycdebug_ << "Reducing stack by rule " << yyrule - 1
2407  << " (line " << yylno << "):\n";
2408  // The symbols being reduced.
2409  for (int yyi = 0; yyi < yynrhs; yyi++)
2410  YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2411  yystack_[(yynrhs) - (yyi + 1)]);
2412  }
2413 #endif // D2_PARSER_DEBUG
2414 
2415 
2416 #line 14 "d2_parser.yy" // lalr1.cc:1218
2417 } } // isc::d2
2418 #line 2419 "d2_parser.cc" // lalr1.cc:1218
2419 #line 830 "d2_parser.yy" // lalr1.cc:1219
2420 
2421 
2422 void
2424  const std::string& what)
2425 {
2426  ctx.error(loc, what);
2427 }
Used while parsing a list of tsig-keys.
Define the isc::d2::parser class.
#define yylex
Definition: d2_parser.cc:38
Used while parsing Logging/loggers/output_options structures.
Syntax errors thrown from user actions.
Definition: d2_parser.h:529
Used while parsing content of a dns-server.
virtual int parse()
Parse.
Definition: d2_parser.cc:519
Used while parsing content of DhcpDdns/tsig-keys/algorithm.
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: d2_parser.cc:484
Evaluation context, an interface to the expression evaluation.
This one is used in pure JSON mode.
bool empty() const
Whether empty.
Definition: d2_parser.h:1422
D2Parser(isc::d2::D2ParserContext &ctx_yyarg)
Build a parser object.
Definition: d2_parser.cc:186
int debug_level_type
Type for debugging levels.
Definition: d2_parser.h:743
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:83
#define YY_STACK_PRINT()
Definition: d2_parser.cc:120
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
Used while parsing content of a tsig-key.
#define YY_RVREF(Type)
Definition: agent_parser.h:84
#define YY_MOVE
Definition: agent_parser.h:81
size_type size() const
Definition: d2_parser.h:243
void clear()
Destroy contents, and record that is empty.
Definition: d2_parser.h:1376
Used while parsing Logging/loggers structures.
#define YY_REDUCE_PRINT(Rule)
Definition: d2_parser.cc:114
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: d2_parser.cc:471
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
Definition: d2_parser.cc:478
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: d2_parser.h:1429
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
Definition: d2_parser.cc:465
Used while parsing content of a ddns-domain.
#define YYERROR
Definition: d2_parser.cc:140
Used while parsing content of DhcpDdns/reverse-ddns.
void leave()
Leave a syntactic context.
Used while parsing content of Logging.
Used while parsing DhcpDdns/ncr-protocol.
#define YY_SYMBOL_PRINT(Title, Symbol)
Definition: d2_parser.cc:104
Notes: IntElement type is changed to int64_t.
Definition: data.h:544
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: d2_parser.cc:80
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
#define YYUSE(E)
Definition: d2_parser.cc:96
#define D2_PARSER_DEBUG
Definition: d2_parser.h:161
Used while parsing DhcpDdns/ncr-format.
std::vector< stack_symbol_type > ::const_reverse_iterator const_iterator
Definition: d2_parser.h:176
#define YYCDEBUG
Definition: d2_parser.cc:102
#define YYCASE_(N, S)
void push(YY_MOVE_REF(T) t)
Steal the contents of t.
Definition: d2_parser.h:223
Defines the logger used by the top-level component of kea-dhcp-ddns.
void pop(int n=1)
Definition: d2_parser.h:230
#define YY_(msgid)
Definition: d2_parser.cc:61
void enter(const ParserContext &ctx)
Enter a new syntactic context.
void clear()
Definition: d2_parser.h:237
Used while parsing content of DhcpDdns.
Present a slice of the top of a stack.
Definition: d2_parser.h:269
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1096
Used while parsing a list of ddns-domains.
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
int operator()()
Parse.
Definition: d2_parser.cc:513
#define YYABORT
Definition: d2_parser.cc:139
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: d2_parser.cc:2423
int symbol_number_type
Symbol type: an internal symbol number.
Definition: d2_parser.h:602
ParserContext ctx_
Current syntactic context.
const_iterator end() const
Definition: d2_parser.h:255
if(!(yy_init))
const_iterator begin() const
Definition: d2_parser.h:249
location_type location
The location.
Definition: d2_parser.h:678
isc::data::Element::Position loc2pos(isc::d2::location &loc)
Converts bison's position to one understood by isc::data::Element.
virtual ~D2Parser()
Definition: d2_parser.cc:195
location location_type
Symbol locations.
Definition: d2_parser.h:526
void error(const isc::d2::location &loc, const std::string &what)
Error handler.
const std::string contextName()
Get the syntax context name.