06.01.2015 Views

Manual

Manual

Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

102 Bison 2.3<br />

10.1.3 C++ Location Values<br />

When the directive %locations is used, the C++ parser supports location tracking, see<br />

Section 3.6 [Locations Overview], page 51. Two auxiliary classes define a position, a<br />

single point in a file, and a location, a range composed of a pair of positions (possibly<br />

spanning several files).<br />

std::string* file<br />

[Method on position]<br />

The name of the file. It will always be handled as a pointer, the parser will never<br />

duplicate nor deallocate it. As an experimental feature you may change it to ‘type*’<br />

using ‘%define "filename_type" "type"’.<br />

unsigned int line<br />

The line, starting at 1.<br />

unsigned int lines (int height = 1)<br />

Advance by height lines, resetting the column number.<br />

unsigned int column<br />

The column, starting at 0.<br />

[Method on position]<br />

[Method on position]<br />

[Method on position]<br />

unsigned int columns (int width = 1)<br />

[Method on position]<br />

Advance by width columns, without changing the line number.<br />

position& operator+= (position& pos, int width )<br />

position operator+ (const position& pos, int width )<br />

position& operator-= (const position& pos, int width )<br />

position operator- (position& pos, int width )<br />

Various forms of syntactic sugar for columns.<br />

[Method on position]<br />

[Method on position]<br />

[Method on position]<br />

[Method on position]<br />

position operator

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!