Kea 2.0.1
agent_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_AGENT_AGENT_PARSER_H_INCLUDED
46# define YY_AGENT_AGENT_PARSER_H_INCLUDED
47// "%code requires" blocks.
48#line 17 "agent_parser.yy"
49
50#include <string>
51#include <cc/data.h>
52#include <boost/lexical_cast.hpp>
54
55using namespace isc::agent;
56using namespace isc::data;
57using namespace std;
58
59#line 60 "agent_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 AGENT__ASSERT
107# include <cassert>
108# define AGENT__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 AGENT_DEBUG
195# if defined YYDEBUG
196#if YYDEBUG
197# define AGENT_DEBUG 1
198# else
199# define AGENT_DEBUG 0
200# endif
201# else /* ! defined YYDEBUG */
202# define AGENT_DEBUG 1
203# endif /* ! defined YYDEBUG */
204#endif /* ! defined AGENT_DEBUG */
205
206#line 14 "agent_parser.yy"
207namespace isc { namespace agent {
208#line 209 "agent_parser.h"
209
210
211
212
215 {
216 public:
217#ifdef AGENT_STYPE
218# ifdef __GNUC__
219# pragma GCC message "bison: do not #define AGENT_STYPE in C++, use %define api.value.type"
220# endif
221 typedef AGENT_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 AGENT__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 AGENT__ASSERT (!yytypeid_);
260 }
261
262# if 201103L <= YY_CPLUSPLUS
264 template <typename T, typename... U>
265 T&
266 emplace (U&&... u)
267 {
268 AGENT__ASSERT (!yytypeid_);
269 AGENT__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 AGENT__ASSERT (!yytypeid_);
280 AGENT__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 AGENT__ASSERT (!yytypeid_);
291 AGENT__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 AGENT__ASSERT (yytypeid_);
321 AGENT__ASSERT (*yytypeid_ == typeid (T));
322 AGENT__ASSERT (sizeof (T) <= size);
323 return *yyas_<T> ();
324 }
325
327 template <typename T>
328 const T&
330 {
331 AGENT__ASSERT (yytypeid_);
332 AGENT__ASSERT (*yytypeid_ == typeid (T));
333 AGENT__ASSERT (sizeof (T) <= size);
334 return *yyas_<T> ();
335 }
336
345 template <typename T>
346 void
348 {
349 AGENT__ASSERT (yytypeid_);
350 AGENT__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 // auth_type_value
431 char dummy1[sizeof (ElementPtr)];
432
433 // "boolean"
434 char dummy2[sizeof (bool)];
435
436 // "floating point"
437 char dummy3[sizeof (double)];
438
439 // "integer"
440 char dummy4[sizeof (int64_t)];
441
442 // "constant string"
443 char dummy5[sizeof (std::string)];
444 };
445
447 enum { size = sizeof (union_type) };
448
450 union
451 {
453 long double yyalign_me_;
455 char yyraw_[size];
456 };
457
459 const std::type_info *yytypeid_;
460 };
461
462#endif
465
467 typedef location location_type;
468
470 struct syntax_error : std::runtime_error
471 {
472 syntax_error (const location_type& l, const std::string& m)
473 : std::runtime_error (m)
474 , location (l)
475 {}
476
478 : std::runtime_error (s.what ())
479 , location (s.location)
480 {}
481
483
485 };
486
488 struct token
489 {
491 {
492 TOKEN_AGENT_EMPTY = -2,
493 TOKEN_END = 0, // "end of file"
494 TOKEN_AGENT_error = 256, // error
495 TOKEN_AGENT_UNDEF = 257, // "invalid token"
496 TOKEN_COMMA = 258, // ","
497 TOKEN_COLON = 259, // ":"
498 TOKEN_LSQUARE_BRACKET = 260, // "["
499 TOKEN_RSQUARE_BRACKET = 261, // "]"
500 TOKEN_LCURLY_BRACKET = 262, // "{"
501 TOKEN_RCURLY_BRACKET = 263, // "}"
502 TOKEN_NULL_TYPE = 264, // "null"
503 TOKEN_CONTROL_AGENT = 265, // "Control-agent"
504 TOKEN_HTTP_HOST = 266, // "http-host"
505 TOKEN_HTTP_PORT = 267, // "http-port"
506 TOKEN_USER_CONTEXT = 268, // "user-context"
507 TOKEN_COMMENT = 269, // "comment"
508 TOKEN_AUTHENTICATION = 270, // "authentication"
509 TOKEN_TYPE = 271, // "type"
510 TOKEN_BASIC = 272, // "basic"
511 TOKEN_REALM = 273, // "realm"
512 TOKEN_CLIENTS = 274, // "clients"
513 TOKEN_USER = 275, // "user"
514 TOKEN_PASSWORD = 276, // "password"
515 TOKEN_TRUST_ANCHOR = 277, // "trust-anchor"
516 TOKEN_CERT_FILE = 278, // "cert-file"
517 TOKEN_KEY_FILE = 279, // "key-file"
518 TOKEN_CERT_REQUIRED = 280, // "cert-required"
519 TOKEN_CONTROL_SOCKETS = 281, // "control-sockets"
520 TOKEN_DHCP4_SERVER = 282, // "dhcp4"
521 TOKEN_DHCP6_SERVER = 283, // "dhcp6"
522 TOKEN_D2_SERVER = 284, // "d2"
523 TOKEN_SOCKET_NAME = 285, // "socket-name"
524 TOKEN_SOCKET_TYPE = 286, // "socket-type"
525 TOKEN_UNIX = 287, // "unix"
526 TOKEN_HOOKS_LIBRARIES = 288, // "hooks-libraries"
527 TOKEN_LIBRARY = 289, // "library"
528 TOKEN_PARAMETERS = 290, // "parameters"
529 TOKEN_LOGGERS = 291, // "loggers"
530 TOKEN_NAME = 292, // "name"
531 TOKEN_OUTPUT_OPTIONS = 293, // "output_options"
532 TOKEN_OUTPUT = 294, // "output"
533 TOKEN_DEBUGLEVEL = 295, // "debuglevel"
534 TOKEN_SEVERITY = 296, // "severity"
535 TOKEN_FLUSH = 297, // "flush"
536 TOKEN_MAXSIZE = 298, // "maxsize"
537 TOKEN_MAXVER = 299, // "maxver"
538 TOKEN_PATTERN = 300, // "pattern"
539 TOKEN_START_JSON = 301, // START_JSON
540 TOKEN_START_AGENT = 302, // START_AGENT
541 TOKEN_START_SUB_AGENT = 303, // START_SUB_AGENT
542 TOKEN_STRING = 304, // "constant string"
543 TOKEN_INTEGER = 305, // "integer"
544 TOKEN_FLOAT = 306, // "floating point"
545 TOKEN_BOOLEAN = 307 // "boolean"
546 };
549 };
550
553
556
559 {
561 {
563 S_YYEMPTY = -2,
564 S_YYEOF = 0, // "end of file"
565 S_YYerror = 1, // error
566 S_YYUNDEF = 2, // "invalid token"
567 S_COMMA = 3, // ","
568 S_COLON = 4, // ":"
569 S_LSQUARE_BRACKET = 5, // "["
570 S_RSQUARE_BRACKET = 6, // "]"
571 S_LCURLY_BRACKET = 7, // "{"
572 S_RCURLY_BRACKET = 8, // "}"
573 S_NULL_TYPE = 9, // "null"
574 S_CONTROL_AGENT = 10, // "Control-agent"
575 S_HTTP_HOST = 11, // "http-host"
576 S_HTTP_PORT = 12, // "http-port"
577 S_USER_CONTEXT = 13, // "user-context"
578 S_COMMENT = 14, // "comment"
579 S_AUTHENTICATION = 15, // "authentication"
580 S_TYPE = 16, // "type"
581 S_BASIC = 17, // "basic"
582 S_REALM = 18, // "realm"
583 S_CLIENTS = 19, // "clients"
584 S_USER = 20, // "user"
585 S_PASSWORD = 21, // "password"
586 S_TRUST_ANCHOR = 22, // "trust-anchor"
587 S_CERT_FILE = 23, // "cert-file"
588 S_KEY_FILE = 24, // "key-file"
589 S_CERT_REQUIRED = 25, // "cert-required"
590 S_CONTROL_SOCKETS = 26, // "control-sockets"
591 S_DHCP4_SERVER = 27, // "dhcp4"
592 S_DHCP6_SERVER = 28, // "dhcp6"
593 S_D2_SERVER = 29, // "d2"
594 S_SOCKET_NAME = 30, // "socket-name"
595 S_SOCKET_TYPE = 31, // "socket-type"
596 S_UNIX = 32, // "unix"
597 S_HOOKS_LIBRARIES = 33, // "hooks-libraries"
598 S_LIBRARY = 34, // "library"
599 S_PARAMETERS = 35, // "parameters"
600 S_LOGGERS = 36, // "loggers"
601 S_NAME = 37, // "name"
602 S_OUTPUT_OPTIONS = 38, // "output_options"
603 S_OUTPUT = 39, // "output"
604 S_DEBUGLEVEL = 40, // "debuglevel"
605 S_SEVERITY = 41, // "severity"
606 S_FLUSH = 42, // "flush"
607 S_MAXSIZE = 43, // "maxsize"
608 S_MAXVER = 44, // "maxver"
609 S_PATTERN = 45, // "pattern"
610 S_START_JSON = 46, // START_JSON
611 S_START_AGENT = 47, // START_AGENT
612 S_START_SUB_AGENT = 48, // START_SUB_AGENT
613 S_STRING = 49, // "constant string"
614 S_INTEGER = 50, // "integer"
615 S_FLOAT = 51, // "floating point"
616 S_BOOLEAN = 52, // "boolean"
617 S_YYACCEPT = 53, // $accept
618 S_start = 54, // start
619 S_55_1 = 55, // $@1
620 S_56_2 = 56, // $@2
621 S_57_3 = 57, // $@3
622 S_sub_agent = 58, // sub_agent
623 S_59_4 = 59, // $@4
624 S_json = 60, // json
625 S_value = 61, // value
626 S_map = 62, // map
627 S_63_5 = 63, // $@5
628 S_map_value = 64, // map_value
629 S_map_content = 65, // map_content
630 S_not_empty_map = 66, // not_empty_map
631 S_list_generic = 67, // list_generic
632 S_68_6 = 68, // $@6
633 S_list_content = 69, // list_content
634 S_not_empty_list = 70, // not_empty_list
635 S_unknown_map_entry = 71, // unknown_map_entry
636 S_agent_syntax_map = 72, // agent_syntax_map
637 S_73_7 = 73, // $@7
638 S_global_object = 74, // global_object
639 S_75_8 = 75, // $@8
640 S_global_params = 76, // global_params
641 S_global_param = 77, // global_param
642 S_http_host = 78, // http_host
643 S_79_9 = 79, // $@9
644 S_http_port = 80, // http_port
645 S_trust_anchor = 81, // trust_anchor
646 S_82_10 = 82, // $@10
647 S_cert_file = 83, // cert_file
648 S_84_11 = 84, // $@11
649 S_key_file = 85, // key_file
650 S_86_12 = 86, // $@12
651 S_cert_required = 87, // cert_required
652 S_user_context = 88, // user_context
653 S_89_13 = 89, // $@13
654 S_comment = 90, // comment
655 S_91_14 = 91, // $@14
656 S_hooks_libraries = 92, // hooks_libraries
657 S_93_15 = 93, // $@15
658 S_hooks_libraries_list = 94, // hooks_libraries_list
659 S_not_empty_hooks_libraries_list = 95, // not_empty_hooks_libraries_list
660 S_hooks_library = 96, // hooks_library
661 S_97_16 = 97, // $@16
662 S_hooks_params = 98, // hooks_params
663 S_hooks_param = 99, // hooks_param
664 S_library = 100, // library
665 S_101_17 = 101, // $@17
666 S_parameters = 102, // parameters
667 S_103_18 = 103, // $@18
668 S_control_sockets = 104, // control_sockets
669 S_105_19 = 105, // $@19
670 S_control_sockets_params = 106, // control_sockets_params
671 S_control_socket = 107, // control_socket
672 S_dhcp4_server_socket = 108, // dhcp4_server_socket
673 S_109_20 = 109, // $@20
674 S_dhcp6_server_socket = 110, // dhcp6_server_socket
675 S_111_21 = 111, // $@21
676 S_d2_server_socket = 112, // d2_server_socket
677 S_113_22 = 113, // $@22
678 S_control_socket_params = 114, // control_socket_params
679 S_control_socket_param = 115, // control_socket_param
680 S_socket_name = 116, // socket_name
681 S_117_23 = 117, // $@23
682 S_socket_type = 118, // socket_type
683 S_119_24 = 119, // $@24
684 S_socket_type_value = 120, // socket_type_value
685 S_authentication = 121, // authentication
686 S_122_25 = 122, // $@25
687 S_auth_params = 123, // auth_params
688 S_auth_param = 124, // auth_param
689 S_auth_type = 125, // auth_type
690 S_126_26 = 126, // $@26
691 S_auth_type_value = 127, // auth_type_value
692 S_realm = 128, // realm
693 S_129_27 = 129, // $@27
694 S_clients = 130, // clients
695 S_131_28 = 131, // $@28
696 S_clients_list = 132, // clients_list
697 S_not_empty_clients_list = 133, // not_empty_clients_list
698 S_basic_auth = 134, // basic_auth
699 S_135_29 = 135, // $@29
700 S_clients_params = 136, // clients_params
701 S_clients_param = 137, // clients_param
702 S_user = 138, // user
703 S_139_30 = 139, // $@30
704 S_password = 140, // password
705 S_141_31 = 141, // $@31
706 S_loggers = 142, // loggers
707 S_143_32 = 143, // $@32
708 S_loggers_entries = 144, // loggers_entries
709 S_logger_entry = 145, // logger_entry
710 S_146_33 = 146, // $@33
711 S_logger_params = 147, // logger_params
712 S_logger_param = 148, // logger_param
713 S_name = 149, // name
714 S_150_34 = 150, // $@34
715 S_debuglevel = 151, // debuglevel
716 S_severity = 152, // severity
717 S_153_35 = 153, // $@35
718 S_output_options_list = 154, // output_options_list
719 S_155_36 = 155, // $@36
720 S_output_options_list_content = 156, // output_options_list_content
721 S_output_entry = 157, // output_entry
722 S_158_37 = 158, // $@37
723 S_output_params_list = 159, // output_params_list
724 S_output_params = 160, // output_params
725 S_output = 161, // output
726 S_162_38 = 162, // $@38
727 S_flush = 163, // flush
728 S_maxsize = 164, // maxsize
729 S_maxver = 165, // maxver
730 S_pattern = 166, // pattern
731 S_167_39 = 167 // $@39
732 };
733 };
734
737
740
747 template <typename Base>
748 struct basic_symbol : Base
749 {
751 typedef Base super_type;
752
755 : value ()
756 , location ()
757 {}
758
759#if 201103L <= YY_CPLUSPLUS
762 : Base (std::move (that))
763 , value ()
764 , location (std::move (that.location))
765 {
766 switch (this->kind ())
767 {
768 case symbol_kind::S_value: // value
769 case symbol_kind::S_map_value: // map_value
770 case symbol_kind::S_socket_type_value: // socket_type_value
771 case symbol_kind::S_auth_type_value: // auth_type_value
772 value.move< ElementPtr > (std::move (that.value));
773 break;
774
775 case symbol_kind::S_BOOLEAN: // "boolean"
776 value.move< bool > (std::move (that.value));
777 break;
778
779 case symbol_kind::S_FLOAT: // "floating point"
780 value.move< double > (std::move (that.value));
781 break;
782
783 case symbol_kind::S_INTEGER: // "integer"
784 value.move< int64_t > (std::move (that.value));
785 break;
786
787 case symbol_kind::S_STRING: // "constant string"
788 value.move< std::string > (std::move (that.value));
789 break;
790
791 default:
792 break;
793 }
794
795 }
796#endif
797
800
802#if 201103L <= YY_CPLUSPLUS
803 basic_symbol (typename Base::kind_type t, location_type&& l)
804 : Base (t)
805 , location (std::move (l))
806 {}
807#else
808 basic_symbol (typename Base::kind_type t, const location_type& l)
809 : Base (t)
810 , location (l)
811 {}
812#endif
813
814#if 201103L <= YY_CPLUSPLUS
815 basic_symbol (typename Base::kind_type t, ElementPtr&& v, location_type&& l)
816 : Base (t)
817 , value (std::move (v))
818 , location (std::move (l))
819 {}
820#else
821 basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
822 : Base (t)
823 , value (v)
824 , location (l)
825 {}
826#endif
827
828#if 201103L <= YY_CPLUSPLUS
829 basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l)
830 : Base (t)
831 , value (std::move (v))
832 , location (std::move (l))
833 {}
834#else
835 basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
836 : Base (t)
837 , value (v)
838 , location (l)
839 {}
840#endif
841
842#if 201103L <= YY_CPLUSPLUS
843 basic_symbol (typename Base::kind_type t, double&& v, location_type&& l)
844 : Base (t)
845 , value (std::move (v))
846 , location (std::move (l))
847 {}
848#else
849 basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
850 : Base (t)
851 , value (v)
852 , location (l)
853 {}
854#endif
855
856#if 201103L <= YY_CPLUSPLUS
857 basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l)
858 : Base (t)
859 , value (std::move (v))
860 , location (std::move (l))
861 {}
862#else
863 basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
864 : Base (t)
865 , value (v)
866 , location (l)
867 {}
868#endif
869
870#if 201103L <= YY_CPLUSPLUS
871 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
872 : Base (t)
873 , value (std::move (v))
874 , location (std::move (l))
875 {}
876#else
877 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
878 : Base (t)
879 , value (v)
880 , location (l)
881 {}
882#endif
883
886 {
887 clear ();
888 }
889
890
891
894 {
895 // User destructor.
896 symbol_kind_type yykind = this->kind ();
897 basic_symbol<Base>& yysym = *this;
898 (void) yysym;
899 switch (yykind)
900 {
901 default:
902 break;
903 }
904
905 // Value type destructor.
906switch (yykind)
907 {
908 case symbol_kind::S_value: // value
909 case symbol_kind::S_map_value: // map_value
910 case symbol_kind::S_socket_type_value: // socket_type_value
911 case symbol_kind::S_auth_type_value: // auth_type_value
912 value.template destroy< ElementPtr > ();
913 break;
914
915 case symbol_kind::S_BOOLEAN: // "boolean"
916 value.template destroy< bool > ();
917 break;
918
919 case symbol_kind::S_FLOAT: // "floating point"
920 value.template destroy< double > ();
921 break;
922
923 case symbol_kind::S_INTEGER: // "integer"
924 value.template destroy< int64_t > ();
925 break;
926
927 case symbol_kind::S_STRING: // "constant string"
928 value.template destroy< std::string > ();
929 break;
930
931 default:
932 break;
933 }
934
935 Base::clear ();
936 }
937
939 std::string name () const YY_NOEXCEPT
940 {
941 return AgentParser::symbol_name (this->kind ());
942 }
943
946
948 bool empty () const YY_NOEXCEPT;
949
951 void move (basic_symbol& s);
952
955
958
959 private:
960#if YY_CPLUSPLUS < 201103L
962 basic_symbol& operator= (const basic_symbol& that);
963#endif
964 };
965
967 struct by_kind
968 {
971
974
975#if 201103L <= YY_CPLUSPLUS
977 by_kind (by_kind&& that) YY_NOEXCEPT;
978#endif
979
981 by_kind (const by_kind& that) YY_NOEXCEPT;
982
985
986
987
989 void clear () YY_NOEXCEPT;
990
992 void move (by_kind& that);
993
996 symbol_kind_type kind () const YY_NOEXCEPT;
997
999 symbol_kind_type type_get () const YY_NOEXCEPT;
1000
1004 };
1005
1008
1011 {
1014
1017
1019#if 201103L <= YY_CPLUSPLUS
1020 symbol_type (int tok, location_type l)
1021 : super_type (token_kind_type (tok), std::move (l))
1022#else
1023 symbol_type (int tok, const location_type& l)
1024 : super_type (token_kind_type (tok), l)
1025#endif
1026 {
1027#if !defined _MSC_VER || defined __clang__
1030#endif
1031 }
1032#if 201103L <= YY_CPLUSPLUS
1033 symbol_type (int tok, bool v, location_type l)
1034 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1035#else
1036 symbol_type (int tok, const bool& v, const location_type& l)
1037 : super_type (token_kind_type (tok), v, l)
1038#endif
1039 {
1040#if !defined _MSC_VER || defined __clang__
1042#endif
1043 }
1044#if 201103L <= YY_CPLUSPLUS
1045 symbol_type (int tok, double v, location_type l)
1046 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1047#else
1048 symbol_type (int tok, const double& v, const location_type& l)
1049 : super_type (token_kind_type (tok), v, l)
1050#endif
1051 {
1052#if !defined _MSC_VER || defined __clang__
1054#endif
1055 }
1056#if 201103L <= YY_CPLUSPLUS
1057 symbol_type (int tok, int64_t v, location_type l)
1058 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1059#else
1060 symbol_type (int tok, const int64_t& v, const location_type& l)
1061 : super_type (token_kind_type (tok), v, l)
1062#endif
1063 {
1064#if !defined _MSC_VER || defined __clang__
1066#endif
1067 }
1068#if 201103L <= YY_CPLUSPLUS
1069 symbol_type (int tok, std::string v, location_type l)
1070 : super_type (token_kind_type (tok), std::move (v), std::move (l))
1071#else
1072 symbol_type (int tok, const std::string& v, const location_type& l)
1073 : super_type (token_kind_type (tok), v, l)
1074#endif
1075 {
1076#if !defined _MSC_VER || defined __clang__
1078#endif
1079 }
1080 };
1081
1084 virtual ~AgentParser ();
1085
1086#if 201103L <= YY_CPLUSPLUS
1088 AgentParser (const AgentParser&) = delete;
1090 AgentParser& operator= (const AgentParser&) = delete;
1091#endif
1092
1095 int operator() ();
1096
1099 virtual int parse ();
1100
1101#if AGENT_DEBUG
1103 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1105 void set_debug_stream (std::ostream &);
1106
1108 typedef int debug_level_type;
1113#endif
1114
1118 virtual void error (const location_type& loc, const std::string& msg);
1119
1121 void error (const syntax_error& err);
1122
1125 static std::string symbol_name (symbol_kind_type yysymbol);
1126
1127 // Implementation of make_symbol for each token kind.
1128#if 201103L <= YY_CPLUSPLUS
1129 static
1132 {
1133 return symbol_type (token::TOKEN_END, std::move (l));
1134 }
1135#else
1136 static
1137 symbol_type
1139 {
1140 return symbol_type (token::TOKEN_END, l);
1141 }
1142#endif
1143#if 201103L <= YY_CPLUSPLUS
1144 static
1145 symbol_type
1147 {
1148 return symbol_type (token::TOKEN_AGENT_error, std::move (l));
1149 }
1150#else
1151 static
1152 symbol_type
1154 {
1156 }
1157#endif
1158#if 201103L <= YY_CPLUSPLUS
1159 static
1160 symbol_type
1162 {
1163 return symbol_type (token::TOKEN_AGENT_UNDEF, std::move (l));
1164 }
1165#else
1166 static
1167 symbol_type
1169 {
1171 }
1172#endif
1173#if 201103L <= YY_CPLUSPLUS
1174 static
1175 symbol_type
1177 {
1178 return symbol_type (token::TOKEN_COMMA, std::move (l));
1179 }
1180#else
1181 static
1182 symbol_type
1184 {
1185 return symbol_type (token::TOKEN_COMMA, l);
1186 }
1187#endif
1188#if 201103L <= YY_CPLUSPLUS
1189 static
1190 symbol_type
1192 {
1193 return symbol_type (token::TOKEN_COLON, std::move (l));
1194 }
1195#else
1196 static
1197 symbol_type
1199 {
1200 return symbol_type (token::TOKEN_COLON, l);
1201 }
1202#endif
1203#if 201103L <= YY_CPLUSPLUS
1204 static
1205 symbol_type
1207 {
1208 return symbol_type (token::TOKEN_LSQUARE_BRACKET, std::move (l));
1209 }
1210#else
1211 static
1212 symbol_type
1214 {
1216 }
1217#endif
1218#if 201103L <= YY_CPLUSPLUS
1219 static
1220 symbol_type
1222 {
1223 return symbol_type (token::TOKEN_RSQUARE_BRACKET, std::move (l));
1224 }
1225#else
1226 static
1227 symbol_type
1229 {
1231 }
1232#endif
1233#if 201103L <= YY_CPLUSPLUS
1234 static
1235 symbol_type
1237 {
1238 return symbol_type (token::TOKEN_LCURLY_BRACKET, std::move (l));
1239 }
1240#else
1241 static
1242 symbol_type
1244 {
1246 }
1247#endif
1248#if 201103L <= YY_CPLUSPLUS
1249 static
1250 symbol_type
1252 {
1253 return symbol_type (token::TOKEN_RCURLY_BRACKET, std::move (l));
1254 }
1255#else
1256 static
1257 symbol_type
1259 {
1261 }
1262#endif
1263#if 201103L <= YY_CPLUSPLUS
1264 static
1265 symbol_type
1267 {
1268 return symbol_type (token::TOKEN_NULL_TYPE, std::move (l));
1269 }
1270#else
1271 static
1272 symbol_type
1274 {
1276 }
1277#endif
1278#if 201103L <= YY_CPLUSPLUS
1279 static
1280 symbol_type
1282 {
1283 return symbol_type (token::TOKEN_CONTROL_AGENT, std::move (l));
1284 }
1285#else
1286 static
1287 symbol_type
1289 {
1291 }
1292#endif
1293#if 201103L <= YY_CPLUSPLUS
1294 static
1295 symbol_type
1297 {
1298 return symbol_type (token::TOKEN_HTTP_HOST, std::move (l));
1299 }
1300#else
1301 static
1302 symbol_type
1304 {
1306 }
1307#endif
1308#if 201103L <= YY_CPLUSPLUS
1309 static
1310 symbol_type
1312 {
1313 return symbol_type (token::TOKEN_HTTP_PORT, std::move (l));
1314 }
1315#else
1316 static
1317 symbol_type
1319 {
1321 }
1322#endif
1323#if 201103L <= YY_CPLUSPLUS
1324 static
1325 symbol_type
1327 {
1328 return symbol_type (token::TOKEN_USER_CONTEXT, std::move (l));
1329 }
1330#else
1331 static
1332 symbol_type
1334 {
1336 }
1337#endif
1338#if 201103L <= YY_CPLUSPLUS
1339 static
1340 symbol_type
1342 {
1343 return symbol_type (token::TOKEN_COMMENT, std::move (l));
1344 }
1345#else
1346 static
1347 symbol_type
1349 {
1351 }
1352#endif
1353#if 201103L <= YY_CPLUSPLUS
1354 static
1355 symbol_type
1357 {
1358 return symbol_type (token::TOKEN_AUTHENTICATION, std::move (l));
1359 }
1360#else
1361 static
1362 symbol_type
1364 {
1366 }
1367#endif
1368#if 201103L <= YY_CPLUSPLUS
1369 static
1370 symbol_type
1372 {
1373 return symbol_type (token::TOKEN_TYPE, std::move (l));
1374 }
1375#else
1376 static
1377 symbol_type
1379 {
1380 return symbol_type (token::TOKEN_TYPE, l);
1381 }
1382#endif
1383#if 201103L <= YY_CPLUSPLUS
1384 static
1385 symbol_type
1387 {
1388 return symbol_type (token::TOKEN_BASIC, std::move (l));
1389 }
1390#else
1391 static
1392 symbol_type
1394 {
1395 return symbol_type (token::TOKEN_BASIC, l);
1396 }
1397#endif
1398#if 201103L <= YY_CPLUSPLUS
1399 static
1400 symbol_type
1402 {
1403 return symbol_type (token::TOKEN_REALM, std::move (l));
1404 }
1405#else
1406 static
1407 symbol_type
1409 {
1410 return symbol_type (token::TOKEN_REALM, l);
1411 }
1412#endif
1413#if 201103L <= YY_CPLUSPLUS
1414 static
1415 symbol_type
1417 {
1418 return symbol_type (token::TOKEN_CLIENTS, std::move (l));
1419 }
1420#else
1421 static
1422 symbol_type
1424 {
1426 }
1427#endif
1428#if 201103L <= YY_CPLUSPLUS
1429 static
1430 symbol_type
1432 {
1433 return symbol_type (token::TOKEN_USER, std::move (l));
1434 }
1435#else
1436 static
1437 symbol_type
1439 {
1440 return symbol_type (token::TOKEN_USER, l);
1441 }
1442#endif
1443#if 201103L <= YY_CPLUSPLUS
1444 static
1445 symbol_type
1447 {
1448 return symbol_type (token::TOKEN_PASSWORD, std::move (l));
1449 }
1450#else
1451 static
1452 symbol_type
1454 {
1456 }
1457#endif
1458#if 201103L <= YY_CPLUSPLUS
1459 static
1460 symbol_type
1462 {
1463 return symbol_type (token::TOKEN_TRUST_ANCHOR, std::move (l));
1464 }
1465#else
1466 static
1467 symbol_type
1469 {
1471 }
1472#endif
1473#if 201103L <= YY_CPLUSPLUS
1474 static
1475 symbol_type
1477 {
1478 return symbol_type (token::TOKEN_CERT_FILE, std::move (l));
1479 }
1480#else
1481 static
1482 symbol_type
1484 {
1486 }
1487#endif
1488#if 201103L <= YY_CPLUSPLUS
1489 static
1490 symbol_type
1492 {
1493 return symbol_type (token::TOKEN_KEY_FILE, std::move (l));
1494 }
1495#else
1496 static
1497 symbol_type
1499 {
1501 }
1502#endif
1503#if 201103L <= YY_CPLUSPLUS
1504 static
1505 symbol_type
1507 {
1508 return symbol_type (token::TOKEN_CERT_REQUIRED, std::move (l));
1509 }
1510#else
1511 static
1512 symbol_type
1514 {
1516 }
1517#endif
1518#if 201103L <= YY_CPLUSPLUS
1519 static
1520 symbol_type
1522 {
1523 return symbol_type (token::TOKEN_CONTROL_SOCKETS, std::move (l));
1524 }
1525#else
1526 static
1527 symbol_type
1529 {
1531 }
1532#endif
1533#if 201103L <= YY_CPLUSPLUS
1534 static
1535 symbol_type
1537 {
1538 return symbol_type (token::TOKEN_DHCP4_SERVER, std::move (l));
1539 }
1540#else
1541 static
1542 symbol_type
1544 {
1546 }
1547#endif
1548#if 201103L <= YY_CPLUSPLUS
1549 static
1550 symbol_type
1552 {
1553 return symbol_type (token::TOKEN_DHCP6_SERVER, std::move (l));
1554 }
1555#else
1556 static
1557 symbol_type
1559 {
1561 }
1562#endif
1563#if 201103L <= YY_CPLUSPLUS
1564 static
1565 symbol_type
1567 {
1568 return symbol_type (token::TOKEN_D2_SERVER, std::move (l));
1569 }
1570#else
1571 static
1572 symbol_type
1574 {
1576 }
1577#endif
1578#if 201103L <= YY_CPLUSPLUS
1579 static
1580 symbol_type
1582 {
1583 return symbol_type (token::TOKEN_SOCKET_NAME, std::move (l));
1584 }
1585#else
1586 static
1587 symbol_type
1589 {
1591 }
1592#endif
1593#if 201103L <= YY_CPLUSPLUS
1594 static
1595 symbol_type
1597 {
1598 return symbol_type (token::TOKEN_SOCKET_TYPE, std::move (l));
1599 }
1600#else
1601 static
1602 symbol_type
1604 {
1606 }
1607#endif
1608#if 201103L <= YY_CPLUSPLUS
1609 static
1610 symbol_type
1612 {
1613 return symbol_type (token::TOKEN_UNIX, std::move (l));
1614 }
1615#else
1616 static
1617 symbol_type
1619 {
1620 return symbol_type (token::TOKEN_UNIX, l);
1621 }
1622#endif
1623#if 201103L <= YY_CPLUSPLUS
1624 static
1625 symbol_type
1627 {
1628 return symbol_type (token::TOKEN_HOOKS_LIBRARIES, std::move (l));
1629 }
1630#else
1631 static
1632 symbol_type
1634 {
1636 }
1637#endif
1638#if 201103L <= YY_CPLUSPLUS
1639 static
1640 symbol_type
1642 {
1643 return symbol_type (token::TOKEN_LIBRARY, std::move (l));
1644 }
1645#else
1646 static
1647 symbol_type
1649 {
1651 }
1652#endif
1653#if 201103L <= YY_CPLUSPLUS
1654 static
1655 symbol_type
1657 {
1658 return symbol_type (token::TOKEN_PARAMETERS, std::move (l));
1659 }
1660#else
1661 static
1662 symbol_type
1664 {
1666 }
1667#endif
1668#if 201103L <= YY_CPLUSPLUS
1669 static
1670 symbol_type
1672 {
1673 return symbol_type (token::TOKEN_LOGGERS, std::move (l));
1674 }
1675#else
1676 static
1677 symbol_type
1679 {
1681 }
1682#endif
1683#if 201103L <= YY_CPLUSPLUS
1684 static
1685 symbol_type
1687 {
1688 return symbol_type (token::TOKEN_NAME, std::move (l));
1689 }
1690#else
1691 static
1692 symbol_type
1694 {
1695 return symbol_type (token::TOKEN_NAME, l);
1696 }
1697#endif
1698#if 201103L <= YY_CPLUSPLUS
1699 static
1700 symbol_type
1702 {
1703 return symbol_type (token::TOKEN_OUTPUT_OPTIONS, std::move (l));
1704 }
1705#else
1706 static
1707 symbol_type
1709 {
1711 }
1712#endif
1713#if 201103L <= YY_CPLUSPLUS
1714 static
1715 symbol_type
1717 {
1718 return symbol_type (token::TOKEN_OUTPUT, std::move (l));
1719 }
1720#else
1721 static
1722 symbol_type
1724 {
1725 return symbol_type (token::TOKEN_OUTPUT, l);
1726 }
1727#endif
1728#if 201103L <= YY_CPLUSPLUS
1729 static
1730 symbol_type
1732 {
1733 return symbol_type (token::TOKEN_DEBUGLEVEL, std::move (l));
1734 }
1735#else
1736 static
1737 symbol_type
1739 {
1741 }
1742#endif
1743#if 201103L <= YY_CPLUSPLUS
1744 static
1745 symbol_type
1747 {
1748 return symbol_type (token::TOKEN_SEVERITY, std::move (l));
1749 }
1750#else
1751 static
1752 symbol_type
1754 {
1756 }
1757#endif
1758#if 201103L <= YY_CPLUSPLUS
1759 static
1760 symbol_type
1762 {
1763 return symbol_type (token::TOKEN_FLUSH, std::move (l));
1764 }
1765#else
1766 static
1767 symbol_type
1769 {
1770 return symbol_type (token::TOKEN_FLUSH, l);
1771 }
1772#endif
1773#if 201103L <= YY_CPLUSPLUS
1774 static
1775 symbol_type
1777 {
1778 return symbol_type (token::TOKEN_MAXSIZE, std::move (l));
1779 }
1780#else
1781 static
1782 symbol_type
1784 {
1786 }
1787#endif
1788#if 201103L <= YY_CPLUSPLUS
1789 static
1790 symbol_type
1792 {
1793 return symbol_type (token::TOKEN_MAXVER, std::move (l));
1794 }
1795#else
1796 static
1797 symbol_type
1799 {
1800 return symbol_type (token::TOKEN_MAXVER, l);
1801 }
1802#endif
1803#if 201103L <= YY_CPLUSPLUS
1804 static
1805 symbol_type
1807 {
1808 return symbol_type (token::TOKEN_PATTERN, std::move (l));
1809 }
1810#else
1811 static
1812 symbol_type
1814 {
1816 }
1817#endif
1818#if 201103L <= YY_CPLUSPLUS
1819 static
1820 symbol_type
1822 {
1823 return symbol_type (token::TOKEN_START_JSON, std::move (l));
1824 }
1825#else
1826 static
1827 symbol_type
1829 {
1831 }
1832#endif
1833#if 201103L <= YY_CPLUSPLUS
1834 static
1835 symbol_type
1837 {
1838 return symbol_type (token::TOKEN_START_AGENT, std::move (l));
1839 }
1840#else
1841 static
1842 symbol_type
1844 {
1846 }
1847#endif
1848#if 201103L <= YY_CPLUSPLUS
1849 static
1850 symbol_type
1852 {
1853 return symbol_type (token::TOKEN_START_SUB_AGENT, std::move (l));
1854 }
1855#else
1856 static
1857 symbol_type
1859 {
1861 }
1862#endif
1863#if 201103L <= YY_CPLUSPLUS
1864 static
1865 symbol_type
1866 make_STRING (std::string v, location_type l)
1867 {
1868 return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
1869 }
1870#else
1871 static
1872 symbol_type
1873 make_STRING (const std::string& v, const location_type& l)
1874 {
1875 return symbol_type (token::TOKEN_STRING, v, l);
1876 }
1877#endif
1878#if 201103L <= YY_CPLUSPLUS
1879 static
1880 symbol_type
1881 make_INTEGER (int64_t v, location_type l)
1882 {
1883 return symbol_type (token::TOKEN_INTEGER, std::move (v), std::move (l));
1884 }
1885#else
1886 static
1887 symbol_type
1888 make_INTEGER (const int64_t& v, const location_type& l)
1889 {
1890 return symbol_type (token::TOKEN_INTEGER, v, l);
1891 }
1892#endif
1893#if 201103L <= YY_CPLUSPLUS
1894 static
1895 symbol_type
1896 make_FLOAT (double v, location_type l)
1897 {
1898 return symbol_type (token::TOKEN_FLOAT, std::move (v), std::move (l));
1899 }
1900#else
1901 static
1902 symbol_type
1903 make_FLOAT (const double& v, const location_type& l)
1904 {
1905 return symbol_type (token::TOKEN_FLOAT, v, l);
1906 }
1907#endif
1908#if 201103L <= YY_CPLUSPLUS
1909 static
1910 symbol_type
1911 make_BOOLEAN (bool v, location_type l)
1912 {
1913 return symbol_type (token::TOKEN_BOOLEAN, std::move (v), std::move (l));
1914 }
1915#else
1916 static
1917 symbol_type
1918 make_BOOLEAN (const bool& v, const location_type& l)
1919 {
1920 return symbol_type (token::TOKEN_BOOLEAN, v, l);
1921 }
1922#endif
1923
1924
1926 {
1927 public:
1928 context (const AgentParser& yyparser, const symbol_type& yyla);
1929 const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
1930 symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
1931 const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
1932
1936 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
1937
1938 private:
1939 const AgentParser& yyparser_;
1940 const symbol_type& yyla_;
1941 };
1942
1943 private:
1944#if YY_CPLUSPLUS < 201103L
1946 AgentParser (const AgentParser&);
1948 AgentParser& operator= (const AgentParser&);
1949#endif
1950
1951
1953 typedef short state_type;
1954
1956 int yy_syntax_error_arguments_ (const context& yyctx,
1957 symbol_kind_type yyarg[], int yyargn) const;
1958
1961 virtual std::string yysyntax_error_ (const context& yyctx) const;
1965 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
1966
1969 static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
1970
1973 static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
1974
1975 static const short yypact_ninf_;
1976 static const signed char yytable_ninf_;
1977
1981 static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
1982
1984 static std::string yytnamerr_ (const char *yystr);
1985
1987 static const char* const yytname_[];
1988
1989
1990 // Tables.
1991 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1992 // STATE-NUM.
1993 static const short yypact_[];
1994
1995 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1996 // Performed when YYTABLE does not specify something else to do. Zero
1997 // means the default is an error.
1998 static const unsigned char yydefact_[];
1999
2000 // YYPGOTO[NTERM-NUM].
2001 static const short yypgoto_[];
2002
2003 // YYDEFGOTO[NTERM-NUM].
2004 static const short yydefgoto_[];
2005
2006 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2007 // positive, shift that token. If negative, reduce the rule whose
2008 // number is the opposite. If YYTABLE_NINF, syntax error.
2009 static const short yytable_[];
2010
2011 static const short yycheck_[];
2012
2013 // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
2014 // state STATE-NUM.
2015 static const unsigned char yystos_[];
2016
2017 // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
2018 static const unsigned char yyr1_[];
2019
2020 // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
2021 static const signed char yyr2_[];
2022
2023
2024#if AGENT_DEBUG
2025 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
2026 static const short yyrline_[];
2028 virtual void yy_reduce_print_ (int r) const;
2030 virtual void yy_stack_print_ () const;
2031
2033 int yydebug_;
2035 std::ostream* yycdebug_;
2036
2040 template <typename Base>
2041 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
2042#endif
2043
2048 template <typename Base>
2049 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
2050
2051 private:
2053 struct by_state
2054 {
2056 by_state () YY_NOEXCEPT;
2057
2059 typedef state_type kind_type;
2060
2062 by_state (kind_type s) YY_NOEXCEPT;
2063
2065 by_state (const by_state& that) YY_NOEXCEPT;
2066
2068 void clear () YY_NOEXCEPT;
2069
2071 void move (by_state& that);
2072
2075 symbol_kind_type kind () const YY_NOEXCEPT;
2076
2079 enum { empty_state = 0 };
2080
2083 state_type state;
2084 };
2085
2087 struct stack_symbol_type : basic_symbol<by_state>
2088 {
2090 typedef basic_symbol<by_state> super_type;
2092 stack_symbol_type ();
2094 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2096 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2097#if YY_CPLUSPLUS < 201103L
2100 stack_symbol_type& operator= (stack_symbol_type& that);
2101
2104 stack_symbol_type& operator= (const stack_symbol_type& that);
2105#endif
2106 };
2107
2109 template <typename T, typename S = std::vector<T> >
2110 class stack
2111 {
2112 public:
2113 // Hide our reversed order.
2114 typedef typename S::iterator iterator;
2115 typedef typename S::const_iterator const_iterator;
2116 typedef typename S::size_type size_type;
2117 typedef typename std::ptrdiff_t index_type;
2118
2119 stack (size_type n = 200) YY_NOEXCEPT
2120 : seq_ (n)
2121 {}
2122
2123#if 201103L <= YY_CPLUSPLUS
2125 stack (const stack&) = delete;
2127 stack& operator= (const stack&) = delete;
2128#endif
2129
2133 const T&
2134 operator[] (index_type i) const
2135 {
2136 return seq_[size_type (size () - 1 - i)];
2137 }
2138
2142 T&
2143 operator[] (index_type i)
2144 {
2145 return seq_[size_type (size () - 1 - i)];
2146 }
2147
2151 void
2152 push (YY_MOVE_REF (T) t)
2153 {
2154 seq_.push_back (T ());
2155 operator[] (0).move (t);
2156 }
2157
2159 void
2160 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2161 {
2162 for (; 0 < n; --n)
2163 seq_.pop_back ();
2164 }
2165
2167 void
2168 clear () YY_NOEXCEPT
2169 {
2170 seq_.clear ();
2171 }
2172
2174 index_type
2175 size () const YY_NOEXCEPT
2176 {
2177 return index_type (seq_.size ());
2178 }
2179
2181 const_iterator
2182 begin () const YY_NOEXCEPT
2183 {
2184 return seq_.begin ();
2185 }
2186
2188 const_iterator
2189 end () const YY_NOEXCEPT
2190 {
2191 return seq_.end ();
2192 }
2193
2195 class slice
2196 {
2197 public:
2198 slice (const stack& stack, index_type range) YY_NOEXCEPT
2199 : stack_ (stack)
2200 , range_ (range)
2201 {}
2202
2203 const T&
2204 operator[] (index_type i) const
2205 {
2206 return stack_[range_ - i];
2207 }
2208
2209 private:
2210 const stack& stack_;
2211 index_type range_;
2212 };
2213
2214 private:
2215#if YY_CPLUSPLUS < 201103L
2217 stack (const stack&);
2219 stack& operator= (const stack&);
2220#endif
2222 S seq_;
2223 };
2224
2225
2227 typedef stack<stack_symbol_type> stack_type;
2228
2230 stack_type yystack_;
2231
2237 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2238
2245 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2246
2248 void yypop_ (int n = 1) YY_NOEXCEPT;
2249
2251 enum
2252 {
2253 yylast_ = 239,
2254 yynnts_ = 115,
2255 yyfinal_ = 8
2256 };
2257
2258
2259 // User arguments.
2261
2262 };
2263
2264 inline
2266 AgentParser::yytranslate_ (int t) YY_NOEXCEPT
2267 {
2268 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2269 // TOKEN-NUM as returned by yylex.
2270 static
2271 const signed char
2272 translate_table[] =
2273 {
2274 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2299 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2300 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2301 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2302 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2303 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2304 45, 46, 47, 48, 49, 50, 51, 52
2305 };
2306 // Last valid token kind.
2307 const int code_max = 307;
2308
2309 if (t <= 0)
2310 return symbol_kind::S_YYEOF;
2311 else if (t <= code_max)
2312 return static_cast <symbol_kind_type> (translate_table[t]);
2313 else
2315 }
2316
2317 // basic_symbol.
2318 template <typename Base>
2320 : Base (that)
2321 , value ()
2322 , location (that.location)
2323 {
2324 switch (this->kind ())
2325 {
2326 case symbol_kind::S_value: // value
2327 case symbol_kind::S_map_value: // map_value
2328 case symbol_kind::S_socket_type_value: // socket_type_value
2329 case symbol_kind::S_auth_type_value: // auth_type_value
2330 value.copy< ElementPtr > (YY_MOVE (that.value));
2331 break;
2332
2333 case symbol_kind::S_BOOLEAN: // "boolean"
2334 value.copy< bool > (YY_MOVE (that.value));
2335 break;
2336
2337 case symbol_kind::S_FLOAT: // "floating point"
2338 value.copy< double > (YY_MOVE (that.value));
2339 break;
2340
2341 case symbol_kind::S_INTEGER: // "integer"
2342 value.copy< int64_t > (YY_MOVE (that.value));
2343 break;
2344
2345 case symbol_kind::S_STRING: // "constant string"
2346 value.copy< std::string > (YY_MOVE (that.value));
2347 break;
2348
2349 default:
2350 break;
2351 }
2352
2353 }
2354
2355
2356
2357
2358 template <typename Base>
2361 {
2362 return this->kind ();
2363 }
2364
2365
2366 template <typename Base>
2367 bool
2369 {
2370 return this->kind () == symbol_kind::S_YYEMPTY;
2371 }
2372
2373 template <typename Base>
2374 void
2376 {
2377 super_type::move (s);
2378 switch (this->kind ())
2379 {
2380 case symbol_kind::S_value: // value
2381 case symbol_kind::S_map_value: // map_value
2382 case symbol_kind::S_socket_type_value: // socket_type_value
2383 case symbol_kind::S_auth_type_value: // auth_type_value
2384 value.move< ElementPtr > (YY_MOVE (s.value));
2385 break;
2386
2387 case symbol_kind::S_BOOLEAN: // "boolean"
2388 value.move< bool > (YY_MOVE (s.value));
2389 break;
2390
2391 case symbol_kind::S_FLOAT: // "floating point"
2392 value.move< double > (YY_MOVE (s.value));
2393 break;
2394
2395 case symbol_kind::S_INTEGER: // "integer"
2396 value.move< int64_t > (YY_MOVE (s.value));
2397 break;
2398
2399 case symbol_kind::S_STRING: // "constant string"
2400 value.move< std::string > (YY_MOVE (s.value));
2401 break;
2402
2403 default:
2404 break;
2405 }
2406
2407 location = YY_MOVE (s.location);
2408 }
2409
2410 // by_kind.
2411 inline
2413 : kind_ (symbol_kind::S_YYEMPTY)
2414 {}
2415
2416#if 201103L <= YY_CPLUSPLUS
2417 inline
2419 : kind_ (that.kind_)
2420 {
2421 that.clear ();
2422 }
2423#endif
2424
2425 inline
2427 : kind_ (that.kind_)
2428 {}
2429
2430 inline
2432 : kind_ (yytranslate_ (t))
2433 {}
2434
2435
2436
2437 inline
2438 void
2440 {
2441 kind_ = symbol_kind::S_YYEMPTY;
2442 }
2443
2444 inline
2445 void
2447 {
2448 kind_ = that.kind_;
2449 that.clear ();
2450 }
2451
2452 inline
2455 {
2456 return kind_;
2457 }
2458
2459
2460 inline
2463 {
2464 return this->kind ();
2465 }
2466
2467
2468#line 14 "agent_parser.yy"
2469} } // isc::agent
2470#line 2471 "agent_parser.h"
2471
2472
2473
2474
2475#endif // !YY_AGENT_AGENT_PARSER_H_INCLUDED
Forward declaration of the ParserContext class.
#define YY_RVREF(Type)
Definition: agent_parser.h:85
#define AGENT__ASSERT
Definition: agent_parser.h:108
#define YY_MOVE_REF(Type)
Definition: agent_parser.h:84
#define YY_NOEXCEPT
Definition: agent_parser.h:94
#define YY_ATTRIBUTE_PURE
Definition: agent_parser.h:116
#define YY_MOVE
Definition: agent_parser.h:82
#define YY_NOTHROW
Definition: agent_parser.h:95
const symbol_type & lookahead() const YY_NOEXCEPT
symbol_kind_type token() const YY_NOEXCEPT
const location_type & location() 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.
Definition: agent_parser.h:229
T & emplace()
Instantiate an empty T in here.
Definition: agent_parser.h:277
void destroy()
Destroy the stored T.
Definition: agent_parser.h:392
void copy(const self_type &that)
Copy the content of that to this.
Definition: agent_parser.h:384
value_type(YY_RVREF(T) t)
Construct and fill.
Definition: agent_parser.h:242
const T & as() const YY_NOEXCEPT
Const accessor to a built T (for printer).
Definition: agent_parser.h:329
void swap(self_type &that) YY_NOEXCEPT
Swap the content with that, of same type.
Definition: agent_parser.h:347
char yyraw_[size]
A buffer large enough to store any of the semantic values.
Definition: agent_parser.h:455
T & as() YY_NOEXCEPT
Accessor to a built T.
Definition: agent_parser.h:318
value_type self_type
Type of *this.
Definition: agent_parser.h:232
value_type() YY_NOEXCEPT
Empty construction.
Definition: agent_parser.h:235
void move(self_type &that)
Move the content of that to this.
Definition: agent_parser.h:359
long double yyalign_me_
Strongest alignment constraints.
Definition: agent_parser.h:453
T & emplace(const T &t)
Instantiate a T in here from t.
Definition: agent_parser.h:288
T & build(const T &t)
Instantiate a T in here from t.
Definition: agent_parser.h:310
~value_type() YY_NOEXCEPT
Destruction, allowed only if empty.
Definition: agent_parser.h:257
T & build()
Instantiate an empty T in here.
Definition: agent_parser.h:301
static symbol_type make_D2_SERVER(const location_type &l)
static symbol_type make_SOCKET_TYPE(const location_type &l)
static symbol_type make_HTTP_HOST(const location_type &l)
static symbol_type make_END(const location_type &l)
static symbol_type make_COMMENT(const location_type &l)
static symbol_type make_NULL_TYPE(const location_type &l)
static symbol_type make_AUTHENTICATION(const location_type &l)
void set_debug_level(debug_level_type l)
Set the current debugging level.
value_type semantic_type
Backward compatibility (Bison 3.8).
Definition: agent_parser.h:464
static symbol_type make_CERT_FILE(const location_type &l)
static symbol_type make_OUTPUT_OPTIONS(const location_type &l)
static symbol_type make_LSQUARE_BRACKET(const location_type &l)
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
static symbol_type make_RSQUARE_BRACKET(const location_type &l)
static symbol_type make_COLON(const location_type &l)
AgentParser(isc::agent::ParserContext &ctx_yyarg)
Build a parser object.
static symbol_type make_BASIC(const location_type &l)
static symbol_type make_PATTERN(const location_type &l)
int debug_level_type
Type for debugging levels.
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_FLOAT(const double &v, const location_type &l)
static symbol_type make_STRING(const std::string &v, const location_type &l)
static symbol_type make_LOGGERS(const location_type &l)
static symbol_type make_SOCKET_NAME(const location_type &l)
location location_type
Symbol locations.
Definition: agent_parser.h:467
static symbol_type make_CONTROL_AGENT(const location_type &l)
static symbol_type make_AGENT_error(const location_type &l)
static symbol_type make_RCURLY_BRACKET(const location_type &l)
virtual int parse()
Parse.
static symbol_type make_DEBUGLEVEL(const location_type &l)
static symbol_type make_START_AGENT(const location_type &l)
static symbol_type make_LCURLY_BRACKET(const location_type &l)
static symbol_type make_FLUSH(const location_type &l)
static symbol_type make_CERT_REQUIRED(const location_type &l)
void set_debug_stream(std::ostream &)
Set the current debugging stream.
static symbol_type make_MAXVER(const location_type &l)
static symbol_type make_PASSWORD(const location_type &l)
static symbol_type make_START_JSON(const location_type &l)
static symbol_type make_CONTROL_SOCKETS(const location_type &l)
static symbol_type make_NAME(const location_type &l)
static symbol_type make_COMMA(const location_type &l)
static symbol_type make_HOOKS_LIBRARIES(const location_type &l)
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
Definition: agent_parser.h:552
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition: agent_parser.h:736
static const symbol_kind_type YYNTOKENS
The number of tokens.
Definition: agent_parser.h:739
static symbol_type make_OUTPUT(const location_type &l)
static symbol_type make_CLIENTS(const location_type &l)
static symbol_type make_DHCP4_SERVER(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_REALM(const location_type &l)
static symbol_type make_TRUST_ANCHOR(const location_type &l)
static symbol_type make_HTTP_PORT(const location_type &l)
static symbol_type make_PARAMETERS(const location_type &l)
static symbol_type make_SEVERITY(const location_type &l)
static symbol_type make_USER(const location_type &l)
static symbol_type make_BOOLEAN(const bool &v, const location_type &l)
static symbol_type make_LIBRARY(const location_type &l)
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition: agent_parser.h:555
static symbol_type make_KEY_FILE(const location_type &l)
static symbol_type make_AGENT_UNDEF(const location_type &l)
static symbol_type make_START_SUB_AGENT(const location_type &l)
debug_level_type debug_level() const YY_ATTRIBUTE_PURE
The current debugging level.
static symbol_type make_UNIX(const location_type &l)
static symbol_type make_MAXSIZE(const location_type &l)
static symbol_type make_USER_CONTEXT(const location_type &l)
static symbol_type make_TYPE(const location_type &l)
static symbol_type make_INTEGER(const int64_t &v, const location_type &l)
Parser context is a wrapper around flex/bison instances dedicated to Control-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.
basic_symbol(const basic_symbol &that)
Copy constructor.
basic_symbol(typename Base::kind_type t, const int64_t &v, const location_type &l)
Definition: agent_parser.h:863
location_type location
The location.
Definition: agent_parser.h:957
basic_symbol() YY_NOEXCEPT
Default constructor.
Definition: agent_parser.h:754
void move(basic_symbol &s)
Destructive move, s is emptied into this.
basic_symbol(typename Base::kind_type t, const location_type &l)
Constructors for typed symbols.
Definition: agent_parser.h:808
basic_symbol(typename Base::kind_type t, const std::string &v, const location_type &l)
Definition: agent_parser.h:877
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.
Definition: agent_parser.h:893
bool empty() const YY_NOEXCEPT
Whether empty.
value_type value
The semantic value.
Definition: agent_parser.h:954
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
basic_symbol(typename Base::kind_type t, const ElementPtr &v, const location_type &l)
Definition: agent_parser.h:821
basic_symbol(typename Base::kind_type t, const double &v, const location_type &l)
Definition: agent_parser.h:849
std::string name() const YY_NOEXCEPT
The user-facing name of this symbol.
Definition: agent_parser.h:939
basic_symbol(typename Base::kind_type t, const bool &v, const location_type &l)
Definition: agent_parser.h:835
Type access provider for token (enum) based symbols.
Definition: agent_parser.h:968
by_kind() YY_NOEXCEPT
Default constructor.
symbol_kind_type kind() const YY_NOEXCEPT
The (internal) type number (corresponding to type).
token_kind_type kind_type
The symbol kind as needed by the constructor.
Definition: agent_parser.h:970
symbol_kind_type kind_
The symbol kind.
symbol_kind_type type_get() const YY_NOEXCEPT
Backward compatibility (Bison 3.6).
void clear() YY_NOEXCEPT
Record that this symbol is empty.
void move(by_kind &that)
Steal the symbol kind from that.
"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.
Definition: agent_parser.h:471
~syntax_error() YY_NOEXCEPT YY_NOTHROW
syntax_error(const syntax_error &s)
Definition: agent_parser.h:477
syntax_error(const location_type &l, const std::string &m)
Definition: agent_parser.h:472
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition: agent_parser.h:548