38#ifndef YY_YY_ROSTLAB_BLAST_PARSER_LOCATION_H_INCLUDED
39# define YY_YY_ROSTLAB_BLAST_PARSER_LOCATION_H_INCLUDED
45# if defined __cplusplus
46# if 201103L <= __cplusplus
47# define YY_NULLPTR nullptr
52# define YY_NULLPTR ((void*)0)
56#line 22 "blast-parser-parser.ypp"
57namespace rostlab {
namespace blast {
58#line 59 "rostlab/blast-parser-location.h"
119 return lhs + rhs < min ? min : lhs + rhs;
142 return res += -width;
156 template <
typename YYChar>
157 std::basic_ostream<YYChar>&
158 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
162 return ostr << pos.line <<
'.' << pos.column;
268 return res += -width;
284 template <
typename YYChar>
285 std::basic_ostream<YYChar>&
286 operator<< (std::basic_ostream<YYChar>& ostr,
const location& loc)
289 = 0 < loc.
end.
column ? loc.end.column - 1 : 0;
292 && (!loc.begin.filename
293 || *loc.begin.filename != *loc.end.filename))
294 ostr <<
'-' << loc.end.filename <<
':' << loc.end.line <<
'.' << end_col;
295 else if (loc.begin.line < loc.end.line)
296 ostr <<
'-' << loc.end.line <<
'.' << end_col;
297 else if (loc.begin.column < end_col)
298 ostr <<
'-' << end_col;
302#line 22 "blast-parser-parser.ypp"
304#line 305 "rostlab/blast-parser-location.h"
Two points in a source file.
position::filename_type filename_type
Type for file name.
position begin
Beginning of the located region.
void lines(counter_type count=1)
Extend the current location to the COUNT next lines.
location(const position &p=position())
Construct a 0-width location in p.
void initialize(filename_type *f=YY_NULLPTR, counter_type l=1, counter_type c=1)
Initialization.
position::counter_type counter_type
Type for line and column numbers.
void step()
Reset initial location to final location.
position end
End of the located region.
void columns(counter_type count=1)
Extend the current location to the COUNT next columns.
location(filename_type *f, counter_type l=1, counter_type c=1)
Construct a 0-width location in f, l, c.
location(const position &b, const position &e)
Construct a location from b to e.
A point in a source file.
counter_type line
Current line number.
void lines(counter_type count=1)
(line related) Advance to the COUNT next lines.
const std::string filename_type
Type for file name.
counter_type column
Current column number.
void initialize(filename_type *fn=YY_NULLPTR, counter_type l=1, counter_type c=1)
Initialization.
int counter_type
Type for line and column numbers.
filename_type * filename
File name to which this position refers.
position(filename_type *f=YY_NULLPTR, counter_type l=1, counter_type c=1)
Construct a position.
void columns(counter_type count=1)
(column related) Advance to the COUNT next columns.
position & operator+=(position &res, position::counter_type width)
Add width columns, in place.
position operator+(position res, position::counter_type width)
Add width columns.
position operator-(position res, position::counter_type width)
Subtract width columns.
position & operator-=(position &res, position::counter_type width)
Subtract width columns, in place.
std::basic_ostream< YYChar > & operator<<(std::basic_ostream< YYChar > &ostr, const position &pos)
Intercept output stream redirection.