|
ztsdb
|
38 #ifndef YY_CFGYY_HOME_LSILVEST_REPOS_ZTSDB_GITHUB_SRC_CONFIG_PARSER_LOCATION_HH_INCLUDED
39 # define YY_CFGYY_HOME_LSILVEST_REPOS_ZTSDB_GITHUB_SRC_CONFIG_PARSER_LOCATION_HH_INCLUDED
45 # if defined __cplusplus
46 # if 201103L <= __cplusplus
47 # define YY_NULLPTR nullptr
52 # define YY_NULLPTR ((void*)0)
57 #line 58 "/home/lsilvest/repos/ztsdb_github/src/config_parser/location.hh"
67 explicit position (std::string* f = YY_NULLPTR,
116 return lhs + rhs < min ? min : lhs + rhs;
139 return res += -width;
151 operator== (
const position& pos1,
const position& pos2)
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)));
162 operator!= (
const position& pos1,
const position& pos2)
164 return !(pos1 == pos2);
171 template <
typename YYChar>
172 std::basic_ostream<YYChar>&
173 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
176 ostr << *pos.filename <<
':';
177 return ostr << pos.line <<
'.' << pos.column;
257 operator+ (location res,
const location& end)
281 return res += -width;
293 operator== (
const location& loc1,
const location& loc2)
295 return loc1.begin == loc2.begin && loc1.end == loc2.end;
300 operator!= (
const location& loc1,
const location& loc2)
302 return !(loc1 == loc2);
311 template <
typename YYChar>
312 std::basic_ostream<YYChar>&
313 operator<< (std::basic_ostream<YYChar>& ostr,
const location& loc)
316 = 0 < loc.end.column ? loc.end.column - 1 : 0;
319 && (!loc.begin.filename
320 || *loc.begin.filename != *loc.end.filename))
321 ostr <<
'-' << loc.end.filename <<
':' << loc.end.line <<
'.' << end_col;
322 else if (loc.begin.line < loc.end.line)
323 ostr <<
'-' << loc.end.line <<
'.' << end_col;
324 else if (loc.begin.column < end_col)
325 ostr <<
'-' << end_col;
330 #line 331 "/home/lsilvest/repos/ztsdb_github/src/config_parser/location.hh"
332 #endif // !YY_CFGYY_HOME_LSILVEST_REPOS_ZTSDB_GITHUB_SRC_CONFIG_PARSER_LOCATION_HH_INCLUDED
void initialize(std::string *fn=YY_NULLPTR, counter_type l=1, counter_type c=1)
Initialization.
Definition: location.hh:77
void step()
Reset initial location to final location.
Definition: location.hh:221
position(std::string *f=YY_NULLPTR, counter_type l=1, counter_type c=1)
Construct a position.
Definition: location.hh:67
void initialize(std::string *f=YY_NULLPTR, counter_type l=1, counter_type c=1)
Initialization.
Definition: location.hh:209
position end
End of the located region.
Definition: location.hh:244
int counter_type
Type for line and column numbers.
Definition: location.hh:64
position begin
Beginning of the located region.
Definition: location.hh:242
counter_type line
Current line number.
Definition: location.hh:108
A point in a source file.
Definition: location.hh:60
void columns(counter_type count=1)
(column related) Advance to the COUNT next columns.
Definition: location.hh:99
location(const position &b, const position &e)
Construct a location from b to e.
Definition: location.hh:188
std::string * filename
File name to which this position refers.
Definition: location.hh:106
location(std::string *f, counter_type l=1, counter_type c=1)
Construct a 0-width location in f, l, c.
Definition: location.hh:200
void columns(counter_type count=1)
Extend the current location to the COUNT next columns.
Definition: location.hh:227
location(const position &p=position())
Construct a 0-width location in p.
Definition: location.hh:194
counter_type column
Current column number.
Definition: location.hh:110
Two points in a source file.
Definition: location.hh:181
position::counter_type counter_type
Type for line and column numbers.
Definition: location.hh:185
void lines(counter_type count=1)
(line related) Advance to the COUNT next lines.
Definition: location.hh:89
void lines(counter_type count=1)
Extend the current location to the COUNT next lines.
Definition: location.hh:233