38 #ifndef YY_LTLYY_LOCATION_HH_INCLUDED
39 # define YY_LTLYY_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"
location(std::string *f, unsigned int l=1u, unsigned int c=1u)
Construct a 0-width location in f, l, c.
Definition: location.hh:68
position begin
Beginning of the located region.
Definition: location.hh:111
location(const position &p=position())
Construct a 0-width location in p.
Definition: location.hh:61
Abstract a position.
Definition: position.hh:58
void initialize(std::string *f=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Initialization.
Definition: location.hh:78
void step()
Reset initial location to final location.
Definition: location.hh:90
void initialize(std::string *fn=YY_NULL, unsigned int l=1u, unsigned int c=1u)
Initialization.
Definition: position.hh:74
position end
End of the located region.
Definition: location.hh:113
void lines(int count=1)
(line related) Advance to the COUNT next lines.
Definition: position.hh:86
location(const position &b, const position &e)
Construct a location from b to e.
Definition: location.hh:54
Abstract a location.
Definition: location.hh:49
void columns(unsigned int count=1)
Extend the current location to the COUNT next columns.
Definition: location.hh:96
void lines(unsigned int count=1)
Extend the current location to the COUNT next lines.
Definition: location.hh:102