Skip to content

Commit 995f22b

Browse files
committed
Having Bison 3.7.2
1 parent 377fb72 commit 995f22b

File tree

5 files changed

+3899
-3408
lines changed

5 files changed

+3899
-3408
lines changed

src/parser/location.hh

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.5.3.
1+
// A Bison parser, made by GNU Bison 3.7.2.
22

33
// Locations for Bison parsers in C++
44

@@ -60,11 +60,13 @@ namespace yy {
6060
class position
6161
{
6262
public:
63+
/// Type for file name.
64+
typedef const std::string filename_type;
6365
/// Type for line and column numbers.
6466
typedef int counter_type;
6567

6668
/// Construct a position.
67-
explicit position (std::string* f = YY_NULLPTR,
69+
explicit position (filename_type* f = YY_NULLPTR,
6870
counter_type l = 1,
6971
counter_type c = 1)
7072
: filename (f)
@@ -74,7 +76,7 @@ namespace yy {
7476

7577

7678
/// Initialization.
77-
void initialize (std::string* fn = YY_NULLPTR,
79+
void initialize (filename_type* fn = YY_NULLPTR,
7880
counter_type l = 1,
7981
counter_type c = 1)
8082
{
@@ -103,7 +105,7 @@ namespace yy {
103105
/** \} */
104106

105107
/// File name to which this position refers.
106-
std::string* filename;
108+
filename_type* filename;
107109
/// Current line number.
108110
counter_type line;
109111
/// Current column number.
@@ -146,24 +148,6 @@ namespace yy {
146148
return res -= width;
147149
}
148150

149-
/// Compare two position objects.
150-
inline bool
151-
operator== (const position& pos1, const position& pos2)
152-
{
153-
return (pos1.line == pos2.line
154-
&& pos1.column == pos2.column
155-
&& (pos1.filename == pos2.filename
156-
|| (pos1.filename && pos2.filename
157-
&& *pos1.filename == *pos2.filename)));
158-
}
159-
160-
/// Compare two position objects.
161-
inline bool
162-
operator!= (const position& pos1, const position& pos2)
163-
{
164-
return !(pos1 == pos2);
165-
}
166-
167151
/** \brief Intercept output stream redirection.
168152
** \param ostr the destination output stream
169153
** \param pos a reference to the position to redirect
@@ -181,6 +165,8 @@ namespace yy {
181165
class location
182166
{
183167
public:
168+
/// Type for file name.
169+
typedef position::filename_type filename_type;
184170
/// Type for line and column numbers.
185171
typedef position::counter_type counter_type;
186172

@@ -197,7 +183,7 @@ namespace yy {
197183
{}
198184

199185
/// Construct a 0-width location in \a f, \a l, \a c.
200-
explicit location (std::string* f,
186+
explicit location (filename_type* f,
201187
counter_type l = 1,
202188
counter_type c = 1)
203189
: begin (f, l, c)
@@ -206,7 +192,7 @@ namespace yy {
206192

207193

208194
/// Initialization.
209-
void initialize (std::string* f = YY_NULLPTR,
195+
void initialize (filename_type* f = YY_NULLPTR,
210196
counter_type l = 1,
211197
counter_type c = 1)
212198
{
@@ -288,20 +274,6 @@ namespace yy {
288274
return res -= width;
289275
}
290276

291-
/// Compare two location objects.
292-
inline bool
293-
operator== (const location& loc1, const location& loc2)
294-
{
295-
return loc1.begin == loc2.begin && loc1.end == loc2.end;
296-
}
297-
298-
/// Compare two location objects.
299-
inline bool
300-
operator!= (const location& loc1, const location& loc2)
301-
{
302-
return !(loc1 == loc2);
303-
}
304-
305277
/** \brief Intercept output stream redirection.
306278
** \param ostr the destination output stream
307279
** \param loc a reference to the location to redirect
@@ -327,6 +299,6 @@ namespace yy {
327299
}
328300

329301
} // yy
330-
#line 331 "location.hh"
302+
#line 303 "location.hh"
331303

332304
#endif // !YY_YY_LOCATION_HH_INCLUDED

src/parser/position.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.5.3.
1+
// A Bison parser, made by GNU Bison 3.7.2.
22

33
// Starting with Bison 3.2, this file is useless: the structure it
44
// used to define is now defined in "location.hh".

0 commit comments

Comments
 (0)