Kea 2.0.3
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
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"
143namespace 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)
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.
276 that.kind_ = symbol_kind::S_YYEMPTY;
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';
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. */
595 yyla.kind_ = symbol_kind::S_YYUNDEF;
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: // $@6: %empty
827#line 193 "netconf_parser.yy"
828 {
829 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
830 ctx.stack_.push_back(l);
831}
832#line 833 "netconf_parser.cc"
833 break;
834
835 case 26: // list_generic: "[" $@6 list_content "]"
836#line 196 "netconf_parser.yy"
837 {
838}
839#line 840 "netconf_parser.cc"
840 break;
841
842 case 29: // not_empty_list: value
843#line 203 "netconf_parser.yy"
844 {
845 // List consisting of a single element.
846 ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
847 }
848#line 849 "netconf_parser.cc"
849 break;
850
851 case 30: // not_empty_list: not_empty_list "," value
852#line 207 "netconf_parser.yy"
853 {
854 // List ending with , and a value.
855 ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
856 }
857#line 858 "netconf_parser.cc"
858 break;
859
860 case 31: // unknown_map_entry: "constant string" ":"
861#line 220 "netconf_parser.yy"
862 {
863 const std::string& where = ctx.contextName();
864 const std::string& keyword = yystack_[1].value.as < std::string > ();
865 error(yystack_[1].location,
866 "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
867}
868#line 869 "netconf_parser.cc"
869 break;
870
871 case 32: // $@7: %empty
872#line 228 "netconf_parser.yy"
873 {
874 // This code is executed when we're about to start parsing
875 // the content of the map
876 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
877 ctx.stack_.push_back(m);
878}
879#line 880 "netconf_parser.cc"
880 break;
881
882 case 33: // netconf_syntax_map: "{" $@7 global_object "}"
883#line 233 "netconf_parser.yy"
884 {
885 // map parsing completed. If we ever want to do any wrap up
886 // (maybe some sanity checking), this would be the best place
887 // for it.
888}
889#line 890 "netconf_parser.cc"
890 break;
891
892 case 34: // $@8: %empty
893#line 240 "netconf_parser.yy"
894 {
895
896 // Let's create a MapElement that will represent it, add it to the
897 // top level map (that's already on the stack) and put the new map
898 // on the stack as well, so child elements will be able to add
899 // themselves to it.
900
901 // Prevent against duplicate.
902 ctx.unique("Netconf", ctx.loc2pos(yystack_[0].location));
903 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
904 ctx.stack_.back()->set("Netconf", m);
905 ctx.stack_.push_back(m);
906 ctx.enter(ctx.NETCONF);
907}
908#line 909 "netconf_parser.cc"
909 break;
910
911 case 35: // global_object: "Netconf" $@8 ":" "{" global_params "}"
912#line 253 "netconf_parser.yy"
913 {
914 // Ok, we're done with parsing Netconf. Let's take the map
915 // off the stack.
916 ctx.stack_.pop_back();
917 ctx.leave();
918}
919#line 920 "netconf_parser.cc"
920 break;
921
922 case 49: // boot_update: "boot-update" ":" "boolean"
923#line 281 "netconf_parser.yy"
924 {
925 ctx.unique("boot-update", ctx.loc2pos(yystack_[2].location));
926 ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
927 ctx.stack_.back()->set("boot-update", flag);
928}
929#line 930 "netconf_parser.cc"
930 break;
931
932 case 50: // subscribe_changes: "subscribe-changes" ":" "boolean"
933#line 287 "netconf_parser.yy"
934 {
935 ctx.unique("subscribe-changes", ctx.loc2pos(yystack_[2].location));
936 ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
937 ctx.stack_.back()->set("subscribe-changes", flag);
938}
939#line 940 "netconf_parser.cc"
940 break;
941
942 case 51: // validate_changes: "validate-changes" ":" "boolean"
943#line 293 "netconf_parser.yy"
944 {
945 ctx.unique("validate-changes", ctx.loc2pos(yystack_[2].location));
946 ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
947 ctx.stack_.back()->set("validate-changes", flag);
948}
949#line 950 "netconf_parser.cc"
950 break;
951
952 case 52: // $@9: %empty
953#line 299 "netconf_parser.yy"
954 {
955 ctx.enter(ctx.NO_KEYWORDS);
956}
957#line 958 "netconf_parser.cc"
958 break;
959
960 case 53: // user_context: "user-context" $@9 ":" map_value
961#line 301 "netconf_parser.yy"
962 {
963 ElementPtr parent = ctx.stack_.back();
964 ElementPtr user_context = yystack_[0].value.as < ElementPtr > ();
965 ConstElementPtr old = parent->get("user-context");
966
967 // Handle already existing user context
968 if (old) {
969 // Check if it was a comment or a duplicate
970 if ((old->size() != 1) || !old->contains("comment")) {
971 std::stringstream msg;
972 msg << "duplicate user-context entries (previous at "
973 << old->getPosition().str() << ")";
974 error(yystack_[3].location, msg.str());
975 }
976 // Merge the comment
977 user_context->set("comment", old->get("comment"));
978 }
979
980 // Set the user context
981 parent->set("user-context", user_context);
982 ctx.leave();
983}
984#line 985 "netconf_parser.cc"
985 break;
986
987 case 54: // $@10: %empty
988#line 324 "netconf_parser.yy"
989 {
990 ctx.enter(ctx.NO_KEYWORDS);
991}
992#line 993 "netconf_parser.cc"
993 break;
994
995 case 55: // comment: "comment" $@10 ":" "constant string"
996#line 326 "netconf_parser.yy"
997 {
998 ElementPtr parent = ctx.stack_.back();
999 ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
1000 ElementPtr comment(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1001 user_context->set("comment", comment);
1002
1003 // Handle already existing user context
1004 ConstElementPtr old = parent->get("user-context");
1005 if (old) {
1006 // Check for duplicate comment
1007 if (old->contains("comment")) {
1008 std::stringstream msg;
1009 msg << "duplicate user-context/comment entries (previous at "
1010 << old->getPosition().str() << ")";
1011 error(yystack_[3].location, msg.str());
1012 }
1013 // Merge the user context in the comment
1014 merge(user_context, old);
1015 }
1016
1017 // Set the user context
1018 parent->set("user-context", user_context);
1019 ctx.leave();
1020}
1021#line 1022 "netconf_parser.cc"
1022 break;
1023
1024 case 56: // $@11: %empty
1025#line 352 "netconf_parser.yy"
1026 {
1027 ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location));
1028 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1029 ctx.stack_.back()->set("hooks-libraries", l);
1030 ctx.stack_.push_back(l);
1031 ctx.enter(ctx.HOOKS_LIBRARIES);
1032}
1033#line 1034 "netconf_parser.cc"
1034 break;
1035
1036 case 57: // hooks_libraries: "hooks-libraries" $@11 ":" "[" hooks_libraries_list "]"
1037#line 358 "netconf_parser.yy"
1038 {
1039 ctx.stack_.pop_back();
1040 ctx.leave();
1041}
1042#line 1043 "netconf_parser.cc"
1043 break;
1044
1045 case 62: // $@12: %empty
1046#line 371 "netconf_parser.yy"
1047 {
1048 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1049 ctx.stack_.back()->add(m);
1050 ctx.stack_.push_back(m);
1051}
1052#line 1053 "netconf_parser.cc"
1053 break;
1054
1055 case 63: // hooks_library: "{" $@12 hooks_params "}"
1056#line 375 "netconf_parser.yy"
1057 {
1058 ctx.stack_.pop_back();
1059}
1060#line 1061 "netconf_parser.cc"
1061 break;
1062
1063 case 69: // $@13: %empty
1064#line 388 "netconf_parser.yy"
1065 {
1066 ctx.unique("library", ctx.loc2pos(yystack_[0].location));
1067 ctx.enter(ctx.NO_KEYWORDS);
1068}
1069#line 1070 "netconf_parser.cc"
1070 break;
1071
1072 case 70: // library: "library" $@13 ":" "constant string"
1073#line 391 "netconf_parser.yy"
1074 {
1075 ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1076 ctx.stack_.back()->set("library", lib);
1077 ctx.leave();
1078}
1079#line 1080 "netconf_parser.cc"
1080 break;
1081
1082 case 71: // $@14: %empty
1083#line 397 "netconf_parser.yy"
1084 {
1085 ctx.unique("parameters", ctx.loc2pos(yystack_[0].location));
1086 ctx.enter(ctx.NO_KEYWORDS);
1087}
1088#line 1089 "netconf_parser.cc"
1089 break;
1090
1091 case 72: // parameters: "parameters" $@14 ":" map_value
1092#line 400 "netconf_parser.yy"
1093 {
1094 ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ());
1095 ctx.leave();
1096}
1097#line 1098 "netconf_parser.cc"
1098 break;
1099
1100 case 73: // $@15: %empty
1101#line 408 "netconf_parser.yy"
1102 {
1103 ctx.unique("managed-servers", ctx.loc2pos(yystack_[2].location));
1104 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location)));
1105 ctx.stack_.back()->set("managed-servers", m);
1106 ctx.stack_.push_back(m);
1107 ctx.enter(ctx.MANAGED_SERVERS);
1108}
1109#line 1110 "netconf_parser.cc"
1110 break;
1111
1112 case 74: // managed_servers: "managed-servers" ":" "{" $@15 servers_entries "}"
1113#line 414 "netconf_parser.yy"
1114 {
1115 ctx.stack_.pop_back();
1116 ctx.leave();
1117}
1118#line 1119 "netconf_parser.cc"
1119 break;
1120
1121 case 84: // $@16: %empty
1122#line 438 "netconf_parser.yy"
1123 {
1124 ctx.unique("dhcp4", ctx.loc2pos(yystack_[0].location));
1125 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1126 ctx.stack_.back()->set("dhcp4", m);
1127 ctx.stack_.push_back(m);
1128 ctx.enter(ctx.SERVER);
1129}
1130#line 1131 "netconf_parser.cc"
1131 break;
1132
1133 case 85: // dhcp4_server: "dhcp4" $@16 ":" "{" managed_server_params "}"
1134#line 444 "netconf_parser.yy"
1135 {
1136 ctx.stack_.pop_back();
1137 ctx.leave();
1138}
1139#line 1140 "netconf_parser.cc"
1140 break;
1141
1142 case 86: // $@17: %empty
1143#line 450 "netconf_parser.yy"
1144 {
1145 ctx.unique("dhcp6", ctx.loc2pos(yystack_[0].location));
1146 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1147 ctx.stack_.back()->set("dhcp6", m);
1148 ctx.stack_.push_back(m);
1149 ctx.enter(ctx.SERVER);
1150}
1151#line 1152 "netconf_parser.cc"
1152 break;
1153
1154 case 87: // dhcp6_server: "dhcp6" $@17 ":" "{" managed_server_params "}"
1155#line 456 "netconf_parser.yy"
1156 {
1157 ctx.stack_.pop_back();
1158 ctx.leave();
1159}
1160#line 1161 "netconf_parser.cc"
1161 break;
1162
1163 case 88: // $@18: %empty
1164#line 462 "netconf_parser.yy"
1165 {
1166 ctx.unique("d2", ctx.loc2pos(yystack_[0].location));
1167 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1168 ctx.stack_.back()->set("d2", m);
1169 ctx.stack_.push_back(m);
1170 ctx.enter(ctx.SERVER);
1171}
1172#line 1173 "netconf_parser.cc"
1173 break;
1174
1175 case 89: // d2_server: "d2" $@18 ":" "{" managed_server_params "}"
1176#line 468 "netconf_parser.yy"
1177 {
1178 ctx.stack_.pop_back();
1179 ctx.leave();
1180}
1181#line 1182 "netconf_parser.cc"
1182 break;
1183
1184 case 90: // $@19: %empty
1185#line 474 "netconf_parser.yy"
1186 {
1187 ctx.unique("ca", ctx.loc2pos(yystack_[0].location));
1188 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1189 ctx.stack_.back()->set("ca", m);
1190 ctx.stack_.push_back(m);
1191 ctx.enter(ctx.SERVER);
1192}
1193#line 1194 "netconf_parser.cc"
1194 break;
1195
1196 case 91: // ca_server: "ca" $@19 ":" "{" managed_server_params "}"
1197#line 480 "netconf_parser.yy"
1198 {
1199 ctx.stack_.pop_back();
1200 ctx.leave();
1201}
1202#line 1203 "netconf_parser.cc"
1203 break;
1204
1205 case 102: // $@20: %empty
1206#line 502 "netconf_parser.yy"
1207 {
1208 ctx.unique("model", ctx.loc2pos(yystack_[0].location));
1209 ctx.enter(ctx.NO_KEYWORDS);
1210}
1211#line 1212 "netconf_parser.cc"
1212 break;
1213
1214 case 103: // model: "model" $@20 ":" "constant string"
1215#line 505 "netconf_parser.yy"
1216 {
1217 ElementPtr model(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1218 ctx.stack_.back()->set("model", model);
1219 ctx.leave();
1220}
1221#line 1222 "netconf_parser.cc"
1222 break;
1223
1224 case 104: // $@21: %empty
1225#line 512 "netconf_parser.yy"
1226 {
1227 ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location));
1228 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1229 ctx.stack_.back()->set("control-socket", m);
1230 ctx.stack_.push_back(m);
1231 ctx.enter(ctx.CONTROL_SOCKET);
1232}
1233#line 1234 "netconf_parser.cc"
1234 break;
1235
1236 case 105: // control_socket: "control-socket" $@21 ":" "{" control_socket_params "}"
1237#line 518 "netconf_parser.yy"
1238 {
1239 ctx.stack_.pop_back();
1240 ctx.leave();
1241}
1242#line 1243 "netconf_parser.cc"
1243 break;
1244
1245 case 114: // $@22: %empty
1246#line 536 "netconf_parser.yy"
1247 {
1248 ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location));
1249 ctx.enter(ctx.SOCKET_TYPE);
1250}
1251#line 1252 "netconf_parser.cc"
1252 break;
1253
1254 case 115: // socket_type: "socket-type" $@22 ":" socket_type_value
1255#line 539 "netconf_parser.yy"
1256 {
1257 ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ());
1258 ctx.leave();
1259}
1260#line 1261 "netconf_parser.cc"
1261 break;
1262
1263 case 116: // socket_type_value: "unix"
1264#line 545 "netconf_parser.yy"
1265 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
1266#line 1267 "netconf_parser.cc"
1267 break;
1268
1269 case 117: // socket_type_value: "http"
1270#line 546 "netconf_parser.yy"
1271 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); }
1272#line 1273 "netconf_parser.cc"
1273 break;
1274
1275 case 118: // socket_type_value: "stdout"
1276#line 547 "netconf_parser.yy"
1277 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("stdout", ctx.loc2pos(yystack_[0].location))); }
1278#line 1279 "netconf_parser.cc"
1279 break;
1280
1281 case 119: // $@23: %empty
1282#line 550 "netconf_parser.yy"
1283 {
1284 ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
1285 ctx.enter(ctx.NO_KEYWORDS);
1286}
1287#line 1288 "netconf_parser.cc"
1288 break;
1289
1290 case 120: // socket_name: "socket-name" $@23 ":" "constant string"
1291#line 553 "netconf_parser.yy"
1292 {
1293 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1294 ctx.stack_.back()->set("socket-name", name);
1295 ctx.leave();
1296}
1297#line 1298 "netconf_parser.cc"
1298 break;
1299
1300 case 121: // $@24: %empty
1301#line 560 "netconf_parser.yy"
1302 {
1303 ctx.unique("socket-url", ctx.loc2pos(yystack_[0].location));
1304 ctx.enter(ctx.NO_KEYWORDS);
1305}
1306#line 1307 "netconf_parser.cc"
1307 break;
1308
1309 case 122: // socket_url: "socket-url" $@24 ":" "constant string"
1310#line 563 "netconf_parser.yy"
1311 {
1312 ElementPtr url(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1313 ctx.stack_.back()->set("socket-url", url);
1314 ctx.leave();
1315}
1316#line 1317 "netconf_parser.cc"
1317 break;
1318
1319 case 123: // $@25: %empty
1320#line 573 "netconf_parser.yy"
1321 {
1322 ctx.unique("loggers", ctx.loc2pos(yystack_[0].location));
1323 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1324 ctx.stack_.back()->set("loggers", l);
1325 ctx.stack_.push_back(l);
1326 ctx.enter(ctx.LOGGERS);
1327}
1328#line 1329 "netconf_parser.cc"
1329 break;
1330
1331 case 124: // loggers: "loggers" $@25 ":" "[" loggers_entries "]"
1332#line 579 "netconf_parser.yy"
1333 {
1334 ctx.stack_.pop_back();
1335 ctx.leave();
1336}
1337#line 1338 "netconf_parser.cc"
1338 break;
1339
1340 case 127: // $@26: %empty
1341#line 591 "netconf_parser.yy"
1342 {
1343 ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
1344 ctx.stack_.back()->add(l);
1345 ctx.stack_.push_back(l);
1346}
1347#line 1348 "netconf_parser.cc"
1348 break;
1349
1350 case 128: // logger_entry: "{" $@26 logger_params "}"
1351#line 595 "netconf_parser.yy"
1352 {
1353 ctx.stack_.pop_back();
1354}
1355#line 1356 "netconf_parser.cc"
1356 break;
1357
1358 case 138: // $@27: %empty
1359#line 612 "netconf_parser.yy"
1360 {
1361 ctx.unique("name", ctx.loc2pos(yystack_[0].location));
1362 ctx.enter(ctx.NO_KEYWORDS);
1363}
1364#line 1365 "netconf_parser.cc"
1365 break;
1366
1367 case 139: // name: "name" $@27 ":" "constant string"
1368#line 615 "netconf_parser.yy"
1369 {
1370 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1371 ctx.stack_.back()->set("name", name);
1372 ctx.leave();
1373}
1374#line 1375 "netconf_parser.cc"
1375 break;
1376
1377 case 140: // debuglevel: "debuglevel" ":" "integer"
1378#line 621 "netconf_parser.yy"
1379 {
1380 ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location));
1381 ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1382 ctx.stack_.back()->set("debuglevel", dl);
1383}
1384#line 1385 "netconf_parser.cc"
1385 break;
1386
1387 case 141: // $@28: %empty
1388#line 627 "netconf_parser.yy"
1389 {
1390 ctx.unique("severity", ctx.loc2pos(yystack_[0].location));
1391 ctx.enter(ctx.NO_KEYWORDS);
1392}
1393#line 1394 "netconf_parser.cc"
1394 break;
1395
1396 case 142: // severity: "severity" $@28 ":" "constant string"
1397#line 630 "netconf_parser.yy"
1398 {
1399 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1400 ctx.stack_.back()->set("severity", sev);
1401 ctx.leave();
1402}
1403#line 1404 "netconf_parser.cc"
1404 break;
1405
1406 case 143: // $@29: %empty
1407#line 636 "netconf_parser.yy"
1408 {
1409 ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
1410 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1411 ctx.stack_.back()->set("output_options", l);
1412 ctx.stack_.push_back(l);
1413 ctx.enter(ctx.OUTPUT_OPTIONS);
1414}
1415#line 1416 "netconf_parser.cc"
1416 break;
1417
1418 case 144: // output_options_list: "output_options" $@29 ":" "[" output_options_list_content "]"
1419#line 642 "netconf_parser.yy"
1420 {
1421 ctx.stack_.pop_back();
1422 ctx.leave();
1423}
1424#line 1425 "netconf_parser.cc"
1425 break;
1426
1427 case 147: // $@30: %empty
1428#line 651 "netconf_parser.yy"
1429 {
1430 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1431 ctx.stack_.back()->add(m);
1432 ctx.stack_.push_back(m);
1433}
1434#line 1435 "netconf_parser.cc"
1435 break;
1436
1437 case 148: // output_entry: "{" $@30 output_params_list "}"
1438#line 655 "netconf_parser.yy"
1439 {
1440 ctx.stack_.pop_back();
1441}
1442#line 1443 "netconf_parser.cc"
1443 break;
1444
1445 case 156: // $@31: %empty
1446#line 670 "netconf_parser.yy"
1447 {
1448 ctx.unique("output", ctx.loc2pos(yystack_[0].location));
1449 ctx.enter(ctx.NO_KEYWORDS);
1450}
1451#line 1452 "netconf_parser.cc"
1452 break;
1453
1454 case 157: // output: "output" $@31 ":" "constant string"
1455#line 673 "netconf_parser.yy"
1456 {
1457 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1458 ctx.stack_.back()->set("output", sev);
1459 ctx.leave();
1460}
1461#line 1462 "netconf_parser.cc"
1462 break;
1463
1464 case 158: // flush: "flush" ":" "boolean"
1465#line 679 "netconf_parser.yy"
1466 {
1467 ctx.unique("flush", ctx.loc2pos(yystack_[2].location));
1468 ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1469 ctx.stack_.back()->set("flush", flush);
1470}
1471#line 1472 "netconf_parser.cc"
1472 break;
1473
1474 case 159: // maxsize: "maxsize" ":" "integer"
1475#line 685 "netconf_parser.yy"
1476 {
1477 ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location));
1478 ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1479 ctx.stack_.back()->set("maxsize", maxsize);
1480}
1481#line 1482 "netconf_parser.cc"
1482 break;
1483
1484 case 160: // maxver: "maxver" ":" "integer"
1485#line 691 "netconf_parser.yy"
1486 {
1487 ctx.unique("maxver", ctx.loc2pos(yystack_[2].location));
1488 ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1489 ctx.stack_.back()->set("maxver", maxver);
1490}
1491#line 1492 "netconf_parser.cc"
1492 break;
1493
1494 case 161: // $@32: %empty
1495#line 697 "netconf_parser.yy"
1496 {
1497 ctx.unique("pattern", ctx.loc2pos(yystack_[0].location));
1498 ctx.enter(ctx.NO_KEYWORDS);
1499}
1500#line 1501 "netconf_parser.cc"
1501 break;
1502
1503 case 162: // pattern: "pattern" $@32 ":" "constant string"
1504#line 700 "netconf_parser.yy"
1505 {
1506 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1507 ctx.stack_.back()->set("pattern", sev);
1508 ctx.leave();
1509}
1510#line 1511 "netconf_parser.cc"
1511 break;
1512
1513
1514#line 1515 "netconf_parser.cc"
1515
1516 default:
1517 break;
1518 }
1519 }
1520#if YY_EXCEPTIONS
1521 catch (const syntax_error& yyexc)
1522 {
1523 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
1524 error (yyexc);
1525 YYERROR;
1526 }
1527#endif // YY_EXCEPTIONS
1528 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1529 yypop_ (yylen);
1530 yylen = 0;
1531
1532 // Shift the result of the reduction.
1533 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1534 }
1535 goto yynewstate;
1536
1537
1538 /*--------------------------------------.
1539 | yyerrlab -- here on detecting error. |
1540 `--------------------------------------*/
1541 yyerrlab:
1542 // If not already recovering from an error, report this error.
1543 if (!yyerrstatus_)
1544 {
1545 ++yynerrs_;
1546 context yyctx (*this, yyla);
1547 std::string msg = yysyntax_error_ (yyctx);
1548 error (yyla.location, YY_MOVE (msg));
1549 }
1550
1551
1552 yyerror_range[1].location = yyla.location;
1553 if (yyerrstatus_ == 3)
1554 {
1555 /* If just tried and failed to reuse lookahead token after an
1556 error, discard it. */
1557
1558 // Return failure if at end of input.
1559 if (yyla.kind () == symbol_kind::S_YYEOF)
1560 YYABORT;
1561 else if (!yyla.empty ())
1562 {
1563 yy_destroy_ ("Error: discarding", yyla);
1564 yyla.clear ();
1565 }
1566 }
1567
1568 // Else will try to reuse lookahead token after shifting the error token.
1569 goto yyerrlab1;
1570
1571
1572 /*---------------------------------------------------.
1573 | yyerrorlab -- error raised explicitly by YYERROR. |
1574 `---------------------------------------------------*/
1575 yyerrorlab:
1576 /* Pacify compilers when the user code never invokes YYERROR and
1577 the label yyerrorlab therefore never appears in user code. */
1578 if (false)
1579 YYERROR;
1580
1581 /* Do not reclaim the symbols of the rule whose action triggered
1582 this YYERROR. */
1583 yypop_ (yylen);
1584 yylen = 0;
1585 YY_STACK_PRINT ();
1586 goto yyerrlab1;
1587
1588
1589 /*-------------------------------------------------------------.
1590 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1591 `-------------------------------------------------------------*/
1592 yyerrlab1:
1593 yyerrstatus_ = 3; // Each real token shifted decrements this.
1594 // Pop stack until we find a state that shifts the error token.
1595 for (;;)
1596 {
1597 yyn = yypact_[+yystack_[0].state];
1598 if (!yy_pact_value_is_default_ (yyn))
1599 {
1601 if (0 <= yyn && yyn <= yylast_
1602 && yycheck_[yyn] == symbol_kind::S_YYerror)
1603 {
1604 yyn = yytable_[yyn];
1605 if (0 < yyn)
1606 break;
1607 }
1608 }
1609
1610 // Pop the current state because it cannot handle the error token.
1611 if (yystack_.size () == 1)
1612 YYABORT;
1613
1614 yyerror_range[1].location = yystack_[0].location;
1615 yy_destroy_ ("Error: popping", yystack_[0]);
1616 yypop_ ();
1617 YY_STACK_PRINT ();
1618 }
1619 {
1620 stack_symbol_type error_token;
1621
1622 yyerror_range[2].location = yyla.location;
1623 YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1624
1625 // Shift the error token.
1626 error_token.state = state_type (yyn);
1627 yypush_ ("Shifting", YY_MOVE (error_token));
1628 }
1629 goto yynewstate;
1630
1631
1632 /*-------------------------------------.
1633 | yyacceptlab -- YYACCEPT comes here. |
1634 `-------------------------------------*/
1635 yyacceptlab:
1636 yyresult = 0;
1637 goto yyreturn;
1638
1639
1640 /*-----------------------------------.
1641 | yyabortlab -- YYABORT comes here. |
1642 `-----------------------------------*/
1643 yyabortlab:
1644 yyresult = 1;
1645 goto yyreturn;
1646
1647
1648 /*-----------------------------------------------------.
1649 | yyreturn -- parsing is finished, return the result. |
1650 `-----------------------------------------------------*/
1651 yyreturn:
1652 if (!yyla.empty ())
1653 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1654
1655 /* Do not reclaim the symbols of the rule whose action triggered
1656 this YYABORT or YYACCEPT. */
1657 yypop_ (yylen);
1658 YY_STACK_PRINT ();
1659 while (1 < yystack_.size ())
1660 {
1661 yy_destroy_ ("Cleanup: popping", yystack_[0]);
1662 yypop_ ();
1663 }
1664
1665 return yyresult;
1666 }
1667#if YY_EXCEPTIONS
1668 catch (...)
1669 {
1670 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1671 // Do not try to display the values of the reclaimed symbols,
1672 // as their printers might throw an exception.
1673 if (!yyla.empty ())
1674 yy_destroy_ (YY_NULLPTR, yyla);
1675
1676 while (1 < yystack_.size ())
1677 {
1678 yy_destroy_ (YY_NULLPTR, yystack_[0]);
1679 yypop_ ();
1680 }
1681 throw;
1682 }
1683#endif // YY_EXCEPTIONS
1684 }
1685
1686 void
1688 {
1689 error (yyexc.location, yyexc.what ());
1690 }
1691
1692 /* Return YYSTR after stripping away unnecessary quotes and
1693 backslashes, so that it's suitable for yyerror. The heuristic is
1694 that double-quoting is unnecessary unless the string contains an
1695 apostrophe, a comma, or backslash (other than backslash-backslash).
1696 YYSTR is taken from yytname. */
1697 std::string
1698 NetconfParser::yytnamerr_ (const char *yystr)
1699 {
1700 if (*yystr == '"')
1701 {
1702 std::string yyr;
1703 char const *yyp = yystr;
1704
1705 for (;;)
1706 switch (*++yyp)
1707 {
1708 case '\'':
1709 case ',':
1710 goto do_not_strip_quotes;
1711
1712 case '\\':
1713 if (*++yyp != '\\')
1714 goto do_not_strip_quotes;
1715 else
1716 goto append;
1717
1718 append:
1719 default:
1720 yyr += *yyp;
1721 break;
1722
1723 case '"':
1724 return yyr;
1725 }
1726 do_not_strip_quotes: ;
1727 }
1728
1729 return yystr;
1730 }
1731
1732 std::string
1734 {
1735 return yytnamerr_ (yytname_[yysymbol]);
1736 }
1737
1738
1739
1740 // NetconfParser::context.
1742 : yyparser_ (yyparser)
1743 , yyla_ (yyla)
1744 {}
1745
1746 int
1748 {
1749 // Actual number of expected tokens
1750 int yycount = 0;
1751
1752 const int yyn = yypact_[+yyparser_.yystack_[0].state];
1753 if (!yy_pact_value_is_default_ (yyn))
1754 {
1755 /* Start YYX at -YYN if negative to avoid negative indexes in
1756 YYCHECK. In other words, skip the first -YYN actions for
1757 this state because they are default actions. */
1758 const int yyxbegin = yyn < 0 ? -yyn : 0;
1759 // Stay within bounds of both yycheck and yytname.
1760 const int yychecklim = yylast_ - yyn + 1;
1761 const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1762 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1763 if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
1764 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1765 {
1766 if (!yyarg)
1767 ++yycount;
1768 else if (yycount == yyargn)
1769 return 0;
1770 else
1771 yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
1772 }
1773 }
1774
1775 if (yyarg && yycount == 0 && 0 < yyargn)
1776 yyarg[0] = symbol_kind::S_YYEMPTY;
1777 return yycount;
1778 }
1779
1780
1781
1782
1783
1784
1785 int
1786 NetconfParser::yy_syntax_error_arguments_ (const context& yyctx,
1787 symbol_kind_type yyarg[], int yyargn) const
1788 {
1789 /* There are many possibilities here to consider:
1790 - If this state is a consistent state with a default action, then
1791 the only way this function was invoked is if the default action
1792 is an error action. In that case, don't check for expected
1793 tokens because there are none.
1794 - The only way there can be no lookahead present (in yyla) is
1795 if this state is a consistent state with a default action.
1796 Thus, detecting the absence of a lookahead is sufficient to
1797 determine that there is no unexpected or expected token to
1798 report. In that case, just report a simple "syntax error".
1799 - Don't assume there isn't a lookahead just because this state is
1800 a consistent state with a default action. There might have
1801 been a previous inconsistent state, consistent state with a
1802 non-default action, or user semantic action that manipulated
1803 yyla. (However, yyla is currently not documented for users.)
1804 - Of course, the expected token list depends on states to have
1805 correct lookahead information, and it depends on the parser not
1806 to perform extra reductions after fetching a lookahead from the
1807 scanner and before detecting a syntax error. Thus, state merging
1808 (from LALR or IELR) and default reductions corrupt the expected
1809 token list. However, the list is correct for canonical LR with
1810 one exception: it will still contain any token that will not be
1811 accepted due to an error action in a later state.
1812 */
1813
1814 if (!yyctx.lookahead ().empty ())
1815 {
1816 if (yyarg)
1817 yyarg[0] = yyctx.token ();
1818 int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1819 return yyn + 1;
1820 }
1821 return 0;
1822 }
1823
1824 // Generate an error message.
1825 std::string
1826 NetconfParser::yysyntax_error_ (const context& yyctx) const
1827 {
1828 // Its maximum.
1829 enum { YYARGS_MAX = 5 };
1830 // Arguments of yyformat.
1831 symbol_kind_type yyarg[YYARGS_MAX];
1832 int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
1833
1834 char const* yyformat = YY_NULLPTR;
1835 switch (yycount)
1836 {
1837#define YYCASE_(N, S) \
1838 case N: \
1839 yyformat = S; \
1840 break
1841 default: // Avoid compiler warnings.
1842 YYCASE_ (0, YY_("syntax error"));
1843 YYCASE_ (1, YY_("syntax error, unexpected %s"));
1844 YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
1845 YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1846 YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1847 YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1848#undef YYCASE_
1849 }
1850
1851 std::string yyres;
1852 // Argument number.
1853 std::ptrdiff_t yyi = 0;
1854 for (char const* yyp = yyformat; *yyp; ++yyp)
1855 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
1856 {
1857 yyres += symbol_name (yyarg[yyi++]);
1858 ++yyp;
1859 }
1860 else
1861 yyres += *yyp;
1862 return yyres;
1863 }
1864
1865
1866 const signed char NetconfParser::yypact_ninf_ = -77;
1867
1868 const signed char NetconfParser::yytable_ninf_ = -1;
1869
1870 const short
1871 NetconfParser::yypact_[] =
1872 {
1873 72, -77, -77, -77, 30, 12, 9, 35, -77, -77,
1874 -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
1875 -77, -77, -77, -77, 12, -2, 55, -1, -77, 63,
1876 74, 80, 71, 92, -77, 95, -77, -77, 104, 116,
1877 121, 122, -77, -77, 123, -77, 97, 125, -77, -77,
1878 -77, -77, -77, -77, -77, -77, -77, -77, 12, 12,
1879 -77, 84, 126, -77, 127, 128, 85, 86, 87, 129,
1880 133, 134, -77, -77, -1, -77, -77, 135, 138, 139,
1881 96, -77, -77, -77, -77, 142, 143, -77, 12, -1,
1882 -77, -77, -77, 16, 144, 145, -77, 132, -77, -77,
1883 -77, -77, -77, 141, 147, -77, -77, -77, -77, -77,
1884 -77, 148, 150, -77, -77, 75, -77, -77, 151, 152,
1885 153, 154, -77, 16, -4, -77, 144, 76, 145, -77,
1886 155, 156, 157, 158, -77, -77, -77, -77, 17, -77,
1887 -77, -77, -77, -77, -77, 162, -77, -77, -77, -77,
1888 21, -77, -77, -77, -77, -77, -77, 61, 61, 61,
1889 61, 163, 164, 23, -77, 165, 166, 113, 167, 76,
1890 -77, -77, -77, -77, -77, -77, -77, -77, -77, 29,
1891 -77, -77, -77, 42, 43, 77, 115, 139, -77, 130,
1892 168, -77, 131, -77, 170, 173, 61, -77, -77, -77,
1893 -77, -77, -77, -77, 171, -77, 136, 172, -77, -77,
1894 101, -77, -77, -5, 51, 171, -77, -77, -77, -77,
1895 -77, -77, -77, 90, -77, -77, -77, -77, -77, 176,
1896 178, 179, -77, 91, -77, -77, -77, -77, -77, -77,
1897 -77, 180, 181, 185, -5, -77, 186, 124, 146, 149,
1898 187, 51, -77, 93, 159, 160, -77, 161, -77, -77,
1899 -77, 169, -77, -77, -77, -77, -77, -77, -77, -77,
1900 -77
1901 };
1902
1903 const unsigned char
1904 NetconfParser::yydefact_[] =
1905 {
1906 0, 2, 4, 6, 0, 0, 0, 0, 1, 25,
1907 18, 15, 14, 11, 12, 13, 3, 10, 16, 17,
1908 32, 5, 8, 7, 27, 21, 0, 36, 29, 0,
1909 28, 0, 0, 22, 34, 0, 52, 54, 0, 0,
1910 0, 0, 56, 123, 0, 48, 0, 37, 38, 40,
1911 41, 42, 46, 47, 44, 43, 45, 26, 0, 0,
1912 19, 0, 0, 33, 0, 0, 0, 0, 0, 0,
1913 0, 0, 31, 9, 0, 30, 23, 0, 0, 0,
1914 0, 49, 50, 51, 73, 0, 0, 39, 0, 36,
1915 20, 53, 55, 75, 58, 0, 24, 0, 84, 86,
1916 88, 90, 83, 0, 76, 77, 79, 80, 81, 82,
1917 62, 0, 59, 60, 127, 0, 125, 35, 0, 0,
1918 0, 0, 74, 0, 0, 57, 0, 0, 0, 124,
1919 0, 0, 0, 0, 78, 69, 71, 66, 0, 64,
1920 67, 68, 61, 138, 143, 0, 141, 137, 135, 136,
1921 0, 129, 131, 133, 134, 132, 126, 0, 0, 0,
1922 0, 0, 0, 0, 63, 0, 0, 0, 0, 0,
1923 128, 102, 104, 101, 95, 96, 97, 99, 100, 0,
1924 92, 94, 98, 0, 0, 0, 0, 0, 65, 0,
1925 0, 140, 0, 130, 0, 0, 0, 85, 87, 89,
1926 91, 70, 72, 139, 0, 142, 0, 0, 93, 147,
1927 0, 145, 103, 0, 0, 0, 144, 114, 119, 121,
1928 113, 111, 112, 0, 106, 108, 109, 110, 156, 0,
1929 0, 0, 161, 0, 149, 151, 152, 153, 154, 155,
1930 146, 0, 0, 0, 0, 105, 0, 0, 0, 0,
1931 0, 0, 148, 0, 0, 0, 107, 0, 158, 159,
1932 160, 0, 150, 116, 117, 118, 115, 120, 122, 157,
1933 162
1934 };
1935
1936 const short
1937 NetconfParser::yypgoto_[] =
1938 {
1939 -77, -77, -77, -77, -77, -77, -77, -77, -20, -76,
1940 -77, 6, -77, -77, -77, -77, -77, -77, -27, -77,
1941 -77, -77, -77, 105, -77, 137, -22, -19, -18, -26,
1942 -77, -25, -77, -77, -77, -77, -77, 70, -77, -77,
1943 34, -77, -77, -77, -77, -77, -77, -77, -77, 38,
1944 -77, -77, -77, -77, -77, -77, -77, -77, -36, 2,
1945 -77, -77, -77, -77, -77, -45, -77, -77, -77, -77,
1946 -77, -77, -77, -77, -77, -77, 73, -77, -77, 31,
1947 -77, -77, -77, -77, -77, -77, -77, -77, -13, -77,
1948 -77, -48, -77, -77, -77, -77, -77, -77, -77
1949 };
1950
1951 const short
1952 NetconfParser::yydefgoto_[] =
1953 {
1954 0, 4, 5, 6, 7, 23, 27, 16, 17, 18,
1955 25, 91, 32, 33, 19, 24, 29, 30, 173, 21,
1956 26, 35, 62, 46, 47, 48, 174, 175, 176, 177,
1957 64, 178, 65, 54, 70, 111, 112, 113, 124, 138,
1958 139, 140, 161, 141, 162, 55, 93, 103, 104, 105,
1959 106, 118, 107, 119, 108, 120, 109, 121, 179, 180,
1960 181, 194, 182, 195, 223, 224, 225, 241, 266, 226,
1961 242, 227, 243, 56, 71, 115, 116, 127, 150, 151,
1962 152, 165, 153, 154, 168, 155, 166, 210, 211, 214,
1963 233, 234, 235, 246, 236, 237, 238, 239, 250
1964 };
1965
1966 const short
1967 NetconfParser::yytable_[] =
1968 {
1969 45, 52, 53, 90, 28, 49, 36, 37, 50, 51,
1970 36, 37, 38, 39, 40, 41, 20, 9, 217, 10,
1971 163, 11, 218, 219, 169, 164, 135, 136, 42, 170,
1972 8, 43, 196, 98, 99, 100, 101, 197, 75, 76,
1973 44, 44, 22, 31, 44, 196, 196, 45, 52, 53,
1974 198, 199, 49, 135, 136, 50, 51, 12, 13, 14,
1975 15, 44, 45, 52, 53, 34, 102, 49, 96, 57,
1976 50, 51, 36, 37, 38, 39, 40, 58, 128, 60,
1977 196, 129, 171, 172, 59, 200, 228, 36, 37, 229,
1978 230, 231, 232, 244, 251, 61, 102, 137, 245, 252,
1979 147, 148, 149, 63, 215, 73, 44, 216, 66, 143,
1980 144, 90, 145, 146, 1, 2, 3, 263, 264, 265,
1981 67, 44, 183, 184, 185, 68, 69, 72, 74, 77,
1982 78, 79, 80, 81, 82, 83, 84, 85, 86, 88,
1983 117, 92, 147, 148, 149, 89, 10, 94, 95, 122,
1984 123, 110, 114, 126, 125, 130, 131, 132, 133, 191,
1985 201, 134, 157, 158, 159, 160, 167, 186, 187, 189,
1986 190, 192, 258, 204, 206, 203, 205, 207, 209, 213,
1987 247, 212, 248, 249, 253, 254, 220, 221, 222, 255,
1988 257, 261, 259, 202, 97, 260, 142, 188, 208, 256,
1989 193, 156, 240, 262, 267, 268, 269, 0, 0, 0,
1990 0, 87, 0, 0, 270, 0, 0, 220, 221, 222
1991 };
1992
1993 const short
1994 NetconfParser::yycheck_[] =
1995 {
1996 27, 27, 27, 79, 24, 27, 11, 12, 27, 27,
1997 11, 12, 13, 14, 15, 16, 7, 5, 23, 7,
1998 3, 9, 27, 28, 3, 8, 30, 31, 29, 8,
1999 0, 32, 3, 17, 18, 19, 20, 8, 58, 59,
2000 45, 45, 7, 45, 45, 3, 3, 74, 74, 74,
2001 8, 8, 74, 30, 31, 74, 74, 45, 46, 47,
2002 48, 45, 89, 89, 89, 10, 93, 89, 88, 6,
2003 89, 89, 11, 12, 13, 14, 15, 3, 3, 8,
2004 3, 6, 21, 22, 4, 8, 35, 11, 12, 38,
2005 39, 40, 41, 3, 3, 3, 123, 124, 8, 8,
2006 127, 127, 127, 8, 3, 8, 45, 6, 4, 33,
2007 34, 187, 36, 37, 42, 43, 44, 24, 25, 26,
2008 4, 45, 158, 159, 160, 4, 4, 4, 3, 45,
2009 4, 4, 4, 48, 48, 48, 7, 4, 4, 4,
2010 8, 45, 169, 169, 169, 7, 7, 5, 5, 8,
2011 3, 7, 7, 3, 6, 4, 4, 4, 4, 46,
2012 45, 123, 7, 7, 7, 7, 4, 4, 4, 4,
2013 4, 4, 48, 5, 4, 45, 45, 4, 7, 7,
2014 4, 45, 4, 4, 4, 4, 213, 213, 213, 4,
2015 4, 4, 46, 187, 89, 46, 126, 163, 196, 244,
2016 169, 128, 215, 251, 45, 45, 45, -1, -1, -1,
2017 -1, 74, -1, -1, 45, -1, -1, 244, 244, 244
2018 };
2019
2020 const unsigned char
2021 NetconfParser::yystos_[] =
2022 {
2023 0, 42, 43, 44, 50, 51, 52, 53, 0, 5,
2024 7, 9, 45, 46, 47, 48, 56, 57, 58, 63,
2025 7, 68, 7, 54, 64, 59, 69, 55, 57, 65,
2026 66, 45, 61, 62, 10, 70, 11, 12, 13, 14,
2027 15, 16, 29, 32, 45, 67, 72, 73, 74, 75,
2028 76, 77, 78, 80, 82, 94, 122, 6, 3, 4,
2029 8, 3, 71, 8, 79, 81, 4, 4, 4, 4,
2030 83, 123, 4, 8, 3, 57, 57, 45, 4, 4,
2031 4, 48, 48, 48, 7, 4, 4, 74, 4, 7,
2032 58, 60, 45, 95, 5, 5, 57, 72, 17, 18,
2033 19, 20, 67, 96, 97, 98, 99, 101, 103, 105,
2034 7, 84, 85, 86, 7, 124, 125, 8, 100, 102,
2035 104, 106, 8, 3, 87, 6, 3, 126, 3, 6,
2036 4, 4, 4, 4, 98, 30, 31, 67, 88, 89,
2037 90, 92, 86, 33, 34, 36, 37, 67, 78, 80,
2038 127, 128, 129, 131, 132, 134, 125, 7, 7, 7,
2039 7, 91, 93, 3, 8, 130, 135, 4, 133, 3,
2040 8, 21, 22, 67, 75, 76, 77, 78, 80, 107,
2041 108, 109, 111, 107, 107, 107, 4, 4, 89, 4,
2042 4, 46, 4, 128, 110, 112, 3, 8, 8, 8,
2043 8, 45, 60, 45, 5, 45, 4, 4, 108, 7,
2044 136, 137, 45, 7, 138, 3, 6, 23, 27, 28,
2045 67, 78, 80, 113, 114, 115, 118, 120, 35, 38,
2046 39, 40, 41, 139, 140, 141, 143, 144, 145, 146,
2047 137, 116, 119, 121, 3, 8, 142, 4, 4, 4,
2048 147, 3, 8, 4, 4, 4, 114, 4, 48, 46,
2049 46, 4, 140, 24, 25, 26, 117, 45, 45, 45,
2050 45
2051 };
2052
2053 const unsigned char
2054 NetconfParser::yyr1_[] =
2055 {
2056 0, 49, 51, 50, 52, 50, 53, 50, 55, 54,
2057 56, 57, 57, 57, 57, 57, 57, 57, 59, 58,
2058 60, 61, 61, 62, 62, 64, 63, 65, 65, 66,
2059 66, 67, 69, 68, 71, 70, 72, 72, 73, 73,
2060 74, 74, 74, 74, 74, 74, 74, 74, 74, 75,
2061 76, 77, 79, 78, 81, 80, 83, 82, 84, 84,
2062 85, 85, 87, 86, 88, 88, 88, 89, 89, 91,
2063 90, 93, 92, 95, 94, 96, 96, 97, 97, 98,
2064 98, 98, 98, 98, 100, 99, 102, 101, 104, 103,
2065 106, 105, 107, 107, 108, 108, 108, 108, 108, 108,
2066 108, 108, 110, 109, 112, 111, 113, 113, 114, 114,
2067 114, 114, 114, 114, 116, 115, 117, 117, 117, 119,
2068 118, 121, 120, 123, 122, 124, 124, 126, 125, 127,
2069 127, 128, 128, 128, 128, 128, 128, 128, 130, 129,
2070 131, 133, 132, 135, 134, 136, 136, 138, 137, 139,
2071 139, 140, 140, 140, 140, 140, 142, 141, 143, 144,
2072 145, 147, 146
2073 };
2074
2075 const signed char
2076 NetconfParser::yyr2_[] =
2077 {
2078 0, 2, 0, 3, 0, 3, 0, 3, 0, 4,
2079 1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
2080 1, 0, 1, 3, 5, 0, 4, 0, 1, 1,
2081 3, 2, 0, 4, 0, 6, 0, 1, 1, 3,
2082 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2083 3, 3, 0, 4, 0, 4, 0, 6, 0, 1,
2084 1, 3, 0, 4, 1, 3, 1, 1, 1, 0,
2085 4, 0, 4, 0, 6, 0, 1, 1, 3, 1,
2086 1, 1, 1, 1, 0, 6, 0, 6, 0, 6,
2087 0, 6, 1, 3, 1, 1, 1, 1, 1, 1,
2088 1, 1, 0, 4, 0, 6, 1, 3, 1, 1,
2089 1, 1, 1, 1, 0, 4, 1, 1, 1, 0,
2090 4, 0, 4, 0, 6, 1, 3, 0, 4, 1,
2091 3, 1, 1, 1, 1, 1, 1, 1, 0, 4,
2092 3, 0, 4, 0, 6, 1, 3, 0, 4, 1,
2093 3, 1, 1, 1, 1, 1, 0, 4, 3, 3,
2094 3, 0, 4
2095 };
2096
2097
2098#if NETCONF_DEBUG || 1
2099 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2100 // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
2101 const char*
2102 const NetconfParser::yytname_[] =
2103 {
2104 "\"end of file\"", "error", "\"invalid token\"", "\",\"", "\":\"",
2105 "\"[\"", "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Netconf\"",
2106 "\"user-context\"", "\"comment\"", "\"boot-update\"",
2107 "\"subscribe-changes\"", "\"validate-changes\"", "\"managed-servers\"",
2108 "\"dhcp4\"", "\"dhcp6\"", "\"d2\"", "\"ca\"", "\"model\"",
2109 "\"control-socket\"", "\"socket-type\"", "\"unix\"", "\"http\"",
2110 "\"stdout\"", "\"socket-name\"", "\"socket-url\"", "\"hooks-libraries\"",
2111 "\"library\"", "\"parameters\"", "\"loggers\"", "\"name\"",
2112 "\"output_options\"", "\"output\"", "\"debuglevel\"", "\"severity\"",
2113 "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"", "START_JSON",
2114 "START_NETCONF", "START_SUB_NETCONF", "\"constant string\"",
2115 "\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
2116 "$@1", "$@2", "$@3", "sub_netconf", "$@4", "json", "value", "map", "$@5",
2117 "map_value", "map_content", "not_empty_map", "list_generic", "$@6",
2118 "list_content", "not_empty_list", "unknown_map_entry",
2119 "netconf_syntax_map", "$@7", "global_object", "$@8", "global_params",
2120 "not_empty_global_params", "global_param", "boot_update",
2121 "subscribe_changes", "validate_changes", "user_context", "$@9",
2122 "comment", "$@10", "hooks_libraries", "$@11", "hooks_libraries_list",
2123 "not_empty_hooks_libraries_list", "hooks_library", "$@12",
2124 "hooks_params", "hooks_param", "library", "$@13", "parameters", "$@14",
2125 "managed_servers", "$@15", "servers_entries",
2126 "not_empty_servers_entries", "server_entry", "dhcp4_server", "$@16",
2127 "dhcp6_server", "$@17", "d2_server", "$@18", "ca_server", "$@19",
2128 "managed_server_params", "managed_server_param", "model", "$@20",
2129 "control_socket", "$@21", "control_socket_params",
2130 "control_socket_param", "socket_type", "$@22", "socket_type_value",
2131 "socket_name", "$@23", "socket_url", "$@24", "loggers", "$@25",
2132 "loggers_entries", "logger_entry", "$@26", "logger_params",
2133 "logger_param", "name", "$@27", "debuglevel", "severity", "$@28",
2134 "output_options_list", "$@29", "output_options_list_content",
2135 "output_entry", "$@30", "output_params_list", "output_params", "output",
2136 "$@31", "flush", "maxsize", "maxver", "pattern", "$@32", YY_NULLPTR
2137 };
2138#endif
2139
2140
2141#if NETCONF_DEBUG
2142 const short
2143 NetconfParser::yyrline_[] =
2144 {
2145 0, 118, 118, 118, 119, 119, 120, 120, 128, 128,
2146 139, 145, 146, 147, 148, 149, 150, 151, 155, 155,
2147 166, 171, 172, 180, 185, 193, 193, 199, 200, 203,
2148 207, 220, 228, 228, 240, 240, 260, 261, 264, 265,
2149 270, 271, 272, 273, 274, 275, 276, 277, 278, 281,
2150 287, 293, 299, 299, 324, 324, 352, 352, 363, 364,
2151 367, 368, 371, 371, 379, 380, 381, 384, 385, 388,
2152 388, 397, 397, 408, 408, 419, 420, 423, 424, 430,
2153 431, 432, 433, 434, 438, 438, 450, 450, 462, 462,
2154 474, 474, 486, 487, 491, 492, 493, 494, 495, 496,
2155 497, 498, 502, 502, 512, 512, 524, 525, 528, 529,
2156 530, 531, 532, 533, 536, 536, 545, 546, 547, 550,
2157 550, 560, 560, 573, 573, 586, 587, 591, 591, 599,
2158 600, 603, 604, 605, 606, 607, 608, 609, 612, 612,
2159 621, 627, 627, 636, 636, 647, 648, 651, 651, 659,
2160 660, 663, 664, 665, 666, 667, 670, 670, 679, 685,
2161 691, 697, 697
2162 };
2163
2164 void
2165 NetconfParser::yy_stack_print_ () const
2166 {
2167 *yycdebug_ << "Stack now";
2168 for (stack_type::const_iterator
2169 i = yystack_.begin (),
2170 i_end = yystack_.end ();
2171 i != i_end; ++i)
2172 *yycdebug_ << ' ' << int (i->state);
2173 *yycdebug_ << '\n';
2174 }
2175
2176 void
2177 NetconfParser::yy_reduce_print_ (int yyrule) const
2178 {
2179 int yylno = yyrline_[yyrule];
2180 int yynrhs = yyr2_[yyrule];
2181 // Print the symbols being reduced, and their result.
2182 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
2183 << " (line " << yylno << "):\n";
2184 // The symbols being reduced.
2185 for (int yyi = 0; yyi < yynrhs; yyi++)
2186 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
2187 yystack_[(yynrhs) - (yyi + 1)]);
2188 }
2189#endif // NETCONF_DEBUG
2190
2191
2192#line 14 "netconf_parser.yy"
2193} } // isc::netconf
2194#line 2195 "netconf_parser.cc"
2195
2196#line 706 "netconf_parser.yy"
2197
2198
2199void
2201 const std::string& what)
2202{
2203 ctx.error(loc, what);
2204}
#define YY_RVREF(Type)
Definition: agent_parser.h:85
#define YY_CAST(Type, Val)
Definition: agent_parser.h:177
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:84
#define YY_NOEXCEPT
Definition: agent_parser.h:94
#define YY_MOVE
Definition: agent_parser.h:82
#define YY_NOTHROW
Definition: agent_parser.h:95
#define YY_USE(E)
Definition: agent_parser.h:130
Notes: IntElement type is changed to int64_t.
Definition: data.h:588
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.
symbol_kind_type token() const YY_NOEXCEPT
context(const NetconfParser &yyparser, const symbol_type &yyla)
const symbol_type & lookahead() const YY_NOEXCEPT
Present a slice of the top of a stack.
virtual int parse()
Parse.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
NetconfParser(isc::netconf::ParserContext &ctx_yyarg)
Build a parser object.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
int debug_level_type
Type for debugging levels.
static const symbol_kind_type YYNTOKENS
The number of tokens.
location location_type
Symbol locations.
void set_debug_level(debug_level_type l)
Set the current debugging level.
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
Parser context is a wrapper around flex/bison instances dedicated to Netconf-agent config file parser...
LexerContext ctx_
Current syntactic context.
const std::string contextName()
Get the syntactic context name.
void unique(const std::string &name, isc::data::Element::Position loc)
Check if a parameter is already present.
isc::data::Element::Position loc2pos(isc::netconf::location &loc)
Converts bison's position to one understandable by isc::data::Element.
void enter(const LexerContext &ctx)
Enter a new syntactic context.
@ NO_KEYWORDS
This one is used in pure JSON mode.
@ HOOKS_LIBRARIES
Used while parsing Netconf/loggers structures.
@ CONFIG
Used while parsing content of Netconf.
@ MANAGED_SERVERS
Used while parsing Netconf/managed-servers.
@ SERVER
Used while parsing Netconf/manages-servers/*‍/control-socket.
@ LOGGERS
Used while parsing Netconf/loggers/output_options structures.
@ SOCKET_TYPE
Used while parsing Netconf/hooks-libraries.
@ CONTROL_SOCKET
Used while parsing Netconf/managed-servers/*‍/control-socket/socket-type.
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
void leave()
Leave a syntactic context.
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1134
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
Defines the logger used by the top-level component of kea-lfc.
#define YYCDEBUG
#define YYABORT
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_REDUCE_PRINT(Rule)
#define YY_SYMBOL_PRINT(Title, Symbol)
#define yylex
#define YYCASE_(N, S)
#define YY_STACK_PRINT()
#define YY_(msgid)
#define YYACCEPT
#define YYERROR
Define the isc::netconf::parser class.
bool empty() const YY_NOEXCEPT
Whether empty.
void move(basic_symbol &s)
Destructive move, s is emptied into this.
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
"External" symbols: returned by the scanner.
Syntax errors thrown from user actions.