Kea: netconf_parser.cc Source File

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