Skip to content

Commit b8d6780

Browse files
fxduponttomaszmrugalski
authored andcommitted
[#66,!115] regen flex/bison
1 parent 5f5b4e4 commit b8d6780

10 files changed

+1008
-1056
lines changed

src/bin/agent/agent_parser.cc

+195-213
Large diffs are not rendered by default.

src/bin/agent/agent_parser.h

+27-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.1.
1+
// A Bison parser, made by GNU Bison 3.0.5.
22

33
// Skeleton interface for Bison LALR(1) parsers in C++
44

@@ -40,7 +40,7 @@
4040
#ifndef YY_AGENT_AGENT_PARSER_H_INCLUDED
4141
# define YY_AGENT_AGENT_PARSER_H_INCLUDED
4242
// // "%code requires" blocks.
43-
#line 17 "agent_parser.yy" // lalr1.cc:380
43+
#line 17 "agent_parser.yy" // lalr1.cc:379
4444

4545
#include <string>
4646
#include <cc/data.h>
@@ -51,7 +51,7 @@ using namespace isc::agent;
5151
using namespace isc::data;
5252
using namespace std;
5353

54-
#line 55 "agent_parser.h" // lalr1.cc:380
54+
#line 55 "agent_parser.h" // lalr1.cc:379
5555

5656
# include <cassert>
5757
# include <cstdlib> // std::abort
@@ -102,7 +102,7 @@ using namespace std;
102102
# define YYUSE(E) /* empty */
103103
#endif
104104

105-
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
105+
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
106106
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
107107
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
108108
_Pragma ("GCC diagnostic push") \
@@ -121,13 +121,6 @@ using namespace std;
121121
# define YY_INITIAL_VALUE(Value) /* Nothing. */
122122
#endif
123123

124-
# ifndef YY_NULLPTR
125-
# if defined __cplusplus && 201103L <= __cplusplus
126-
# define YY_NULLPTR nullptr
127-
# else
128-
# define YY_NULLPTR 0
129-
# endif
130-
# endif
131124
/* Debug traces. */
132125
#ifndef AGENT_DEBUG
133126
# if defined YYDEBUG
@@ -141,9 +134,9 @@ using namespace std;
141134
# endif /* ! defined YYDEBUG */
142135
#endif /* ! defined AGENT_DEBUG */
143136

144-
#line 14 "agent_parser.yy" // lalr1.cc:380
137+
#line 14 "agent_parser.yy" // lalr1.cc:379
145138
namespace isc { namespace agent {
146-
#line 147 "agent_parser.h" // lalr1.cc:380
139+
#line 140 "agent_parser.h" // lalr1.cc:379
147140

148141

149142

@@ -160,8 +153,7 @@ namespace isc { namespace agent {
160153

161154
/// Empty construction.
162155
variant ()
163-
: yybuffer_ ()
164-
, yytypeid_ (YY_NULLPTR)
156+
: yytypeid_ (YY_NULLPTR)
165157
{}
166158

167159
/// Construct and fill.
@@ -187,7 +179,7 @@ namespace isc { namespace agent {
187179
YYASSERT (!yytypeid_);
188180
YYASSERT (sizeof (T) <= S);
189181
yytypeid_ = & typeid (T);
190-
return *new (yyas_<T> ()) T ();
182+
return *new (yyas_<T> ()) T;
191183
}
192184

193185
/// Instantiate a \a T in here from \a t.
@@ -206,7 +198,6 @@ namespace isc { namespace agent {
206198
T&
207199
as ()
208200
{
209-
YYASSERT (yytypeid_);
210201
YYASSERT (*yytypeid_ == typeid (T));
211202
YYASSERT (sizeof (T) <= S);
212203
return *yyas_<T> ();
@@ -217,7 +208,6 @@ namespace isc { namespace agent {
217208
const T&
218209
as () const
219210
{
220-
YYASSERT (yytypeid_);
221211
YYASSERT (*yytypeid_ == typeid (T));
222212
YYASSERT (sizeof (T) <= S);
223213
return *yyas_<T> ();
@@ -431,15 +421,15 @@ namespace isc { namespace agent {
431421

432422
basic_symbol (typename Base::kind_type t, const location_type& l);
433423

434-
basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l);
424+
basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l);
435425

436-
basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l);
426+
basic_symbol (typename Base::kind_type t, const bool v, const location_type& l);
437427

438-
basic_symbol (typename Base::kind_type t, const double& v, const location_type& l);
428+
basic_symbol (typename Base::kind_type t, const double v, const location_type& l);
439429

440-
basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l);
430+
basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l);
441431

442-
basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l);
432+
basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);
443433

444434

445435
/// Constructor for symbols with semantic value.
@@ -747,7 +737,7 @@ namespace isc { namespace agent {
747737
// Tables.
748738
// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
749739
// STATE-NUM.
750-
static const short yypact_[];
740+
static const short int yypact_[];
751741

752742
// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
753743
// Performed when YYTABLE does not specify something else to do. Zero
@@ -758,14 +748,14 @@ namespace isc { namespace agent {
758748
static const signed char yypgoto_[];
759749

760750
// YYDEFGOTO[NTERM-NUM].
761-
static const short yydefgoto_[];
751+
static const short int yydefgoto_[];
762752

763753
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
764754
// positive, shift that token. If negative, reduce the rule whose
765755
// number is the opposite. If YYTABLE_NINF, syntax error.
766756
static const unsigned char yytable_[];
767757

768-
static const short yycheck_[];
758+
static const short int yycheck_[];
769759

770760
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
771761
// symbol of state STATE-NUM.
@@ -786,7 +776,7 @@ namespace isc { namespace agent {
786776
static const char* const yytname_[];
787777
#if AGENT_DEBUG
788778
// YYRLINE[YYN] -- Source line where rule number YYN was defined.
789-
static const unsigned short yyrline_[];
779+
static const unsigned short int yyrline_[];
790780
/// Report on the debug stream that the rule \a r is going to be reduced.
791781
virtual void yy_reduce_print_ (int r);
792782
/// Print the state stack on the debug stream.
@@ -851,7 +841,7 @@ namespace isc { namespace agent {
851841
typedef basic_symbol<by_state> super_type;
852842
/// Construct an empty symbol.
853843
stack_symbol_type ();
854-
/// Copy construct (for efficiency).
844+
/// Copy construct.
855845
stack_symbol_type (const stack_symbol_type& that);
856846
/// Steal the contents from \a sym to build this.
857847
stack_symbol_type (state_type s, symbol_type& sym);
@@ -961,7 +951,6 @@ namespace isc { namespace agent {
961951
template <typename Base>
962952
AgentParser::basic_symbol<Base>::basic_symbol ()
963953
: value ()
964-
, location ()
965954
{}
966955

967956
template <typename Base>
@@ -1042,39 +1031,40 @@ namespace isc { namespace agent {
10421031
template <typename Base>
10431032
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
10441033
: Base (t)
1034+
, value ()
10451035
, location (l)
10461036
{}
10471037

10481038
template <typename Base>
1049-
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr& v, const location_type& l)
1039+
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l)
10501040
: Base (t)
10511041
, value (v)
10521042
, location (l)
10531043
{}
10541044

10551045
template <typename Base>
1056-
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
1046+
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l)
10571047
: Base (t)
10581048
, value (v)
10591049
, location (l)
10601050
{}
10611051

10621052
template <typename Base>
1063-
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
1053+
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double v, const location_type& l)
10641054
: Base (t)
10651055
, value (v)
10661056
, location (l)
10671057
{}
10681058

10691059
template <typename Base>
1070-
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l)
1060+
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l)
10711061
: Base (t)
10721062
, value (v)
10731063
, location (l)
10741064
{}
10751065

10761066
template <typename Base>
1077-
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
1067+
AgentParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l)
10781068
: Base (t)
10791069
, value (v)
10801070
, location (l)
@@ -1221,7 +1211,7 @@ namespace isc { namespace agent {
12211211
// YYTOKNUM[NUM] -- (External) token number corresponding to the
12221212
// (internal) symbol number NUM (which must be that of a token). */
12231213
static
1224-
const unsigned short
1214+
const unsigned short int
12251215
yytoken_number_[] =
12261216
{
12271217
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -1492,9 +1482,9 @@ namespace isc { namespace agent {
14921482
}
14931483

14941484

1495-
#line 14 "agent_parser.yy" // lalr1.cc:380
1485+
#line 14 "agent_parser.yy" // lalr1.cc:379
14961486
} } // isc::agent
1497-
#line 1498 "agent_parser.h" // lalr1.cc:380
1487+
#line 1488 "agent_parser.h" // lalr1.cc:379
14981488

14991489

15001490

src/bin/agent/location.hh

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// A Bison parser, made by GNU Bison 3.1.
1+
// Generated 201811071038
2+
// A Bison parser, made by GNU Bison 3.0.5.
23

34
// Locations for Bison parsers in C++
45

@@ -40,9 +41,9 @@
4041

4142
# include "position.hh"
4243

43-
#line 14 "agent_parser.yy" // location.cc:290
44+
#line 14 "agent_parser.yy" // location.cc:292
4445
namespace isc { namespace agent {
45-
#line 46 "location.hh" // location.cc:290
46+
#line 46 "location.hh" // location.cc:292
4647
/// Abstract a location.
4748
class location
4849
{
@@ -167,7 +168,7 @@ namespace isc { namespace agent {
167168
** Avoid duplicate information.
168169
*/
169170
template <typename YYChar>
170-
std::basic_ostream<YYChar>&
171+
inline std::basic_ostream<YYChar>&
171172
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
172173
{
173174
unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
@@ -183,7 +184,7 @@ namespace isc { namespace agent {
183184
return ostr;
184185
}
185186

186-
#line 14 "agent_parser.yy" // location.cc:290
187+
#line 14 "agent_parser.yy" // location.cc:292
187188
} } // isc::agent
188-
#line 189 "location.hh" // location.cc:290
189+
#line 189 "location.hh" // location.cc:292
189190
#endif // !YY_AGENT_LOCATION_HH_INCLUDED

src/bin/agent/position.hh

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// A Bison parser, made by GNU Bison 3.1.
1+
// Generated 201811071038
2+
// A Bison parser, made by GNU Bison 3.0.5.
23

34
// Positions for Bison parsers in C++
45

@@ -50,9 +51,9 @@
5051
# endif
5152
# endif
5253

53-
#line 14 "agent_parser.yy" // location.cc:290
54+
#line 14 "agent_parser.yy" // location.cc:292
5455
namespace isc { namespace agent {
55-
#line 56 "position.hh" // location.cc:290
56+
#line 56 "position.hh" // location.cc:292
5657
/// Abstract a position.
5758
class position
5859
{
@@ -104,10 +105,12 @@ namespace isc { namespace agent {
104105
unsigned column;
105106

106107
private:
107-
/// Compute max(min, lhs+rhs).
108-
static unsigned add_ (unsigned lhs, int rhs, int min)
108+
/// Compute max(min, lhs+rhs) (provided min <= lhs).
109+
static unsigned add_ (unsigned lhs, int rhs, unsigned min)
109110
{
110-
return static_cast<unsigned>(std::max(min, static_cast<int>(lhs) + rhs));
111+
return (0 < rhs || -static_cast<unsigned>(rhs) < lhs
112+
? rhs + lhs
113+
: min);
111114
}
112115
};
113116

@@ -163,15 +166,15 @@ namespace isc { namespace agent {
163166
** \param pos a reference to the position to redirect
164167
*/
165168
template <typename YYChar>
166-
std::basic_ostream<YYChar>&
169+
inline std::basic_ostream<YYChar>&
167170
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
168171
{
169172
if (pos.filename)
170173
ostr << *pos.filename << ':';
171174
return ostr << pos.line << '.' << pos.column;
172175
}
173176

174-
#line 14 "agent_parser.yy" // location.cc:290
177+
#line 14 "agent_parser.yy" // location.cc:292
175178
} } // isc::agent
176-
#line 177 "position.hh" // location.cc:290
179+
#line 179 "position.hh" // location.cc:292
177180
#endif // !YY_AGENT_POSITION_HH_INCLUDED

0 commit comments

Comments
 (0)