38 #ifndef YY_YY_ROSTLAB_BLAST_PARSER_POSITION_H_INCLUDED
39 # define YY_YY_ROSTLAB_BLAST_PARSER_POSITION_H_INCLUDED
46 # if defined __cplusplus && 201103L <= __cplusplus
47 # define YY_NULLPTR nullptr
53 #line 22 "blast-parser-parser.ypp" // location.cc:291
54 namespace rostlab {
namespace blast {
55 #line 56 "rostlab/blast-parser-position.h" // location.cc:291
83 void lines (
int count = 1)
109 static unsigned int add_ (
unsigned int lhs,
int rhs,
unsigned int min)
111 return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
136 return res += -width;
150 return (pos1.line == pos2.line
151 && pos1.column == pos2.column
152 && (pos1.filename == pos2.filename
153 || (pos1.filename && pos2.filename
154 && *pos1.filename == *pos2.filename)));
161 return !(pos1 == pos2);
168 template <
typename YYChar>
169 inline std::basic_ostream<YYChar>&
170 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
174 return ostr << pos.line <<
'.' << pos.column;
177 #line 22 "blast-parser-parser.ypp" // location.cc:291
179 #line 180 "rostlab/blast-parser-position.h" // location.cc:291
180 #endif // !YY_YY_ROSTLAB_BLAST_PARSER_POSITION_H_INCLUDED
std::string * filename
File name to which this position refers.
bool operator!=(const location &loc1, const location &loc2)
Compare two location objects.
position(std::string *f=YY_NULLPTR, unsigned int l=1u, unsigned int c=1u)
Construct a position.
location & operator+=(location &res, int width)
Change end position in place.
void lines(int count=1)
(line related) Advance to the COUNT next lines.
unsigned int line
Current line number.
location & operator-=(location &res, int width)
Change end position in place.
location operator-(const location &begin, int width)
Change end position.
unsigned int column
Current column number.
bool operator==(const location &loc1, const location &loc2)
Compare two location objects.
location operator+(location res, const location &end)
Join two location objects to create a location.
void initialize(std::string *fn=YY_NULLPTR, unsigned int l=1u, unsigned int c=1u)
Initialization.
void columns(int count=1)
(column related) Advance to the COUNT next columns.