38 #ifndef YY_YY_ROSTLAB_BLAST_PARSER_LOCATION_H_INCLUDED
39 # define YY_YY_ROSTLAB_BLAST_PARSER_LOCATION_H_INCLUDED
43 #line 22 "blast-parser-parser.ypp" // location.cc:291
44 namespace rostlab {
namespace blast {
45 #line 46 "rostlab/blast-parser-location.h" // location.cc:291
137 return res += -width;
143 return begin + -width;
150 return loc1.begin == loc2.begin && loc1.end == loc2.end;
157 return !(loc1 == loc2);
166 template <
typename YYChar>
167 inline std::basic_ostream<YYChar>&
168 operator<< (std::basic_ostream<YYChar>& ostr,
const location& loc)
170 unsigned int end_col = 0 < loc.
end.
column ? loc.end.column - 1 : 0;
174 && (!loc.begin.filename
175 || *loc.begin.filename != *loc.end.filename))
176 ostr <<
'-' << loc.end.filename <<
':' << loc.end.line <<
'.' << end_col;
177 else if (loc.begin.line < loc.end.line)
178 ostr <<
'-' << loc.end.line <<
'.' << end_col;
179 else if (loc.begin.column < end_col)
180 ostr <<
'-' << end_col;
184 #line 22 "blast-parser-parser.ypp" // location.cc:291
186 #line 187 "rostlab/blast-parser-location.h" // location.cc:291
187 #endif // !YY_YY_ROSTLAB_BLAST_PARSER_LOCATION_H_INCLUDED
location(const position &p=position())
Construct a 0-width location in p.
void initialize(std::string *f=YY_NULLPTR, unsigned int l=1u, unsigned int c=1u)
Initialization.
bool operator!=(const location &loc1, const location &loc2)
Compare two location objects.
location & operator+=(location &res, int width)
Change end position in place.
void lines(int count=1)
(line related) Advance to the COUNT next lines.
location(std::string *f, unsigned int l=1u, unsigned int c=1u)
Construct a 0-width location in f, l, c.
position begin
Beginning of the located region.
location & operator-=(location &res, int width)
Change end position in place.
location operator-(const location &begin, int width)
Change end position.
position end
End of the located region.
unsigned int column
Current column number.
bool operator==(const location &loc1, const location &loc2)
Compare two location objects.
void lines(int count=1)
Extend the current location to the COUNT next lines.
location operator+(location res, const location &end)
Join two location objects to create a location.
location(const position &b, const position &e)
Construct a location from b to e.
void columns(int count=1)
Extend the current location to the COUNT next columns.
void initialize(std::string *fn=YY_NULLPTR, unsigned int l=1u, unsigned int c=1u)
Initialization.
void step()
Reset initial location to final location.