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