 |
ztsdb
|
Go to the documentation of this file.
44 #ifndef YY_YY_POSITION_HH_INCLUDED
45 # define YY_YY_POSITION_HH_INCLUDED
52 # if defined __cplusplus && 201103L <= __cplusplus
53 # define YY_NULLPTR nullptr
66 explicit position (
const std::string& filename_p = std::string(),
69 std::shared_ptr<const std::string> s_p =
70 std::make_shared<const std::string>())
83 std::shared_ptr<const std::string> s_p)
93 void lines (
int count = 1)
117 std::shared_ptr<const std::string>
s;
121 static unsigned int add_ (
unsigned int lhs,
int rhs,
unsigned int min)
123 return (0 < rhs || -
static_cast<unsigned int>(rhs) < lhs
148 return res += -width;
171 return !(pos1 == pos2);
178 template <
typename YYChar>
179 inline std::basic_ostream<YYChar>&
180 operator<< (std::basic_ostream<YYChar>& ostr,
const position& pos)
189 #endif // !YY_YY_POSITION_HH_INCLUDED
unsigned int line
Current line number.
Definition: position.hpp:113
position(const std::string &filename_p=std::string(), unsigned int l=1u, unsigned int c=1u, std::shared_ptr< const std::string > s_p=std::make_shared< const std::string >())
Construct a position.
Definition: position.hpp:66
Abstract a position.
Definition: position.hpp:62
std::string filename
File name to which this location refers.
Definition: position.hpp:111
unsigned int column
Current column number.
Definition: position.hpp:115
void columns(int count=1)
(column related) Advance to the COUNT next columns.
Definition: position.hpp:104
std::shared_ptr< const std::string > s
Shared pointer to the buffer being parsed;.
Definition: position.hpp:117
void lines(int count=1)
(line related) Advance to the COUNT next lines.
Definition: position.hpp:94
void initialize(const std::string &filename_p, unsigned int l, unsigned int c, std::shared_ptr< const std::string > s_p)
Initialization.
Definition: position.hpp:80