Kea 2.2.0
netconf_parser.h
Go to the documentation of this file.
1// A Bison parser, made by GNU Bison 3.8.2.
2
3// Skeleton interface 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
39// C++ LALR(1) parser skeleton written by Akim Demaille.
40
41// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
42// especially those whose name start with YY_ or yy_. They are
43// private implementation details that can be changed or removed.
44
45#ifndef YY_NETCONF_NETCONF_PARSER_H_INCLUDED
46# define YY_NETCONF_NETCONF_PARSER_H_INCLUDED
47// "%code requires" blocks.
48#line 17 "netconf_parser.yy"
49
50#include <string>
51#include <cc/data.h>
52#include <boost/lexical_cast.hpp>
54
55using namespace isc::netconf;
56using namespace isc::data;
57using namespace std;
58
59#line 60 "netconf_parser.h"
60
61# include <cassert>
62# include <cstdlib> // std::abort
63# include <iostream>
64# include <stdexcept>
65# include <string>
66# include <vector>
67
68#if defined __cplusplus
69# define YY_CPLUSPLUS __cplusplus
70#else
71# define YY_CPLUSPLUS 199711L
72#endif
73
74// Support move semantics when possible.
75#if 201103L <= YY_CPLUSPLUS
76# define YY_MOVE std::move
77# define YY_MOVE_OR_COPY move
78# define YY_MOVE_REF(Type) Type&&
79# define YY_RVREF(Type) Type&&
80# define YY_COPY(Type) Type
81#else
82# define YY_MOVE
83# define YY_MOVE_OR_COPY copy
84# define YY_MOVE_REF(Type) Type&
85# define YY_RVREF(Type) const Type&
86# define YY_COPY(Type) const Type&
87#endif
88
89// Support noexcept when possible.
90#if 201103L <= YY_CPLUSPLUS
91# define YY_NOEXCEPT noexcept
92# define YY_NOTHROW
93#else
94# define YY_NOEXCEPT
95# define YY_NOTHROW throw ()
96#endif
97
98// Support constexpr when possible.
99#if 201703 <= YY_CPLUSPLUS
100# define YY_CONSTEXPR constexpr
101#else
102# define YY_CONSTEXPR
103#endif
104# include "location.hh"
105#include <typeinfo>
106#ifndef NETCONF__ASSERT
107# include <cassert>
108# define NETCONF__ASSERT assert
109#endif
110
111
112#ifndef YY_ATTRIBUTE_PURE
113# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
114# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
115# else
116# define YY_ATTRIBUTE_PURE
117# endif
118#endif
119
120#ifndef YY_ATTRIBUTE_UNUSED
121# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
122# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
123# else
124# define YY_ATTRIBUTE_UNUSED
125# endif
126#endif
127
128/* Suppress unused-variable warnings by "using" E. */
129#if ! defined lint || defined __GNUC__
130# define YY_USE(E) ((void) (E))
131#else
132# define YY_USE(E) /* empty */
133#endif
134
135/* Suppress an incorrect diagnostic about yylval being uninitialized. */
136#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
137# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
138# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
139 _Pragma ("GCC diagnostic push") \
140 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
141# else
142# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
143 _Pragma ("GCC diagnostic push") \
144 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
145 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
146# endif
147# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
148 _Pragma ("GCC diagnostic pop")
149#else
150# define YY_INITIAL_VALUE(Value) Value
151#endif
152#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
153# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
154# define YY_IGNORE_MAYBE_UNINITIALIZED_END
155#endif
156#ifndef YY_INITIAL_VALUE
157# define YY_INITIAL_VALUE(Value) /* Nothing. */
158#endif
159
160#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
161# define YY_IGNORE_USELESS_CAST_BEGIN \
162 _Pragma ("GCC diagnostic push") \
163 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
164# define YY_IGNORE_USELESS_CAST_END \
165 _Pragma ("GCC diagnostic pop")
166#endif
167#ifndef YY_IGNORE_USELESS_CAST_BEGIN
168# define YY_IGNORE_USELESS_CAST_BEGIN
169# define YY_IGNORE_USELESS_CAST_END
170#endif
171
172# ifndef YY_CAST
173# ifdef __cplusplus
174# define YY_CAST(Type, Val) static_cast<Type> (Val)
175# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
176# else
177# define YY_CAST(Type, Val) ((Type) (Val))
178# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
179# endif
180# endif
181# ifndef YY_NULLPTR
182# if defined __cplusplus
183# if 201103L <= __cplusplus
184# define YY_NULLPTR nullptr
185# else
186# define YY_NULLPTR 0
187# endif
188# else
189# define YY_NULLPTR ((void*)0)
190# endif
191# endif
192
193/* Debug traces. */
194#ifndef NETCONF_DEBUG
195# if defined YYDEBUG
196#if YYDEBUG
197# define NETCONF_DEBUG 1
198# else
199# define NETCONF_DEBUG 0
200# endif
201# else /* ! defined YYDEBUG */
202# define NETCONF_DEBUG 1
203# endif /* ! defined YYDEBUG */
204#endif /* ! defined NETCONF_DEBUG */
205
206#line 14 "netconf_parser.yy"
207namespace isc { namespace netconf {
208#line 209 "netconf_parser.h"
209
210
211
212
215 {
216 public:
217#ifdef NETCONF_STYPE
218# ifdef __GNUC__
219# pragma GCC message "bison: do not #define NETCONF_STYPE in C++, use %define api.value.type"
220# endif
221 typedef NETCONF_STYPE value_type;
222#else
229 {
230 public:
233
236 : yyraw_ ()
237 , yytypeid_ (YY_NULLPTR)
238 {}
239
241 template <typename T>
243 : yytypeid_ (&typeid (T))
244 {
245 NETCONF__ASSERT (sizeof (T) <= size);
246 new (yyas_<T> ()) T (YY_MOVE (t));
247 }
248
249#if 201103L <= YY_CPLUSPLUS
251 value_type (const self_type&) = delete;
253 self_type& operator= (const self_type&) = delete;
254#endif
255
258 {
259 NETCONF__ASSERT (!yytypeid_);
260 }
261
262# if 201103L <= YY_CPLUSPLUS
264 template <typename T, typename... U>
265 T&
266 emplace (U&&... u)
267 {
268 NETCONF__ASSERT (!yytypeid_);
269 NETCONF__ASSERT (sizeof (T) <= size);
270 yytypeid_ = & typeid (T);
271 return *new (yyas_<T> ()) T (std::forward <U>(u)...);
272 }
273# else
275 template <typename T>
276 T&
278 {
279 NETCONF__ASSERT (!yytypeid_);
280 NETCONF__ASSERT (sizeof (T) <= size);
281 yytypeid_ = & typeid (T);
282 return *new (yyas_<T> ()) T ();
283 }
284
286 template <typename T>
287 T&
288 emplace (const T& t)
289 {
290 NETCONF__ASSERT (!yytypeid_);
291 NETCONF__ASSERT (sizeof (T) <= size);
292 yytypeid_ = & typeid (T);
293 return *new (yyas_<T> ()) T (t);
294 }
295# endif
296
299 template <typename T>
300 T&
302 {
303 return emplace<T> ();
304 }
305
308 template <typename T>
309 T&
310 build (const T& t)
311 {
312 return emplace<T> (t);
313 }
314
316 template <typename T>
317 T&
319 {
320 NETCONF__ASSERT (yytypeid_);
321 NETCONF__ASSERT (*yytypeid_ == typeid (T));
322 NETCONF__ASSERT (sizeof (T) <= size);
323 return *yyas_<T> ();
324 }
325
327 template <typename T>
328 const T&
330 {
331 NETCONF__ASSERT (yytypeid_);
332 NETCONF__ASSERT (*yytypeid_ == typeid (T));
333 NETCONF__ASSERT (sizeof (T) <= size);
334 return *yyas_<T> ();
335 }
336
345 template <typename T>
346 void
348 {
349 NETCONF__ASSERT (yytypeid_);
350 NETCONF__ASSERT (*yytypeid_ == *that.yytypeid_);
351 std::swap (as<T> (), that.as<T> ());
352 }
353
357 template <typename T>
358 void
360 {
361# if 201103L <= YY_CPLUSPLUS
362 emplace<T> (std::move (that.as<T> ()));
363# else
364 emplace<T> ();
365 swap<T> (that);
366# endif
367 that.destroy<T> ();
368 }
369
370# if 201103L <= YY_CPLUSPLUS
372 template <typename T>
373 void
374 move (self_type&& that)
375 {
376 emplace<T> (std::move (that.as<T> ()));
377 that.destroy<T> ();
378 }
379#endif
380
382 template <typename T>
383 void
384 copy (const self_type& that)
385 {
386 emplace<T> (that.as<T> ());
387 }
388
390 template <typename T>
391 void
393 {
394 as<T> ().~T ();
395 yytypeid_ = YY_NULLPTR;
396 }
397
398 private:
399#if YY_CPLUSPLUS < 201103L
401 value_type (const self_type&);
403 self_type& operator= (const self_type&);
404#endif
405
407 template <typename T>
408 T*
409 yyas_ () YY_NOEXCEPT
410 {
411 void *yyp = yyraw_;
412 return static_cast<T*> (yyp);
413 }
414
416 template <typename T>
417 const T*
418 yyas_ () const YY_NOEXCEPT
419 {
420 const void *yyp = yyraw_;
421 return static_cast<const T*> (yyp);
422 }
423
425 union union_type
426 {
427 // value
428 // map_value
429 // socket_type_value
430 char dummy1[sizeof (ElementPtr)];
431
432 // "boolean"
433 char dummy2[sizeof (bool)];
434
435 // "floating point"
436 char dummy3[sizeof (double)];
437
438 // "integer"
439 char dummy4[sizeof (int64_t)];
440
441 // "constant string"
442 char dummy5[sizeof (std::string)];
443 };
444
446 enum { size = sizeof (union_type) };
447
449 union
450 {
452 long double yyalign_me_;
454 char yyraw_[size];
455 };
456
458 const std::type_info *yytypeid_;
459 };
460
461#endif
464
466 typedef location location_type;
467
469 struct syntax_error : std::runtime_error
470 {
471 syntax_error (const location_type& l, const std::string& m)
472 : std::runtime_error (m)
473 , location (l)
474 {}
475
477 : std::runtime_error (s.what ())
478 , location (s.location)
479 {}
480
482
484 };
485
487 struct token
488 {
490 {
491 TOKEN_NETCONF_EMPTY = -2,
492 TOKEN_END = 0, // "end of file"
493 TOKEN_NETCONF_error = 256, // error
494 TOKEN_NETCONF_UNDEF = 257, // "invalid token"
495 TOKEN_COMMA = 258, // ","
496 TOKEN_COLON = 259, // ":"
497 TOKEN_LSQUARE_BRACKET = 260, // "["
498 TOKEN_RSQUARE_BRACKET = 261, // "]"
499 TOKEN_LCURLY_BRACKET = 262, // "{"
500 TOKEN_RCURLY_BRACKET = 263, // "}"
501 TOKEN_NULL_TYPE = 264, // "null"
502 TOKEN_NETCONF = 265, // "Netconf"
503 TOKEN_USER_CONTEXT = 266, // "user-context"
504 TOKEN_COMMENT = 267, // "comment"
505 TOKEN_BOOT_UPDATE = 268, // "boot-update"
506 TOKEN_SUBSCRIBE_CHANGES = 269, // "subscribe-changes"
507 TOKEN_VALIDATE_CHANGES = 270, // "validate-changes"
508 TOKEN_MANAGED_SERVERS = 271, // "managed-servers"
509 TOKEN_DHCP4_SERVER = 272, // "dhcp4"
510 TOKEN_DHCP6_SERVER = 273, // "dhcp6"
511 TOKEN_D2_SERVER = 274, // "d2"
512 TOKEN_CA_SERVER = 275, // "ca"
513 TOKEN_MODEL = 276, // "model"
514 TOKEN_CONTROL_SOCKET = 277, // "control-socket"
515 TOKEN_SOCKET_TYPE = 278, // "socket-type"
516 TOKEN_UNIX = 279, // "unix"
517 TOKEN_HTTP = 280, // "http"
518 TOKEN_STDOUT = 281, // "stdout"
519 TOKEN_SOCKET_NAME = 282, // "socket-name"
520 TOKEN_SOCKET_URL = 283, // "socket-url"
521 TOKEN_HOOKS_LIBRARIES = 284, // "hooks-libraries"
522 TOKEN_LIBRARY = 285, // "library"
523 TOKEN_PARAMETERS = 286, // "parameters"
524 TOKEN_LOGGERS = 287, // "loggers"
525 TOKEN_NAME = 288, // "name"
526 TOKEN_OUTPUT_OPTIONS = 289, // "output_options"
527 TOKEN_OUTPUT = 290, // "output"
528 TOKEN_DEBUGLEVEL = 291, // "debuglevel"
529 TOKEN_SEVERITY = 292, // "severity"
530 TOKEN_FLUSH = 293, // "flush"
531 TOKEN_MAXSIZE = 294, // "maxsize"
532 TOKEN_MAXVER = 295, // "maxver"
533 TOKEN_PATTERN = 296, // "pattern"
534 TOKEN_START_JSON = 297, // START_JSON
535 TOKEN_START_NETCONF = 298, // START_NETCONF
536 TOKEN_START_SUB_NETCONF = 299, // START_SUB_NETCONF
537 TOKEN_STRING = 300, // "constant string"
538 TOKEN_INTEGER = 301, // "integer"
539 TOKEN_FLOAT = 302, // "floating point"
540 TOKEN_BOOLEAN = 303 // "boolean"
541 };
544 };
545
548
551
554 {
556 {
558 S_YYEMPTY = -2,
559 S_YYEOF = 0, // "end of file"
560 S_YYerror = 1, // error
561 S_YYUNDEF = 2, // "invalid token"
562 S_COMMA = 3, // ","
563 S_COLON = 4, // ":"
564 S_LSQUARE_BRACKET = 5, // "["
565 S_RSQUARE_BRACKET = 6, // "]"
566 S_LCURLY_BRACKET = 7, // "{"
567 S_RCURLY_BRACKET = 8, // "}"
568 S_NULL_TYPE = 9, // "null"
569 S_NETCONF = 10, // "Netconf"
570 S_USER_CONTEXT = 11, // "user-context"
571 S_COMMENT = 12, // "comment"
572 S_BOOT_UPDATE = 13, // "boot-update"
573 S_SUBSCRIBE_CHANGES = 14, // "subscribe-changes"
574 S_VALIDATE_CHANGES = 15, // "validate-changes"
575 S_MANAGED_SERVERS = 16, // "managed-servers"
576 S_DHCP4_SERVER = 17, // "dhcp4"
577 S_DHCP6_SERVER = 18, // "dhcp6"
578 S_D2_SERVER = 19, // "d2"
579 S_CA_SERVER = 20, // "ca"
580 S_MODEL = 21, // "model"
581 S_CONTROL_SOCKET = 22, // "control-socket"
582 S_SOCKET_TYPE = 23, // "socket-type"
583 S_UNIX = 24, // "unix"
584 S_HTTP = 25, // "http"
585 S_STDOUT = 26, // "stdout"
586 S_SOCKET_NAME = 27, // "socket-name"
587 S_SOCKET_URL = 28, // "socket-url"
588 S_HOOKS_LIBRARIES = 29, // "hooks-libraries"
589 S_LIBRARY = 30, // "library"
590 S_PARAMETERS = 31, // "parameters"
591 S_LOGGERS = 32, // "loggers"
592 S_NAME = 33, // "name"
593 S_OUTPUT_OPTIONS = 34, // "output_options"
594 S_OUTPUT = 35, // "output"
595 S_DEBUGLEVEL = 36, // "debuglevel"
596 S_SEVERITY = 37, // "severity"
597 S_FLUSH = 38, // "flush"
598 S_MAXSIZE = 39, // "maxsize"
599 S_MAXVER = 40, // "maxver"
600 S_PATTERN = 41, // "pattern"
601 S_START_JSON = 42, // START_JSON
602 S_START_NETCONF = 43, // START_NETCONF
603 S_START_SUB_NETCONF = 44, // START_SUB_NETCONF
604 S_STRING = 45, // "constant string"
605 S_INTEGER = 46, // "integer"
606 S_FLOAT = 47, // "floating point"
607 S_BOOLEAN = 48, // "boolean"
608 S_YYACCEPT = 49, // $accept
609 S_start = 50, // start
610 S_51_1 = 51, // $@1
611 S_52_2 = 52, // $@2
612 S_53_3 = 53, // $@3
613 S_sub_netconf = 54, // sub_netconf
614 S_55_4 = 55, // $@4
615 S_json = 56, // json
616 S_value = 57, // value
617 S_map = 58, // map
618 S_59_5 = 59, // $@5
619 S_map_value = 60, // map_value
620 S_map_content = 61, // map_content
621 S_not_empty_map = 62, // not_empty_map
622 S_list_generic = 63, // list_generic
623 S_64_6 = 64, // $@6
624 S_list_content = 65, // list_content
625 S_not_empty_list = 66, // not_empty_list
626 S_unknown_map_entry = 67, // unknown_map_entry
627 S_netconf_syntax_map = 68, // netconf_syntax_map
628 S_69_7 = 69, // $@7
629 S_global_object = 70, // global_object
630 S_71_8 = 71, // $@8
631 S_global_object_comma = 72, // global_object_comma
632 S_global_params = 73, // global_params
633 S_not_empty_global_params = 74, // not_empty_global_params
634 S_global_param = 75, // global_param
635 S_boot_update = 76, // boot_update
636 S_subscribe_changes = 77, // subscribe_changes
637 S_validate_changes = 78, // validate_changes
638 S_user_context = 79, // user_context
639 S_80_9 = 80, // $@9
640 S_comment = 81, // comment
641 S_82_10 = 82, // $@10
642 S_hooks_libraries = 83, // hooks_libraries
643 S_84_11 = 84, // $@11
644 S_hooks_libraries_list = 85, // hooks_libraries_list
645 S_not_empty_hooks_libraries_list = 86, // not_empty_hooks_libraries_list
646 S_hooks_library = 87, // hooks_library
647 S_88_12 = 88, // $@12
648 S_hooks_params = 89, // hooks_params
649 S_hooks_param = 90, // hooks_param
650 S_library = 91, // library
651 S_92_13 = 92, // $@13
652 S_parameters = 93, // parameters
653 S_94_14 = 94, // $@14
654 S_managed_servers = 95, // managed_servers
655 S_96_15 = 96, // $@15
656 S_servers_entries = 97, // servers_entries
657 S_not_empty_servers_entries = 98, // not_empty_servers_entries
658 S_server_entry = 99, // server_entry
659 S_dhcp4_server = 100, // dhcp4_server
660 S_101_16 = 101, // $@16
661 S_dhcp6_server = 102, // dhcp6_server
662 S_103_17 = 103, // $@17
663 S_d2_server = 104, // d2_server
664 S_105_18 = 105, // $@18
665 S_ca_server = 106, // ca_server
666 S_107_19 = 107, // $@19
667 S_managed_server_params = 108, // managed_server_params
668 S_managed_server_param = 109, // managed_server_param
669 S_model = 110, // model
670 S_111_20 = 111, // $@20
671 S_control_socket = 112, // control_socket
672 S_113_21 = 113, // $@21
673 S_control_socket_params = 114, // control_socket_params
674 S_control_socket_param = 115, // control_socket_param
675 S_socket_type = 116, // socket_type
676 S_117_22 = 117, // $@22
677 S_socket_type_value = 118, // socket_type_value
678 S_socket_name = 119, // socket_name
679 S_120_23 = 120, // $@23
680 S_socket_url = 121, // socket_url
681 S_122_24 = 122, // $@24
682 S_loggers = 123, // loggers
683 S_124_25 = 124, // $@25
684 S_loggers_entries = 125, // loggers_entries
685 S_logger_entry = 126, // logger_entry
686 S_127_26 = 127, // $@26
687 S_logger_params = 128, // logger_params
688 S_logger_param = 129, // logger_param
689 S_name = 130, // name
690 S_131_27 = 131, // $@27
691 S_debuglevel = 132, // debuglevel
692 S_severity = 133, // severity
693 S_134_28 = 134, // $@28
694 S_output_options_list = 135, // output_options_list
695 S_136_29 = 136, // $@29
696 S_output_options_list_content = 137, // output_options_list_content
697 S_output_entry = 138, // output_entry
698 S_139_30 = 139, // $@30
699 S_output_params_list = 140, // output_params_list
700 S_output_params = 141, // output_params
701 S_output = 142, // output
702 S_143_31 = 143, // $@31
703 S_flush = 144, // flush
704 S_maxsize = 145, // maxsize
705 S_maxver = 146, // maxver
706 S_pattern = 147, // pattern
707 S_148_32 = 148 // $@32
708 };
709 };
710
713
716
723 template <typename Base>
724 struct basic_symbol : Base
725 {
727 typedef Base super_type;
728
731 : value ()
732 , location ()
733 {}
734
735#if 201103L <= YY_CPLUSPLUS
738 : Base (std::move (that))
739 , value ()
740 , location (std::move (that.location))
741 {
742 switch (this->kind ())
743 {
744 case symbol_kind::S_value: // value
745 case symbol_kind::S_map_value: // map_value
746 case symbol_kind::S_socket_type_value: // socket_type_value
747 value.move< ElementPtr > (std::move (that.value));
748 break;
749
750 case symbol_kind::S_BOOLEAN: // "boolean"
751 value.move< bool > (std::move (that.value));
752 break;
753
754 case symbol_kind::S_FLOAT: // "floating point"
755 value.move< double > (std::move (that.value));
756 break;
757
758 case symbol_kind::S_INTEGER: // "integer"
759 value.move< int64_t > (std::move (that.value));
760 break;
761
762 case symbol_kind::S_STRING: // "constant string"
763 value.move< std::string > (std::move (that.value));
764 break;
765
766 default:
767 break;
768 }
769
770 }
771#endif
772
774 basic_symbol (const basic_symbol& that);
775
777#if 201103L <= YY_CPLUSPLUS
778 basic_symbol (typename Base::kind_type t, location_type&& l)
779 : Base (t)
780 , location (std::move (l))
781 {}
782#else
783 basic_symbol (typename Base::kind_type t, const location_type& l)
784 : Base (t)
785 , location (l)
786 {}
787#endif
788
789#if 201103L <= YY_CPLUSPLUS
790 basic_symbol (typename Base::kind_type t, ElementPtr&& v, location_type&& l)
791 : Base (t)
792 , value (std::move (v))
793 , location (std::move (l))
794 {}
795#else
796 basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
797 : Base (t)
798 , value (v)
799 , location (l)
800 {}
801#endif
802
803#if 201103L <= YY_CPLUSPLUS
804 basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l)
805 : Base (t)
806 , value (std::move (v))
807 , location (std::move (l))
808 {}
809#else
810 basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
811 : Base (t)
812 , value (v)
813 , location (l)
814 {}
815#endif
816
817#if 201103L <= YY_CPLUSPLUS
818 basic_symbol (typename Base::kind_type t, double&& v, location_type&& l)
819 : Base (t)
820 , value (std::move (v))
821 , location (std::move (l))
822 {}
823#else
824 basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
825 : Base (t)
826 , value (v)
827 , location (l)
828 {}
829#endif
830
831#if 201103L <= YY_CPLUSPLUS
832 basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l)
833 : Base (t)
834 , value (std::move (v))
835 , location (std::move (l))
836 {}
837#else
838 basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
839 : Base (t)
840 , value (v)
841 , location (l)
842 {}
843#endif
844
845#if 201103L <= YY_CPLUSPLUS
846 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
847 : Base (t)
848 , value (std::move (v))
849 , location (std::move (l))
850 {}
851#else
852 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
853 : Base (t)
854 , value (v)
855 , location (l)
856 {}
857#endif
858
861 {
862 clear ();
863 }
864
865
866
869 {
870 // User destructor.
871 symbol_kind_type yykind = this->kind ();
872 basic_symbol<Base>& yysym = *this;
873 (void) yysym;
874 switch (yykind)
875 {
876 default:
877 break;
878 }
879
880 // Value type destructor.
881switch (yykind)
882 {
883 case symbol_kind::S_value: // value
884 case symbol_kind::S_map_value: // map_value
885 case symbol_kind::S_socket_type_value: // socket_type_value
886 value.template destroy< ElementPtr > ();
887 break;
888
889 case symbol_kind::S_BOOLEAN: // "boolean"
890 value.template destroy< bool > ();
891 break;
892
893 case symbol_kind::S_FLOAT: // "floating point"
894 value.template destroy< double > ();
895 break;
896
897 case symbol_kind::S_INTEGER: // "integer"
898 value.template destroy< int64_t > ();
899 break;
900
901 case symbol_kind::S_STRING: // "constant string"
902 value.template destroy< std::string > ();
903 break;
904
905 default:
906 break;
907 }
908
909 Base::clear ();
910 }
911
913 std::string name () const YY_NOEXCEPT
914 {
915 return NetconfParser::symbol_name (this->kind ());
916 }
917
919 symbol_kind_type type_get () const YY_NOEXCEPT;
920
922 bool empty () const YY_NOEXCEPT;
923
925 void move (basic_symbol& s);
926
929
932
933 private:
934#if YY_CPLUSPLUS < 201103L
936 basic_symbol& operator= (const basic_symbol& that);
937#endif
938 };
939
941 struct by_kind
942 {
945
948
949#if 201103L <= YY_CPLUSPLUS
951 by_kind (by_kind&& that) YY_NOEXCEPT;
952#endif
953
955 by_kind (const by_kind& that) YY_NOEXCEPT;
956
959
960
961
963 void clear () YY_NOEXCEPT;
964
966 void move (by_kind& that);
967
970 symbol_kind_type kind () const YY_NOEXCEPT;
971
973 symbol_kind_type type_get () const YY_NOEXCEPT;
974
978 };
979
982
985 {
988
991
993#if 201103L <= YY_CPLUSPLUS
994 symbol_type (int tok, location_type l)
995 : super_type (token_kind_type (tok), std::move (l))
996#else
997 symbol_type (int tok, const location_type& l)
998 : super_type (token_kind_type (tok), l)
999#endif
1000 {
1001#if !defined _MSC_VER || defined __clang__
1004#endif
1005 }
1006#if 201103L <= YY_CPLUSPLUS
1007 symbol_type (int tok, bool v, location_type l)
1008 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1009#else
1010 symbol_type (int tok, const bool& v, const location_type& l)
1011 : super_type (token_kind_type (tok), v, l)
1012#endif
1013 {
1014#if !defined _MSC_VER || defined __clang__
1016#endif
1017 }
1018#if 201103L <= YY_CPLUSPLUS
1019 symbol_type (int tok, double v, location_type l)
1020 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1021#else
1022 symbol_type (int tok, const double& v, const location_type& l)
1023 : super_type (token_kind_type (tok), v, l)
1024#endif
1025 {
1026#if !defined _MSC_VER || defined __clang__
1028#endif
1029 }
1030#if 201103L <= YY_CPLUSPLUS
1031 symbol_type (int tok, int64_t v, location_type l)
1032 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1033#else
1034 symbol_type (int tok, const int64_t& v, const location_type& l)
1035 : super_type (token_kind_type (tok), v, l)
1036#endif
1037 {
1038#if !defined _MSC_VER || defined __clang__
1040#endif
1041 }
1042#if 201103L <= YY_CPLUSPLUS
1043 symbol_type (int tok, std::string v, location_type l)
1044 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1045#else
1046 symbol_type (int tok, const std::string& v, const location_type& l)
1047 : super_type (token_kind_type (tok), v, l)
1048#endif
1049 {
1050#if !defined _MSC_VER || defined __clang__
1052#endif
1053 }
1054 };
1055
1058 virtual ~NetconfParser ();
1059
1060#if 201103L <= YY_CPLUSPLUS
1062 NetconfParser (const NetconfParser&) = delete;
1064 NetconfParser& operator= (const NetconfParser&) = delete;
1065#endif
1066
1069 int operator() ();
1070
1073 virtual int parse ();
1074
1075#if NETCONF_DEBUG
1077 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1079 void set_debug_stream (std::ostream &);
1080
1082 typedef int debug_level_type;
1087#endif
1088
1092 virtual void error (const location_type& loc, const std::string& msg);
1093
1095 void error (const syntax_error& err);
1096
1099 static std::string symbol_name (symbol_kind_type yysymbol);
1100
1101 // Implementation of make_symbol for each token kind.
1102#if 201103L <= YY_CPLUSPLUS
1103 static
1106 {
1107 return symbol_type (token::TOKEN_END, std::move (l));
1108 }
1109#else
1110 static
1111 symbol_type
1113 {
1114 return symbol_type (token::TOKEN_END, l);
1115 }
1116#endif
1117#if 201103L <= YY_CPLUSPLUS
1118 static
1119 symbol_type
1121 {
1122 return symbol_type (token::TOKEN_NETCONF_error, std::move (l));
1123 }
1124#else
1125 static
1126 symbol_type
1128 {
1130 }
1131#endif
1132#if 201103L <= YY_CPLUSPLUS
1133 static
1134 symbol_type
1136 {
1137 return symbol_type (token::TOKEN_NETCONF_UNDEF, std::move (l));
1138 }
1139#else
1140 static
1141 symbol_type
1143 {
1145 }
1146#endif
1147#if 201103L <= YY_CPLUSPLUS
1148 static
1149 symbol_type
1151 {
1152 return symbol_type (token::TOKEN_COMMA, std::move (l));
1153 }
1154#else
1155 static
1156 symbol_type
1158 {
1159 return symbol_type (token::TOKEN_COMMA, l);
1160 }
1161#endif
1162#if 201103L <= YY_CPLUSPLUS
1163 static
1164 symbol_type
1166 {
1167 return symbol_type (token::TOKEN_COLON, std::move (l));
1168 }
1169#else
1170 static
1171 symbol_type
1173 {
1174 return symbol_type (token::TOKEN_COLON, l);
1175 }
1176#endif
1177#if 201103L <= YY_CPLUSPLUS
1178 static
1179 symbol_type
1181 {
1182 return symbol_type (token::TOKEN_LSQUARE_BRACKET, std::move (l));
1183 }
1184#else
1185 static
1186 symbol_type
1188 {
1190 }
1191#endif
1192#if 201103L <= YY_CPLUSPLUS
1193 static
1194 symbol_type
1196 {
1197 return symbol_type (token::TOKEN_RSQUARE_BRACKET, std::move (l));
1198 }
1199#else
1200 static
1201 symbol_type
1203 {
1205 }
1206#endif
1207#if 201103L <= YY_CPLUSPLUS
1208 static
1209 symbol_type
1211 {
1212 return symbol_type (token::TOKEN_LCURLY_BRACKET, std::move (l));
1213 }
1214#else
1215 static
1216 symbol_type
1218 {
1220 }
1221#endif
1222#if 201103L <= YY_CPLUSPLUS
1223 static
1224 symbol_type
1226 {
1227 return symbol_type (token::TOKEN_RCURLY_BRACKET, std::move (l));
1228 }
1229#else
1230 static
1231 symbol_type
1233 {
1235 }
1236#endif
1237#if 201103L <= YY_CPLUSPLUS
1238 static
1239 symbol_type
1241 {
1242 return symbol_type (token::TOKEN_NULL_TYPE, std::move (l));
1243 }
1244#else
1245 static
1246 symbol_type
1248 {
1250 }
1251#endif
1252#if 201103L <= YY_CPLUSPLUS
1253 static
1254 symbol_type
1256 {
1257 return symbol_type (token::TOKEN_NETCONF, std::move (l));
1258 }
1259#else
1260 static
1261 symbol_type
1263 {
1265 }
1266#endif
1267#if 201103L <= YY_CPLUSPLUS
1268 static
1269 symbol_type
1271 {
1272 return symbol_type (token::TOKEN_USER_CONTEXT, std::move (l));
1273 }
1274#else
1275 static
1276 symbol_type
1278 {
1280 }
1281#endif
1282#if 201103L <= YY_CPLUSPLUS
1283 static
1284 symbol_type
1286 {
1287 return symbol_type (token::TOKEN_COMMENT, std::move (l));
1288 }
1289#else
1290 static
1291 symbol_type
1293 {
1295 }
1296#endif
1297#if 201103L <= YY_CPLUSPLUS
1298 static
1299 symbol_type
1301 {
1302 return symbol_type (token::TOKEN_BOOT_UPDATE, std::move (l));
1303 }
1304#else
1305 static
1306 symbol_type
1308 {
1310 }
1311#endif
1312#if 201103L <= YY_CPLUSPLUS
1313 static
1314 symbol_type
1316 {
1317 return symbol_type (token::TOKEN_SUBSCRIBE_CHANGES, std::move (l));
1318 }
1319#else
1320 static
1321 symbol_type
1323 {
1325 }
1326#endif
1327#if 201103L <= YY_CPLUSPLUS
1328 static
1329 symbol_type
1331 {
1332 return symbol_type (token::TOKEN_VALIDATE_CHANGES, std::move (l));
1333 }
1334#else
1335 static
1336 symbol_type
1338 {
1340 }
1341#endif
1342#if 201103L <= YY_CPLUSPLUS
1343 static
1344 symbol_type
1346 {
1347 return symbol_type (token::TOKEN_MANAGED_SERVERS, std::move (l));
1348 }
1349#else
1350 static
1351 symbol_type
1353 {
1355 }
1356#endif
1357#if 201103L <= YY_CPLUSPLUS
1358 static
1359 symbol_type
1361 {
1362 return symbol_type (token::TOKEN_DHCP4_SERVER, std::move (l));
1363 }
1364#else
1365 static
1366 symbol_type
1368 {
1370 }
1371#endif
1372#if 201103L <= YY_CPLUSPLUS
1373 static
1374 symbol_type
1376 {
1377 return symbol_type (token::TOKEN_DHCP6_SERVER, std::move (l));
1378 }
1379#else
1380 static
1381 symbol_type
1383 {
1385 }
1386#endif
1387#if 201103L <= YY_CPLUSPLUS
1388 static
1389 symbol_type
1391 {
1392 return symbol_type (token::TOKEN_D2_SERVER, std::move (l));
1393 }
1394#else
1395 static
1396 symbol_type
1398 {
1400 }
1401#endif
1402#if 201103L <= YY_CPLUSPLUS
1403 static
1404 symbol_type
1406 {
1407 return symbol_type (token::TOKEN_CA_SERVER, std::move (l));
1408 }
1409#else
1410 static
1411 symbol_type
1413 {
1415 }
1416#endif
1417#if 201103L <= YY_CPLUSPLUS
1418 static
1419 symbol_type
1421 {
1422 return symbol_type (token::TOKEN_MODEL, std::move (l));
1423 }
1424#else
1425 static
1426 symbol_type
1428 {
1429 return symbol_type (token::TOKEN_MODEL, l);
1430 }
1431#endif
1432#if 201103L <= YY_CPLUSPLUS
1433 static
1434 symbol_type
1436 {
1437 return symbol_type (token::TOKEN_CONTROL_SOCKET, std::move (l));
1438 }
1439#else
1440 static
1441 symbol_type
1443 {
1445 }
1446#endif
1447#if 201103L <= YY_CPLUSPLUS
1448 static
1449 symbol_type
1451 {
1452 return symbol_type (token::TOKEN_SOCKET_TYPE, std::move (l));
1453 }
1454#else
1455 static
1456 symbol_type
1458 {
1460 }
1461#endif
1462#if 201103L <= YY_CPLUSPLUS
1463 static
1464 symbol_type
1466 {
1467 return symbol_type (token::TOKEN_UNIX, std::move (l));
1468 }
1469#else
1470 static
1471 symbol_type
1473 {
1474 return symbol_type (token::TOKEN_UNIX, l);
1475 }
1476#endif
1477#if 201103L <= YY_CPLUSPLUS
1478 static
1479 symbol_type
1481 {
1482 return symbol_type (token::TOKEN_HTTP, std::move (l));
1483 }
1484#else
1485 static
1486 symbol_type
1488 {
1489 return symbol_type (token::TOKEN_HTTP, l);
1490 }
1491#endif
1492#if 201103L <= YY_CPLUSPLUS
1493 static
1494 symbol_type
1496 {
1497 return symbol_type (token::TOKEN_STDOUT, std::move (l));
1498 }
1499#else
1500 static
1501 symbol_type
1503 {
1504 return symbol_type (token::TOKEN_STDOUT, l);
1505 }
1506#endif
1507#if 201103L <= YY_CPLUSPLUS
1508 static
1509 symbol_type
1511 {
1512 return symbol_type (token::TOKEN_SOCKET_NAME, std::move (l));
1513 }
1514#else
1515 static
1516 symbol_type
1518 {
1520 }
1521#endif
1522#if 201103L <= YY_CPLUSPLUS
1523 static
1524 symbol_type
1526 {
1527 return symbol_type (token::TOKEN_SOCKET_URL, std::move (l));
1528 }
1529#else
1530 static
1531 symbol_type
1533 {
1535 }
1536#endif
1537#if 201103L <= YY_CPLUSPLUS
1538 static
1539 symbol_type
1541 {
1542 return symbol_type (token::TOKEN_HOOKS_LIBRARIES, std::move (l));
1543 }
1544#else
1545 static
1546 symbol_type
1548 {
1550 }
1551#endif
1552#if 201103L <= YY_CPLUSPLUS
1553 static
1554 symbol_type
1556 {
1557 return symbol_type (token::TOKEN_LIBRARY, std::move (l));
1558 }
1559#else
1560 static
1561 symbol_type
1563 {
1565 }
1566#endif
1567#if 201103L <= YY_CPLUSPLUS
1568 static
1569 symbol_type
1571 {
1572 return symbol_type (token::TOKEN_PARAMETERS, std::move (l));
1573 }
1574#else
1575 static
1576 symbol_type
1578 {
1580 }
1581#endif
1582#if 201103L <= YY_CPLUSPLUS
1583 static
1584 symbol_type
1586 {
1587 return symbol_type (token::TOKEN_LOGGERS, std::move (l));
1588 }
1589#else
1590 static
1591 symbol_type
1593 {
1595 }
1596#endif
1597#if 201103L <= YY_CPLUSPLUS
1598 static
1599 symbol_type
1601 {
1602 return symbol_type (token::TOKEN_NAME, std::move (l));
1603 }
1604#else
1605 static
1606 symbol_type
1608 {
1609 return symbol_type (token::TOKEN_NAME, l);
1610 }
1611#endif
1612#if 201103L <= YY_CPLUSPLUS
1613 static
1614 symbol_type
1616 {
1617 return symbol_type (token::TOKEN_OUTPUT_OPTIONS, std::move (l));
1618 }
1619#else
1620 static
1621 symbol_type
1623 {
1625 }
1626#endif
1627#if 201103L <= YY_CPLUSPLUS
1628 static
1629 symbol_type
1631 {
1632 return symbol_type (token::TOKEN_OUTPUT, std::move (l));
1633 }
1634#else
1635 static
1636 symbol_type
1638 {
1639 return symbol_type (token::TOKEN_OUTPUT, l);
1640 }
1641#endif
1642#if 201103L <= YY_CPLUSPLUS
1643 static
1644 symbol_type
1646 {
1647 return symbol_type (token::TOKEN_DEBUGLEVEL, std::move (l));
1648 }
1649#else
1650 static
1651 symbol_type
1653 {
1655 }
1656#endif
1657#if 201103L <= YY_CPLUSPLUS
1658 static
1659 symbol_type
1661 {
1662 return symbol_type (token::TOKEN_SEVERITY, std::move (l));
1663 }
1664#else
1665 static
1666 symbol_type
1668 {
1670 }
1671#endif
1672#if 201103L <= YY_CPLUSPLUS
1673 static
1674 symbol_type
1676 {
1677 return symbol_type (token::TOKEN_FLUSH, std::move (l));
1678 }
1679#else
1680 static
1681 symbol_type
1683 {
1684 return symbol_type (token::TOKEN_FLUSH, l);
1685 }
1686#endif
1687#if 201103L <= YY_CPLUSPLUS
1688 static
1689 symbol_type
1691 {
1692 return symbol_type (token::TOKEN_MAXSIZE, std::move (l));
1693 }
1694#else
1695 static
1696 symbol_type
1698 {
1700 }
1701#endif
1702#if 201103L <= YY_CPLUSPLUS
1703 static
1704 symbol_type
1706 {
1707 return symbol_type (token::TOKEN_MAXVER, std::move (l));
1708 }
1709#else
1710 static
1711 symbol_type
1713 {
1714 return symbol_type (token::TOKEN_MAXVER, l);
1715 }
1716#endif
1717#if 201103L <= YY_CPLUSPLUS
1718 static
1719 symbol_type
1721 {
1722 return symbol_type (token::TOKEN_PATTERN, std::move (l));
1723 }
1724#else
1725 static
1726 symbol_type
1728 {
1730 }
1731#endif
1732#if 201103L <= YY_CPLUSPLUS
1733 static
1734 symbol_type
1736 {
1737 return symbol_type (token::TOKEN_START_JSON, std::move (l));
1738 }
1739#else
1740 static
1741 symbol_type
1743 {
1745 }
1746#endif
1747#if 201103L <= YY_CPLUSPLUS
1748 static
1749 symbol_type
1751 {
1752 return symbol_type (token::TOKEN_START_NETCONF, std::move (l));
1753 }
1754#else
1755 static
1756 symbol_type
1758 {
1760 }
1761#endif
1762#if 201103L <= YY_CPLUSPLUS
1763 static
1764 symbol_type
1766 {
1767 return symbol_type (token::TOKEN_START_SUB_NETCONF, std::move (l));
1768 }
1769#else
1770 static
1771 symbol_type
1773 {
1775 }
1776#endif
1777#if 201103L <= YY_CPLUSPLUS
1778 static
1779 symbol_type
1780 make_STRING (std::string v, location_type l)
1781 {
1782 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
1783 }
1784#else
1785 static
1786 symbol_type
1787 make_STRING (const std::string& v, const location_type& l)
1788 {
1789 return symbol_type (token::TOKEN_STRING, v, l);
1790 }
1791#endif
1792#if 201103L <= YY_CPLUSPLUS
1793 static
1794 symbol_type
1795 make_INTEGER (int64_t v, location_type l)
1796 {
1797 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
1798 }
1799#else
1800 static
1801 symbol_type
1802 make_INTEGER (const int64_t& v, const location_type& l)
1803 {
1804 return symbol_type (token::TOKEN_INTEGER, v, l);
1805 }
1806#endif
1807#if 201103L <= YY_CPLUSPLUS
1808 static
1809 symbol_type
1810 make_FLOAT (double v, location_type l)
1811 {
1812 return symbol_type (token::TOKEN_FLOAT, std::move (v), std::move (l));
1813 }
1814#else
1815 static
1816 symbol_type
1817 make_FLOAT (const double& v, const location_type& l)
1818 {
1819 return symbol_type (token::TOKEN_FLOAT, v, l);
1820 }
1821#endif
1822#if 201103L <= YY_CPLUSPLUS
1823 static
1824 symbol_type
1825 make_BOOLEAN (bool v, location_type l)
1826 {
1827 return symbol_type (token::TOKEN_BOOLEAN, std::move (v), std::move (l));
1828 }
1829#else
1830 static
1831 symbol_type
1832 make_BOOLEAN (const bool& v, const location_type& l)
1833 {
1834 return symbol_type (token::TOKEN_BOOLEAN, v, l);
1835 }
1836#endif
1837
1838
1840 {
1841 public:
1842 context (const NetconfParser& yyparser, const symbol_type& yyla);
1843 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
1844 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
1845 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
1846
1850 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
1851
1852 private:
1853 const NetconfParser& yyparser_;
1854 const symbol_type& yyla_;
1855 };
1856
1857 private:
1858#if YY_CPLUSPLUS < 201103L
1862 NetconfParser& operator= (const NetconfParser&);
1863#endif
1864
1865
1867 typedef short state_type;
1868
1870 int yy_syntax_error_arguments_ (const context& yyctx,
1871 symbol_kind_type yyarg[], int yyargn) const;
1872
1875 virtual std::string yysyntax_error_ (const context& yyctx) const;
1879 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
1880
1883 static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
1884
1887 static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
1888
1889 static const signed char yypact_ninf_;
1890 static const signed char yytable_ninf_;
1891
1895 static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
1896
1898 static std::string yytnamerr_ (const char *yystr);
1899
1901 static const char* const yytname_[];
1902
1903
1904 // Tables.
1905 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1906 // STATE-NUM.
1907 static const short yypact_[];
1908
1909 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1910 // Performed when YYTABLE does not specify something else to do. Zero
1911 // means the default is an error.
1912 static const unsigned char yydefact_[];
1913
1914 // YYPGOTO[NTERM-NUM].
1915 static const signed char yypgoto_[];
1916
1917 // YYDEFGOTO[NTERM-NUM].
1918 static const short yydefgoto_[];
1919
1920 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1921 // positive, shift that token. If negative, reduce the rule whose
1922 // number is the opposite. If YYTABLE_NINF, syntax error.
1923 static const short yytable_[];
1924
1925 static const short yycheck_[];
1926
1927 // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1928 // state STATE-NUM.
1929 static const unsigned char yystos_[];
1930
1931 // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
1932 static const unsigned char yyr1_[];
1933
1934 // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
1935 static const signed char yyr2_[];
1936
1937
1938#if NETCONF_DEBUG
1939 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
1940 static const short yyrline_[];
1942 virtual void yy_reduce_print_ (int r) const;
1944 virtual void yy_stack_print_ () const;
1945
1947 int yydebug_;
1949 std::ostream* yycdebug_;
1950
1954 template <typename Base>
1955 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
1956#endif
1957
1962 template <typename Base>
1963 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
1964
1965 private:
1967 struct by_state
1968 {
1970 by_state () YY_NOEXCEPT;
1971
1973 typedef state_type kind_type;
1974
1976 by_state (kind_type s) YY_NOEXCEPT;
1977
1979 by_state (const by_state& that) YY_NOEXCEPT;
1980
1982 void clear () YY_NOEXCEPT;
1983
1985 void move (by_state& that);
1986
1989 symbol_kind_type kind () const YY_NOEXCEPT;
1990
1993 enum { empty_state = 0 };
1994
1997 state_type state;
1998 };
1999
2001 struct stack_symbol_type : basic_symbol<by_state>
2002 {
2004 typedef basic_symbol<by_state> super_type;
2006 stack_symbol_type ();
2008 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2010 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2011#if YY_CPLUSPLUS < 201103L
2014 stack_symbol_type& operator= (stack_symbol_type& that);
2015
2018 stack_symbol_type& operator= (const stack_symbol_type& that);
2019#endif
2020 };
2021
2023 template <typename T, typename S = std::vector<T> >
2024 class stack
2025 {
2026 public:
2027 // Hide our reversed order.
2028 typedef typename S::iterator iterator;
2029 typedef typename S::const_iterator const_iterator;
2030 typedef typename S::size_type size_type;
2031 typedef typename std::ptrdiff_t index_type;
2032
2033 stack (size_type n = 200) YY_NOEXCEPT
2034 : seq_ (n)
2035 {}
2036
2037#if 201103L <= YY_CPLUSPLUS
2039 stack (const stack&) = delete;
2041 stack& operator= (const stack&) = delete;
2042#endif
2043
2047 const T&
2048 operator[] (index_type i) const
2049 {
2050 return seq_[size_type (size () - 1 - i)];
2051 }
2052
2056 T&
2057 operator[] (index_type i)
2058 {
2059 return seq_[size_type (size () - 1 - i)];
2060 }
2061
2065 void
2066 push (YY_MOVE_REF (T) t)
2067 {
2068 seq_.push_back (T ());
2069 operator[] (0).move (t);
2070 }
2071
2073 void
2074 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2075 {
2076 for (; 0 < n; --n)
2077 seq_.pop_back ();
2078 }
2079
2081 void
2082 clear () YY_NOEXCEPT
2083 {
2084 seq_.clear ();
2085 }
2086
2088 index_type
2089 size () const YY_NOEXCEPT
2090 {
2091 return index_type (seq_.size ());
2092 }
2093
2095 const_iterator
2096 begin () const YY_NOEXCEPT
2097 {
2098 return seq_.begin ();
2099 }
2100
2102 const_iterator
2103 end () const YY_NOEXCEPT
2104 {
2105 return seq_.end ();
2106 }
2107
2109 class slice
2110 {
2111 public:
2112 slice (const stack& stack, index_type range) YY_NOEXCEPT
2113 : stack_ (stack)
2114 , range_ (range)
2115 {}
2116
2117 const T&
2118 operator[] (index_type i) const
2119 {
2120 return stack_[range_ - i];
2121 }
2122
2123 private:
2124 const stack& stack_;
2125 index_type range_;
2126 };
2127
2128 private:
2129#if YY_CPLUSPLUS < 201103L
2131 stack (const stack&);
2133 stack& operator= (const stack&);
2134#endif
2136 S seq_;
2137 };
2138
2139
2141 typedef stack<stack_symbol_type> stack_type;
2142
2144 stack_type yystack_;
2145
2151 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2152
2159 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2160
2162 void yypop_ (int n = 1) YY_NOEXCEPT;
2163
2165 enum
2166 {
2167 yylast_ = 221,
2168 yynnts_ = 100,
2169 yyfinal_ = 8
2170 };
2171
2172
2173 // User arguments.
2175
2176 };
2177
2178 inline
2180 NetconfParser::yytranslate_ (int t) YY_NOEXCEPT
2181 {
2182 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2183 // TOKEN-NUM as returned by yylex.
2184 static
2185 const signed char
2186 translate_table[] =
2187 {
2188 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2190 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2191 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2192 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2193 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2194 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2195 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2197 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2201 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2204 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2205 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2207 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2208 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2209 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2210 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2211 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2212 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2213 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2214 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2215 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2216 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2217 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2218 45, 46, 47, 48
2219 };
2220 // Last valid token kind.
2221 const int code_max = 303;
2222
2223 if (t <= 0)
2224 return symbol_kind::S_YYEOF;
2225 else if (t <= code_max)
2226 return static_cast <symbol_kind_type> (translate_table[t]);
2227 else
2229 }
2230
2231 // basic_symbol.
2232 template <typename Base>
2234 : Base (that)
2235 , value ()
2236 , location (that.location)
2237 {
2238 switch (this->kind ())
2239 {
2240 case symbol_kind::S_value: // value
2241 case symbol_kind::S_map_value: // map_value
2242 case symbol_kind::S_socket_type_value: // socket_type_value
2243 value.copy< ElementPtr > (YY_MOVE (that.value));
2244 break;
2245
2246 case symbol_kind::S_BOOLEAN: // "boolean"
2247 value.copy< bool > (YY_MOVE (that.value));
2248 break;
2249
2250 case symbol_kind::S_FLOAT: // "floating point"
2251 value.copy< double > (YY_MOVE (that.value));
2252 break;
2253
2254 case symbol_kind::S_INTEGER: // "integer"
2255 value.copy< int64_t > (YY_MOVE (that.value));
2256 break;
2257
2258 case symbol_kind::S_STRING: // "constant string"
2259 value.copy< std::string > (YY_MOVE (that.value));
2260 break;
2261
2262 default:
2263 break;
2264 }
2265
2266 }
2267
2268
2269
2270
2271 template <typename Base>
2274 {
2275 return this->kind ();
2276 }
2277
2278
2279 template <typename Base>
2280 bool
2282 {
2283 return this->kind () == symbol_kind::S_YYEMPTY;
2284 }
2285
2286 template <typename Base>
2287 void
2289 {
2290 super_type::move (s);
2291 switch (this->kind ())
2292 {
2293 case symbol_kind::S_value: // value
2294 case symbol_kind::S_map_value: // map_value
2295 case symbol_kind::S_socket_type_value: // socket_type_value
2296 value.move< ElementPtr > (YY_MOVE (s.value));
2297 break;
2298
2299 case symbol_kind::S_BOOLEAN: // "boolean"
2300 value.move< bool > (YY_MOVE (s.value));
2301 break;
2302
2303 case symbol_kind::S_FLOAT: // "floating point"
2304 value.move< double > (YY_MOVE (s.value));
2305 break;
2306
2307 case symbol_kind::S_INTEGER: // "integer"
2308 value.move< int64_t > (YY_MOVE (s.value));
2309 break;
2310
2311 case symbol_kind::S_STRING: // "constant string"
2312 value.move< std::string > (YY_MOVE (s.value));
2313 break;
2314
2315 default:
2316 break;
2317 }
2318
2319 location = YY_MOVE (s.location);
2320 }
2321
2322 // by_kind.
2323 inline
2325 : kind_ (symbol_kind::S_YYEMPTY)
2326 {}
2327
2328#if 201103L <= YY_CPLUSPLUS
2329 inline
2331 : kind_ (that.kind_)
2332 {
2333 that.clear ();
2334 }
2335#endif
2336
2337 inline
2339 : kind_ (that.kind_)
2340 {}
2341
2342 inline
2344 : kind_ (yytranslate_ (t))
2345 {}
2346
2347
2348
2349 inline
2350 void
2352 {
2353 kind_ = symbol_kind::S_YYEMPTY;
2354 }
2355
2356 inline
2357 void
2359 {
2360 kind_ = that.kind_;
2361 that.clear ();
2362 }
2363
2364 inline
2367 {
2368 return kind_;
2369 }
2370
2371
2372 inline
2375 {
2376 return this->kind ();
2377 }
2378
2379
2380#line 14 "netconf_parser.yy"
2381} } // isc::netconf
2382#line 2383 "netconf_parser.h"
2383
2384
2385
2386
2387#endif // !YY_NETCONF_NETCONF_PARSER_H_INCLUDED
const location_type & location() const YY_NOEXCEPT
symbol_kind_type token() const YY_NOEXCEPT
const symbol_type & lookahead() const YY_NOEXCEPT
Present a slice of the top of a stack.
slice(const stack &stack, index_type range) YY_NOEXCEPT
A buffer to store and retrieve objects.
long double yyalign_me_
Strongest alignment constraints.
void move(self_type &that)
Move the content of that to this.
T & build(const T &t)
Instantiate a T in here from t.
value_type(YY_RVREF(T) t)
Construct and fill.
void swap(self_type &that) YY_NOEXCEPT
Swap the content with that, of same type.
char yyraw_[size]
A buffer large enough to store any of the semantic values.
T & as() YY_NOEXCEPT
Accessor to a built T.
void copy(const self_type &that)
Copy the content of that to this.
T & build()
Instantiate an empty T in here.
void destroy()
Destroy the stored T.
T & emplace(const T &t)
Instantiate a T in here from t.
const T & as() const YY_NOEXCEPT
Const accessor to a built T (for printer).
T & emplace()
Instantiate an empty T in here.
~value_type() YY_NOEXCEPT
Destruction, allowed only if empty.
value_type() YY_NOEXCEPT
Empty construction.
static symbol_type make_NETCONF(const location_type &l)
static symbol_type make_SOCKET_URL(const location_type &l)
static symbol_type make_MAXVER(const location_type &l)
static symbol_type make_OUTPUT_OPTIONS(const location_type &l)
static symbol_type make_MAXSIZE(const location_type &l)
static symbol_type make_INTEGER(const int64_t &v, const location_type &l)
virtual int parse()
Parse.
static symbol_type make_HOOKS_LIBRARIES(const location_type &l)
static symbol_type make_CONTROL_SOCKET(const location_type &l)
void set_debug_stream(std::ostream &)
Set the current debugging stream.
static symbol_type make_OUTPUT(const location_type &l)
static symbol_type make_DHCP6_SERVER(const location_type &l)
std::ostream & debug_stream() const YY_ATTRIBUTE_PURE
The current debugging stream.
static symbol_type make_BOOT_UPDATE(const location_type &l)
static symbol_type make_NETCONF_UNDEF(const location_type &l)
static symbol_type make_NULL_TYPE(const location_type &l)
static symbol_type make_DEBUGLEVEL(const location_type &l)
static symbol_type make_HTTP(const location_type &l)
static std::string symbol_name(symbol_kind_type yysymbol)
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
static symbol_type make_VALIDATE_CHANGES(const location_type &l)
static symbol_type make_END(const location_type &l)
static symbol_type make_LIBRARY(const location_type &l)
static symbol_type make_LOGGERS(const location_type &l)
static symbol_type make_NETCONF_error(const location_type &l)
static symbol_type make_LCURLY_BRACKET(const location_type &l)
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
NetconfParser(isc::netconf::ParserContext &ctx_yyarg)
Build a parser object.
static symbol_type make_STDOUT(const location_type &l)
value_type semantic_type
Backward compatibility (Bison 3.8).
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
static symbol_type make_SOCKET_TYPE(const location_type &l)
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
static symbol_type make_LSQUARE_BRACKET(const location_type &l)
static symbol_type make_DHCP4_SERVER(const location_type &l)
int debug_level_type
Type for debugging levels.
static symbol_type make_D2_SERVER(const location_type &l)
static symbol_type make_PARAMETERS(const location_type &l)
static symbol_type make_NAME(const location_type &l)
static symbol_type make_FLUSH(const location_type &l)
static symbol_type make_START_JSON(const location_type &l)
static symbol_type make_UNIX(const location_type &l)
static symbol_type make_PATTERN(const location_type &l)
static symbol_type make_STRING(const std::string &v, const location_type &l)
static const symbol_kind_type YYNTOKENS
The number of tokens.
static symbol_type make_COMMENT(const location_type &l)
static symbol_type make_SEVERITY(const location_type &l)
static symbol_type make_MANAGED_SERVERS(const location_type &l)
location location_type
Symbol locations.
static symbol_type make_SUBSCRIBE_CHANGES(const location_type &l)
static symbol_type make_CA_SERVER(const location_type &l)
static symbol_type make_COLON(const location_type &l)
static symbol_type make_RCURLY_BRACKET(const location_type &l)
void set_debug_level(debug_level_type l)
Set the current debugging level.
static symbol_type make_USER_CONTEXT(const location_type &l)
static symbol_type make_COMMA(const location_type &l)
static symbol_type make_RSQUARE_BRACKET(const location_type &l)
static symbol_type make_START_NETCONF(const location_type &l)
static symbol_type make_MODEL(const location_type &l)
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
static symbol_type make_START_SUB_NETCONF(const location_type &l)
static symbol_type make_BOOLEAN(const bool &v, const location_type &l)
static symbol_type make_FLOAT(const double &v, const location_type &l)
static symbol_type make_SOCKET_NAME(const location_type &l)
Parser context is a wrapper around flex/bison instances dedicated to Netconf-agent config file parser...
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
Defines the logger used by the top-level component of kea-lfc.
Forward declaration of the ParserContext class.
#define YY_RVREF(Type)
#define NETCONF__ASSERT
#define YY_MOVE_REF(Type)
#define YY_NOEXCEPT
#define YY_ATTRIBUTE_PURE
#define YY_MOVE
#define YY_NOTHROW
bool empty() const YY_NOEXCEPT
Whether empty.
basic_symbol(typename Base::kind_type t, const bool &v, const location_type &l)
basic_symbol() YY_NOEXCEPT
Default constructor.
basic_symbol(typename Base::kind_type t, const double &v, const location_type &l)
void move(basic_symbol &s)
Destructive move, s is emptied into this.
basic_symbol(typename Base::kind_type t, const ElementPtr &v, const location_type &l)
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructors for typed symbols.
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
basic_symbol(typename Base::kind_type t, const int64_t &v, const location_type &l)
value_type value
The semantic value.
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Type access provider for token (enum) based symbols.
token_kind_type kind_type
The symbol kind as needed by the constructor.
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
by_kind() YY_NOEXCEPT
Default constructor.
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
symbol_kind_type kind_
The symbol kind.
void move(by_kind &that)
Steal the symbol kind from that.
void clear() YY_NOEXCEPT
Record that this symbol is empty.
"External" symbols: returned by the scanner.
symbol_type() YY_NOEXCEPT
Empty symbol.
basic_symbol< by_kind > super_type
Superclass.
Syntax errors thrown from user actions.
syntax_error(const location_type &l, const std::string &m)
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).