Kea  1.5.0
netconf_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 netconf_lex
39 
40 
41 
42 #include "netconf_parser.h"
43 
44 
45 // Unqualified %code blocks.
46 #line 33 "netconf_parser.yy" // lalr1.cc:438
47 
48 #include <netconf/parser_context.h>
49 
50 #line 51 "netconf_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 NETCONF_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 // !NETCONF_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 // !NETCONF_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 "netconf_parser.yy" // lalr1.cc:513
144 namespace isc { namespace netconf {
145 #line 146 "netconf_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  NetconfParser::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  NetconfParser::by_state::by_state ()
207  : state (empty_state)
208  {}
209 
210  NetconfParser::by_state::by_state (const by_state& other)
211  : state (other.state)
212  {}
213 
214  void
215  NetconfParser::by_state::clear ()
216  {
217  state = empty_state;
218  }
219 
220  void
221  NetconfParser::by_state::move (by_state& that)
222  {
223  state = that.state;
224  that.clear ();
225  }
226 
227  NetconfParser::by_state::by_state (state_type s)
228  : state (s)
229  {}
230 
232  NetconfParser::by_state::type_get () const
233  {
234  if (state == empty_state)
235  return empty_symbol;
236  else
237  return yystos_[state];
238  }
239 
240  NetconfParser::stack_symbol_type::stack_symbol_type ()
241  {}
242 
243  NetconfParser::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 57: // value
249  case 60: // map_value
250  case 119: // socket_type_value
251  value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
252  break;
253 
254  case 48: // "boolean"
255  value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
256  break;
257 
258  case 47: // "floating point"
259  value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
260  break;
261 
262  case 46: // "integer"
263  value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
264  break;
265 
266  case 45: // "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  NetconfParser::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 57: // value
286  case 60: // map_value
287  case 119: // socket_type_value
288  value.move< ElementPtr > (YY_MOVE (that.value));
289  break;
290 
291  case 48: // "boolean"
292  value.move< bool > (YY_MOVE (that.value));
293  break;
294 
295  case 47: // "floating point"
296  value.move< double > (YY_MOVE (that.value));
297  break;
298 
299  case 46: // "integer"
300  value.move< int64_t > (YY_MOVE (that.value));
301  break;
302 
303  case 45: // "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  NetconfParser::stack_symbol_type&
317  NetconfParser::stack_symbol_type::operator= (stack_symbol_type& that)
318  {
319  state = that.state;
320  switch (that.type_get ())
321  {
322  case 57: // value
323  case 60: // map_value
324  case 119: // socket_type_value
325  value.move< ElementPtr > (that.value);
326  break;
327 
328  case 48: // "boolean"
329  value.move< bool > (that.value);
330  break;
331 
332  case 47: // "floating point"
333  value.move< double > (that.value);
334  break;
335 
336  case 46: // "integer"
337  value.move< int64_t > (that.value);
338  break;
339 
340  case 45: // "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  NetconfParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
358  {
359  if (yymsg)
360  YY_SYMBOL_PRINT (yymsg, yysym);
361  }
362 
363 #if NETCONF_DEBUG
364  template <typename Base>
365  void
366  NetconfParser::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 45: // "constant string"
382 
383 #line 107 "netconf_parser.yy" // lalr1.cc:672
384  { yyoutput << yysym.value.template as< std::string > (); }
385 #line 386 "netconf_parser.cc" // lalr1.cc:672
386  break;
387 
388  case 46: // "integer"
389 
390 #line 107 "netconf_parser.yy" // lalr1.cc:672
391  { yyoutput << yysym.value.template as< int64_t > (); }
392 #line 393 "netconf_parser.cc" // lalr1.cc:672
393  break;
394 
395  case 47: // "floating point"
396 
397 #line 107 "netconf_parser.yy" // lalr1.cc:672
398  { yyoutput << yysym.value.template as< double > (); }
399 #line 400 "netconf_parser.cc" // lalr1.cc:672
400  break;
401 
402  case 48: // "boolean"
403 
404 #line 107 "netconf_parser.yy" // lalr1.cc:672
405  { yyoutput << yysym.value.template as< bool > (); }
406 #line 407 "netconf_parser.cc" // lalr1.cc:672
407  break;
408 
409  case 57: // value
410 
411 #line 107 "netconf_parser.yy" // lalr1.cc:672
412  { yyoutput << yysym.value.template as< ElementPtr > (); }
413 #line 414 "netconf_parser.cc" // lalr1.cc:672
414  break;
415 
416  case 60: // map_value
417 
418 #line 107 "netconf_parser.yy" // lalr1.cc:672
419  { yyoutput << yysym.value.template as< ElementPtr > (); }
420 #line 421 "netconf_parser.cc" // lalr1.cc:672
421  break;
422 
423  case 119: // socket_type_value
424 
425 #line 107 "netconf_parser.yy" // lalr1.cc:672
426  { yyoutput << yysym.value.template as< ElementPtr > (); }
427 #line 428 "netconf_parser.cc" // lalr1.cc:672
428  break;
429 
430 
431  default:
432  break;
433  }
434  yyo << ')';
435  }
436 #endif
437 
438  void
439  NetconfParser::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  NetconfParser::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  NetconfParser::yypop_ (int n)
459  {
460  yystack_.pop (n);
461  }
462 
463 #if NETCONF_DEBUG
464  std::ostream&
466  {
467  return *yycdebug_;
468  }
469 
470  void
472  {
473  yycdebug_ = &o;
474  }
475 
476 
479  {
480  return yydebug_;
481  }
482 
483  void
485  {
486  yydebug_ = l;
487  }
488 #endif // NETCONF_DEBUG
489 
490  NetconfParser::state_type
491  NetconfParser::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  NetconfParser::yy_pact_value_is_default_ (int yyvalue)
502  {
503  return yyvalue == yypact_ninf_;
504  }
505 
506  bool
507  NetconfParser::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 57: // value
638  case 60: // map_value
639  case 119: // socket_type_value
640  yylhs.value.emplace< ElementPtr > ();
641  break;
642 
643  case 48: // "boolean"
644  yylhs.value.emplace< bool > ();
645  break;
646 
647  case 47: // "floating point"
648  yylhs.value.emplace< double > ();
649  break;
650 
651  case 46: // "integer"
652  yylhs.value.emplace< int64_t > ();
653  break;
654 
655  case 45: // "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 118 "netconf_parser.yy" // lalr1.cc:907
681  { ctx.ctx_ = ctx.NO_KEYWORDS; }
682 #line 683 "netconf_parser.cc" // lalr1.cc:907
683  break;
684 
685  case 4:
686 #line 119 "netconf_parser.yy" // lalr1.cc:907
687  { ctx.ctx_ = ctx.CONFIG; }
688 #line 689 "netconf_parser.cc" // lalr1.cc:907
689  break;
690 
691  case 6:
692 #line 120 "netconf_parser.yy" // lalr1.cc:907
693  { ctx.ctx_ = ctx.NETCONF; }
694 #line 695 "netconf_parser.cc" // lalr1.cc:907
695  break;
696 
697  case 8:
698 #line 128 "netconf_parser.yy" // lalr1.cc:907
699  {
700  // Parse the Netconf map
701  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
702  ctx.stack_.push_back(m);
703 }
704 #line 705 "netconf_parser.cc" // lalr1.cc:907
705  break;
706 
707  case 9:
708 #line 132 "netconf_parser.yy" // lalr1.cc:907
709  {
710  // parsing completed
711 }
712 #line 713 "netconf_parser.cc" // lalr1.cc:907
713  break;
714 
715  case 10:
716 #line 139 "netconf_parser.yy" // lalr1.cc:907
717  {
718  // Push back the JSON value on the stack
719  ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ());
720 }
721 #line 722 "netconf_parser.cc" // lalr1.cc:907
722  break;
723 
724  case 11:
725 #line 145 "netconf_parser.yy" // lalr1.cc:907
726  { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); }
727 #line 728 "netconf_parser.cc" // lalr1.cc:907
728  break;
729 
730  case 12:
731 #line 146 "netconf_parser.yy" // lalr1.cc:907
732  { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); }
733 #line 734 "netconf_parser.cc" // lalr1.cc:907
734  break;
735 
736  case 13:
737 #line 147 "netconf_parser.yy" // lalr1.cc:907
738  { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); }
739 #line 740 "netconf_parser.cc" // lalr1.cc:907
740  break;
741 
742  case 14:
743 #line 148 "netconf_parser.yy" // lalr1.cc:907
744  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); }
745 #line 746 "netconf_parser.cc" // lalr1.cc:907
746  break;
747 
748  case 15:
749 #line 149 "netconf_parser.yy" // lalr1.cc:907
750  { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
751 #line 752 "netconf_parser.cc" // lalr1.cc:907
752  break;
753 
754  case 16:
755 #line 150 "netconf_parser.yy" // lalr1.cc:907
756  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
757 #line 758 "netconf_parser.cc" // lalr1.cc:907
758  break;
759 
760  case 17:
761 #line 151 "netconf_parser.yy" // lalr1.cc:907
762  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
763 #line 764 "netconf_parser.cc" // lalr1.cc:907
764  break;
765 
766  case 18:
767 #line 155 "netconf_parser.yy" // lalr1.cc:907
768  {
769  // This code is executed when we're about to start parsing
770  // the content of the map
771  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
772  ctx.stack_.push_back(m);
773 }
774 #line 775 "netconf_parser.cc" // lalr1.cc:907
775  break;
776 
777  case 19:
778 #line 160 "netconf_parser.yy" // lalr1.cc:907
779  {
780  // map parsing completed. If we ever want to do any wrap up
781  // (maybe some sanity checking), this would be the best place
782  // for it.
783 }
784 #line 785 "netconf_parser.cc" // lalr1.cc:907
785  break;
786 
787  case 20:
788 #line 166 "netconf_parser.yy" // lalr1.cc:907
789  { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
790 #line 791 "netconf_parser.cc" // lalr1.cc:907
791  break;
792 
793  case 23:
794 #line 180 "netconf_parser.yy" // lalr1.cc:907
795  {
796  // map containing a single entry
797  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
798  }
799 #line 800 "netconf_parser.cc" // lalr1.cc:907
800  break;
801 
802  case 24:
803 #line 184 "netconf_parser.yy" // lalr1.cc:907
804  {
805  // map consisting of a shorter map followed by
806  // comma and string:value
807  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
808  }
809 #line 810 "netconf_parser.cc" // lalr1.cc:907
810  break;
811 
812  case 25:
813 #line 191 "netconf_parser.yy" // lalr1.cc:907
814  {
815  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
816  ctx.stack_.push_back(l);
817 }
818 #line 819 "netconf_parser.cc" // lalr1.cc:907
819  break;
820 
821  case 26:
822 #line 194 "netconf_parser.yy" // lalr1.cc:907
823  {
824 }
825 #line 826 "netconf_parser.cc" // lalr1.cc:907
826  break;
827 
828  case 29:
829 #line 201 "netconf_parser.yy" // lalr1.cc:907
830  {
831  // List consisting of a single element.
832  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
833  }
834 #line 835 "netconf_parser.cc" // lalr1.cc:907
835  break;
836 
837  case 30:
838 #line 205 "netconf_parser.yy" // lalr1.cc:907
839  {
840  // List ending with , and a value.
841  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
842  }
843 #line 844 "netconf_parser.cc" // lalr1.cc:907
844  break;
845 
846  case 31:
847 #line 218 "netconf_parser.yy" // lalr1.cc:907
848  {
849  const std::string& where = ctx.contextName();
850  const std::string& keyword = yystack_[1].value.as< std::string > ();
851  error(yystack_[1].location,
852  "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
853 }
854 #line 855 "netconf_parser.cc" // lalr1.cc:907
855  break;
856 
857  case 32:
858 #line 226 "netconf_parser.yy" // lalr1.cc:907
859  {
860  // This code is executed when we're about to start parsing
861  // the content of the map
862  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
863  ctx.stack_.push_back(m);
864 }
865 #line 866 "netconf_parser.cc" // lalr1.cc:907
866  break;
867 
868  case 33:
869 #line 231 "netconf_parser.yy" // lalr1.cc:907
870  {
871  // map parsing completed. If we ever want to do any wrap up
872  // (maybe some sanity checking), this would be the best place
873  // for it.
874 }
875 #line 876 "netconf_parser.cc" // lalr1.cc:907
876  break;
877 
878  case 38:
879 #line 248 "netconf_parser.yy" // lalr1.cc:907
880  {
881 
882  // Let's create a MapElement that will represent it, add it to the
883  // top level map (that's already on the stack) and put the new map
884  // on the stack as well, so child elements will be able to add
885  // themselves to it.
886  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
887  ctx.stack_.back()->set("Netconf", m);
888  ctx.stack_.push_back(m);
889  ctx.enter(ctx.NETCONF);
890 }
891 #line 892 "netconf_parser.cc" // lalr1.cc:907
892  break;
893 
894  case 39:
895 #line 258 "netconf_parser.yy" // lalr1.cc:907
896  {
897  // Ok, we're done with parsing Netconf. Let's take the map
898  // off the stack.
899  ctx.stack_.pop_back();
900  ctx.leave();
901 }
902 #line 903 "netconf_parser.cc" // lalr1.cc:907
903  break;
904 
905  case 52:
906 #line 285 "netconf_parser.yy" // lalr1.cc:907
907  {
908  ElementPtr flag(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
909  ctx.stack_.back()->set("boot-update", flag);
910 }
911 #line 912 "netconf_parser.cc" // lalr1.cc:907
912  break;
913 
914  case 53:
915 #line 290 "netconf_parser.yy" // lalr1.cc:907
916  {
917  ElementPtr flag(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
918  ctx.stack_.back()->set("subscribe-changes", flag);
919 }
920 #line 921 "netconf_parser.cc" // lalr1.cc:907
921  break;
922 
923  case 54:
924 #line 295 "netconf_parser.yy" // lalr1.cc:907
925  {
926  ElementPtr flag(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
927  ctx.stack_.back()->set("validate-changes", flag);
928 }
929 #line 930 "netconf_parser.cc" // lalr1.cc:907
930  break;
931 
932  case 55:
933 #line 300 "netconf_parser.yy" // lalr1.cc:907
934  {
935  ctx.enter(ctx.NO_KEYWORDS);
936 }
937 #line 938 "netconf_parser.cc" // lalr1.cc:907
938  break;
939 
940  case 56:
941 #line 302 "netconf_parser.yy" // lalr1.cc:907
942  {
943  ElementPtr parent = ctx.stack_.back();
944  ElementPtr user_context = yystack_[0].value.as< ElementPtr > ();
945  ConstElementPtr old = parent->get("user-context");
946 
947  // Handle already existing user context
948  if (old) {
949  // Check if it was a comment or a duplicate
950  if ((old->size() != 1) || !old->contains("comment")) {
951  std::stringstream msg;
952  msg << "duplicate user-context entries (previous at "
953  << old->getPosition().str() << ")";
954  error(yystack_[3].location, msg.str());
955  }
956  // Merge the comment
957  user_context->set("comment", old->get("comment"));
958  }
959 
960  // Set the user context
961  parent->set("user-context", user_context);
962  ctx.leave();
963 }
964 #line 965 "netconf_parser.cc" // lalr1.cc:907
965  break;
966 
967  case 57:
968 #line 325 "netconf_parser.yy" // lalr1.cc:907
969  {
970  ctx.enter(ctx.NO_KEYWORDS);
971 }
972 #line 973 "netconf_parser.cc" // lalr1.cc:907
973  break;
974 
975  case 58:
976 #line 327 "netconf_parser.yy" // lalr1.cc:907
977  {
978  ElementPtr parent = ctx.stack_.back();
979  ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
980  ElementPtr comment(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
981  user_context->set("comment", comment);
982 
983  // Handle already existing user context
984  ConstElementPtr old = parent->get("user-context");
985  if (old) {
986  // Check for duplicate comment
987  if (old->contains("comment")) {
988  std::stringstream msg;
989  msg << "duplicate user-context/comment entries (previous at "
990  << old->getPosition().str() << ")";
991  error(yystack_[3].location, msg.str());
992  }
993  // Merge the user context in the comment
994  merge(user_context, old);
995  }
996 
997  // Set the user context
998  parent->set("user-context", user_context);
999  ctx.leave();
1000 }
1001 #line 1002 "netconf_parser.cc" // lalr1.cc:907
1002  break;
1003 
1004  case 59:
1005 #line 353 "netconf_parser.yy" // lalr1.cc:907
1006  {
1007  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1008  ctx.stack_.back()->set("hooks-libraries", l);
1009  ctx.stack_.push_back(l);
1010  ctx.enter(ctx.HOOKS_LIBRARIES);
1011 }
1012 #line 1013 "netconf_parser.cc" // lalr1.cc:907
1013  break;
1014 
1015  case 60:
1016 #line 358 "netconf_parser.yy" // lalr1.cc:907
1017  {
1018  ctx.stack_.pop_back();
1019  ctx.leave();
1020 }
1021 #line 1022 "netconf_parser.cc" // lalr1.cc:907
1022  break;
1023 
1024  case 65:
1025 #line 371 "netconf_parser.yy" // lalr1.cc:907
1026  {
1027  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1028  ctx.stack_.back()->add(m);
1029  ctx.stack_.push_back(m);
1030 }
1031 #line 1032 "netconf_parser.cc" // lalr1.cc:907
1032  break;
1033 
1034  case 66:
1035 #line 375 "netconf_parser.yy" // lalr1.cc:907
1036  {
1037  ctx.stack_.pop_back();
1038 }
1039 #line 1040 "netconf_parser.cc" // lalr1.cc:907
1040  break;
1041 
1042  case 72:
1043 #line 388 "netconf_parser.yy" // lalr1.cc:907
1044  {
1045  ctx.enter(ctx.NO_KEYWORDS);
1046 }
1047 #line 1048 "netconf_parser.cc" // lalr1.cc:907
1048  break;
1049 
1050  case 73:
1051 #line 390 "netconf_parser.yy" // lalr1.cc:907
1052  {
1053  ElementPtr lib(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1054  ctx.stack_.back()->set("library", lib);
1055  ctx.leave();
1056 }
1057 #line 1058 "netconf_parser.cc" // lalr1.cc:907
1058  break;
1059 
1060  case 74:
1061 #line 396 "netconf_parser.yy" // lalr1.cc:907
1062  {
1063  ctx.enter(ctx.NO_KEYWORDS);
1064 }
1065 #line 1066 "netconf_parser.cc" // lalr1.cc:907
1066  break;
1067 
1068  case 75:
1069 #line 398 "netconf_parser.yy" // lalr1.cc:907
1070  {
1071  ctx.stack_.back()->set("parameters", yystack_[0].value.as< ElementPtr > ());
1072  ctx.leave();
1073 }
1074 #line 1075 "netconf_parser.cc" // lalr1.cc:907
1075  break;
1076 
1077  case 76:
1078 #line 406 "netconf_parser.yy" // lalr1.cc:907
1079  {
1080  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location)));
1081  ctx.stack_.back()->set("managed-servers", m);
1082  ctx.stack_.push_back(m);
1083  ctx.enter(ctx.MANAGED_SERVERS);
1084 }
1085 #line 1086 "netconf_parser.cc" // lalr1.cc:907
1086  break;
1087 
1088  case 77:
1089 #line 411 "netconf_parser.yy" // lalr1.cc:907
1090  {
1091  ctx.stack_.pop_back();
1092  ctx.leave();
1093 }
1094 #line 1095 "netconf_parser.cc" // lalr1.cc:907
1095  break;
1096 
1097  case 87:
1098 #line 435 "netconf_parser.yy" // lalr1.cc:907
1099  {
1100  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1101  ctx.stack_.back()->set("dhcp4", m);
1102  ctx.stack_.push_back(m);
1103  ctx.enter(ctx.SERVER);
1104 }
1105 #line 1106 "netconf_parser.cc" // lalr1.cc:907
1106  break;
1107 
1108  case 88:
1109 #line 440 "netconf_parser.yy" // lalr1.cc:907
1110  {
1111  ctx.stack_.pop_back();
1112  ctx.leave();
1113 }
1114 #line 1115 "netconf_parser.cc" // lalr1.cc:907
1115  break;
1116 
1117  case 89:
1118 #line 446 "netconf_parser.yy" // lalr1.cc:907
1119  {
1120  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1121  ctx.stack_.back()->set("dhcp6", m);
1122  ctx.stack_.push_back(m);
1123  ctx.enter(ctx.SERVER);
1124 }
1125 #line 1126 "netconf_parser.cc" // lalr1.cc:907
1126  break;
1127 
1128  case 90:
1129 #line 451 "netconf_parser.yy" // lalr1.cc:907
1130  {
1131  ctx.stack_.pop_back();
1132  ctx.leave();
1133 }
1134 #line 1135 "netconf_parser.cc" // lalr1.cc:907
1135  break;
1136 
1137  case 91:
1138 #line 457 "netconf_parser.yy" // lalr1.cc:907
1139  {
1140  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1141  ctx.stack_.back()->set("d2", m);
1142  ctx.stack_.push_back(m);
1143  ctx.enter(ctx.SERVER);
1144 }
1145 #line 1146 "netconf_parser.cc" // lalr1.cc:907
1146  break;
1147 
1148  case 92:
1149 #line 462 "netconf_parser.yy" // lalr1.cc:907
1150  {
1151  ctx.stack_.pop_back();
1152  ctx.leave();
1153 }
1154 #line 1155 "netconf_parser.cc" // lalr1.cc:907
1155  break;
1156 
1157  case 93:
1158 #line 468 "netconf_parser.yy" // lalr1.cc:907
1159  {
1160  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1161  ctx.stack_.back()->set("ca", m);
1162  ctx.stack_.push_back(m);
1163  ctx.enter(ctx.SERVER);
1164 }
1165 #line 1166 "netconf_parser.cc" // lalr1.cc:907
1166  break;
1167 
1168  case 94:
1169 #line 473 "netconf_parser.yy" // lalr1.cc:907
1170  {
1171  ctx.stack_.pop_back();
1172  ctx.leave();
1173 }
1174 #line 1175 "netconf_parser.cc" // lalr1.cc:907
1175  break;
1176 
1177  case 105:
1178 #line 495 "netconf_parser.yy" // lalr1.cc:907
1179  {
1180  ctx.enter(ctx.NO_KEYWORDS);
1181 }
1182 #line 1183 "netconf_parser.cc" // lalr1.cc:907
1183  break;
1184 
1185  case 106:
1186 #line 497 "netconf_parser.yy" // lalr1.cc:907
1187  {
1188  ElementPtr model(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1189  ctx.stack_.back()->set("model", model);
1190  ctx.leave();
1191 }
1192 #line 1193 "netconf_parser.cc" // lalr1.cc:907
1193  break;
1194 
1195  case 107:
1196 #line 504 "netconf_parser.yy" // lalr1.cc:907
1197  {
1198  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1199  ctx.stack_.back()->set("control-socket", m);
1200  ctx.stack_.push_back(m);
1201  ctx.enter(ctx.CONTROL_SOCKET);
1202 }
1203 #line 1204 "netconf_parser.cc" // lalr1.cc:907
1204  break;
1205 
1206  case 108:
1207 #line 509 "netconf_parser.yy" // lalr1.cc:907
1208  {
1209  ctx.stack_.pop_back();
1210  ctx.leave();
1211 }
1212 #line 1213 "netconf_parser.cc" // lalr1.cc:907
1213  break;
1214 
1215  case 117:
1216 #line 527 "netconf_parser.yy" // lalr1.cc:907
1217  {
1218  ctx.enter(ctx.SOCKET_TYPE);
1219 }
1220 #line 1221 "netconf_parser.cc" // lalr1.cc:907
1221  break;
1222 
1223  case 118:
1224 #line 529 "netconf_parser.yy" // lalr1.cc:907
1225  {
1226  ctx.stack_.back()->set("socket-type", yystack_[0].value.as< ElementPtr > ());
1227  ctx.leave();
1228 }
1229 #line 1230 "netconf_parser.cc" // lalr1.cc:907
1230  break;
1231 
1232  case 119:
1233 #line 535 "netconf_parser.yy" // lalr1.cc:907
1234  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
1235 #line 1236 "netconf_parser.cc" // lalr1.cc:907
1236  break;
1237 
1238  case 120:
1239 #line 536 "netconf_parser.yy" // lalr1.cc:907
1240  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); }
1241 #line 1242 "netconf_parser.cc" // lalr1.cc:907
1242  break;
1243 
1244  case 121:
1245 #line 537 "netconf_parser.yy" // lalr1.cc:907
1246  { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("stdout", ctx.loc2pos(yystack_[0].location))); }
1247 #line 1248 "netconf_parser.cc" // lalr1.cc:907
1248  break;
1249 
1250  case 122:
1251 #line 540 "netconf_parser.yy" // lalr1.cc:907
1252  {
1253  ctx.enter(ctx.NO_KEYWORDS);
1254 }
1255 #line 1256 "netconf_parser.cc" // lalr1.cc:907
1256  break;
1257 
1258  case 123:
1259 #line 542 "netconf_parser.yy" // lalr1.cc:907
1260  {
1261  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1262  ctx.stack_.back()->set("socket-name", name);
1263  ctx.leave();
1264 }
1265 #line 1266 "netconf_parser.cc" // lalr1.cc:907
1266  break;
1267 
1268  case 124:
1269 #line 549 "netconf_parser.yy" // lalr1.cc:907
1270  {
1271  ctx.enter(ctx.NO_KEYWORDS);
1272 }
1273 #line 1274 "netconf_parser.cc" // lalr1.cc:907
1274  break;
1275 
1276  case 125:
1277 #line 551 "netconf_parser.yy" // lalr1.cc:907
1278  {
1279  ElementPtr url(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1280  ctx.stack_.back()->set("socket-url", url);
1281  ctx.leave();
1282 }
1283 #line 1284 "netconf_parser.cc" // lalr1.cc:907
1284  break;
1285 
1286  case 126:
1287 #line 564 "netconf_parser.yy" // lalr1.cc:907
1288  {
1289  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1290  ctx.stack_.back()->set("Logging", m);
1291  ctx.stack_.push_back(m);
1292  ctx.enter(ctx.LOGGING);
1293 }
1294 #line 1295 "netconf_parser.cc" // lalr1.cc:907
1295  break;
1296 
1297  case 127:
1298 #line 569 "netconf_parser.yy" // lalr1.cc:907
1299  {
1300  ctx.stack_.pop_back();
1301  ctx.leave();
1302 }
1303 #line 1304 "netconf_parser.cc" // lalr1.cc:907
1304  break;
1305 
1306  case 131:
1307 #line 586 "netconf_parser.yy" // lalr1.cc:907
1308  {
1309  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1310  ctx.stack_.back()->set("loggers", l);
1311  ctx.stack_.push_back(l);
1312  ctx.enter(ctx.LOGGERS);
1313 }
1314 #line 1315 "netconf_parser.cc" // lalr1.cc:907
1315  break;
1316 
1317  case 132:
1318 #line 591 "netconf_parser.yy" // lalr1.cc:907
1319  {
1320  ctx.stack_.pop_back();
1321  ctx.leave();
1322 }
1323 #line 1324 "netconf_parser.cc" // lalr1.cc:907
1324  break;
1325 
1326  case 135:
1327 #line 603 "netconf_parser.yy" // lalr1.cc:907
1328  {
1329  ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1330  ctx.stack_.back()->add(l);
1331  ctx.stack_.push_back(l);
1332 }
1333 #line 1334 "netconf_parser.cc" // lalr1.cc:907
1334  break;
1335 
1336  case 136:
1337 #line 607 "netconf_parser.yy" // lalr1.cc:907
1338  {
1339  ctx.stack_.pop_back();
1340 }
1341 #line 1342 "netconf_parser.cc" // lalr1.cc:907
1342  break;
1343 
1344  case 146:
1345 #line 624 "netconf_parser.yy" // lalr1.cc:907
1346  {
1347  ctx.enter(ctx.NO_KEYWORDS);
1348 }
1349 #line 1350 "netconf_parser.cc" // lalr1.cc:907
1350  break;
1351 
1352  case 147:
1353 #line 626 "netconf_parser.yy" // lalr1.cc:907
1354  {
1355  ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1356  ctx.stack_.back()->set("name", name);
1357  ctx.leave();
1358 }
1359 #line 1360 "netconf_parser.cc" // lalr1.cc:907
1360  break;
1361 
1362  case 148:
1363 #line 632 "netconf_parser.yy" // lalr1.cc:907
1364  {
1365  ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1366  ctx.stack_.back()->set("debuglevel", dl);
1367 }
1368 #line 1369 "netconf_parser.cc" // lalr1.cc:907
1369  break;
1370 
1371  case 149:
1372 #line 637 "netconf_parser.yy" // lalr1.cc:907
1373  {
1374  ctx.enter(ctx.NO_KEYWORDS);
1375 }
1376 #line 1377 "netconf_parser.cc" // lalr1.cc:907
1377  break;
1378 
1379  case 150:
1380 #line 639 "netconf_parser.yy" // lalr1.cc:907
1381  {
1382  ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1383  ctx.stack_.back()->set("severity", sev);
1384  ctx.leave();
1385 }
1386 #line 1387 "netconf_parser.cc" // lalr1.cc:907
1387  break;
1388 
1389  case 151:
1390 #line 645 "netconf_parser.yy" // lalr1.cc:907
1391  {
1392  ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1393  ctx.stack_.back()->set("output_options", l);
1394  ctx.stack_.push_back(l);
1395  ctx.enter(ctx.OUTPUT_OPTIONS);
1396 }
1397 #line 1398 "netconf_parser.cc" // lalr1.cc:907
1398  break;
1399 
1400  case 152:
1401 #line 650 "netconf_parser.yy" // lalr1.cc:907
1402  {
1403  ctx.stack_.pop_back();
1404  ctx.leave();
1405 }
1406 #line 1407 "netconf_parser.cc" // lalr1.cc:907
1407  break;
1408 
1409  case 155:
1410 #line 659 "netconf_parser.yy" // lalr1.cc:907
1411  {
1412  ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1413  ctx.stack_.back()->add(m);
1414  ctx.stack_.push_back(m);
1415 }
1416 #line 1417 "netconf_parser.cc" // lalr1.cc:907
1417  break;
1418 
1419  case 156:
1420 #line 663 "netconf_parser.yy" // lalr1.cc:907
1421  {
1422  ctx.stack_.pop_back();
1423 }
1424 #line 1425 "netconf_parser.cc" // lalr1.cc:907
1425  break;
1426 
1427  case 163:
1428 #line 677 "netconf_parser.yy" // lalr1.cc:907
1429  {
1430  ctx.enter(ctx.NO_KEYWORDS);
1431 }
1432 #line 1433 "netconf_parser.cc" // lalr1.cc:907
1433  break;
1434 
1435  case 164:
1436 #line 679 "netconf_parser.yy" // lalr1.cc:907
1437  {
1438  ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
1439  ctx.stack_.back()->set("output", sev);
1440  ctx.leave();
1441 }
1442 #line 1443 "netconf_parser.cc" // lalr1.cc:907
1443  break;
1444 
1445  case 165:
1446 #line 685 "netconf_parser.yy" // lalr1.cc:907
1447  {
1448  ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
1449  ctx.stack_.back()->set("flush", flush);
1450 }
1451 #line 1452 "netconf_parser.cc" // lalr1.cc:907
1452  break;
1453 
1454  case 166:
1455 #line 690 "netconf_parser.yy" // lalr1.cc:907
1456  {
1457  ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1458  ctx.stack_.back()->set("maxsize", maxsize);
1459 }
1460 #line 1461 "netconf_parser.cc" // lalr1.cc:907
1461  break;
1462 
1463  case 167:
1464 #line 695 "netconf_parser.yy" // lalr1.cc:907
1465  {
1466  ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
1467  ctx.stack_.back()->set("maxver", maxver);
1468 }
1469 #line 1470 "netconf_parser.cc" // lalr1.cc:907
1470  break;
1471 
1472 
1473 #line 1474 "netconf_parser.cc" // lalr1.cc:907
1474  default:
1475  break;
1476  }
1477  }
1478 #if YY_EXCEPTIONS
1479  catch (const syntax_error& yyexc)
1480  {
1481  error (yyexc);
1482  YYERROR;
1483  }
1484 #endif // YY_EXCEPTIONS
1485  YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1486  yypop_ (yylen);
1487  yylen = 0;
1488  YY_STACK_PRINT ();
1489 
1490  // Shift the result of the reduction.
1491  yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1492  }
1493  goto yynewstate;
1494 
1495  /*--------------------------------------.
1496  | yyerrlab -- here on detecting error. |
1497  `--------------------------------------*/
1498  yyerrlab:
1499  // If not already recovering from an error, report this error.
1500  if (!yyerrstatus_)
1501  {
1502  ++yynerrs_;
1503  error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla));
1504  }
1505 
1506 
1507  yyerror_range[1].location = yyla.location;
1508  if (yyerrstatus_ == 3)
1509  {
1510  /* If just tried and failed to reuse lookahead token after an
1511  error, discard it. */
1512 
1513  // Return failure if at end of input.
1514  if (yyla.type_get () == yyeof_)
1515  YYABORT;
1516  else if (!yyla.empty ())
1517  {
1518  yy_destroy_ ("Error: discarding", yyla);
1519  yyla.clear ();
1520  }
1521  }
1522 
1523  // Else will try to reuse lookahead token after shifting the error token.
1524  goto yyerrlab1;
1525 
1526 
1527  /*---------------------------------------------------.
1528  | yyerrorlab -- error raised explicitly by YYERROR. |
1529  `---------------------------------------------------*/
1530  yyerrorlab:
1531 
1532  /* Pacify compilers like GCC when the user code never invokes
1533  YYERROR and the label yyerrorlab therefore never appears in user
1534  code. */
1535  if (false)
1536  goto yyerrorlab;
1537  /* Do not reclaim the symbols of the rule whose action triggered
1538  this YYERROR. */
1539  yypop_ (yylen);
1540  yylen = 0;
1541  goto yyerrlab1;
1542 
1543  /*-------------------------------------------------------------.
1544  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1545  `-------------------------------------------------------------*/
1546  yyerrlab1:
1547  yyerrstatus_ = 3; // Each real token shifted decrements this.
1548  {
1549  stack_symbol_type error_token;
1550  for (;;)
1551  {
1552  yyn = yypact_[yystack_[0].state];
1553  if (!yy_pact_value_is_default_ (yyn))
1554  {
1555  yyn += yyterror_;
1556  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1557  {
1558  yyn = yytable_[yyn];
1559  if (0 < yyn)
1560  break;
1561  }
1562  }
1563 
1564  // Pop the current state because it cannot handle the error token.
1565  if (yystack_.size () == 1)
1566  YYABORT;
1567 
1568  yyerror_range[1].location = yystack_[0].location;
1569  yy_destroy_ ("Error: popping", yystack_[0]);
1570  yypop_ ();
1571  YY_STACK_PRINT ();
1572  }
1573 
1574  yyerror_range[2].location = yyla.location;
1575  YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1576 
1577  // Shift the error token.
1578  error_token.state = yyn;
1579  yypush_ ("Shifting", YY_MOVE (error_token));
1580  }
1581  goto yynewstate;
1582 
1583  // Accept.
1584  yyacceptlab:
1585  yyresult = 0;
1586  goto yyreturn;
1587 
1588  // Abort.
1589  yyabortlab:
1590  yyresult = 1;
1591  goto yyreturn;
1592 
1593  yyreturn:
1594  if (!yyla.empty ())
1595  yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1596 
1597  /* Do not reclaim the symbols of the rule whose action triggered
1598  this YYABORT or YYACCEPT. */
1599  yypop_ (yylen);
1600  while (1 < yystack_.size ())
1601  {
1602  yy_destroy_ ("Cleanup: popping", yystack_[0]);
1603  yypop_ ();
1604  }
1605 
1606  return yyresult;
1607  }
1608 #if YY_EXCEPTIONS
1609  catch (...)
1610  {
1611  YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1612  // Do not try to display the values of the reclaimed symbols,
1613  // as their printers might throw an exception.
1614  if (!yyla.empty ())
1615  yy_destroy_ (YY_NULLPTR, yyla);
1616 
1617  while (1 < yystack_.size ())
1618  {
1619  yy_destroy_ (YY_NULLPTR, yystack_[0]);
1620  yypop_ ();
1621  }
1622  throw;
1623  }
1624 #endif // YY_EXCEPTIONS
1625  }
1626 
1627  void
1629  {
1630  error (yyexc.location, yyexc.what ());
1631  }
1632 
1633  // Generate an error message.
1634  std::string
1635  NetconfParser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const
1636  {
1637  // Number of reported tokens (one for the "unexpected", one per
1638  // "expected").
1639  size_t yycount = 0;
1640  // Its maximum.
1641  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1642  // Arguments of yyformat.
1643  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1644 
1645  /* There are many possibilities here to consider:
1646  - If this state is a consistent state with a default action, then
1647  the only way this function was invoked is if the default action
1648  is an error action. In that case, don't check for expected
1649  tokens because there are none.
1650  - The only way there can be no lookahead present (in yyla) is
1651  if this state is a consistent state with a default action.
1652  Thus, detecting the absence of a lookahead is sufficient to
1653  determine that there is no unexpected or expected token to
1654  report. In that case, just report a simple "syntax error".
1655  - Don't assume there isn't a lookahead just because this state is
1656  a consistent state with a default action. There might have
1657  been a previous inconsistent state, consistent state with a
1658  non-default action, or user semantic action that manipulated
1659  yyla. (However, yyla is currently not documented for users.)
1660  - Of course, the expected token list depends on states to have
1661  correct lookahead information, and it depends on the parser not
1662  to perform extra reductions after fetching a lookahead from the
1663  scanner and before detecting a syntax error. Thus, state
1664  merging (from LALR or IELR) and default reductions corrupt the
1665  expected token list. However, the list is correct for
1666  canonical LR with one exception: it will still contain any
1667  token that will not be accepted due to an error action in a
1668  later state.
1669  */
1670  if (!yyla.empty ())
1671  {
1672  int yytoken = yyla.type_get ();
1673  yyarg[yycount++] = yytname_[yytoken];
1674  int yyn = yypact_[yystate];
1675  if (!yy_pact_value_is_default_ (yyn))
1676  {
1677  /* Start YYX at -YYN if negative to avoid negative indexes in
1678  YYCHECK. In other words, skip the first -YYN actions for
1679  this state because they are default actions. */
1680  int yyxbegin = yyn < 0 ? -yyn : 0;
1681  // Stay within bounds of both yycheck and yytname.
1682  int yychecklim = yylast_ - yyn + 1;
1683  int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1684  for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1685  if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
1686  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1687  {
1688  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1689  {
1690  yycount = 1;
1691  break;
1692  }
1693  else
1694  yyarg[yycount++] = yytname_[yyx];
1695  }
1696  }
1697  }
1698 
1699  char const* yyformat = YY_NULLPTR;
1700  switch (yycount)
1701  {
1702 #define YYCASE_(N, S) \
1703  case N: \
1704  yyformat = S; \
1705  break
1706  default: // Avoid compiler warnings.
1707  YYCASE_ (0, YY_("syntax error"));
1708  YYCASE_ (1, YY_("syntax error, unexpected %s"));
1709  YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
1710  YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1711  YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1712  YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1713 #undef YYCASE_
1714  }
1715 
1716  std::string yyres;
1717  // Argument number.
1718  size_t yyi = 0;
1719  for (char const* yyp = yyformat; *yyp; ++yyp)
1720  if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
1721  {
1722  yyres += yytnamerr_ (yyarg[yyi++]);
1723  ++yyp;
1724  }
1725  else
1726  yyres += *yyp;
1727  return yyres;
1728  }
1729 
1730 
1731  const signed char NetconfParser::yypact_ninf_ = -64;
1732 
1733  const signed char NetconfParser::yytable_ninf_ = -1;
1734 
1735  const short
1736  NetconfParser::yypact_[] =
1737  {
1738  64, -64, -64, -64, 13, 9, 18, 29, -64, -64,
1739  -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
1740  -64, -64, -64, -64, 9, -22, 10, 15, -64, 1,
1741  70, 79, 74, 106, -64, -64, 7, -64, -64, -64,
1742  -64, -64, 113, 116, 117, 118, -64, 119, -64, 120,
1743  121, -64, -64, -64, -64, -64, -64, -64, -64, -64,
1744  9, 9, -64, 80, 122, 123, 10, -64, 125, 126,
1745  83, 84, 85, 127, 131, -64, -64, 15, -64, -64,
1746  132, 130, 133, -64, 134, 97, -64, -64, -64, -64,
1747  138, -64, 9, 15, 105, -64, -64, -64, 44, 137,
1748  -64, 139, -64, 16, -64, -64, -64, -64, -64, -64,
1749  -64, 140, 136, -64, -64, -64, -64, -64, -64, 143,
1750  142, -64, -64, 146, 105, -64, 147, 148, 152, 153,
1751  -64, 44, 2, -64, 137, 141, -64, 154, 155, 156,
1752  157, -64, -64, -64, -64, 40, -64, -64, -64, -64,
1753  158, 65, 65, 65, 65, 162, 163, 88, -64, -64,
1754  43, -64, -64, -64, -64, -64, -64, -64, -64, -64,
1755  62, -64, -64, -64, 82, 91, 92, 114, 9, -64,
1756  0, 158, -64, 164, 165, 65, -64, -64, -64, -64,
1757  -64, -64, -64, -64, 166, -64, -64, -64, -64, 93,
1758  -64, -64, -64, -64, -64, -64, 115, 167, -64, 168,
1759  169, 129, 172, 0, -64, -64, -6, 135, 173, -64,
1760  149, -64, -64, -64, -64, -64, -64, -64, 94, -64,
1761  -64, -64, -64, -64, 170, -64, 175, 177, 178, -6,
1762  -64, -64, 78, -64, 87, 150, 151, -64, 52, 170,
1763  -64, -64, -64, -64, -64, -64, -64, -64, 179, 180,
1764  181, 95, -64, -64, -64, -64, -64, -64, 188, 145,
1765  159, 160, 52, -64, 171, -64, -64, -64, -64, -64
1766  };
1767 
1768  const unsigned char
1769  NetconfParser::yydefact_[] =
1770  {
1771  0, 2, 4, 6, 0, 0, 0, 0, 1, 25,
1772  18, 15, 14, 11, 12, 13, 3, 10, 16, 17,
1773  32, 5, 8, 7, 27, 21, 0, 40, 29, 0,
1774  28, 0, 0, 22, 38, 126, 0, 34, 36, 37,
1775  55, 57, 0, 0, 0, 0, 59, 0, 51, 0,
1776  41, 42, 44, 45, 46, 49, 50, 48, 47, 26,
1777  0, 0, 19, 0, 0, 0, 0, 33, 0, 0,
1778  0, 0, 0, 0, 0, 31, 9, 0, 30, 23,
1779  0, 0, 0, 35, 0, 0, 52, 53, 54, 76,
1780  0, 43, 0, 40, 0, 20, 56, 58, 78, 61,
1781  24, 0, 131, 0, 128, 130, 87, 89, 91, 93,
1782  86, 0, 79, 80, 82, 83, 84, 85, 65, 0,
1783  62, 63, 39, 0, 0, 127, 0, 0, 0, 0,
1784  77, 0, 0, 60, 0, 0, 129, 0, 0, 0,
1785  0, 81, 72, 74, 69, 0, 67, 70, 71, 64,
1786  0, 0, 0, 0, 0, 0, 0, 0, 66, 135,
1787  0, 133, 105, 107, 104, 98, 99, 100, 102, 103,
1788  0, 95, 97, 101, 0, 0, 0, 0, 0, 68,
1789  0, 0, 132, 0, 0, 0, 88, 90, 92, 94,
1790  73, 75, 146, 151, 0, 149, 145, 143, 144, 0,
1791  137, 139, 141, 142, 140, 134, 0, 0, 96, 0,
1792  0, 0, 0, 0, 136, 106, 0, 0, 0, 148,
1793  0, 138, 117, 122, 124, 116, 114, 115, 0, 109,
1794  111, 112, 113, 147, 0, 150, 0, 0, 0, 0,
1795  108, 155, 0, 153, 0, 0, 0, 110, 0, 0,
1796  152, 119, 120, 121, 118, 123, 125, 163, 0, 0,
1797  0, 0, 157, 159, 160, 161, 162, 154, 0, 0,
1798  0, 0, 0, 156, 0, 165, 166, 167, 158, 164
1799  };
1800 
1801  const short
1802  NetconfParser::yypgoto_[] =
1803  {
1804  -64, -64, -64, -64, -64, -64, -64, -64, -20, 124,
1805  -64, -64, -64, -64, -64, -64, -64, -64, -27, -64,
1806  -64, -64, 144, -64, -64, 104, -64, 161, -24, -19,
1807  -18, -26, -64, -25, -64, -64, -64, -64, -64, 37,
1808  -64, -64, 41, -64, -64, -64, -64, -64, -64, -64,
1809  -64, 68, -64, -64, -64, -64, -64, -64, -64, -64,
1810  -38, 17, -64, -64, -64, -64, -64, -39, -64, -64,
1811  -64, -64, -64, -64, -64, -64, -64, -64, 77, -64,
1812  -64, -64, 22, -64, -64, -9, -64, -64, -64, -64,
1813  -64, -64, -64, -64, -42, -64, -64, -63, -64, -64,
1814  -64, -64, -64
1815  };
1816 
1817  const short
1818  NetconfParser::yydefgoto_[] =
1819  {
1820  -1, 4, 5, 6, 7, 23, 27, 16, 17, 18,
1821  25, 96, 32, 33, 19, 24, 29, 30, 164, 21,
1822  26, 36, 37, 38, 64, 49, 50, 51, 165, 166,
1823  167, 168, 68, 169, 69, 57, 74, 119, 120, 121,
1824  132, 145, 146, 147, 155, 148, 156, 58, 98, 111,
1825  112, 113, 114, 126, 115, 127, 116, 128, 117, 129,
1826  170, 171, 172, 183, 173, 184, 228, 229, 230, 236,
1827  254, 231, 237, 232, 238, 39, 65, 103, 104, 105,
1828  123, 160, 161, 180, 199, 200, 201, 209, 202, 203,
1829  212, 204, 210, 242, 243, 248, 261, 262, 263, 268,
1830  264, 265, 266
1831  };
1832 
1833  const unsigned short
1834  NetconfParser::yytable_[] =
1835  {
1836  48, 55, 56, 52, 28, 40, 41, 59, 53, 54,
1837  66, 40, 41, 8, 9, 67, 10, 222, 11, 124,
1838  34, 223, 224, 31, 125, 20, 40, 41, 42, 43,
1839  44, 45, 142, 143, 192, 193, 22, 194, 195, 47,
1840  78, 79, 35, 157, 46, 47, 181, 47, 158, 182,
1841  48, 55, 56, 52, 12, 13, 14, 15, 53, 54,
1842  47, 106, 107, 108, 109, 185, 48, 55, 56, 52,
1843  186, 110, 100, 60, 53, 54, 40, 41, 42, 43,
1844  44, 249, 62, 61, 250, 185, 162, 163, 257, 47,
1845  187, 258, 259, 260, 185, 185, 213, 239, 272, 188,
1846  189, 214, 240, 273, 110, 144, 1, 2, 3, 63,
1847  47, 251, 252, 253, 174, 175, 176, 70, 142, 143,
1848  71, 72, 73, 75, 77, 80, 81, 82, 76, 84,
1849  85, 86, 87, 88, 89, 90, 92, 93, 102, 131,
1850  94, 10, 97, 99, 118, 134, 150, 122, 130, 133,
1851  135, 137, 138, 196, 197, 198, 139, 140, 191, 190,
1852  215, 151, 152, 153, 154, 159, 177, 178, 206, 207,
1853  211, 149, 217, 218, 216, 219, 220, 241, 234, 244,
1854  233, 245, 246, 269, 270, 271, 196, 197, 198, 225,
1855  226, 227, 274, 275, 235, 255, 256, 101, 179, 141,
1856  247, 136, 208, 205, 221, 276, 277, 267, 95, 278,
1857  83, 0, 225, 226, 227, 0, 279, 0, 0, 0,
1858  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1859  0, 0, 0, 0, 0, 0, 0, 0, 91
1860  };
1861 
1862  const short
1863  NetconfParser::yycheck_[] =
1864  {
1865  27, 27, 27, 27, 24, 11, 12, 6, 27, 27,
1866  3, 11, 12, 0, 5, 8, 7, 23, 9, 3,
1867  10, 27, 28, 45, 8, 7, 11, 12, 13, 14,
1868  15, 16, 30, 31, 34, 35, 7, 37, 38, 45,
1869  60, 61, 32, 3, 29, 45, 3, 45, 8, 6,
1870  77, 77, 77, 77, 45, 46, 47, 48, 77, 77,
1871  45, 17, 18, 19, 20, 3, 93, 93, 93, 93,
1872  8, 98, 92, 3, 93, 93, 11, 12, 13, 14,
1873  15, 3, 8, 4, 6, 3, 21, 22, 36, 45,
1874  8, 39, 40, 41, 3, 3, 3, 3, 3, 8,
1875  8, 8, 8, 8, 131, 132, 42, 43, 44, 3,
1876  45, 24, 25, 26, 152, 153, 154, 4, 30, 31,
1877  4, 4, 4, 4, 3, 45, 4, 4, 8, 4,
1878  4, 48, 48, 48, 7, 4, 4, 7, 33, 3,
1879  7, 7, 45, 5, 7, 3, 5, 8, 8, 6,
1880  4, 4, 4, 180, 180, 180, 4, 4, 178, 45,
1881  45, 7, 7, 7, 7, 7, 4, 4, 4, 4,
1882  4, 134, 4, 4, 7, 46, 4, 7, 5, 4,
1883  45, 4, 4, 4, 4, 4, 213, 213, 213, 216,
1884  216, 216, 4, 48, 45, 45, 45, 93, 157, 131,
1885  239, 124, 185, 181, 213, 46, 46, 249, 84, 272,
1886  66, -1, 239, 239, 239, -1, 45, -1, -1, -1,
1887  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1888  -1, -1, -1, -1, -1, -1, -1, -1, 77
1889  };
1890 
1891  const unsigned char
1892  NetconfParser::yystos_[] =
1893  {
1894  0, 42, 43, 44, 50, 51, 52, 53, 0, 5,
1895  7, 9, 45, 46, 47, 48, 56, 57, 58, 63,
1896  7, 68, 7, 54, 64, 59, 69, 55, 57, 65,
1897  66, 45, 61, 62, 10, 32, 70, 71, 72, 124,
1898  11, 12, 13, 14, 15, 16, 29, 45, 67, 74,
1899  75, 76, 77, 78, 79, 80, 82, 84, 96, 6,
1900  3, 4, 8, 3, 73, 125, 3, 8, 81, 83,
1901  4, 4, 4, 4, 85, 4, 8, 3, 57, 57,
1902  45, 4, 4, 71, 4, 4, 48, 48, 48, 7,
1903  4, 76, 4, 7, 7, 58, 60, 45, 97, 5,
1904  57, 74, 33, 126, 127, 128, 17, 18, 19, 20,
1905  67, 98, 99, 100, 101, 103, 105, 107, 7, 86,
1906  87, 88, 8, 129, 3, 8, 102, 104, 106, 108,
1907  8, 3, 89, 6, 3, 4, 127, 4, 4, 4,
1908  4, 100, 30, 31, 67, 90, 91, 92, 94, 88,
1909  5, 7, 7, 7, 7, 93, 95, 3, 8, 7,
1910  130, 131, 21, 22, 67, 77, 78, 79, 80, 82,
1911  109, 110, 111, 113, 109, 109, 109, 4, 4, 91,
1912  132, 3, 6, 112, 114, 3, 8, 8, 8, 8,
1913  45, 57, 34, 35, 37, 38, 67, 80, 82, 133,
1914  134, 135, 137, 138, 140, 131, 4, 4, 110, 136,
1915  141, 4, 139, 3, 8, 45, 7, 4, 4, 46,
1916  4, 134, 23, 27, 28, 67, 80, 82, 115, 116,
1917  117, 120, 122, 45, 5, 45, 118, 121, 123, 3,
1918  8, 7, 142, 143, 4, 4, 4, 116, 144, 3,
1919  6, 24, 25, 26, 119, 45, 45, 36, 39, 40,
1920  41, 145, 146, 147, 149, 150, 151, 143, 148, 4,
1921  4, 4, 3, 8, 4, 48, 46, 46, 146, 45
1922  };
1923 
1924  const unsigned char
1925  NetconfParser::yyr1_[] =
1926  {
1927  0, 49, 51, 50, 52, 50, 53, 50, 55, 54,
1928  56, 57, 57, 57, 57, 57, 57, 57, 59, 58,
1929  60, 61, 61, 62, 62, 64, 63, 65, 65, 66,
1930  66, 67, 69, 68, 70, 70, 71, 71, 73, 72,
1931  74, 74, 75, 75, 76, 76, 76, 76, 76, 76,
1932  76, 76, 77, 78, 79, 81, 80, 83, 82, 85,
1933  84, 86, 86, 87, 87, 89, 88, 90, 90, 90,
1934  91, 91, 93, 92, 95, 94, 97, 96, 98, 98,
1935  99, 99, 100, 100, 100, 100, 100, 102, 101, 104,
1936  103, 106, 105, 108, 107, 109, 109, 110, 110, 110,
1937  110, 110, 110, 110, 110, 112, 111, 114, 113, 115,
1938  115, 116, 116, 116, 116, 116, 116, 118, 117, 119,
1939  119, 119, 121, 120, 123, 122, 125, 124, 126, 126,
1940  127, 129, 128, 130, 130, 132, 131, 133, 133, 134,
1941  134, 134, 134, 134, 134, 134, 136, 135, 137, 139,
1942  138, 141, 140, 142, 142, 144, 143, 145, 145, 146,
1943  146, 146, 146, 148, 147, 149, 150, 151
1944  };
1945 
1946  const unsigned char
1947  NetconfParser::yyr2_[] =
1948  {
1949  0, 2, 0, 3, 0, 3, 0, 3, 0, 4,
1950  1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
1951  1, 0, 1, 3, 5, 0, 4, 0, 1, 1,
1952  3, 2, 0, 4, 1, 3, 1, 1, 0, 6,
1953  0, 1, 1, 3, 1, 1, 1, 1, 1, 1,
1954  1, 1, 3, 3, 3, 0, 4, 0, 4, 0,
1955  6, 0, 1, 1, 3, 0, 4, 1, 3, 1,
1956  1, 1, 0, 4, 0, 4, 0, 6, 0, 1,
1957  1, 3, 1, 1, 1, 1, 1, 0, 6, 0,
1958  6, 0, 6, 0, 6, 1, 3, 1, 1, 1,
1959  1, 1, 1, 1, 1, 0, 4, 0, 6, 1,
1960  3, 1, 1, 1, 1, 1, 1, 0, 4, 1,
1961  1, 1, 0, 4, 0, 4, 0, 6, 1, 3,
1962  1, 0, 6, 1, 3, 0, 4, 1, 3, 1,
1963  1, 1, 1, 1, 1, 1, 0, 4, 3, 0,
1964  4, 0, 6, 1, 3, 0, 4, 1, 3, 1,
1965  1, 1, 1, 0, 4, 3, 3, 3
1966  };
1967 
1968 
1969 
1970  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1971  // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1972  const char*
1973  const NetconfParser::yytname_[] =
1974  {
1975  "\"end of file\"", "error", "$undefined", "\",\"", "\":\"", "\"[\"",
1976  "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Netconf\"", "\"user-context\"",
1977  "\"comment\"", "\"boot-update\"", "\"subscribe-changes\"",
1978  "\"validate-changes\"", "\"managed-servers\"", "\"dhcp4\"", "\"dhcp6\"",
1979  "\"d2\"", "\"ca\"", "\"model\"", "\"control-socket\"", "\"socket-type\"",
1980  "\"unix\"", "\"http\"", "\"stdout\"", "\"socket-name\"",
1981  "\"socket-url\"", "\"hooks-libraries\"", "\"library\"", "\"parameters\"",
1982  "\"Logging\"", "\"loggers\"", "\"name\"", "\"output_options\"",
1983  "\"output\"", "\"debuglevel\"", "\"severity\"", "\"flush\"",
1984  "\"maxsize\"", "\"maxver\"", "START_JSON", "START_NETCONF",
1985  "START_SUB_NETCONF", "\"constant string\"", "\"integer\"",
1986  "\"floating point\"", "\"boolean\"", "$accept", "start", "$@1", "$@2",
1987  "$@3", "sub_netconf", "$@4", "json", "value", "map", "$@5", "map_value",
1988  "map_content", "not_empty_map", "list_generic", "$@6", "list_content",
1989  "not_empty_list", "unknown_map_entry", "netconf_syntax_map", "$@7",
1990  "global_objects", "global_object", "netconf_object", "$@8",
1991  "global_params", "not_empty_global_params", "global_param",
1992  "boot_update", "subscribe_changes", "validate_changes", "user_context",
1993  "$@9", "comment", "$@10", "hooks_libraries", "$@11",
1994  "hooks_libraries_list", "not_empty_hooks_libraries_list",
1995  "hooks_library", "$@12", "hooks_params", "hooks_param", "library",
1996  "$@13", "parameters", "$@14", "managed_servers", "$@15",
1997  "servers_entries", "not_empty_servers_entries", "server_entry",
1998  "dhcp4_server", "$@16", "dhcp6_server", "$@17", "d2_server", "$@18",
1999  "ca_server", "$@19", "managed_server_params", "managed_server_param",
2000  "model", "$@20", "control_socket", "$@21", "control_socket_params",
2001  "control_socket_param", "socket_type", "$@22", "socket_type_value",
2002  "socket_name", "$@23", "socket_url", "$@24", "logging_object", "$@25",
2003  "logging_params", "logging_param", "loggers", "$@26", "loggers_entries",
2004  "logger_entry", "$@27", "logger_params", "logger_param", "name", "$@28",
2005  "debuglevel", "severity", "$@29", "output_options_list", "$@30",
2006  "output_options_list_content", "output_entry", "$@31",
2007  "output_params_list", "output_params", "output", "$@32", "flush",
2008  "maxsize", "maxver", YY_NULLPTR
2009  };
2010 
2011 #if NETCONF_DEBUG
2012  const unsigned short
2013  NetconfParser::yyrline_[] =
2014  {
2015  0, 118, 118, 118, 119, 119, 120, 120, 128, 128,
2016  139, 145, 146, 147, 148, 149, 150, 151, 155, 155,
2017  166, 171, 172, 180, 184, 191, 191, 197, 198, 201,
2018  205, 218, 226, 226, 238, 239, 243, 244, 248, 248,
2019  265, 266, 269, 270, 275, 276, 277, 278, 279, 280,
2020  281, 282, 285, 290, 295, 300, 300, 325, 325, 353,
2021  353, 363, 364, 367, 368, 371, 371, 379, 380, 381,
2022  384, 385, 388, 388, 396, 396, 406, 406, 416, 417,
2023  420, 421, 427, 428, 429, 430, 431, 435, 435, 446,
2024  446, 457, 457, 468, 468, 479, 480, 484, 485, 486,
2025  487, 488, 489, 490, 491, 495, 495, 504, 504, 515,
2026  516, 519, 520, 521, 522, 523, 524, 527, 527, 535,
2027  536, 537, 540, 540, 549, 549, 564, 564, 577, 578,
2028  582, 586, 586, 598, 599, 603, 603, 611, 612, 615,
2029  616, 617, 618, 619, 620, 621, 624, 624, 632, 637,
2030  637, 645, 645, 655, 656, 659, 659, 667, 668, 671,
2031  672, 673, 674, 677, 677, 685, 690, 695
2032  };
2033 
2034  // Print the state stack on the debug stream.
2035  void
2036  NetconfParser::yystack_print_ ()
2037  {
2038  *yycdebug_ << "Stack now";
2040  i = yystack_.begin (),
2041  i_end = yystack_.end ();
2042  i != i_end; ++i)
2043  *yycdebug_ << ' ' << i->state;
2044  *yycdebug_ << '\n';
2045  }
2046 
2047  // Report on the debug stream that the rule \a yyrule is going to be reduced.
2048  void
2049  NetconfParser::yy_reduce_print_ (int yyrule)
2050  {
2051  unsigned yylno = yyrline_[yyrule];
2052  int yynrhs = yyr2_[yyrule];
2053  // Print the symbols being reduced, and their result.
2054  *yycdebug_ << "Reducing stack by rule " << yyrule - 1
2055  << " (line " << yylno << "):\n";
2056  // The symbols being reduced.
2057  for (int yyi = 0; yyi < yynrhs; yyi++)
2058  YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2059  yystack_[(yynrhs) - (yyi + 1)]);
2060  }
2061 #endif // NETCONF_DEBUG
2062 
2063 
2064 #line 14 "netconf_parser.yy" // lalr1.cc:1218
2065 } } // isc::netconf
2066 #line 2067 "netconf_parser.cc" // lalr1.cc:1218
2067 #line 700 "netconf_parser.yy" // lalr1.cc:1219
2068 
2069 
2070 void
2072  const std::string& what)
2073 {
2074  ctx.error(loc, what);
2075 }
isc::netconf::ParserContext::enter
void enter(const LexerContext &ctx)
Enter a new syntactic context.
Definition: netconf/parser_context.cc:115
isc::netconf::NetconfParser::basic_symbol::location
location_type location
The location.
Definition: netconf_parser.h:669
isc::netconf::ParserContext::MANAGED_SERVERS
@ MANAGED_SERVERS
Used while parsing Netconf/managed-servers.
Definition: netconf/parser_context.h:179
isc::data::ListElement
Definition: data.h:613
YY_STACK_PRINT
#define YY_STACK_PRINT()
Definition: netconf_parser.cc:120
YY_MOVE
#define YY_MOVE
Definition: agent_parser.h:81
isc::netconf::NetconfParser::location_type
location location_type
Symbol locations.
Definition: netconf_parser.h:525
isc::data::DoubleElement
Definition: data.h:560
isc::netconf::NetconfParser::basic_symbol
A complete symbol.
Definition: netconf_parser.h:609
parser_context.h
isc::netconf::stack::pop
void pop(int n=1)
Definition: netconf_parser.h:229
isc::netconf::stack::clear
void clear()
Definition: netconf_parser.h:236
isc::netconf::ParserContext::stack_
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
Definition: netconf/parser_context.h:67
isc::netconf::ParserContext::LOGGING
@ LOGGING
Definition: netconf/parser_context.h:176
isc::netconf::NetconfParser::symbol_number_type
int symbol_number_type
Symbol type: an internal symbol number.
Definition: netconf_parser.h:593
isc::netconf::ParserContext::NETCONF
@ NETCONF
Used while parsing content of Logging.
Definition: netconf/parser_context.h:173
isc::data::MapElement
Definition: data.h:646
YYABORT
#define YYABORT
Definition: netconf_parser.cc:139
isc::netconf::slice
Present a slice of the top of a stack.
Definition: netconf_parser.h:269
YYUSE
#define YYUSE(E)
Definition: netconf_parser.cc:96
isc::netconf::NetconfParser::parse
virtual int parse()
Parse.
Definition: netconf_parser.cc:519
isc::netconf::stack::push
void push(YY_MOVE_REF(T) t)
Steal the contents of t.
Definition: netconf_parser.h:222
NETCONF_DEBUG
#define NETCONF_DEBUG
Definition: netconf_parser.h:160
isc::netconf::ParserContext::SERVER
@ SERVER
Used while parsing Netconf/manages-servers/*‍/control-socket.
Definition: netconf/parser_context.h:182
isc::netconf::ParserContext
Parser context is a wrapper around flex/bison instances dedicated to Netconf-agent config file parser...
Definition: netconf/parser_context.h:38
isc::netconf::stack::end
const_iterator end() const
Definition: netconf_parser.h:254
isc::netconf::ParserContext::SOCKET_TYPE
@ SOCKET_TYPE
Used while parsing Netconf/hooks-libraries.
Definition: netconf/parser_context.h:188
isc::netconf::ParserContext::HOOKS_LIBRARIES
@ HOOKS_LIBRARIES
Used while parsing Logging/loggers structures.
Definition: netconf/parser_context.h:191
isc::netconf::NetconfParser::debug_stream
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
Definition: netconf_parser.cc:465
YYCASE_
#define YYCASE_(N, S)
isc::netconf::stack< stack_symbol_type >::const_iterator
S::const_reverse_iterator const_iterator
Definition: netconf_parser.h:175
isc::netconf::NetconfParser::operator()
int operator()()
Parse.
Definition: netconf_parser.cc:513
YYERROR
#define YYERROR
Definition: netconf_parser.cc:140
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::netconf::ParserContext::NO_KEYWORDS
@ NO_KEYWORDS
This one is used in pure JSON mode.
Definition: netconf/parser_context.h:167
isc::netconf::NetconfParser::syntax_error
Syntax errors thrown from user actions.
Definition: netconf_parser.h:529
isc::netconf::ParserContext::error
void error(const isc::netconf::location &loc, const std::string &what)
Error handler.
Definition: netconf/parser_context.cc:73
yylex
#define yylex
Definition: netconf_parser.cc:38
isc::netconf::NetconfParser::basic_symbol::move
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: netconf_parser.h:1387
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Symbol)
Definition: netconf_parser.cc:104
isc::data::NullElement
Definition: data.h:590
isc::netconf::ParserContext::ctx_
LexerContext ctx_
Current syntactic context.
Definition: netconf/parser_context.h:230
YY_MOVE_REF
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:83
isc::netconf::ParserContext::contextName
const std::string contextName()
Get the syntactic context name.
Definition: netconf/parser_context.cc:132
isc::netconf::NetconfParser::NetconfParser
NetconfParser(isc::netconf::ParserContext &ctx_yyarg)
Build a parser object.
Definition: netconf_parser.cc:186
isc::netconf::stack::begin
const_iterator begin() const
Definition: netconf_parser.h:248
YYCDEBUG
#define YYCDEBUG
Definition: netconf_parser.cc:102
isc::netconf::NetconfParser::basic_symbol::empty
bool empty() const
Whether empty.
Definition: netconf_parser.h:1380
isc::netconf::NetconfParser::basic_symbol::clear
void clear()
Destroy contents, and record that is empty.
Definition: netconf_parser.h:1334
YY_RVREF
#define YY_RVREF(Type)
Definition: agent_parser.h:84
isc::netconf::NetconfParser::debug_level
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
Definition: netconf_parser.cc:478
isc::netconf::NetconfParser::set_debug_stream
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: netconf_parser.cc:471
YYLLOC_DEFAULT
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: netconf_parser.cc:80
isc::netconf::ParserContext::OUTPUT_OPTIONS
@ OUTPUT_OPTIONS
Definition: netconf/parser_context.h:197
isc::netconf::NetconfParser::set_debug_level
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: netconf_parser.cc:484
isc::data::StringElement
Definition: data.h:598
isc::data::IntElement
Notes: IntElement type is changed to int64_t.
Definition: data.h:544
isc::netconf::ParserContext::CONTROL_SOCKET
@ CONTROL_SOCKET
Used while parsing Netconf/managed-servers/*‍/control-socket/socket-type.
Definition: netconf/parser_context.h:185
isc::netconf::NetconfParser::error
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: netconf_parser.cc:2071
isc::netconf::ParserContext::loc2pos
isc::data::Element::Position loc2pos(isc::netconf::location &loc)
Converts bison's position to one understandable by isc::data::Element.
Definition: netconf/parser_context.cc:91
YY_
#define YY_(msgid)
Definition: netconf_parser.cc:61
isc::netconf::NetconfParser::~NetconfParser
virtual ~NetconfParser()
Definition: netconf_parser.cc:195
isc::netconf::NetconfParser::empty_symbol
@ empty_symbol
Definition: netconf_parser.h:596
isc::data::BoolElement
Definition: data.h:575
isc::data::merge
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1096
isc::netconf::ParserContext::LOGGERS
@ LOGGERS
Used while parsing Logging/loggers/output_options structures.
Definition: netconf/parser_context.h:194
netconf_parser.h
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
isc::netconf::ParserContext::CONFIG
@ CONFIG
Used while parsing content of Netconf.
Definition: netconf/parser_context.h:170
isc::netconf::NetconfParser::syntax_error::location
location_type location
Definition: netconf_parser.h:531
isc::netconf::NetconfParser::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: netconf_parser.h:734
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition: netconf_parser.cc:114
isc::netconf::stack::size
size_type size() const
Definition: netconf_parser.h:242
if
if(!(yy_init))
Definition: agent_lexer.cc:1692
isc::netconf::ParserContext::leave
void leave()
Leave a syntactic context.
Definition: netconf/parser_context.cc:122