1
- // A Bison parser, made by GNU Bison 3.5.3 .
1
+ // A Bison parser, made by GNU Bison 3.7.2 .
2
2
3
3
// Locations for Bison parsers in C++
4
4
@@ -60,11 +60,13 @@ namespace yy {
60
60
class position
61
61
{
62
62
public:
63
+ // / Type for file name.
64
+ typedef const std::string filename_type;
63
65
// / Type for line and column numbers.
64
66
typedef int counter_type;
65
67
66
68
// / Construct a position.
67
- explicit position (std::string * f = YY_NULLPTR,
69
+ explicit position (filename_type * f = YY_NULLPTR,
68
70
counter_type l = 1 ,
69
71
counter_type c = 1 )
70
72
: filename (f)
@@ -74,7 +76,7 @@ namespace yy {
74
76
75
77
76
78
// / Initialization.
77
- void initialize (std::string * fn = YY_NULLPTR,
79
+ void initialize (filename_type * fn = YY_NULLPTR,
78
80
counter_type l = 1 ,
79
81
counter_type c = 1 )
80
82
{
@@ -103,7 +105,7 @@ namespace yy {
103
105
/* * \} */
104
106
105
107
// / File name to which this position refers.
106
- std::string * filename;
108
+ filename_type * filename;
107
109
// / Current line number.
108
110
counter_type line;
109
111
// / Current column number.
@@ -146,24 +148,6 @@ namespace yy {
146
148
return res -= width;
147
149
}
148
150
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
-
167
151
/* * \brief Intercept output stream redirection.
168
152
** \param ostr the destination output stream
169
153
** \param pos a reference to the position to redirect
@@ -181,6 +165,8 @@ namespace yy {
181
165
class location
182
166
{
183
167
public:
168
+ // / Type for file name.
169
+ typedef position::filename_type filename_type;
184
170
// / Type for line and column numbers.
185
171
typedef position::counter_type counter_type;
186
172
@@ -197,7 +183,7 @@ namespace yy {
197
183
{}
198
184
199
185
// / Construct a 0-width location in \a f, \a l, \a c.
200
- explicit location (std::string * f,
186
+ explicit location (filename_type * f,
201
187
counter_type l = 1 ,
202
188
counter_type c = 1 )
203
189
: begin (f, l, c)
@@ -206,7 +192,7 @@ namespace yy {
206
192
207
193
208
194
// / Initialization.
209
- void initialize (std::string * f = YY_NULLPTR,
195
+ void initialize (filename_type * f = YY_NULLPTR,
210
196
counter_type l = 1 ,
211
197
counter_type c = 1 )
212
198
{
@@ -288,20 +274,6 @@ namespace yy {
288
274
return res -= width;
289
275
}
290
276
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
-
305
277
/* * \brief Intercept output stream redirection.
306
278
** \param ostr the destination output stream
307
279
** \param loc a reference to the location to redirect
@@ -327,6 +299,6 @@ namespace yy {
327
299
}
328
300
329
301
} // yy
330
- #line 331 "location.hh"
302
+ #line 303 "location.hh"
331
303
332
304
#endif // !YY_YY_LOCATION_HH_INCLUDED
0 commit comments