From 23927bd1d9dc3470e2d7eb89bcdb0f9d3cb186c2 Mon Sep 17 00:00:00 2001 From: Wlodek Wencel Date: Tue, 14 Dec 2021 05:04:51 -0800 Subject: [PATCH] [#2240] parsers and grammar regen --- doc/sphinx/grammar/grammar-ca-parser.rst | 2 +- doc/sphinx/grammar/grammar-d2-parser.rst | 7 +- doc/sphinx/grammar/grammar-dhcp4-parser.rst | 5 +- doc/sphinx/grammar/grammar-dhcp6-parser.rst | 11 +- doc/sphinx/grammar/grammar-netconf-parser.rst | 2 +- src/bin/agent/agent_parser.cc | 27 ++-- src/bin/agent/agent_parser.h | 152 +++++++++++------- src/bin/agent/location.hh | 2 +- src/bin/d2/d2_parser.cc | 27 ++-- src/bin/d2/d2_parser.h | 152 +++++++++++------- src/bin/d2/location.hh | 2 +- src/bin/dhcp4/dhcp4_parser.cc | 27 ++-- src/bin/dhcp4/dhcp4_parser.h | 152 +++++++++++------- src/bin/dhcp4/location.hh | 2 +- src/bin/dhcp6/dhcp6_parser.cc | 27 ++-- src/bin/dhcp6/dhcp6_parser.h | 152 +++++++++++------- src/bin/dhcp6/location.hh | 2 +- src/bin/netconf/location.hh | 2 +- src/bin/netconf/netconf_parser.cc | 27 ++-- src/bin/netconf/netconf_parser.h | 152 +++++++++++------- src/lib/eval/location.hh | 2 +- src/lib/eval/parser.cc | 27 ++-- src/lib/eval/parser.h | 134 ++++++++------- 23 files changed, 656 insertions(+), 439 deletions(-) diff --git a/doc/sphinx/grammar/grammar-ca-parser.rst b/doc/sphinx/grammar/grammar-ca-parser.rst index 6ddf773b84..c82dd714c5 100644 --- a/doc/sphinx/grammar/grammar-ca-parser.rst +++ b/doc/sphinx/grammar/grammar-ca-parser.rst @@ -1,5 +1,5 @@ -Grammar generated on 2021-06-22 19:06. See Chapter :ref:`kea-ctrl-agent` for an explanation. +Grammar generated on 2021-12-14 13:12. See Chapter :ref:`kea-ctrl-agent` for an explanation. .. code-block:: BNF :linenos: diff --git a/doc/sphinx/grammar/grammar-d2-parser.rst b/doc/sphinx/grammar/grammar-d2-parser.rst index c9bbb95103..e820813759 100644 --- a/doc/sphinx/grammar/grammar-d2-parser.rst +++ b/doc/sphinx/grammar/grammar-d2-parser.rst @@ -1,5 +1,5 @@ -Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp-ddns-server` for an explanation. +Grammar generated on 2021-12-14 13:12. See Chapter :ref:`dhcp-ddns-server` for an explanation. .. code-block:: BNF :linenos: @@ -130,7 +130,7 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp-ddns-server` for a | ddns_domain_params "," ddns_domain_param ddns_domain_param ::= ddns_domain_name - | ddns_domain_key_name + | ddns_key_name | dns_servers | user_context | comment @@ -138,7 +138,7 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp-ddns-server` for a ddns_domain_name ::= "name" ":" STRING - ddns_domain_key_name ::= "key-name" ":" STRING + ddns_key_name ::= "key-name" ":" STRING dns_servers ::= "dns-servers" ":" "[" dns_server_list "]" @@ -157,6 +157,7 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp-ddns-server` for a dns_server_param ::= dns_server_hostname | dns_server_ip_address | dns_server_port + | ddns_key_name | user_context | comment | unknown_map_entry diff --git a/doc/sphinx/grammar/grammar-dhcp4-parser.rst b/doc/sphinx/grammar/grammar-dhcp4-parser.rst index 83e4966fd4..3c8c613360 100644 --- a/doc/sphinx/grammar/grammar-dhcp4-parser.rst +++ b/doc/sphinx/grammar/grammar-dhcp4-parser.rst @@ -1,5 +1,5 @@ -Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp4` for an explanation. +Grammar generated on 2021-12-14 13:12. See Chapter :ref:`dhcp4` for an explanation. .. code-block:: BNF :linenos: @@ -141,6 +141,7 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp4` for an explanati | dhcp_multi_threading | ip_reservations_unique | compatibility + | parked_packet_limit | unknown_map_entry valid_lifetime ::= "valid-lifetime" ":" INTEGER @@ -167,6 +168,8 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp4` for an explanati server_tag ::= "server-tag" ":" STRING + parked_packet_limit ::= "parked-packet-limit" ":" INTEGER + echo_client_id ::= "echo-client-id" ":" BOOLEAN match_client_id ::= "match-client-id" ":" BOOLEAN diff --git a/doc/sphinx/grammar/grammar-dhcp6-parser.rst b/doc/sphinx/grammar/grammar-dhcp6-parser.rst index 874e7b1db6..0bf8f5733d 100644 --- a/doc/sphinx/grammar/grammar-dhcp6-parser.rst +++ b/doc/sphinx/grammar/grammar-dhcp6-parser.rst @@ -1,5 +1,5 @@ -Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp6` for an explanation. +Grammar generated on 2021-12-14 13:12. See Chapter :ref:`dhcp6` for an explanation. .. code-block:: BNF :linenos: @@ -144,6 +144,7 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp6` for an explanati | dhcp_multi_threading | ip_reservations_unique | compatibility + | parked_packet_limit | unknown_map_entry data_directory ::= "data-directory" ":" STRING @@ -210,6 +211,8 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp6` for an explanati server_tag ::= "server-tag" ":" STRING + parked_packet_limit ::= "parked-packet-limit" ":" INTEGER + ip_reservations_unique ::= "ip-reservations-unique" ":" BOOLEAN interfaces_config ::= "interfaces-config" ":" "{" interfaces_config_params "}" @@ -786,6 +789,12 @@ Grammar generated on 2021-06-22 19:06. See Chapter :ref:`dhcp6` for an explanati | option_data_list | user_context | comment + | preferred_lifetime + | min_preferred_lifetime + | max_preferred_lifetime + | valid_lifetime + | min_valid_lifetime + | max_valid_lifetime | unknown_map_entry client_class_name ::= name diff --git a/doc/sphinx/grammar/grammar-netconf-parser.rst b/doc/sphinx/grammar/grammar-netconf-parser.rst index 2002ea0665..c0d74794b7 100644 --- a/doc/sphinx/grammar/grammar-netconf-parser.rst +++ b/doc/sphinx/grammar/grammar-netconf-parser.rst @@ -1,5 +1,5 @@ -Grammar generated on 2021-06-22 19:06. See Chapter :ref:`netconf` for an explanation. +Grammar generated on 2021-12-14 13:12. See Chapter :ref:`netconf` for an explanation. .. code-block:: BNF :linenos: diff --git a/src/bin/agent/agent_parser.cc b/src/bin/agent/agent_parser.cc index 81c72e1bd0..8bf98bc814 100644 --- a/src/bin/agent/agent_parser.cc +++ b/src/bin/agent/agent_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace agent { AgentParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -457,7 +457,7 @@ namespace isc { namespace agent { } void - AgentParser::yypop_ (int n) + AgentParser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -500,13 +500,13 @@ namespace isc { namespace agent { } bool - AgentParser::yy_pact_value_is_default_ (int yyvalue) + AgentParser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - AgentParser::yy_table_value_is_error_ (int yyvalue) + AgentParser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1875,16 +1875,16 @@ namespace isc { namespace agent { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -1905,6 +1905,9 @@ namespace isc { namespace agent { + + + int AgentParser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -2340,7 +2343,7 @@ namespace isc { namespace agent { #line 14 "agent_parser.yy" } } // isc::agent -#line 2344 "agent_parser.cc" +#line 2347 "agent_parser.cc" #line 782 "agent_parser.yy" diff --git a/src/bin/agent/agent_parser.h b/src/bin/agent/agent_parser.h index 4bbe1502f4..c96f427dbb 100644 --- a/src/bin/agent/agent_parser.h +++ b/src/bin/agent/agent_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -132,12 +132,18 @@ using namespace std; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -199,7 +205,7 @@ using namespace std; #line 14 "agent_parser.yy" namespace isc { namespace agent { -#line 203 "agent_parser.h" +#line 209 "agent_parser.h" @@ -208,27 +214,32 @@ namespace isc { namespace agent { class AgentParser { public: -#ifndef AGENT_STYPE +#ifdef AGENT_STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define AGENT_STYPE in C++, use %define api.value.type" +# endif + typedef AGENT_STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { AGENT__ASSERT (sizeof (T) <= size); @@ -237,13 +248,13 @@ namespace isc { namespace agent { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { AGENT__ASSERT (!yytypeid_); } @@ -387,7 +398,7 @@ namespace isc { namespace agent { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -397,7 +408,7 @@ namespace isc { namespace agent { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -406,7 +417,7 @@ namespace isc { namespace agent { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -439,18 +450,19 @@ namespace isc { namespace agent { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef AGENT_STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -537,7 +549,7 @@ namespace isc { namespace agent { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -739,7 +751,7 @@ namespace isc { namespace agent { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -875,6 +887,8 @@ namespace isc { namespace agent { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -937,7 +951,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -952,22 +966,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -997,59 +1013,69 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ AGENT__ASSERT (tok == token::TOKEN_END || (token::TOKEN_AGENT_error <= tok && tok <= token::TOKEN_START_SUB_AGENT)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, bool v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const bool& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ AGENT__ASSERT (tok == token::TOKEN_BOOLEAN); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, double v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const double& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ AGENT__ASSERT (tok == token::TOKEN_FLOAT); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, int64_t v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const int64_t& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ AGENT__ASSERT (tok == token::TOKEN_INTEGER); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ AGENT__ASSERT (tok == token::TOKEN_STRING); +#endif } }; @@ -1098,7 +1124,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -1940,19 +1966,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -1984,14 +2010,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -2090,7 +2116,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -2169,7 +2195,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -2219,7 +2245,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -2237,7 +2263,7 @@ switch (yykind) inline AgentParser::symbol_kind_type - AgentParser::yytranslate_ (int t) + AgentParser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -2283,7 +2309,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -2328,6 +2354,7 @@ switch (yykind) + template AgentParser::symbol_kind_type AgentParser::basic_symbol::type_get () const YY_NOEXCEPT @@ -2335,6 +2362,7 @@ switch (yykind) return this->kind (); } + template bool AgentParser::basic_symbol::empty () const YY_NOEXCEPT @@ -2381,13 +2409,13 @@ switch (yykind) // by_kind. inline - AgentParser::by_kind::by_kind () + AgentParser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - AgentParser::by_kind::by_kind (by_kind&& that) + AgentParser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -2395,15 +2423,17 @@ switch (yykind) #endif inline - AgentParser::by_kind::by_kind (const by_kind& that) + AgentParser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - AgentParser::by_kind::by_kind (token_kind_type t) + AgentParser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void AgentParser::by_kind::clear () YY_NOEXCEPT @@ -2426,6 +2456,7 @@ switch (yykind) return kind_; } + inline AgentParser::symbol_kind_type AgentParser::by_kind::type_get () const YY_NOEXCEPT @@ -2433,9 +2464,10 @@ switch (yykind) return this->kind (); } + #line 14 "agent_parser.yy" } } // isc::agent -#line 2439 "agent_parser.h" +#line 2471 "agent_parser.h" diff --git a/src/bin/agent/location.hh b/src/bin/agent/location.hh index f7d7b1b104..3f820cc25f 100644 --- a/src/bin/agent/location.hh +++ b/src/bin/agent/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/bin/d2/d2_parser.cc b/src/bin/d2/d2_parser.cc index 90a536af68..dda2cb72b1 100644 --- a/src/bin/d2/d2_parser.cc +++ b/src/bin/d2/d2_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace d2 { D2Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -447,7 +447,7 @@ namespace isc { namespace d2 { } void - D2Parser::yypop_ (int n) + D2Parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -490,13 +490,13 @@ namespace isc { namespace d2 { } bool - D2Parser::yy_pact_value_is_default_ (int yyvalue) + D2Parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - D2Parser::yy_table_value_is_error_ (int yyvalue) + D2Parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -2150,16 +2150,16 @@ namespace isc { namespace d2 { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -2180,6 +2180,9 @@ namespace isc { namespace d2 { + + + int D2Parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -2691,7 +2694,7 @@ namespace isc { namespace d2 { #line 14 "d2_parser.yy" } } // isc::d2 -#line 2695 "d2_parser.cc" +#line 2698 "d2_parser.cc" #line 929 "d2_parser.yy" diff --git a/src/bin/d2/d2_parser.h b/src/bin/d2/d2_parser.h index 8111d740ee..e595c40f86 100644 --- a/src/bin/d2/d2_parser.h +++ b/src/bin/d2/d2_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -133,12 +133,18 @@ using namespace std; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -200,7 +206,7 @@ using namespace std; #line 14 "d2_parser.yy" namespace isc { namespace d2 { -#line 204 "d2_parser.h" +#line 210 "d2_parser.h" @@ -209,27 +215,32 @@ namespace isc { namespace d2 { class D2Parser { public: -#ifndef D2_PARSER_STYPE +#ifdef D2_PARSER_STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define D2_PARSER_STYPE in C++, use %define api.value.type" +# endif + typedef D2_PARSER_STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { D2_PARSER__ASSERT (sizeof (T) <= size); @@ -238,13 +249,13 @@ namespace isc { namespace d2 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { D2_PARSER__ASSERT (!yytypeid_); } @@ -388,7 +399,7 @@ namespace isc { namespace d2 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -398,7 +409,7 @@ namespace isc { namespace d2 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -407,7 +418,7 @@ namespace isc { namespace d2 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -439,18 +450,19 @@ namespace isc { namespace d2 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef D2_PARSER_STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -545,7 +557,7 @@ namespace isc { namespace d2 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -791,7 +803,7 @@ namespace isc { namespace d2 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -926,6 +938,8 @@ namespace isc { namespace d2 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -987,7 +1001,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -1002,22 +1016,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -1047,59 +1063,69 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ D2_PARSER__ASSERT (tok == token::TOKEN_END || (token::TOKEN_D2_PARSER_error <= tok && tok <= token::TOKEN_SUB_HOOKS_LIBRARY)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, bool v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const bool& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ D2_PARSER__ASSERT (tok == token::TOKEN_BOOLEAN); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, double v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const double& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ D2_PARSER__ASSERT (tok == token::TOKEN_FLOAT); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, int64_t v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const int64_t& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ D2_PARSER__ASSERT (tok == token::TOKEN_INTEGER); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ D2_PARSER__ASSERT (tok == token::TOKEN_STRING); +#endif } }; @@ -1148,7 +1174,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -2110,19 +2136,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -2154,14 +2180,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -2260,7 +2286,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -2339,7 +2365,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -2389,7 +2415,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -2407,7 +2433,7 @@ switch (yykind) inline D2Parser::symbol_kind_type - D2Parser::yytranslate_ (int t) + D2Parser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -2454,7 +2480,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -2498,6 +2524,7 @@ switch (yykind) + template D2Parser::symbol_kind_type D2Parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -2505,6 +2532,7 @@ switch (yykind) return this->kind (); } + template bool D2Parser::basic_symbol::empty () const YY_NOEXCEPT @@ -2550,13 +2578,13 @@ switch (yykind) // by_kind. inline - D2Parser::by_kind::by_kind () + D2Parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - D2Parser::by_kind::by_kind (by_kind&& that) + D2Parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -2564,15 +2592,17 @@ switch (yykind) #endif inline - D2Parser::by_kind::by_kind (const by_kind& that) + D2Parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - D2Parser::by_kind::by_kind (token_kind_type t) + D2Parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void D2Parser::by_kind::clear () YY_NOEXCEPT @@ -2595,6 +2625,7 @@ switch (yykind) return kind_; } + inline D2Parser::symbol_kind_type D2Parser::by_kind::type_get () const YY_NOEXCEPT @@ -2602,9 +2633,10 @@ switch (yykind) return this->kind (); } + #line 14 "d2_parser.yy" } } // isc::d2 -#line 2608 "d2_parser.h" +#line 2640 "d2_parser.h" diff --git a/src/bin/d2/location.hh b/src/bin/d2/location.hh index f0842a473a..4145366614 100644 --- a/src/bin/d2/location.hh +++ b/src/bin/d2/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/bin/dhcp4/dhcp4_parser.cc b/src/bin/dhcp4/dhcp4_parser.cc index ed7da91781..bafd5e68e6 100644 --- a/src/bin/dhcp4/dhcp4_parser.cc +++ b/src/bin/dhcp4/dhcp4_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace dhcp { Dhcp4Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -507,7 +507,7 @@ namespace isc { namespace dhcp { } void - Dhcp4Parser::yypop_ (int n) + Dhcp4Parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -550,13 +550,13 @@ namespace isc { namespace dhcp { } bool - Dhcp4Parser::yy_pact_value_is_default_ (int yyvalue) + Dhcp4Parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - Dhcp4Parser::yy_table_value_is_error_ (int yyvalue) + Dhcp4Parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -4479,16 +4479,16 @@ namespace isc { namespace dhcp { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -4509,6 +4509,9 @@ namespace isc { namespace dhcp { + + + int Dhcp4Parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -5833,7 +5836,7 @@ namespace isc { namespace dhcp { #line 14 "dhcp4_parser.yy" } } // isc::dhcp -#line 5837 "dhcp4_parser.cc" +#line 5840 "dhcp4_parser.cc" #line 2732 "dhcp4_parser.yy" diff --git a/src/bin/dhcp4/dhcp4_parser.h b/src/bin/dhcp4/dhcp4_parser.h index 4a94efbe71..0143410368 100644 --- a/src/bin/dhcp4/dhcp4_parser.h +++ b/src/bin/dhcp4/dhcp4_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -133,12 +133,18 @@ using namespace std; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -200,7 +206,7 @@ using namespace std; #line 14 "dhcp4_parser.yy" namespace isc { namespace dhcp { -#line 204 "dhcp4_parser.h" +#line 210 "dhcp4_parser.h" @@ -209,27 +215,32 @@ namespace isc { namespace dhcp { class Dhcp4Parser { public: -#ifndef PARSER4_STYPE +#ifdef PARSER4_STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define PARSER4_STYPE in C++, use %define api.value.type" +# endif + typedef PARSER4_STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { PARSER4__ASSERT (sizeof (T) <= size); @@ -238,13 +249,13 @@ namespace isc { namespace dhcp { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { PARSER4__ASSERT (!yytypeid_); } @@ -388,7 +399,7 @@ namespace isc { namespace dhcp { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -398,7 +409,7 @@ namespace isc { namespace dhcp { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -407,7 +418,7 @@ namespace isc { namespace dhcp { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -445,18 +456,19 @@ namespace isc { namespace dhcp { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef PARSER4_STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -695,7 +707,7 @@ namespace isc { namespace dhcp { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1353,7 +1365,7 @@ namespace isc { namespace dhcp { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -1494,6 +1506,8 @@ namespace isc { namespace dhcp { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -1561,7 +1575,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -1576,22 +1590,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -1621,59 +1637,69 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER4__ASSERT (tok == token::TOKEN_END || (token::TOKEN_PARSER4_error <= tok && tok <= token::TOKEN_SUB_CONFIG_CONTROL)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, bool v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const bool& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER4__ASSERT (tok == token::TOKEN_BOOLEAN); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, double v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const double& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER4__ASSERT (tok == token::TOKEN_FLOAT); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, int64_t v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const int64_t& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER4__ASSERT (tok == token::TOKEN_INTEGER); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER4__ASSERT (tok == token::TOKEN_STRING); +#endif } }; @@ -1722,7 +1748,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4844,19 +4870,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -4888,14 +4914,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const short yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const short yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4994,7 +5020,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -5073,7 +5099,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -5123,7 +5149,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -5141,7 +5167,7 @@ switch (yykind) inline Dhcp4Parser::symbol_kind_type - Dhcp4Parser::yytranslate_ (int t) + Dhcp4Parser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -5202,7 +5228,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -5252,6 +5278,7 @@ switch (yykind) + template Dhcp4Parser::symbol_kind_type Dhcp4Parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5259,6 +5286,7 @@ switch (yykind) return this->kind (); } + template bool Dhcp4Parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5310,13 +5338,13 @@ switch (yykind) // by_kind. inline - Dhcp4Parser::by_kind::by_kind () + Dhcp4Parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - Dhcp4Parser::by_kind::by_kind (by_kind&& that) + Dhcp4Parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5324,15 +5352,17 @@ switch (yykind) #endif inline - Dhcp4Parser::by_kind::by_kind (const by_kind& that) + Dhcp4Parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - Dhcp4Parser::by_kind::by_kind (token_kind_type t) + Dhcp4Parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void Dhcp4Parser::by_kind::clear () YY_NOEXCEPT @@ -5355,6 +5385,7 @@ switch (yykind) return kind_; } + inline Dhcp4Parser::symbol_kind_type Dhcp4Parser::by_kind::type_get () const YY_NOEXCEPT @@ -5362,9 +5393,10 @@ switch (yykind) return this->kind (); } + #line 14 "dhcp4_parser.yy" } } // isc::dhcp -#line 5368 "dhcp4_parser.h" +#line 5400 "dhcp4_parser.h" diff --git a/src/bin/dhcp4/location.hh b/src/bin/dhcp4/location.hh index 3c542905df..860fbfa0c9 100644 --- a/src/bin/dhcp4/location.hh +++ b/src/bin/dhcp4/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/bin/dhcp6/dhcp6_parser.cc b/src/bin/dhcp6/dhcp6_parser.cc index 97600cf9c1..ff2632481b 100644 --- a/src/bin/dhcp6/dhcp6_parser.cc +++ b/src/bin/dhcp6/dhcp6_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace dhcp { Dhcp6Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -497,7 +497,7 @@ namespace isc { namespace dhcp { } void - Dhcp6Parser::yypop_ (int n) + Dhcp6Parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -540,13 +540,13 @@ namespace isc { namespace dhcp { } bool - Dhcp6Parser::yy_pact_value_is_default_ (int yyvalue) + Dhcp6Parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - Dhcp6Parser::yy_table_value_is_error_ (int yyvalue) + Dhcp6Parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -4601,16 +4601,16 @@ namespace isc { namespace dhcp { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -4631,6 +4631,9 @@ namespace isc { namespace dhcp { + + + int Dhcp6Parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -5977,7 +5980,7 @@ namespace isc { namespace dhcp { #line 14 "dhcp6_parser.yy" } } // isc::dhcp -#line 5981 "dhcp6_parser.cc" +#line 5984 "dhcp6_parser.cc" #line 2864 "dhcp6_parser.yy" diff --git a/src/bin/dhcp6/dhcp6_parser.h b/src/bin/dhcp6/dhcp6_parser.h index 46f0607571..ed7bc8612a 100644 --- a/src/bin/dhcp6/dhcp6_parser.h +++ b/src/bin/dhcp6/dhcp6_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -133,12 +133,18 @@ using namespace std; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -200,7 +206,7 @@ using namespace std; #line 14 "dhcp6_parser.yy" namespace isc { namespace dhcp { -#line 204 "dhcp6_parser.h" +#line 210 "dhcp6_parser.h" @@ -209,27 +215,32 @@ namespace isc { namespace dhcp { class Dhcp6Parser { public: -#ifndef PARSER6_STYPE +#ifdef PARSER6_STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define PARSER6_STYPE in C++, use %define api.value.type" +# endif + typedef PARSER6_STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { PARSER6__ASSERT (sizeof (T) <= size); @@ -238,13 +249,13 @@ namespace isc { namespace dhcp { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { PARSER6__ASSERT (!yytypeid_); } @@ -388,7 +399,7 @@ namespace isc { namespace dhcp { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -398,7 +409,7 @@ namespace isc { namespace dhcp { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -407,7 +418,7 @@ namespace isc { namespace dhcp { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -444,18 +455,19 @@ namespace isc { namespace dhcp { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef PARSER6_STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -702,7 +714,7 @@ namespace isc { namespace dhcp { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1388,7 +1400,7 @@ namespace isc { namespace dhcp { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -1528,6 +1540,8 @@ namespace isc { namespace dhcp { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -1594,7 +1608,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -1609,22 +1623,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -1654,59 +1670,69 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER6__ASSERT (tok == token::TOKEN_END || (token::TOKEN_PARSER6_error <= tok && tok <= token::TOKEN_SUB_CONFIG_CONTROL)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, bool v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const bool& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER6__ASSERT (tok == token::TOKEN_BOOLEAN); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, double v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const double& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER6__ASSERT (tok == token::TOKEN_FLOAT); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, int64_t v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const int64_t& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER6__ASSERT (tok == token::TOKEN_INTEGER); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ PARSER6__ASSERT (tok == token::TOKEN_STRING); +#endif } }; @@ -1755,7 +1781,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4997,19 +5023,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -5041,14 +5067,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const short yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const short yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -5147,7 +5173,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -5226,7 +5252,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -5276,7 +5302,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -5294,7 +5320,7 @@ switch (yykind) inline Dhcp6Parser::symbol_kind_type - Dhcp6Parser::yytranslate_ (int t) + Dhcp6Parser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -5356,7 +5382,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -5405,6 +5431,7 @@ switch (yykind) + template Dhcp6Parser::symbol_kind_type Dhcp6Parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5412,6 +5439,7 @@ switch (yykind) return this->kind (); } + template bool Dhcp6Parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5462,13 +5490,13 @@ switch (yykind) // by_kind. inline - Dhcp6Parser::by_kind::by_kind () + Dhcp6Parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - Dhcp6Parser::by_kind::by_kind (by_kind&& that) + Dhcp6Parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5476,15 +5504,17 @@ switch (yykind) #endif inline - Dhcp6Parser::by_kind::by_kind (const by_kind& that) + Dhcp6Parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - Dhcp6Parser::by_kind::by_kind (token_kind_type t) + Dhcp6Parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void Dhcp6Parser::by_kind::clear () YY_NOEXCEPT @@ -5507,6 +5537,7 @@ switch (yykind) return kind_; } + inline Dhcp6Parser::symbol_kind_type Dhcp6Parser::by_kind::type_get () const YY_NOEXCEPT @@ -5514,9 +5545,10 @@ switch (yykind) return this->kind (); } + #line 14 "dhcp6_parser.yy" } } // isc::dhcp -#line 5520 "dhcp6_parser.h" +#line 5552 "dhcp6_parser.h" diff --git a/src/bin/dhcp6/location.hh b/src/bin/dhcp6/location.hh index e8036de559..4fb140a70e 100644 --- a/src/bin/dhcp6/location.hh +++ b/src/bin/dhcp6/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/bin/netconf/location.hh b/src/bin/netconf/location.hh index 7a07bc26fa..842a1114e8 100644 --- a/src/bin/netconf/location.hh +++ b/src/bin/netconf/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/bin/netconf/netconf_parser.cc b/src/bin/netconf/netconf_parser.cc index ae162714e3..57e970a7db 100644 --- a/src/bin/netconf/netconf_parser.cc +++ b/src/bin/netconf/netconf_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace netconf { NetconfParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -447,7 +447,7 @@ namespace isc { namespace netconf { } void - NetconfParser::yypop_ (int n) + NetconfParser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -490,13 +490,13 @@ namespace isc { namespace netconf { } bool - NetconfParser::yy_pact_value_is_default_ (int yyvalue) + NetconfParser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - NetconfParser::yy_table_value_is_error_ (int yyvalue) + NetconfParser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1749,16 +1749,16 @@ namespace isc { namespace netconf { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -1779,6 +1779,9 @@ namespace isc { namespace netconf { + + + int NetconfParser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -2188,7 +2191,7 @@ namespace isc { namespace netconf { #line 14 "netconf_parser.yy" } } // isc::netconf -#line 2192 "netconf_parser.cc" +#line 2195 "netconf_parser.cc" #line 706 "netconf_parser.yy" diff --git a/src/bin/netconf/netconf_parser.h b/src/bin/netconf/netconf_parser.h index 98568b131f..ee7ed9317e 100644 --- a/src/bin/netconf/netconf_parser.h +++ b/src/bin/netconf/netconf_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -132,12 +132,18 @@ using namespace std; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -199,7 +205,7 @@ using namespace std; #line 14 "netconf_parser.yy" namespace isc { namespace netconf { -#line 203 "netconf_parser.h" +#line 209 "netconf_parser.h" @@ -208,27 +214,32 @@ namespace isc { namespace netconf { class NetconfParser { public: -#ifndef NETCONF_STYPE +#ifdef NETCONF_STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define NETCONF_STYPE in C++, use %define api.value.type" +# endif + typedef NETCONF_STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { NETCONF__ASSERT (sizeof (T) <= size); @@ -237,13 +248,13 @@ namespace isc { namespace netconf { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { NETCONF__ASSERT (!yytypeid_); } @@ -387,7 +398,7 @@ namespace isc { namespace netconf { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -397,7 +408,7 @@ namespace isc { namespace netconf { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -406,7 +417,7 @@ namespace isc { namespace netconf { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -438,18 +449,19 @@ namespace isc { namespace netconf { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef NETCONF_STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -532,7 +544,7 @@ namespace isc { namespace netconf { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -714,7 +726,7 @@ namespace isc { namespace netconf { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -849,6 +861,8 @@ namespace isc { namespace netconf { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -910,7 +924,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -925,22 +939,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -970,59 +986,69 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ NETCONF__ASSERT (tok == token::TOKEN_END || (token::TOKEN_NETCONF_error <= tok && tok <= token::TOKEN_START_SUB_NETCONF)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, bool v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const bool& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ NETCONF__ASSERT (tok == token::TOKEN_BOOLEAN); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, double v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const double& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ NETCONF__ASSERT (tok == token::TOKEN_FLOAT); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, int64_t v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const int64_t& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ NETCONF__ASSERT (tok == token::TOKEN_INTEGER); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ NETCONF__ASSERT (tok == token::TOKEN_STRING); +#endif } }; @@ -1071,7 +1097,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -1853,19 +1879,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const signed char yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -1897,14 +1923,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -2003,7 +2029,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -2082,7 +2108,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -2132,7 +2158,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -2150,7 +2176,7 @@ switch (yykind) inline NetconfParser::symbol_kind_type - NetconfParser::yytranslate_ (int t) + NetconfParser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -2196,7 +2222,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -2240,6 +2266,7 @@ switch (yykind) + template NetconfParser::symbol_kind_type NetconfParser::basic_symbol::type_get () const YY_NOEXCEPT @@ -2247,6 +2274,7 @@ switch (yykind) return this->kind (); } + template bool NetconfParser::basic_symbol::empty () const YY_NOEXCEPT @@ -2292,13 +2320,13 @@ switch (yykind) // by_kind. inline - NetconfParser::by_kind::by_kind () + NetconfParser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - NetconfParser::by_kind::by_kind (by_kind&& that) + NetconfParser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -2306,15 +2334,17 @@ switch (yykind) #endif inline - NetconfParser::by_kind::by_kind (const by_kind& that) + NetconfParser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - NetconfParser::by_kind::by_kind (token_kind_type t) + NetconfParser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void NetconfParser::by_kind::clear () YY_NOEXCEPT @@ -2337,6 +2367,7 @@ switch (yykind) return kind_; } + inline NetconfParser::symbol_kind_type NetconfParser::by_kind::type_get () const YY_NOEXCEPT @@ -2344,9 +2375,10 @@ switch (yykind) return this->kind (); } + #line 14 "netconf_parser.yy" } } // isc::netconf -#line 2350 "netconf_parser.h" +#line 2382 "netconf_parser.h" diff --git a/src/lib/eval/location.hh b/src/lib/eval/location.hh index f25b5a9e2f..5bde47985a 100644 --- a/src/lib/eval/location.hh +++ b/src/lib/eval/location.hh @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Locations for Bison parsers in C++ diff --git a/src/lib/eval/parser.cc b/src/lib/eval/parser.cc index 898f2040a6..a4d4079a32 100644 --- a/src/lib/eval/parser.cc +++ b/src/lib/eval/parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -160,9 +160,9 @@ namespace isc { namespace eval { EvalParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -575,7 +575,7 @@ namespace isc { namespace eval { } void - EvalParser::yypop_ (int n) + EvalParser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -618,13 +618,13 @@ namespace isc { namespace eval { } bool - EvalParser::yy_pact_value_is_default_ (int yyvalue) + EvalParser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - EvalParser::yy_table_value_is_error_ (int yyvalue) + EvalParser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1806,16 +1806,16 @@ namespace isc { namespace eval { // Actual number of expected tokens int yycount = 0; - int yyn = yypact_[+yyparser_.yystack_[0].state]; + const int yyn = yypact_[+yyparser_.yystack_[0].state]; if (!yy_pact_value_is_default_ (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + const int yyxbegin = yyn < 0 ? -yyn : 0; // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -1836,6 +1836,9 @@ namespace isc { namespace eval { + + + int EvalParser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -2184,7 +2187,7 @@ namespace isc { namespace eval { #line 14 "parser.yy" } } // isc::eval -#line 2188 "parser.cc" +#line 2191 "parser.cc" #line 626 "parser.yy" diff --git a/src/lib/eval/parser.h b/src/lib/eval/parser.h index d6c67a8559..0ff5185efe 100644 --- a/src/lib/eval/parser.h +++ b/src/lib/eval/parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.6. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -132,12 +132,18 @@ using namespace isc::eval; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -199,7 +205,7 @@ using namespace isc::eval; #line 14 "parser.yy" namespace isc { namespace eval { -#line 203 "parser.h" +#line 209 "parser.h" @@ -208,27 +214,32 @@ namespace isc { namespace eval { class EvalParser { public: -#ifndef EVALSTYPE +#ifdef EVALSTYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define EVALSTYPE in C++, use %define api.value.type" +# endif + typedef EVALSTYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { EVAL_ASSERT (sizeof (T) <= size); @@ -237,13 +248,13 @@ namespace isc { namespace eval { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { EVAL_ASSERT (!yytypeid_); } @@ -387,7 +398,7 @@ namespace isc { namespace eval { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -397,7 +408,7 @@ namespace isc { namespace eval { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -406,7 +417,7 @@ namespace isc { namespace eval { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -454,18 +465,19 @@ namespace isc { namespace eval { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef EVALSTYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef location location_type; @@ -562,7 +574,7 @@ namespace isc { namespace eval { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -676,7 +688,7 @@ namespace isc { namespace eval { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -887,6 +899,8 @@ namespace isc { namespace eval { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -968,7 +982,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -983,22 +997,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -1028,29 +1044,33 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ EVAL_ASSERT (tok == token::TOKEN_END || (token::TOKEN_EVALerror <= tok && tok <= token::TOKEN_TOPLEVEL_STRING)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ EVAL_ASSERT ((token::TOKEN_STRING <= tok && tok <= token::TOKEN_IP_ADDRESS)); +#endif } }; @@ -1099,7 +1119,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static std::string symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -2091,19 +2111,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -2135,14 +2155,14 @@ switch (yykind) static const unsigned char yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const signed char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const signed char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -2241,7 +2261,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -2320,7 +2340,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -2370,7 +2390,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -2388,7 +2408,7 @@ switch (yykind) inline EvalParser::symbol_kind_type - EvalParser::yytranslate_ (int t) + EvalParser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -2435,7 +2455,7 @@ switch (yykind) if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } @@ -2499,6 +2519,7 @@ switch (yykind) + template EvalParser::symbol_kind_type EvalParser::basic_symbol::type_get () const YY_NOEXCEPT @@ -2506,6 +2527,7 @@ switch (yykind) return this->kind (); } + template bool EvalParser::basic_symbol::empty () const YY_NOEXCEPT @@ -2571,13 +2593,13 @@ switch (yykind) // by_kind. inline - EvalParser::by_kind::by_kind () + EvalParser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - EvalParser::by_kind::by_kind (by_kind&& that) + EvalParser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -2585,15 +2607,17 @@ switch (yykind) #endif inline - EvalParser::by_kind::by_kind (const by_kind& that) + EvalParser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - EvalParser::by_kind::by_kind (token_kind_type t) + EvalParser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void EvalParser::by_kind::clear () YY_NOEXCEPT @@ -2616,6 +2640,7 @@ switch (yykind) return kind_; } + inline EvalParser::symbol_kind_type EvalParser::by_kind::type_get () const YY_NOEXCEPT @@ -2623,9 +2648,10 @@ switch (yykind) return this->kind (); } + #line 14 "parser.yy" } } // isc::eval -#line 2629 "parser.h" +#line 2655 "parser.h" -- 2.47.2