[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
10.1.3.1 C++ position
- Constructor on position: position (std::string* file = 0, uint line = 1, uint col = 1)
Create a
position
denoting a given point. Note thatfile
is not reclaimed when theposition
is destroyed: memory managed must be handled elsewhere.
- Method on position: void initialize (std::string* file = 0, uint line = 1, uint col = 1)
Reset the position to the given values.
- Instance Variable of position: std::string* file
The name of the file. It will always be handled as a pointer, the parser will never duplicate nor deallocate it. As an experimental feature you may change it to ‘type*’ using ‘%define filename_type "type"’.
- Method on position: void lines (int height = 1)
If height is not null, advance by height lines, resetting the column number. The resulting line number cannot be less than 1.
- Method on position: void columns (int width = 1)
Advance by width columns, without changing the line number. The resulting column number cannot be less than 1.
- Method on position: position& operator+= (int width)
- Method on position: position operator+ (int width)
- Method on position: position& operator-= (int width)
- Method on position: position operator- (int width)
Various forms of syntactic sugar for
columns
.
- Method on position: bool operator== (const position& that)
- Method on position: bool operator!= (const position& that)
Whether
*this
andthat
denote equal/different positions.
- Function: std::ostream& operator<< (std::ostream& o, const position& p)
Report p on o like this: ‘file:line.column’, or ‘line.column’ if file is null.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 1, 2013 using texi2html 5.0.