38 #ifndef YY_TGBAYY_POSITION_HH_INCLUDED
39 # define YY_TGBAYY_POSITION_HH_INCLUDED
46 # if defined __cplusplus && 201103L <= __cplusplus
47 # define YY_NULL nullptr
56 #line 57 "position.hh"
85 void lines (
int count = 1)
109 operator+= (
position& res,
const int width)
116 inline const position
117 operator+ (
const position& begin,
const int width)
119 position res = begin;
125 operator-= (position& res,
const int width)
127 return res += -width;
131 inline const position
132 operator- (
const position& begin,
const int width)
134 return begin + -width;
139 operator== (
const position& pos1,
const position& pos2)
141 return (pos1.line == pos2.line
142 && pos1.column == pos2.column
143 && (pos1.filename == pos2.filename
144 || (pos1.filename && pos2.filename
145 && *pos1.filename == *pos2.filename)));
150 operator!= (
const position& pos1,
const position& pos2)
152 return !(pos1 == pos2);
159 template <
typename YYChar>
160 inline std::basic_ostream<YYChar>&
161 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
164 ostr << *pos.filename <<
':';
165 return ostr << pos.line <<
'.' << pos.column;
171 #line 172 "position.hh"
unsigned int column
Current column number.
Definition: position.hh:104
Abstract a position.
Definition: position.hh:58
void columns(int count=1)
(column related) Advance to the COUNT next columns.
Definition: position.hh:93
std::string * filename
File name to which this position refers.
Definition: position.hh:100
unsigned int line
Current line number.
Definition: position.hh:102
void initialize(std::string *fn=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Initialization.
Definition: position.hh:74
position(std::string *f=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Construct a position.
Definition: position.hh:63
void lines(int count=1)
(line related) Advance to the COUNT next lines.
Definition: position.hh:86