39 #ifndef BISON_POSITION_HH 40 # define BISON_POSITION_HH 48 #line 1 "[Bison:b4_percent_define_default]" 53 #line 54 "position.hh" 78 inline void lines (
int count = 1)
120 return res += -width;
127 return begin + -width;
135 (pos1.filename == pos2.filename
136 || (pos1.filename && pos2.filename && *pos1.filename == *pos2.filename))
137 && pos1.line == pos2.line && pos1.column == pos2.column;
144 return !(pos1 == pos2);
155 ostr << *pos.filename <<
':';
156 return ostr << pos.line <<
'.' << pos.column;
161 #line 1 "[Bison:b4_percent_define_default]" 166 #line 167 "position.hh" 167 #endif // not BISON_POSITION_HH bool operator!=(const location &loc1, const location &loc2)
Compare two location objects.
void lines(int count=1)
(line related) Advance to the COUNT next lines.
const position operator-(const position &begin, const int width)
Add two position objects.
std::string * filename
File name to which this position refers.
const location operator+(const location &begin, const location &end)
Join two location objects to create a location.
std::ostream & operator<<(std::ostream &ostr, const location &loc)
Intercept output stream redirection.
location & operator+=(location &res, unsigned int width)
Add and assign a location.
void columns(int count=1)
(column related) Advance to the COUNT next columns.
bool operator==(const location &loc1, const location &loc2)
Compare two location objects.
void initialize(std::string *fn)
Initialization.
unsigned int line
Current line number.
const position & operator-=(position &res, const int width)
Add and assign a position.
position()
Construct a position.
unsigned int column
Current column number.