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