38 #ifndef YY_YY_POSITION_HH_INCLUDED
39 # define YY_YY_POSITION_HH_INCLUDED
46 # if defined __cplusplus && 201103L <= __cplusplus
47 # define YY_NULL nullptr
54 #line 4 "evalexpr_parser.yy"
57 #line 58 "position.hh"
86 void lines (
int count = 1)
117 inline const position
128 return res += -width;
132 inline const position
135 return begin + -width;
142 return (pos1.line == pos2.line
143 && pos1.column == pos2.column
144 && (pos1.filename == pos2.filename
145 || (pos1.filename && pos2.filename
146 && *pos1.filename == *pos2.filename)));
153 return !(pos1 == pos2);
160 template <
typename YYChar>
161 inline std::basic_ostream<YYChar>&
162 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
166 return ostr << pos.line <<
'.' << pos.column;
170 #line 4 "evalexpr_parser.yy"
173 #line 174 "position.hh"
bool operator!=(const location &loc1, const location &loc2)
Compare two location objects.
position & operator-=(position &res, const int width)
Add and assign a position.
void initialize(std::string *fn=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Initialization.
position(std::string *f=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Construct a position.
const location operator+(const location &begin, const location &end)
Join two location objects to create a location.
const position operator-(const position &begin, const int width)
Add two position objects.
unsigned int column
Current column number.
void columns(int count=1)
(column related) Advance to the COUNT next columns.
location & operator+=(location &res, unsigned int width)
Add and assign a location.
void lines(int count=1)
(line related) Advance to the COUNT next lines.
bool operator==(const location &loc1, const location &loc2)
Compare two location objects.
unsigned int line
Current line number.
std::string * filename
File name to which this position refers.