doc: c++: complete the location documentation.

* data/location.cc (position::initialize, location::initialize):
Also accept line and column, with default values.
* doc/bison.texinfo (C++ position, C++ location): New nodes.
Describe more thoroughly these classes.
Fix several Texinfo misuses.
This commit is contained in:
Akim Demaille
2012-03-31 09:46:12 +02:00
parent 2091988f7e
commit 936c88d178
3 changed files with 95 additions and 27 deletions

View File

@@ -54,11 +54,13 @@ b4_copyright([Positions for Bison parsers in C++],
]])[
/// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL)
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
filename = fn;
line = ]b4_location_initial_line[u;
column = ]b4_location_initial_column[u;
line = l;
column = c;
}
/** \name Line and Column related manipulators
@@ -195,9 +197,11 @@ b4_copyright([Locations for Bison parsers in C++],
])[
/// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL)
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
begin.initialize (fn);
begin.initialize (f, l, c);
end = begin;
}