Kea 2.7.6
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 <cc/data.h>
52
53#include <boost/lexical_cast.hpp>
54
55#include <sstream>
56#include <string>
57
58using namespace isc::netconf;
59using namespace isc::data;
60using namespace std;
61
62#line 63 "netconf_parser.h"
63
64# include <cassert>
65# include <cstdlib> // std::abort
66# include <iostream>
67# include <stdexcept>
68# include <string>
69# include <vector>
70
71#if defined __cplusplus
72# define YY_CPLUSPLUS __cplusplus
73#else
74# define YY_CPLUSPLUS 199711L
75#endif
76
77// Support move semantics when possible.
78#if 201103L <= YY_CPLUSPLUS
79# define YY_MOVE std::move
80# define YY_MOVE_OR_COPY move
81# define YY_MOVE_REF(Type) Type&&
82# define YY_RVREF(Type) Type&&
83# define YY_COPY(Type) Type
84#else
85# define YY_MOVE
86# define YY_MOVE_OR_COPY copy
87# define YY_MOVE_REF(Type) Type&
88# define YY_RVREF(Type) const Type&
89# define YY_COPY(Type) const Type&
90#endif
91
92// Support noexcept when possible.
93#if 201103L <= YY_CPLUSPLUS
94# define YY_NOEXCEPT noexcept
95# define YY_NOTHROW
96#else
97# define YY_NOEXCEPT
98# define YY_NOTHROW throw ()
99#endif
100
101// Support constexpr when possible.
102#if 201703 <= YY_CPLUSPLUS
103# define YY_CONSTEXPR constexpr
104#else
105# define YY_CONSTEXPR
106#endif
107# include "location.hh"
108#include <typeinfo>
109#ifndef NETCONF__ASSERT
110# include <cassert>
111# define NETCONF__ASSERT assert
112#endif
113
114
115#ifndef YY_ATTRIBUTE_PURE
116# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
117# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
118# else
119# define YY_ATTRIBUTE_PURE
120# endif
121#endif
122
123#ifndef YY_ATTRIBUTE_UNUSED
124# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
125# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
126# else
127# define YY_ATTRIBUTE_UNUSED
128# endif
129#endif
130
131/* Suppress unused-variable warnings by "using" E. */
132#if ! defined lint || defined __GNUC__
133# define YY_USE(E) ((void) (E))
134#else
135# define YY_USE(E) /* empty */
136#endif
137
138/* Suppress an incorrect diagnostic about yylval being uninitialized. */
139#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
140# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
141# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
142 _Pragma ("GCC diagnostic push") \
143 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
144# else
145# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
146 _Pragma ("GCC diagnostic push") \
147 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
148 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
149# endif
150# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
151 _Pragma ("GCC diagnostic pop")
152#else
153# define YY_INITIAL_VALUE(Value) Value
154#endif
155#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
156# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
157# define YY_IGNORE_MAYBE_UNINITIALIZED_END
158#endif
159#ifndef YY_INITIAL_VALUE
160# define YY_INITIAL_VALUE(Value) /* Nothing. */
161#endif
162
163#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
164# define YY_IGNORE_USELESS_CAST_BEGIN \
165 _Pragma ("GCC diagnostic push") \
166 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
167# define YY_IGNORE_USELESS_CAST_END \
168 _Pragma ("GCC diagnostic pop")
169#endif
170#ifndef YY_IGNORE_USELESS_CAST_BEGIN
171# define YY_IGNORE_USELESS_CAST_BEGIN
172# define YY_IGNORE_USELESS_CAST_END
173#endif
174
175# ifndef YY_CAST
176# ifdef __cplusplus
177# define YY_CAST(Type, Val) static_cast<Type> (Val)
178# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
179# else
180# define YY_CAST(Type, Val) ((Type) (Val))
181# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
182# endif
183# endif
184# ifndef YY_NULLPTR
185# if defined __cplusplus
186# if 201103L <= __cplusplus
187# define YY_NULLPTR nullptr
188# else
189# define YY_NULLPTR 0
190# endif
191# else
192# define YY_NULLPTR ((void*)0)
193# endif
194# endif
195
196/* Debug traces. */
197#ifndef NETCONF_DEBUG
198# if defined YYDEBUG
199#if YYDEBUG
200# define NETCONF_DEBUG 1
201# else
202# define NETCONF_DEBUG 0
203# endif
204# else /* ! defined YYDEBUG */
205# define NETCONF_DEBUG 1
206# endif /* ! defined YYDEBUG */
207#endif /* ! defined NETCONF_DEBUG */
208
209#line 14 "netconf_parser.yy"
210namespace isc { namespace netconf {
211#line 212 "netconf_parser.h"
212
213
214
215
218 {
219 public:
220#ifdef NETCONF_STYPE
221# ifdef __GNUC__
222# pragma GCC message "bison: do not #define NETCONF_STYPE in C++, use %define api.value.type"
223# endif
224 typedef NETCONF_STYPE value_type;
225#else
232 {
233 public:
236
239 : yyraw_ ()
240 , yytypeid_ (YY_NULLPTR)
241 {}
242
244 template <typename T>
246 : yytypeid_ (&typeid (T))
247 {
248 NETCONF__ASSERT (sizeof (T) <= size);
249 new (yyas_<T> ()) T (YY_MOVE (t));
250 }
251
252#if 201103L <= YY_CPLUSPLUS
254 value_type (const self_type&) = delete;
256 self_type& operator= (const self_type&) = delete;
257#endif
258
261 {
262 NETCONF__ASSERT (!yytypeid_);
263 }
264
265# if 201103L <= YY_CPLUSPLUS
267 template <typename T, typename... U>
268 T&
269 emplace (U&&... u)
270 {
271 NETCONF__ASSERT (!yytypeid_);
272 NETCONF__ASSERT (sizeof (T) <= size);
273 yytypeid_ = & typeid (T);
274 return *new (yyas_<T> ()) T (std::forward <U>(u)...);
275 }
276# else
278 template <typename T>
279 T&
281 {
282 NETCONF__ASSERT (!yytypeid_);
283 NETCONF__ASSERT (sizeof (T) <= size);
284 yytypeid_ = & typeid (T);
285 return *new (yyas_<T> ()) T ();
286 }
287
289 template <typename T>
290 T&
291 emplace (const T& t)
292 {
293 NETCONF__ASSERT (!yytypeid_);
294 NETCONF__ASSERT (sizeof (T) <= size);
295 yytypeid_ = & typeid (T);
296 return *new (yyas_<T> ()) T (t);
297 }
298# endif
299
302 template <typename T>
303 T&
305 {
306 return emplace<T> ();
307 }
308
311 template <typename T>
312 T&
313 build (const T& t)
314 {
315 return emplace<T> (t);
316 }
317
319 template <typename T>
320 T&
322 {
323 NETCONF__ASSERT (yytypeid_);
324 NETCONF__ASSERT (*yytypeid_ == typeid (T));
325 NETCONF__ASSERT (sizeof (T) <= size);
326 return *yyas_<T> ();
327 }
328
330 template <typename T>
331 const T&
333 {
334 NETCONF__ASSERT (yytypeid_);
335 NETCONF__ASSERT (*yytypeid_ == typeid (T));
336 NETCONF__ASSERT (sizeof (T) <= size);
337 return *yyas_<T> ();
338 }
339
348 template <typename T>
349 void
351 {
352 NETCONF__ASSERT (yytypeid_);
353 NETCONF__ASSERT (*yytypeid_ == *that.yytypeid_);
354 std::swap (as<T> (), that.as<T> ());
355 }
356
360 template <typename T>
361 void
363 {
364# if 201103L <= YY_CPLUSPLUS
365 emplace<T> (std::move (that.as<T> ()));
366# else
367 emplace<T> ();
368 swap<T> (that);
369# endif
370 that.destroy<T> ();
371 }
372
373# if 201103L <= YY_CPLUSPLUS
375 template <typename T>
376 void
377 move (self_type&& that)
378 {
379 emplace<T> (std::move (that.as<T> ()));
380 that.destroy<T> ();
381 }
382#endif
383
385 template <typename T>
386 void
387 copy (const self_type& that)
388 {
389 emplace<T> (that.as<T> ());
390 }
391
393 template <typename T>
394 void
396 {
397 as<T> ().~T ();
398 yytypeid_ = YY_NULLPTR;
399 }
400
401 private:
402#if YY_CPLUSPLUS < 201103L
404 value_type (const self_type&);
406 self_type& operator= (const self_type&);
407#endif
408
410 template <typename T>
411 T*
412 yyas_ () YY_NOEXCEPT
413 {
414 void *yyp = yyraw_;
415 return static_cast<T*> (yyp);
416 }
417
419 template <typename T>
420 const T*
421 yyas_ () const YY_NOEXCEPT
422 {
423 const void *yyp = yyraw_;
424 return static_cast<const T*> (yyp);
425 }
426
428 union union_type
429 {
430 // value
431 // map_value
432 // socket_type_value
433 char dummy1[sizeof (ElementPtr)];
434
435 // "boolean"
436 char dummy2[sizeof (bool)];
437
438 // "floating point"
439 char dummy3[sizeof (double)];
440
441 // "integer"
442 char dummy4[sizeof (int64_t)];
443
444 // "constant string"
445 char dummy5[sizeof (string)];
446 };
447
449 enum { size = sizeof (union_type) };
450
452 union
453 {
455 long double yyalign_me_;
457 char yyraw_[size];
458 };
459
461 const std::type_info *yytypeid_;
462 };
463
464#endif
467
469 typedef location location_type;
470
472 struct syntax_error : std::runtime_error
473 {
474 syntax_error (const location_type& l, const std::string& m)
475 : std::runtime_error (m)
476 , location (l)
477 {}
478
480 : std::runtime_error (s.what ())
481 , location (s.location)
482 {}
483
485
487 };
488
490 struct token
491 {
493 {
494 TOKEN_NETCONF_EMPTY = -2,
495 TOKEN_END = 0, // "end of file"
496 TOKEN_NETCONF_error = 256, // error
497 TOKEN_NETCONF_UNDEF = 257, // "invalid token"
498 TOKEN_COMMA = 258, // ","
499 TOKEN_COLON = 259, // ":"
500 TOKEN_LSQUARE_BRACKET = 260, // "["
501 TOKEN_RSQUARE_BRACKET = 261, // "]"
502 TOKEN_LCURLY_BRACKET = 262, // "{"
503 TOKEN_RCURLY_BRACKET = 263, // "}"
504 TOKEN_NULL_TYPE = 264, // "null"
505 TOKEN_NETCONF = 265, // "Netconf"
506 TOKEN_USER_CONTEXT = 266, // "user-context"
507 TOKEN_COMMENT = 267, // "comment"
508 TOKEN_BOOT_UPDATE = 268, // "boot-update"
509 TOKEN_SUBSCRIBE_CHANGES = 269, // "subscribe-changes"
510 TOKEN_VALIDATE_CHANGES = 270, // "validate-changes"
511 TOKEN_MANAGED_SERVERS = 271, // "managed-servers"
512 TOKEN_DHCP4_SERVER = 272, // "dhcp4"
513 TOKEN_DHCP6_SERVER = 273, // "dhcp6"
514 TOKEN_D2_SERVER = 274, // "d2"
515 TOKEN_CA_SERVER = 275, // "ca"
516 TOKEN_MODEL = 276, // "model"
517 TOKEN_CONTROL_SOCKET = 277, // "control-socket"
518 TOKEN_SOCKET_TYPE = 278, // "socket-type"
519 TOKEN_UNIX = 279, // "unix"
520 TOKEN_HTTP = 280, // "http"
521 TOKEN_STDOUT = 281, // "stdout"
522 TOKEN_SOCKET_NAME = 282, // "socket-name"
523 TOKEN_SOCKET_URL = 283, // "socket-url"
524 TOKEN_HOOKS_LIBRARIES = 284, // "hooks-libraries"
525 TOKEN_LIBRARY = 285, // "library"
526 TOKEN_PARAMETERS = 286, // "parameters"
527 TOKEN_LOGGERS = 287, // "loggers"
528 TOKEN_NAME = 288, // "name"
529 TOKEN_OUTPUT_OPTIONS = 289, // "output-options"
530 TOKEN_OUTPUT = 290, // "output"
531 TOKEN_DEBUGLEVEL = 291, // "debuglevel"
532 TOKEN_SEVERITY = 292, // "severity"
533 TOKEN_FLUSH = 293, // "flush"
534 TOKEN_MAXSIZE = 294, // "maxsize"
535 TOKEN_MAXVER = 295, // "maxver"
536 TOKEN_PATTERN = 296, // "pattern"
537 TOKEN_START_JSON = 297, // START_JSON
538 TOKEN_START_NETCONF = 298, // START_NETCONF
539 TOKEN_START_SUB_NETCONF = 299, // START_SUB_NETCONF
540 TOKEN_STRING = 300, // "constant string"
541 TOKEN_INTEGER = 301, // "integer"
542 TOKEN_FLOAT = 302, // "floating point"
543 TOKEN_BOOLEAN = 303 // "boolean"
544 };
547 };
548
551
554
557 {
559 {
560 YYNTOKENS = 49,
561 S_YYEMPTY = -2,
562 S_YYEOF = 0, // "end of file"
563 S_YYerror = 1, // error
564 S_YYUNDEF = 2, // "invalid token"
565 S_COMMA = 3, // ","
566 S_COLON = 4, // ":"
567 S_LSQUARE_BRACKET = 5, // "["
568 S_RSQUARE_BRACKET = 6, // "]"
569 S_LCURLY_BRACKET = 7, // "{"
570 S_RCURLY_BRACKET = 8, // "}"
571 S_NULL_TYPE = 9, // "null"
572 S_NETCONF = 10, // "Netconf"
573 S_USER_CONTEXT = 11, // "user-context"
574 S_COMMENT = 12, // "comment"
575 S_BOOT_UPDATE = 13, // "boot-update"
576 S_SUBSCRIBE_CHANGES = 14, // "subscribe-changes"
577 S_VALIDATE_CHANGES = 15, // "validate-changes"
578 S_MANAGED_SERVERS = 16, // "managed-servers"
579 S_DHCP4_SERVER = 17, // "dhcp4"
580 S_DHCP6_SERVER = 18, // "dhcp6"
581 S_D2_SERVER = 19, // "d2"
582 S_CA_SERVER = 20, // "ca"
583 S_MODEL = 21, // "model"
584 S_CONTROL_SOCKET = 22, // "control-socket"
585 S_SOCKET_TYPE = 23, // "socket-type"
586 S_UNIX = 24, // "unix"
587 S_HTTP = 25, // "http"
588 S_STDOUT = 26, // "stdout"
589 S_SOCKET_NAME = 27, // "socket-name"
590 S_SOCKET_URL = 28, // "socket-url"
591 S_HOOKS_LIBRARIES = 29, // "hooks-libraries"
592 S_LIBRARY = 30, // "library"
593 S_PARAMETERS = 31, // "parameters"
594 S_LOGGERS = 32, // "loggers"
595 S_NAME = 33, // "name"
596 S_OUTPUT_OPTIONS = 34, // "output-options"
597 S_OUTPUT = 35, // "output"
598 S_DEBUGLEVEL = 36, // "debuglevel"
599 S_SEVERITY = 37, // "severity"
600 S_FLUSH = 38, // "flush"
601 S_MAXSIZE = 39, // "maxsize"
602 S_MAXVER = 40, // "maxver"
603 S_PATTERN = 41, // "pattern"
604 S_START_JSON = 42, // START_JSON
605 S_START_NETCONF = 43, // START_NETCONF
606 S_START_SUB_NETCONF = 44, // START_SUB_NETCONF
607 S_STRING = 45, // "constant string"
608 S_INTEGER = 46, // "integer"
609 S_FLOAT = 47, // "floating point"
610 S_BOOLEAN = 48, // "boolean"
611 S_YYACCEPT = 49, // $accept
612 S_start = 50, // start
613 S_51_1 = 51, // $@1
614 S_52_2 = 52, // $@2
615 S_53_3 = 53, // $@3
616 S_sub_netconf = 54, // sub_netconf
617 S_55_4 = 55, // $@4
618 S_json = 56, // json
619 S_value = 57, // value
620 S_map = 58, // map
621 S_59_5 = 59, // $@5
622 S_map_value = 60, // map_value
623 S_map_content = 61, // map_content
624 S_not_empty_map = 62, // not_empty_map
625 S_list_generic = 63, // list_generic
626 S_64_6 = 64, // $@6
627 S_list_content = 65, // list_content
628 S_not_empty_list = 66, // not_empty_list
629 S_unknown_map_entry = 67, // unknown_map_entry
630 S_netconf_syntax_map = 68, // netconf_syntax_map
631 S_69_7 = 69, // $@7
632 S_global_object = 70, // global_object
633 S_71_8 = 71, // $@8
634 S_global_object_comma = 72, // global_object_comma
635 S_global_params = 73, // global_params
636 S_not_empty_global_params = 74, // not_empty_global_params
637 S_global_param = 75, // global_param
638 S_boot_update = 76, // boot_update
639 S_subscribe_changes = 77, // subscribe_changes
640 S_validate_changes = 78, // validate_changes
641 S_user_context = 79, // user_context
642 S_80_9 = 80, // $@9
643 S_comment = 81, // comment
644 S_82_10 = 82, // $@10
645 S_hooks_libraries = 83, // hooks_libraries
646 S_84_11 = 84, // $@11
647 S_hooks_libraries_list = 85, // hooks_libraries_list
648 S_not_empty_hooks_libraries_list = 86, // not_empty_hooks_libraries_list
649 S_hooks_library = 87, // hooks_library
650 S_88_12 = 88, // $@12
651 S_hooks_params = 89, // hooks_params
652 S_hooks_param = 90, // hooks_param
653 S_library = 91, // library
654 S_92_13 = 92, // $@13
655 S_parameters = 93, // parameters
656 S_94_14 = 94, // $@14
657 S_managed_servers = 95, // managed_servers
658 S_96_15 = 96, // $@15
659 S_servers_entries = 97, // servers_entries
660 S_not_empty_servers_entries = 98, // not_empty_servers_entries
661 S_server_entry = 99, // server_entry
662 S_dhcp4_server = 100, // dhcp4_server
663 S_101_16 = 101, // $@16
664 S_dhcp6_server = 102, // dhcp6_server
665 S_103_17 = 103, // $@17
666 S_d2_server = 104, // d2_server
667 S_105_18 = 105, // $@18
668 S_ca_server = 106, // ca_server
669 S_107_19 = 107, // $@19
670 S_managed_server_params = 108, // managed_server_params
671 S_managed_server_param = 109, // managed_server_param
672 S_model = 110, // model
673 S_111_20 = 111, // $@20
674 S_control_socket = 112, // control_socket
675 S_113_21 = 113, // $@21
676 S_control_socket_params = 114, // control_socket_params
677 S_control_socket_param = 115, // control_socket_param
678 S_socket_type = 116, // socket_type
679 S_117_22 = 117, // $@22
680 S_socket_type_value = 118, // socket_type_value
681 S_socket_name = 119, // socket_name
682 S_120_23 = 120, // $@23
683 S_socket_url = 121, // socket_url
684 S_122_24 = 122, // $@24
685 S_loggers = 123, // loggers
686 S_124_25 = 124, // $@25
687 S_loggers_entries = 125, // loggers_entries
688 S_logger_entry = 126, // logger_entry
689 S_127_26 = 127, // $@26
690 S_logger_params = 128, // logger_params
691 S_logger_param = 129, // logger_param
692 S_name = 130, // name
693 S_131_27 = 131, // $@27
694 S_debuglevel = 132, // debuglevel
695 S_severity = 133, // severity
696 S_134_28 = 134, // $@28
697 S_output_options_list = 135, // output_options_list
698 S_136_29 = 136, // $@29
699 S_output_options_list_content = 137, // output_options_list_content
700 S_output_entry = 138, // output_entry
701 S_139_30 = 139, // $@30
702 S_output_params_list = 140, // output_params_list
703 S_output_params = 141, // output_params
704 S_output = 142, // output
705 S_143_31 = 143, // $@31
706 S_flush = 144, // flush
707 S_maxsize = 145, // maxsize
708 S_maxver = 146, // maxver
709 S_pattern = 147, // pattern
710 S_148_32 = 148 // $@32
711 };
712 };
713
716
719
726 template <typename Base>
727 struct basic_symbol : Base
728 {
730 typedef Base super_type;
731
734 : value ()
735 , location ()
736 {}
737
738#if 201103L <= YY_CPLUSPLUS
741 : Base (std::move (that))
742 , value ()
743 , location (std::move (that.location))
744 {
745 switch (this->kind ())
746 {
747 case symbol_kind::S_value: // value
748 case symbol_kind::S_map_value: // map_value
749 case symbol_kind::S_socket_type_value: // socket_type_value
750 value.move< ElementPtr > (std::move (that.value));
751 break;
752
753 case symbol_kind::S_BOOLEAN: // "boolean"
754 value.move< bool > (std::move (that.value));
755 break;
756
757 case symbol_kind::S_FLOAT: // "floating point"
758 value.move< double > (std::move (that.value));
759 break;
760
761 case symbol_kind::S_INTEGER: // "integer"
762 value.move< int64_t > (std::move (that.value));
763 break;
764
765 case symbol_kind::S_STRING: // "constant string"
766 value.move< string > (std::move (that.value));
767 break;
768
769 default:
770 break;
771 }
772
773 }
774#endif
775
778
780#if 201103L <= YY_CPLUSPLUS
781 basic_symbol (typename Base::kind_type t, location_type&& l)
782 : Base (t)
783 , location (std::move (l))
784 {}
785#else
786 basic_symbol (typename Base::kind_type t, const location_type& l)
787 : Base (t)
788 , location (l)
789 {}
790#endif
791
792#if 201103L <= YY_CPLUSPLUS
793 basic_symbol (typename Base::kind_type t, ElementPtr&& v, location_type&& l)
794 : Base (t)
795 , value (std::move (v))
796 , location (std::move (l))
797 {}
798#else
799 basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
800 : Base (t)
801 , value (v)
802 , location (l)
803 {}
804#endif
805
806#if 201103L <= YY_CPLUSPLUS
807 basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l)
808 : Base (t)
809 , value (std::move (v))
810 , location (std::move (l))
811 {}
812#else
813 basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
814 : Base (t)
815 , value (v)
816 , location (l)
817 {}
818#endif
819
820#if 201103L <= YY_CPLUSPLUS
821 basic_symbol (typename Base::kind_type t, double&& v, location_type&& l)
822 : Base (t)
823 , value (std::move (v))
824 , location (std::move (l))
825 {}
826#else
827 basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
828 : Base (t)
829 , value (v)
830 , location (l)
831 {}
832#endif
833
834#if 201103L <= YY_CPLUSPLUS
835 basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l)
836 : Base (t)
837 , value (std::move (v))
838 , location (std::move (l))
839 {}
840#else
841 basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
842 : Base (t)
843 , value (v)
844 , location (l)
845 {}
846#endif
847
848#if 201103L <= YY_CPLUSPLUS
849 basic_symbol (typename Base::kind_type t, string&& v, location_type&& l)
850 : Base (t)
851 , value (std::move (v))
852 , location (std::move (l))
853 {}
854#else
855 basic_symbol (typename Base::kind_type t, const string& v, const location_type& l)
856 : Base (t)
857 , value (v)
858 , location (l)
859 {}
860#endif
861
864 {
865 clear ();
866 }
867
868
869
872 {
873 // User destructor.
874 symbol_kind_type yykind = this->kind ();
875 basic_symbol<Base>& yysym = *this;
876 (void) yysym;
877 switch (yykind)
878 {
879 default:
880 break;
881 }
882
883 // Value type destructor.
884switch (yykind)
885 {
886 case symbol_kind::S_value: // value
887 case symbol_kind::S_map_value: // map_value
888 case symbol_kind::S_socket_type_value: // socket_type_value
889 value.template destroy< ElementPtr > ();
890 break;
891
892 case symbol_kind::S_BOOLEAN: // "boolean"
893 value.template destroy< bool > ();
894 break;
895
896 case symbol_kind::S_FLOAT: // "floating point"
897 value.template destroy< double > ();
898 break;
899
900 case symbol_kind::S_INTEGER: // "integer"
901 value.template destroy< int64_t > ();
902 break;
903
904 case symbol_kind::S_STRING: // "constant string"
905 value.template destroy< string > ();
906 break;
907
908 default:
909 break;
910 }
911
912 Base::clear ();
913 }
914
916 std::string name () const YY_NOEXCEPT
917 {
918 return NetconfParser::symbol_name (this->kind ());
919 }
920
923
925 bool empty () const YY_NOEXCEPT;
926
928 void move (basic_symbol& s);
929
932
935
936 private:
937#if YY_CPLUSPLUS < 201103L
939 basic_symbol& operator= (const basic_symbol& that);
940#endif
941 };
942
944 struct by_kind
945 {
948
951
952#if 201103L <= YY_CPLUSPLUS
954 by_kind (by_kind&& that) YY_NOEXCEPT;
955#endif
956
958 by_kind (const by_kind& that) YY_NOEXCEPT;
959
962
963
964
966 void clear () YY_NOEXCEPT;
967
969 void move (by_kind& that);
970
973 symbol_kind_type kind () const YY_NOEXCEPT;
974
976 symbol_kind_type type_get () const YY_NOEXCEPT;
977
981 };
982
985
988 {
991
994
996#if 201103L <= YY_CPLUSPLUS
997 symbol_type (int tok, location_type l)
998 : super_type (token_kind_type (tok), std::move (l))
999#else
1000 symbol_type (int tok, const location_type& l)
1001 : super_type (token_kind_type (tok), l)
1002#endif
1003 {
1004#if !defined _MSC_VER || defined __clang__
1005 NETCONF__ASSERT (tok == token::TOKEN_END
1006 || (token::TOKEN_NETCONF_error <= tok && tok <= token::TOKEN_START_SUB_NETCONF));
1007#endif
1008 }
1009#if 201103L <= YY_CPLUSPLUS
1010 symbol_type (int tok, bool v, location_type l)
1011 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1012#else
1013 symbol_type (int tok, const bool& v, const location_type& l)
1014 : super_type (token_kind_type (tok), v, l)
1015#endif
1016 {
1017#if !defined _MSC_VER || defined __clang__
1018 NETCONF__ASSERT (tok == token::TOKEN_BOOLEAN);
1019#endif
1020 }
1021#if 201103L <= YY_CPLUSPLUS
1022 symbol_type (int tok, double v, location_type l)
1023 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1024#else
1025 symbol_type (int tok, const double& v, const location_type& l)
1026 : super_type (token_kind_type (tok), v, l)
1027#endif
1028 {
1029#if !defined _MSC_VER || defined __clang__
1030 NETCONF__ASSERT (tok == token::TOKEN_FLOAT);
1031#endif
1032 }
1033#if 201103L <= YY_CPLUSPLUS
1034 symbol_type (int tok, int64_t v, location_type l)
1035 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1036#else
1037 symbol_type (int tok, const int64_t& v, const location_type& l)
1038 : super_type (token_kind_type (tok), v, l)
1039#endif
1040 {
1041#if !defined _MSC_VER || defined __clang__
1042 NETCONF__ASSERT (tok == token::TOKEN_INTEGER);
1043#endif
1044 }
1045#if 201103L <= YY_CPLUSPLUS
1046 symbol_type (int tok, string v, location_type l)
1047 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1048#else
1049 symbol_type (int tok, const string& v, const location_type& l)
1050 : super_type (token_kind_type (tok), v, l)
1051#endif
1052 {
1053#if !defined _MSC_VER || defined __clang__
1054 NETCONF__ASSERT (tok == token::TOKEN_STRING);
1055#endif
1056 }
1057 };
1058
1061 virtual ~NetconfParser ();
1062
1063#if 201103L <= YY_CPLUSPLUS
1065 NetconfParser (const NetconfParser&) = delete;
1067 NetconfParser& operator= (const NetconfParser&) = delete;
1068#endif
1069
1072 int operator() ();
1073
1076 virtual int parse ();
1077
1078#if NETCONF_DEBUG
1080 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1082 void set_debug_stream (std::ostream &);
1083
1085 typedef int debug_level_type;
1087 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
1089 void set_debug_level (debug_level_type l);
1090#endif
1091
1095 virtual void error (const location_type& loc, const std::string& msg);
1096
1098 void error (const syntax_error& err);
1099
1102 static std::string symbol_name (symbol_kind_type yysymbol);
1103
1104 // Implementation of make_symbol for each token kind.
1105#if 201103L <= YY_CPLUSPLUS
1106 static
1107 symbol_type
1108 make_END (location_type l)
1109 {
1110 return symbol_type (token::TOKEN_END, std::move (l));
1111 }
1112#else
1113 static
1114 symbol_type
1116 {
1117 return symbol_type (token::TOKEN_END, l);
1118 }
1119#endif
1120#if 201103L <= YY_CPLUSPLUS
1121 static
1122 symbol_type
1123 make_NETCONF_error (location_type l)
1124 {
1125 return symbol_type (token::TOKEN_NETCONF_error, std::move (l));
1126 }
1127#else
1128 static
1129 symbol_type
1131 {
1132 return symbol_type (token::TOKEN_NETCONF_error, l);
1133 }
1134#endif
1135#if 201103L <= YY_CPLUSPLUS
1136 static
1137 symbol_type
1138 make_NETCONF_UNDEF (location_type l)
1139 {
1140 return symbol_type (token::TOKEN_NETCONF_UNDEF, std::move (l));
1141 }
1142#else
1143 static
1144 symbol_type
1146 {
1147 return symbol_type (token::TOKEN_NETCONF_UNDEF, l);
1148 }
1149#endif
1150#if 201103L <= YY_CPLUSPLUS
1151 static
1152 symbol_type
1153 make_COMMA (location_type l)
1154 {
1155 return symbol_type (token::TOKEN_COMMA, std::move (l));
1156 }
1157#else
1158 static
1159 symbol_type
1161 {
1162 return symbol_type (token::TOKEN_COMMA, l);
1163 }
1164#endif
1165#if 201103L <= YY_CPLUSPLUS
1166 static
1167 symbol_type
1168 make_COLON (location_type l)
1169 {
1170 return symbol_type (token::TOKEN_COLON, std::move (l));
1171 }
1172#else
1173 static
1174 symbol_type
1176 {
1177 return symbol_type (token::TOKEN_COLON, l);
1178 }
1179#endif
1180#if 201103L <= YY_CPLUSPLUS
1181 static
1182 symbol_type
1183 make_LSQUARE_BRACKET (location_type l)
1184 {
1185 return symbol_type (token::TOKEN_LSQUARE_BRACKET, std::move (l));
1186 }
1187#else
1188 static
1189 symbol_type
1191 {
1192 return symbol_type (token::TOKEN_LSQUARE_BRACKET, l);
1193 }
1194#endif
1195#if 201103L <= YY_CPLUSPLUS
1196 static
1197 symbol_type
1198 make_RSQUARE_BRACKET (location_type l)
1199 {
1200 return symbol_type (token::TOKEN_RSQUARE_BRACKET, std::move (l));
1201 }
1202#else
1203 static
1204 symbol_type
1206 {
1207 return symbol_type (token::TOKEN_RSQUARE_BRACKET, l);
1208 }
1209#endif
1210#if 201103L <= YY_CPLUSPLUS
1211 static
1212 symbol_type
1213 make_LCURLY_BRACKET (location_type l)
1214 {
1215 return symbol_type (token::TOKEN_LCURLY_BRACKET, std::move (l));
1216 }
1217#else
1218 static
1219 symbol_type
1221 {
1222 return symbol_type (token::TOKEN_LCURLY_BRACKET, l);
1223 }
1224#endif
1225#if 201103L <= YY_CPLUSPLUS
1226 static
1227 symbol_type
1228 make_RCURLY_BRACKET (location_type l)
1229 {
1230 return symbol_type (token::TOKEN_RCURLY_BRACKET, std::move (l));
1231 }
1232#else
1233 static
1234 symbol_type
1236 {
1237 return symbol_type (token::TOKEN_RCURLY_BRACKET, l);
1238 }
1239#endif
1240#if 201103L <= YY_CPLUSPLUS
1241 static
1242 symbol_type
1243 make_NULL_TYPE (location_type l)
1244 {
1245 return symbol_type (token::TOKEN_NULL_TYPE, std::move (l));
1246 }
1247#else
1248 static
1249 symbol_type
1251 {
1252 return symbol_type (token::TOKEN_NULL_TYPE, l);
1253 }
1254#endif
1255#if 201103L <= YY_CPLUSPLUS
1256 static
1257 symbol_type
1258 make_NETCONF (location_type l)
1259 {
1260 return symbol_type (token::TOKEN_NETCONF, std::move (l));
1261 }
1262#else
1263 static
1264 symbol_type
1266 {
1267 return symbol_type (token::TOKEN_NETCONF, l);
1268 }
1269#endif
1270#if 201103L <= YY_CPLUSPLUS
1271 static
1272 symbol_type
1273 make_USER_CONTEXT (location_type l)
1274 {
1275 return symbol_type (token::TOKEN_USER_CONTEXT, std::move (l));
1276 }
1277#else
1278 static
1279 symbol_type
1281 {
1282 return symbol_type (token::TOKEN_USER_CONTEXT, l);
1283 }
1284#endif
1285#if 201103L <= YY_CPLUSPLUS
1286 static
1287 symbol_type
1288 make_COMMENT (location_type l)
1289 {
1290 return symbol_type (token::TOKEN_COMMENT, std::move (l));
1291 }
1292#else
1293 static
1294 symbol_type
1296 {
1297 return symbol_type (token::TOKEN_COMMENT, l);
1298 }
1299#endif
1300#if 201103L <= YY_CPLUSPLUS
1301 static
1302 symbol_type
1303 make_BOOT_UPDATE (location_type l)
1304 {
1305 return symbol_type (token::TOKEN_BOOT_UPDATE, std::move (l));
1306 }
1307#else
1308 static
1309 symbol_type
1311 {
1312 return symbol_type (token::TOKEN_BOOT_UPDATE, l);
1313 }
1314#endif
1315#if 201103L <= YY_CPLUSPLUS
1316 static
1317 symbol_type
1318 make_SUBSCRIBE_CHANGES (location_type l)
1319 {
1320 return symbol_type (token::TOKEN_SUBSCRIBE_CHANGES, std::move (l));
1321 }
1322#else
1323 static
1324 symbol_type
1326 {
1327 return symbol_type (token::TOKEN_SUBSCRIBE_CHANGES, l);
1328 }
1329#endif
1330#if 201103L <= YY_CPLUSPLUS
1331 static
1332 symbol_type
1333 make_VALIDATE_CHANGES (location_type l)
1334 {
1335 return symbol_type (token::TOKEN_VALIDATE_CHANGES, std::move (l));
1336 }
1337#else
1338 static
1339 symbol_type
1341 {
1342 return symbol_type (token::TOKEN_VALIDATE_CHANGES, l);
1343 }
1344#endif
1345#if 201103L <= YY_CPLUSPLUS
1346 static
1347 symbol_type
1348 make_MANAGED_SERVERS (location_type l)
1349 {
1350 return symbol_type (token::TOKEN_MANAGED_SERVERS, std::move (l));
1351 }
1352#else
1353 static
1354 symbol_type
1356 {
1357 return symbol_type (token::TOKEN_MANAGED_SERVERS, l);
1358 }
1359#endif
1360#if 201103L <= YY_CPLUSPLUS
1361 static
1362 symbol_type
1363 make_DHCP4_SERVER (location_type l)
1364 {
1365 return symbol_type (token::TOKEN_DHCP4_SERVER, std::move (l));
1366 }
1367#else
1368 static
1369 symbol_type
1371 {
1372 return symbol_type (token::TOKEN_DHCP4_SERVER, l);
1373 }
1374#endif
1375#if 201103L <= YY_CPLUSPLUS
1376 static
1377 symbol_type
1378 make_DHCP6_SERVER (location_type l)
1379 {
1380 return symbol_type (token::TOKEN_DHCP6_SERVER, std::move (l));
1381 }
1382#else
1383 static
1384 symbol_type
1386 {
1387 return symbol_type (token::TOKEN_DHCP6_SERVER, l);
1388 }
1389#endif
1390#if 201103L <= YY_CPLUSPLUS
1391 static
1392 symbol_type
1393 make_D2_SERVER (location_type l)
1394 {
1395 return symbol_type (token::TOKEN_D2_SERVER, std::move (l));
1396 }
1397#else
1398 static
1399 symbol_type
1401 {
1402 return symbol_type (token::TOKEN_D2_SERVER, l);
1403 }
1404#endif
1405#if 201103L <= YY_CPLUSPLUS
1406 static
1407 symbol_type
1408 make_CA_SERVER (location_type l)
1409 {
1410 return symbol_type (token::TOKEN_CA_SERVER, std::move (l));
1411 }
1412#else
1413 static
1414 symbol_type
1416 {
1417 return symbol_type (token::TOKEN_CA_SERVER, l);
1418 }
1419#endif
1420#if 201103L <= YY_CPLUSPLUS
1421 static
1422 symbol_type
1423 make_MODEL (location_type l)
1424 {
1425 return symbol_type (token::TOKEN_MODEL, std::move (l));
1426 }
1427#else
1428 static
1429 symbol_type
1431 {
1432 return symbol_type (token::TOKEN_MODEL, l);
1433 }
1434#endif
1435#if 201103L <= YY_CPLUSPLUS
1436 static
1437 symbol_type
1438 make_CONTROL_SOCKET (location_type l)
1439 {
1440 return symbol_type (token::TOKEN_CONTROL_SOCKET, std::move (l));
1441 }
1442#else
1443 static
1444 symbol_type
1446 {
1447 return symbol_type (token::TOKEN_CONTROL_SOCKET, l);
1448 }
1449#endif
1450#if 201103L <= YY_CPLUSPLUS
1451 static
1452 symbol_type
1453 make_SOCKET_TYPE (location_type l)
1454 {
1455 return symbol_type (token::TOKEN_SOCKET_TYPE, std::move (l));
1456 }
1457#else
1458 static
1459 symbol_type
1461 {
1462 return symbol_type (token::TOKEN_SOCKET_TYPE, l);
1463 }
1464#endif
1465#if 201103L <= YY_CPLUSPLUS
1466 static
1467 symbol_type
1468 make_UNIX (location_type l)
1469 {
1470 return symbol_type (token::TOKEN_UNIX, std::move (l));
1471 }
1472#else
1473 static
1474 symbol_type
1476 {
1477 return symbol_type (token::TOKEN_UNIX, l);
1478 }
1479#endif
1480#if 201103L <= YY_CPLUSPLUS
1481 static
1482 symbol_type
1483 make_HTTP (location_type l)
1484 {
1485 return symbol_type (token::TOKEN_HTTP, std::move (l));
1486 }
1487#else
1488 static
1489 symbol_type
1491 {
1492 return symbol_type (token::TOKEN_HTTP, l);
1493 }
1494#endif
1495#if 201103L <= YY_CPLUSPLUS
1496 static
1497 symbol_type
1498 make_STDOUT (location_type l)
1499 {
1500 return symbol_type (token::TOKEN_STDOUT, std::move (l));
1501 }
1502#else
1503 static
1504 symbol_type
1506 {
1507 return symbol_type (token::TOKEN_STDOUT, l);
1508 }
1509#endif
1510#if 201103L <= YY_CPLUSPLUS
1511 static
1512 symbol_type
1513 make_SOCKET_NAME (location_type l)
1514 {
1515 return symbol_type (token::TOKEN_SOCKET_NAME, std::move (l));
1516 }
1517#else
1518 static
1519 symbol_type
1521 {
1522 return symbol_type (token::TOKEN_SOCKET_NAME, l);
1523 }
1524#endif
1525#if 201103L <= YY_CPLUSPLUS
1526 static
1527 symbol_type
1528 make_SOCKET_URL (location_type l)
1529 {
1530 return symbol_type (token::TOKEN_SOCKET_URL, std::move (l));
1531 }
1532#else
1533 static
1534 symbol_type
1536 {
1537 return symbol_type (token::TOKEN_SOCKET_URL, l);
1538 }
1539#endif
1540#if 201103L <= YY_CPLUSPLUS
1541 static
1542 symbol_type
1543 make_HOOKS_LIBRARIES (location_type l)
1544 {
1545 return symbol_type (token::TOKEN_HOOKS_LIBRARIES, std::move (l));
1546 }
1547#else
1548 static
1549 symbol_type
1551 {
1552 return symbol_type (token::TOKEN_HOOKS_LIBRARIES, l);
1553 }
1554#endif
1555#if 201103L <= YY_CPLUSPLUS
1556 static
1557 symbol_type
1558 make_LIBRARY (location_type l)
1559 {
1560 return symbol_type (token::TOKEN_LIBRARY, std::move (l));
1561 }
1562#else
1563 static
1564 symbol_type
1566 {
1567 return symbol_type (token::TOKEN_LIBRARY, l);
1568 }
1569#endif
1570#if 201103L <= YY_CPLUSPLUS
1571 static
1572 symbol_type
1573 make_PARAMETERS (location_type l)
1574 {
1575 return symbol_type (token::TOKEN_PARAMETERS, std::move (l));
1576 }
1577#else
1578 static
1579 symbol_type
1581 {
1582 return symbol_type (token::TOKEN_PARAMETERS, l);
1583 }
1584#endif
1585#if 201103L <= YY_CPLUSPLUS
1586 static
1587 symbol_type
1588 make_LOGGERS (location_type l)
1589 {
1590 return symbol_type (token::TOKEN_LOGGERS, std::move (l));
1591 }
1592#else
1593 static
1594 symbol_type
1596 {
1597 return symbol_type (token::TOKEN_LOGGERS, l);
1598 }
1599#endif
1600#if 201103L <= YY_CPLUSPLUS
1601 static
1602 symbol_type
1603 make_NAME (location_type l)
1604 {
1605 return symbol_type (token::TOKEN_NAME, std::move (l));
1606 }
1607#else
1608 static
1609 symbol_type
1611 {
1612 return symbol_type (token::TOKEN_NAME, l);
1613 }
1614#endif
1615#if 201103L <= YY_CPLUSPLUS
1616 static
1617 symbol_type
1618 make_OUTPUT_OPTIONS (location_type l)
1619 {
1620 return symbol_type (token::TOKEN_OUTPUT_OPTIONS, std::move (l));
1621 }
1622#else
1623 static
1624 symbol_type
1626 {
1627 return symbol_type (token::TOKEN_OUTPUT_OPTIONS, l);
1628 }
1629#endif
1630#if 201103L <= YY_CPLUSPLUS
1631 static
1632 symbol_type
1633 make_OUTPUT (location_type l)
1634 {
1635 return symbol_type (token::TOKEN_OUTPUT, std::move (l));
1636 }
1637#else
1638 static
1639 symbol_type
1641 {
1642 return symbol_type (token::TOKEN_OUTPUT, l);
1643 }
1644#endif
1645#if 201103L <= YY_CPLUSPLUS
1646 static
1647 symbol_type
1648 make_DEBUGLEVEL (location_type l)
1649 {
1650 return symbol_type (token::TOKEN_DEBUGLEVEL, std::move (l));
1651 }
1652#else
1653 static
1654 symbol_type
1656 {
1657 return symbol_type (token::TOKEN_DEBUGLEVEL, l);
1658 }
1659#endif
1660#if 201103L <= YY_CPLUSPLUS
1661 static
1662 symbol_type
1663 make_SEVERITY (location_type l)
1664 {
1665 return symbol_type (token::TOKEN_SEVERITY, std::move (l));
1666 }
1667#else
1668 static
1669 symbol_type
1671 {
1672 return symbol_type (token::TOKEN_SEVERITY, l);
1673 }
1674#endif
1675#if 201103L <= YY_CPLUSPLUS
1676 static
1677 symbol_type
1678 make_FLUSH (location_type l)
1679 {
1680 return symbol_type (token::TOKEN_FLUSH, std::move (l));
1681 }
1682#else
1683 static
1684 symbol_type
1686 {
1687 return symbol_type (token::TOKEN_FLUSH, l);
1688 }
1689#endif
1690#if 201103L <= YY_CPLUSPLUS
1691 static
1692 symbol_type
1693 make_MAXSIZE (location_type l)
1694 {
1695 return symbol_type (token::TOKEN_MAXSIZE, std::move (l));
1696 }
1697#else
1698 static
1699 symbol_type
1701 {
1702 return symbol_type (token::TOKEN_MAXSIZE, l);
1703 }
1704#endif
1705#if 201103L <= YY_CPLUSPLUS
1706 static
1707 symbol_type
1708 make_MAXVER (location_type l)
1709 {
1710 return symbol_type (token::TOKEN_MAXVER, std::move (l));
1711 }
1712#else
1713 static
1714 symbol_type
1716 {
1717 return symbol_type (token::TOKEN_MAXVER, l);
1718 }
1719#endif
1720#if 201103L <= YY_CPLUSPLUS
1721 static
1722 symbol_type
1723 make_PATTERN (location_type l)
1724 {
1725 return symbol_type (token::TOKEN_PATTERN, std::move (l));
1726 }
1727#else
1728 static
1729 symbol_type
1731 {
1732 return symbol_type (token::TOKEN_PATTERN, l);
1733 }
1734#endif
1735#if 201103L <= YY_CPLUSPLUS
1736 static
1737 symbol_type
1738 make_START_JSON (location_type l)
1739 {
1740 return symbol_type (token::TOKEN_START_JSON, std::move (l));
1741 }
1742#else
1743 static
1744 symbol_type
1746 {
1747 return symbol_type (token::TOKEN_START_JSON, l);
1748 }
1749#endif
1750#if 201103L <= YY_CPLUSPLUS
1751 static
1752 symbol_type
1753 make_START_NETCONF (location_type l)
1754 {
1755 return symbol_type (token::TOKEN_START_NETCONF, std::move (l));
1756 }
1757#else
1758 static
1759 symbol_type
1761 {
1762 return symbol_type (token::TOKEN_START_NETCONF, l);
1763 }
1764#endif
1765#if 201103L <= YY_CPLUSPLUS
1766 static
1767 symbol_type
1768 make_START_SUB_NETCONF (location_type l)
1769 {
1770 return symbol_type (token::TOKEN_START_SUB_NETCONF, std::move (l));
1771 }
1772#else
1773 static
1774 symbol_type
1776 {
1777 return symbol_type (token::TOKEN_START_SUB_NETCONF, l);
1778 }
1779#endif
1780#if 201103L <= YY_CPLUSPLUS
1781 static
1782 symbol_type
1783 make_STRING (string v, location_type l)
1784 {
1785 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
1786 }
1787#else
1788 static
1789 symbol_type
1790 make_STRING (const string& v, const location_type& l)
1791 {
1792 return symbol_type (token::TOKEN_STRING, v, l);
1793 }
1794#endif
1795#if 201103L <= YY_CPLUSPLUS
1796 static
1797 symbol_type
1798 make_INTEGER (int64_t v, location_type l)
1799 {
1800 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
1801 }
1802#else
1803 static
1804 symbol_type
1805 make_INTEGER (const int64_t& v, const location_type& l)
1806 {
1807 return symbol_type (token::TOKEN_INTEGER, v, l);
1808 }
1809#endif
1810#if 201103L <= YY_CPLUSPLUS
1811 static
1812 symbol_type
1813 make_FLOAT (double v, location_type l)
1814 {
1815 return symbol_type (token::TOKEN_FLOAT, std::move (v), std::move (l));
1816 }
1817#else
1818 static
1819 symbol_type
1820 make_FLOAT (const double& v, const location_type& l)
1821 {
1822 return symbol_type (token::TOKEN_FLOAT, v, l);
1823 }
1824#endif
1825#if 201103L <= YY_CPLUSPLUS
1826 static
1827 symbol_type
1828 make_BOOLEAN (bool v, location_type l)
1829 {
1830 return symbol_type (token::TOKEN_BOOLEAN, std::move (v), std::move (l));
1831 }
1832#else
1833 static
1834 symbol_type
1835 make_BOOLEAN (const bool& v, const location_type& l)
1836 {
1837 return symbol_type (token::TOKEN_BOOLEAN, v, l);
1838 }
1839#endif
1840
1841
1843 {
1844 public:
1845 context (const NetconfParser& yyparser, const symbol_type& yyla);
1846 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
1847 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
1848 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
1849
1853 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
1854
1855 private:
1856 const NetconfParser& yyparser_;
1857 const symbol_type& yyla_;
1858 };
1859
1860 private:
1861#if YY_CPLUSPLUS < 201103L
1865 NetconfParser& operator= (const NetconfParser&);
1866#endif
1867
1868
1870 typedef short state_type;
1871
1873 int yy_syntax_error_arguments_ (const context& yyctx,
1874 symbol_kind_type yyarg[], int yyargn) const;
1875
1878 virtual std::string yysyntax_error_ (const context& yyctx) const;
1882 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
1883
1886 static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
1887
1890 static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
1891
1892 static const signed char yypact_ninf_;
1893 static const signed char yytable_ninf_;
1894
1898 static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
1899
1901 static std::string yytnamerr_ (const char *yystr);
1902
1904 static const char* const yytname_[];
1905
1906
1907 // Tables.
1908 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1909 // STATE-NUM.
1910 static const short yypact_[];
1911
1912 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1913 // Performed when YYTABLE does not specify something else to do. Zero
1914 // means the default is an error.
1915 static const unsigned char yydefact_[];
1916
1917 // YYPGOTO[NTERM-NUM].
1918 static const signed char yypgoto_[];
1919
1920 // YYDEFGOTO[NTERM-NUM].
1921 static const short yydefgoto_[];
1922
1923 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1924 // positive, shift that token. If negative, reduce the rule whose
1925 // number is the opposite. If YYTABLE_NINF, syntax error.
1926 static const short yytable_[];
1927
1928 static const short yycheck_[];
1929
1930 // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1931 // state STATE-NUM.
1932 static const unsigned char yystos_[];
1933
1934 // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
1935 static const unsigned char yyr1_[];
1936
1937 // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
1938 static const signed char yyr2_[];
1939
1940
1941#if NETCONF_DEBUG
1942 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
1943 static const short yyrline_[];
1945 virtual void yy_reduce_print_ (int r) const;
1947 virtual void yy_stack_print_ () const;
1948
1950 int yydebug_;
1952 std::ostream* yycdebug_;
1953
1957 template <typename Base>
1958 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
1959#endif
1960
1965 template <typename Base>
1966 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
1967
1968 private:
1970 struct by_state
1971 {
1973 by_state () YY_NOEXCEPT;
1974
1976 typedef state_type kind_type;
1977
1979 by_state (kind_type s) YY_NOEXCEPT;
1980
1982 by_state (const by_state& that) YY_NOEXCEPT;
1983
1985 void clear () YY_NOEXCEPT;
1986
1988 void move (by_state& that);
1989
1992 symbol_kind_type kind () const YY_NOEXCEPT;
1993
1996 enum { empty_state = 0 };
1997
2000 state_type state;
2001 };
2002
2004 struct stack_symbol_type : basic_symbol<by_state>
2005 {
2007 typedef basic_symbol<by_state> super_type;
2009 stack_symbol_type ();
2011 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2013 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2014#if YY_CPLUSPLUS < 201103L
2017 stack_symbol_type& operator= (stack_symbol_type& that);
2018
2021 stack_symbol_type& operator= (const stack_symbol_type& that);
2022#endif
2023 };
2024
2026 template <typename T, typename S = std::vector<T> >
2027 class stack
2028 {
2029 public:
2030 // Hide our reversed order.
2031 typedef typename S::iterator iterator;
2032 typedef typename S::const_iterator const_iterator;
2033 typedef typename S::size_type size_type;
2034 typedef typename std::ptrdiff_t index_type;
2035
2036 stack (size_type n = 200) YY_NOEXCEPT
2037 : seq_ (n)
2038 {}
2039
2040#if 201103L <= YY_CPLUSPLUS
2042 stack (const stack&) = delete;
2044 stack& operator= (const stack&) = delete;
2045#endif
2046
2050 const T&
2051 operator[] (index_type i) const
2052 {
2053 return seq_[size_type (size () - 1 - i)];
2054 }
2055
2059 T&
2060 operator[] (index_type i)
2061 {
2062 return seq_[size_type (size () - 1 - i)];
2063 }
2064
2068 void
2069 push (YY_MOVE_REF (T) t)
2070 {
2071 seq_.push_back (T ());
2072 operator[] (0).move (t);
2073 }
2074
2076 void
2077 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2078 {
2079 for (; 0 < n; --n)
2080 seq_.pop_back ();
2081 }
2082
2084 void
2085 clear () YY_NOEXCEPT
2086 {
2087 seq_.clear ();
2088 }
2089
2091 index_type
2092 size () const YY_NOEXCEPT
2093 {
2094 return index_type (seq_.size ());
2095 }
2096
2098 const_iterator
2099 begin () const YY_NOEXCEPT
2100 {
2101 return seq_.begin ();
2102 }
2103
2105 const_iterator
2106 end () const YY_NOEXCEPT
2107 {
2108 return seq_.end ();
2109 }
2110
2112 class slice
2113 {
2114 public:
2115 slice (const stack& stack, index_type range) YY_NOEXCEPT
2116 : stack_ (stack)
2117 , range_ (range)
2118 {}
2119
2120 const T&
2121 operator[] (index_type i) const
2122 {
2123 return stack_[range_ - i];
2124 }
2125
2126 private:
2127 const stack& stack_;
2128 index_type range_;
2129 };
2130
2131 private:
2132#if YY_CPLUSPLUS < 201103L
2134 stack (const stack&);
2136 stack& operator= (const stack&);
2137#endif
2139 S seq_;
2140 };
2141
2142
2144 typedef stack<stack_symbol_type> stack_type;
2145
2147 stack_type yystack_;
2148
2154 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2155
2162 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2163
2165 void yypop_ (int n = 1) YY_NOEXCEPT;
2166
2168 enum
2169 {
2170 yylast_ = 221,
2171 yynnts_ = 100,
2172 yyfinal_ = 8
2173 };
2174
2175
2176 // User arguments.
2178
2179 };
2180
2181 inline
2183 NetconfParser::yytranslate_ (int t) YY_NOEXCEPT
2184 {
2185 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2186 // TOKEN-NUM as returned by yylex.
2187 static
2188 const signed char
2189 translate_table[] =
2190 {
2191 0, 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, 2, 2, 2, 2,
2214 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2215 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2216 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2217 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2218 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2219 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2220 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2221 45, 46, 47, 48
2222 };
2223 // Last valid token kind.
2224 const int code_max = 303;
2225
2226 if (t <= 0)
2227 return symbol_kind::S_YYEOF;
2228 else if (t <= code_max)
2229 return static_cast <symbol_kind_type> (translate_table[t]);
2230 else
2232 }
2233
2234 // basic_symbol.
2235 template <typename Base>
2237 : Base (that)
2238 , value ()
2239 , location (that.location)
2240 {
2241 switch (this->kind ())
2242 {
2243 case symbol_kind::S_value: // value
2244 case symbol_kind::S_map_value: // map_value
2245 case symbol_kind::S_socket_type_value: // socket_type_value
2246 value.copy< ElementPtr > (YY_MOVE (that.value));
2247 break;
2248
2249 case symbol_kind::S_BOOLEAN: // "boolean"
2250 value.copy< bool > (YY_MOVE (that.value));
2251 break;
2252
2253 case symbol_kind::S_FLOAT: // "floating point"
2254 value.copy< double > (YY_MOVE (that.value));
2255 break;
2256
2257 case symbol_kind::S_INTEGER: // "integer"
2258 value.copy< int64_t > (YY_MOVE (that.value));
2259 break;
2260
2261 case symbol_kind::S_STRING: // "constant string"
2262 value.copy< string > (YY_MOVE (that.value));
2263 break;
2264
2265 default:
2266 break;
2267 }
2268
2269 }
2270
2271
2272
2273
2274 template <typename Base>
2277 {
2278 return this->kind ();
2279 }
2280
2281
2282 template <typename Base>
2283 bool
2285 {
2286 return this->kind () == symbol_kind::S_YYEMPTY;
2287 }
2288
2289 template <typename Base>
2290 void
2292 {
2293 super_type::move (s);
2294 switch (this->kind ())
2295 {
2296 case symbol_kind::S_value: // value
2297 case symbol_kind::S_map_value: // map_value
2298 case symbol_kind::S_socket_type_value: // socket_type_value
2299 value.move< ElementPtr > (YY_MOVE (s.value));
2300 break;
2301
2302 case symbol_kind::S_BOOLEAN: // "boolean"
2303 value.move< bool > (YY_MOVE (s.value));
2304 break;
2305
2306 case symbol_kind::S_FLOAT: // "floating point"
2307 value.move< double > (YY_MOVE (s.value));
2308 break;
2309
2310 case symbol_kind::S_INTEGER: // "integer"
2311 value.move< int64_t > (YY_MOVE (s.value));
2312 break;
2313
2314 case symbol_kind::S_STRING: // "constant string"
2315 value.move< string > (YY_MOVE (s.value));
2316 break;
2317
2318 default:
2319 break;
2320 }
2321
2322 location = YY_MOVE (s.location);
2323 }
2324
2325 // by_kind.
2326 inline
2328 : kind_ (symbol_kind::S_YYEMPTY)
2329 {}
2330
2331#if 201103L <= YY_CPLUSPLUS
2332 inline
2334 : kind_ (that.kind_)
2335 {
2336 that.clear ();
2337 }
2338#endif
2339
2340 inline
2342 : kind_ (that.kind_)
2343 {}
2344
2345 inline
2347 : kind_ (yytranslate_ (t))
2348 {}
2349
2350
2351
2352 inline
2353 void
2358
2359 inline
2360 void
2362 {
2363 kind_ = that.kind_;
2364 that.clear ();
2365 }
2366
2367 inline
2370 {
2371 return kind_;
2372 }
2373
2374
2375 inline
2378 {
2379 return this->kind ();
2380 }
2381
2382
2383#line 14 "netconf_parser.yy"
2384} } // isc::netconf
2385#line 2386 "netconf_parser.h"
2386
2387
2388
2389
2390#endif // !YY_NETCONF_NETCONF_PARSER_H_INCLUDED
#define YY_RVREF(Type)
#define YY_MOVE_REF(Type)
#define YY_NOEXCEPT
#define YY_ATTRIBUTE_PURE
#define YY_MOVE
#define YY_NOTHROW
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)
static symbol_type make_HOOKS_LIBRARIES(const location_type &l)
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
static symbol_type make_CONTROL_SOCKET(const location_type &l)
static symbol_type make_OUTPUT(const location_type &l)
static symbol_type make_DHCP6_SERVER(const location_type &l)
static symbol_type make_BOOT_UPDATE(const location_type &l)
value_type semantic_type
Backward compatibility (Bison 3.8).
static symbol_type make_NETCONF_UNDEF(const location_type &l)
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
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)
static symbol_type make_STRING(const string &v, const location_type &l)
static symbol_type make_STDOUT(const location_type &l)
static symbol_type make_SOCKET_TYPE(const location_type &l)
static symbol_type make_LSQUARE_BRACKET(const location_type &l)
static symbol_type make_DHCP4_SERVER(const location_type &l)
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
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 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)
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)
static symbol_type make_USER_CONTEXT(const location_type &l)
static symbol_type make_COMMA(const location_type &l)
location location_type
Symbol locations.
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)
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:28
Defines the logger used by the top-level component of kea-lfc.
Forward declaration of the ParserContext class.
#define NETCONF__ASSERT
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(const basic_symbol &that)
Copy constructor.
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)
basic_symbol(typename Base::kind_type t, const string &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).