38 #ifndef YY_ELTLYY_LOCATION_HH_INCLUDED
39 # define YY_ELTLYY_LOCATION_HH_INCLUDED
41 # include "position.hh"
46 #line 47 "location.hh"
125 inline const location operator+ (
const location& begin,
unsigned int width)
127 location res = begin;
133 inline location& operator+= (location& res,
unsigned int width)
141 operator== (
const location& loc1,
const location& loc2)
143 return loc1.begin == loc2.begin && loc1.end == loc2.end;
148 operator!= (
const location& loc1,
const location& loc2)
150 return !(loc1 == loc2);
159 template <
typename YYChar>
160 inline std::basic_ostream<YYChar>&
161 operator<< (std::basic_ostream<YYChar>& ostr,
const location& loc)
163 position last = loc.end - 1;
166 && (!loc.begin.filename
167 || *loc.begin.filename != *last.filename))
169 else if (loc.begin.line != last.line)
170 ostr <<
'-' << last.line <<
'.' << last.column;
171 else if (loc.begin.column != last.column)
172 ostr <<
'-' << last.column;
179 #line 180 "location.hh"