Commit b8d67806 authored by Francis Dupont's avatar Francis Dupont Committed by Tomek Mrugalski
Browse files

[#66,!115] regen flex/bison

parent 5f5b4e48
This diff is collapsed.
// A Bison parser, made by GNU Bison 3.1.
// A Bison parser, made by GNU Bison 3.0.5.
// Skeleton interface for Bison LALR(1) parsers in C++
......@@ -40,7 +40,7 @@
#ifndef YY_AGENT_AGENT_PARSER_H_INCLUDED
# define YY_AGENT_AGENT_PARSER_H_INCLUDED
// // "%code requires" blocks.
#line 17 "agent_parser.yy" // lalr1.cc:380
#line 17 "agent_parser.yy" // lalr1.cc:379
#include <string>
#include <cc/data.h>
......@@ -51,7 +51,7 @@ using namespace isc::agent;
using namespace isc::data;
using namespace std;
#line 55 "agent_parser.h" // lalr1.cc:380
#line 55 "agent_parser.h" // lalr1.cc:379
# include <cassert>
# include <cstdlib> // std::abort
......@@ -102,7 +102,7 @@ using namespace std;
# define YYUSE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
......@@ -121,13 +121,6 @@ using namespace std;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULLPTR nullptr
# else
# define YY_NULLPTR 0
# endif
# endif
/* Debug traces. */
#ifndef AGENT_DEBUG
# if defined YYDEBUG
......@@ -141,9 +134,9 @@ using namespace std;
# endif /* ! defined YYDEBUG */
#endif /* ! defined AGENT_DEBUG */
#line 14 "agent_parser.yy" // lalr1.cc:380
#line 14 "agent_parser.yy" // lalr1.cc:379
namespace isc { namespace agent {
#line 147 "agent_parser.h" // lalr1.cc:380
#line 140 "agent_parser.h" // lalr1.cc:379
......@@ -160,8 +153,7 @@ namespace isc { namespace agent {
/// Empty construction.
variant ()
: yybuffer_ ()
, yytypeid_ (YY_NULLPTR)
: yytypeid_ (YY_NULLPTR)
{}
/// Construct and fill.
......@@ -187,7 +179,7 @@ namespace isc { namespace agent {
YYASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= S);
yytypeid_ = & typeid (T);
return *new (yyas_<T> ()) T ();
return *new (yyas_<T> ()) T;
}
/// Instantiate a \a T in here from \a t.
......@@ -206,7 +198,6 @@ namespace isc { namespace agent {
T&
as ()
{
YYASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);
return *yyas_<T> ();
......@@ -217,7 +208,6 @@ namespace isc { namespace agent {
const T&
as () const
{
YYASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);
return *yyas_<T> ();
......@@ -431,15 +421,15 @@ namespace isc { namespace agent {
basic_symbol (typename Base::kind_type t, const location_type& l);
basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l);
basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const bool v, const location_type& l);
basic_symbol (typename Base::kind_type t, const double& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const double v, const location_type& l);
basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l);
basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);
/// Constructor for symbols with semantic value.
......@@ -747,7 +737,7 @@ namespace isc { namespace agent {
// Tables.
// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
// STATE-NUM.
static const short yypact_[];
static const short int yypact_[];
// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
// Performed when YYTABLE does not specify something else to do. Zero
......@@ -758,14 +748,14 @@ namespace isc { namespace agent {
static const signed char yypgoto_[];
// YYDEFGOTO[NTERM-NUM].
static const short yydefgoto_[];
static const short int yydefgoto_[];
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
// positive, shift that token. If negative, reduce the rule whose
// number is the opposite. If YYTABLE_NINF, syntax error.
static const unsigned char yytable_[];
static const short yycheck_[];
static const short int yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
......@@ -786,7 +776,7 @@ namespace isc { namespace agent {
static const char* const yytname_[];
#if AGENT_DEBUG
// YYRLINE[YYN] -- Source line where rule number YYN was defined.
static const unsigned short yyrline_[];
static const unsigned short int yyrline_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_ (int r);
/// Print the state stack on the debug stream.
......@@ -851,7 +841,7 @@ namespace isc { namespace agent {
typedef basic_symbol<by_state> super_type;
/// Construct an empty symbol.
stack_symbol_type ();
/// Copy construct (for efficiency).
/// Copy construct.
stack_symbol_type (const stack_symbol_type& that);
/// Steal the contents from \a sym to build this.
stack_symbol_type (state_type s, symbol_type& sym);
......@@ -961,7 +951,6 @@ namespace isc { namespace agent {
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol ()
: value ()
, location ()
{}
template <typename Base>
......@@ -1042,39 +1031,40 @@ namespace isc { namespace agent {
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
: Base (t)
, value ()
, location (l)
{}
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l)
: Base (t)
, value (v)
, location (l)
......@@ -1221,7 +1211,7 @@ namespace isc { namespace agent {
// YYTOKNUM[NUM] -- (External) token number corresponding to the
// (internal) symbol number NUM (which must be that of a token). */
static
const unsigned short
const unsigned short int
yytoken_number_[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
......@@ -1492,9 +1482,9 @@ namespace isc { namespace agent {
}
#line 14 "agent_parser.yy" // lalr1.cc:380
#line 14 "agent_parser.yy" // lalr1.cc:379
} } // isc::agent
#line 1498 "agent_parser.h" // lalr1.cc:380
#line 1488 "agent_parser.h" // lalr1.cc:379
......
// A Bison parser, made by GNU Bison 3.1.
// Generated 201811071038
// A Bison parser, made by GNU Bison 3.0.5.
// Locations for Bison parsers in C++
......@@ -40,9 +41,9 @@
# include "position.hh"
#line 14 "agent_parser.yy" // location.cc:290
#line 14 "agent_parser.yy" // location.cc:292
namespace isc { namespace agent {
#line 46 "location.hh" // location.cc:290
#line 46 "location.hh" // location.cc:292
/// Abstract a location.
class location
{
......@@ -167,7 +168,7 @@ namespace isc { namespace agent {
** Avoid duplicate information.
*/
template <typename YYChar>
std::basic_ostream<YYChar>&
inline std::basic_ostream<YYChar>&
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
{
unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
......@@ -183,7 +184,7 @@ namespace isc { namespace agent {
return ostr;
}
#line 14 "agent_parser.yy" // location.cc:290
#line 14 "agent_parser.yy" // location.cc:292
} } // isc::agent
#line 189 "location.hh" // location.cc:290
#line 189 "location.hh" // location.cc:292
#endif // !YY_AGENT_LOCATION_HH_INCLUDED
// A Bison parser, made by GNU Bison 3.1.
// Generated 201811071038
// A Bison parser, made by GNU Bison 3.0.5.
// Positions for Bison parsers in C++
......@@ -50,9 +51,9 @@
# endif
# endif
#line 14 "agent_parser.yy" // location.cc:290
#line 14 "agent_parser.yy" // location.cc:292
namespace isc { namespace agent {
#line 56 "position.hh" // location.cc:290
#line 56 "position.hh" // location.cc:292
/// Abstract a position.
class position
{
......@@ -104,10 +105,12 @@ namespace isc { namespace agent {
unsigned column;
private:
/// Compute max(min, lhs+rhs).
static unsigned add_ (unsigned lhs, int rhs, int min)
/// Compute max(min, lhs+rhs) (provided min <= lhs).
static unsigned add_ (unsigned lhs, int rhs, unsigned min)
{
return static_cast<unsigned>(std::max(min, static_cast<int>(lhs) + rhs));
return (0 < rhs || -static_cast<unsigned>(rhs) < lhs
? rhs + lhs
: min);
}
};
......@@ -163,7 +166,7 @@ namespace isc { namespace agent {
** \param pos a reference to the position to redirect
*/
template <typename YYChar>
std::basic_ostream<YYChar>&
inline std::basic_ostream<YYChar>&
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
{
if (pos.filename)
......@@ -171,7 +174,7 @@ namespace isc { namespace agent {
return ostr << pos.line << '.' << pos.column;
}
#line 14 "agent_parser.yy" // location.cc:290
#line 14 "agent_parser.yy" // location.cc:292
} } // isc::agent
#line 177 "position.hh" // location.cc:290
#line 179 "position.hh" // location.cc:292
#endif // !YY_AGENT_POSITION_HH_INCLUDED
// A Bison parser, made by GNU Bison 3.1.
// Generated 201811071038
// A Bison parser, made by GNU Bison 3.0.5.
// Stack handling for Bison parsers in C++
......@@ -40,9 +41,9 @@
# include <vector>
#line 14 "agent_parser.yy" // stack.hh:132
#line 14 "agent_parser.yy" // stack.hh:131
namespace isc { namespace agent {
#line 46 "stack.hh" // stack.hh:132
#line 46 "stack.hh" // stack.hh:131
/// A stack with random access from its top.
template <class T, class S = std::vector<T> >
class stack
......@@ -51,14 +52,14 @@ namespace isc { namespace agent {
// Hide our reversed order.
typedef typename S::reverse_iterator iterator;
typedef typename S::const_reverse_iterator const_iterator;
typedef typename S::size_type size_type;
stack ()
: seq_ ()
{
seq_.reserve (200);
}
stack (size_type n)
stack (unsigned n)
: seq_ (n)
{}
......@@ -66,7 +67,7 @@ namespace isc { namespace agent {
///
/// Index 0 returns the topmost element.
T&
operator[] (size_type i)
operator[] (unsigned i)
{
return seq_[seq_.size () - 1 - i];
}
......@@ -75,7 +76,7 @@ namespace isc { namespace agent {
///
/// Index 0 returns the topmost element.
const T&
operator[] (size_type i) const
operator[] (unsigned i) const
{
return seq_[seq_.size () - 1 - i];
}
......@@ -91,7 +92,7 @@ namespace isc { namespace agent {
}
void
pop (size_type n = 1)
pop (unsigned n = 1)
{
for (; n; --n)
seq_.pop_back ();
......@@ -103,7 +104,7 @@ namespace isc { namespace agent {
seq_.clear ();
}
size_type
typename S::size_type
size () const
{
return seq_.size ();
......@@ -133,25 +134,24 @@ namespace isc { namespace agent {
class slice
{
public:
typedef typename S::size_type size_type;
slice (const S& stack, size_type range)
slice (const S& stack, unsigned range)
: stack_ (stack)
, range_ (range)
{}
const T&
operator[] (size_type i) const
operator [] (unsigned i) const
{
return stack_[range_ - i];
}
private:
const S& stack_;
size_type range_;
unsigned range_;
};
#line 14 "agent_parser.yy" // stack.hh:132
#line 14 "agent_parser.yy" // stack.hh:131
} } // isc::agent
#line 156 "stack.hh" // stack.hh:132
#line 155 "stack.hh" // stack.hh:131
#endif // !YY_AGENT_STACK_HH_INCLUDED
This diff is collapsed.
// A Bison parser, made by GNU Bison 3.1.
// A Bison parser, made by GNU Bison 3.0.5.
// Skeleton interface for Bison LALR(1) parsers in C++
......@@ -40,7 +40,7 @@
#ifndef YY_PARSER4_DHCP4_PARSER_H_INCLUDED
# define YY_PARSER4_DHCP4_PARSER_H_INCLUDED
// // "%code requires" blocks.
#line 17 "dhcp4_parser.yy" // lalr1.cc:380
#line 17 "dhcp4_parser.yy" // lalr1.cc:379
#include <string>
#include <cc/data.h>
......@@ -52,7 +52,7 @@ using namespace isc::dhcp;
using namespace isc::data;
using namespace std;
#line 56 "dhcp4_parser.h" // lalr1.cc:380
#line 56 "dhcp4_parser.h" // lalr1.cc:379
# include <cassert>
# include <cstdlib> // std::abort
......@@ -103,7 +103,7 @@ using namespace std;
# define YYUSE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
......@@ -122,13 +122,6 @@ using namespace std;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULLPTR nullptr
# else
# define YY_NULLPTR 0
# endif
# endif
/* Debug traces. */
#ifndef PARSER4_DEBUG
# if defined YYDEBUG
......@@ -142,9 +135,9 @@ using namespace std;
# endif /* ! defined YYDEBUG */
#endif /* ! defined PARSER4_DEBUG */
#line 14 "dhcp4_parser.yy" // lalr1.cc:380
#line 14 "dhcp4_parser.yy" // lalr1.cc:379
namespace isc { namespace dhcp {
#line 148 "dhcp4_parser.h" // lalr1.cc:380
#line 141 "dhcp4_parser.h" // lalr1.cc:379
......@@ -161,8 +154,7 @@ namespace isc { namespace dhcp {
/// Empty construction.
variant ()
: yybuffer_ ()
, yytypeid_ (YY_NULLPTR)
: yytypeid_ (YY_NULLPTR)
{}
/// Construct and fill.
......@@ -188,7 +180,7 @@ namespace isc { namespace dhcp {
YYASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= S);
yytypeid_ = & typeid (T);
return *new (yyas_<T> ()) T ();
return *new (yyas_<T> ()) T;
}
/// Instantiate a \a T in here from \a t.
......@@ -207,7 +199,6 @@ namespace isc { namespace dhcp {
T&
as ()
{
YYASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);
return *yyas_<T> ();
......@@ -218,7 +209,6 @@ namespace isc { namespace dhcp {
const T&
as () const
{
YYASSERT (yytypeid_);
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);
return *yyas_<T> ();
......@@ -561,15 +551,15 @@ namespace isc { namespace dhcp {
basic_symbol (typename Base::kind_type t, const location_type& l);
basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l);
basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const bool v, const location_type& l);
basic_symbol (typename Base::kind_type t, const double& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const double v, const location_type& l);
basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l);
basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l);
basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);
/// Constructor for symbols with semantic value.
......@@ -1364,7 +1354,7 @@ namespace isc { namespace dhcp {
/// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue);
static const short yypact_ninf_;
static const short int yypact_ninf_;
static const signed char yytable_ninf_;
/// Convert a scanner token number \a t to a symbol number.
......@@ -1373,32 +1363,32 @@ namespace isc { namespace dhcp {
// Tables.
// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
// STATE-NUM.
static const short yypact_[];
static const short int yypact_[];
// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
// Performed when YYTABLE does not specify something else to do. Zero
// means the default is an error.
static const unsigned short yydefact_[];
static const unsigned short int yydefact_[];
// YYPGOTO[NTERM-NUM].
static const short yypgoto_[];
static const short int yypgoto_[];
// YYDEFGOTO[NTERM-NUM].
static const short yydefgoto_[];
static const short int yydefgoto_[];
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
// positive, shift that token. If negative, reduce the rule whose
// number is the opposite. If YYTABLE_NINF, syntax error.
static const unsigned short yytable_[];
static const unsigned short int yytable_[];
static const short yycheck_[];
static const short int yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
static const unsigned short yystos_[];
static const unsigned short int yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
static const unsigned short yyr1_[];
static const unsigned short int yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
static const unsigned char yyr2_[];
......@@ -1412,7 +1402,7 @@ namespace isc { namespace dhcp {
static const char* const yytname_[];
#if PARSER4_DEBUG
// YYRLINE[YYN] -- Source line where rule number YYN was defined.
static const unsigned short yyrline_[];
static const unsigned short int yyrline_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_ (int r);
/// Print the state stack on the debug stream.
......@@ -1477,7 +1467,7 @@ namespace isc { namespace dhcp {
typedef basic_symbol<by_state> super_type;
/// Construct an empty symbol.
stack_symbol_type ();
/// Copy construct (for efficiency).
/// Copy construct.
stack_symbol_type (const stack_symbol_type& that);
/// Steal the contents from \a sym to build this.
stack_symbol_type (state_type s, symbol_type& sym);
......@@ -1600,7 +1590,6 @@ namespace isc { namespace dhcp {
template <typename Base>
Dhcp4Parser::basic_symbol<Base>::basic_symbol ()
: value ()
, location ()
{}
template <typename Base>
......@@ -1691,39 +1680,40 @@ namespace isc { namespace dhcp {
template <typename Base>
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
: Base (t)
, value ()
, location (l)
{}
template <typename Base>
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
template <typename Base>
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
Dhcp4Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}