c++: improve the generated documentation

* data/lalr1.cc, data/location.cc: Improve documenting comments.
* tests/c++.at (Doxygen Documentation): Fix AT_BISON_OPTION_PUSHDEFS,
so that the generated yyerror is correct.
* tests/c++.at, tests/headers.at: Prefer %empty.
This commit is contained in:
Akim Demaille
2018-11-04 13:03:43 +01:00
parent cf1446dc9e
commit 86efe28222
4 changed files with 10 additions and 8 deletions

View File

@@ -272,8 +272,9 @@ m4_define([b4_shared_declarations],
/// Print the state stack on the debug stream.
virtual void yystack_print_ ();
// Debugging.
/// Debugging level.
int yydebug_;
/// Debug stream.
std::ostream* yycdebug_;
/// \brief Display a symbol type, value and location.

View File

@@ -59,7 +59,7 @@ m4_ifdef([b4_location_file],
# ------------------
# Define the position and location classes.
m4_define([b4_location_define],
[[ /// Abstract a position.
[[ /// A point in a source file.
class position
{
public:]m4_ifdef([b4_location_constructors], [[
@@ -178,7 +178,7 @@ m4_define([b4_location_define],
return ostr << pos.line << '.' << pos.column;
}
/// Abstract a location.
/// Two points in a source file.
class location
{
public:

View File

@@ -679,14 +679,15 @@ m4_define([AT_CHECK_DOXYGEN],
[m4_fatal([invalid argument: $1])])
AT_SETUP([Doxygen $1 Documentation])
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %locations])
AT_DATA([input.yy],
[[%skeleton "lalr1.cc"
[[%require "3.2"
%skeleton "lalr1.cc"
%locations
%defines
%debug
%%
exp: /* empty */;
exp: %empty;
%%
]AT_YYERROR_DEFINE[
]])

View File

@@ -41,7 +41,7 @@ AT_DATA_GRAMMAR([$1.y],
]AT_YYLEX_DECLARE_EXTERN[
%}
%%
dummy: /* empty */;
dummy: %empty;
%%
#include <$1.h>
])
@@ -81,7 +81,7 @@ AT_DATA_GRAMMAR([input.y],
]AT_YYLEX_DEFINE[
%}
%%
exp: /* empty */;
exp: %empty;
]])
AT_BISON_CHECK([--defines -o input.c input.y])