c++: comment changes

* data/c++.m4, data/glr.cc, data/lalr1.cc: Convert some /* ... */
comments to //.
This commit is contained in:
Akim Demaille
2012-12-22 10:51:55 +01:00
parent 38de4e570f
commit ac826bc4b1
3 changed files with 37 additions and 39 deletions

View File

@@ -441,7 +441,7 @@ m4_define([b4_cc_constructor_call],
m4_define([b4_parse_param_vars], m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param], [m4_ifset([b4_parse_param],
[ [
/* User arguments. */ // User arguments.
b4_cc_var_decls(b4_parse_param)])]) b4_cc_var_decls(b4_parse_param)])])
m4_define([b4_cc_var_decls], m4_define([b4_cc_var_decls],
[m4_map_sep([b4_cc_var_decl], [ [m4_map_sep([b4_cc_var_decl], [

View File

@@ -290,7 +290,7 @@ b4_location_define])])[
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[); const location_type* yylocationp]])[);
private: private:
/* Debugging. */ // Debugging.
std::ostream* yycdebug_; std::ostream* yycdebug_;
#endif #endif
@@ -318,7 +318,7 @@ b4_defines_if(
b4_copyright([Skeleton interface for Bison GLR parsers in C++], b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002-2012])[ [2002-2012])[
/* C++ GLR parser skeleton written by Akim Demaille. */ // C++ GLR parser skeleton written by Akim Demaille.
]b4_cpp_guard_open([b4_spec_defines_file])[ ]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[ ]b4_shared_declarations[

View File

@@ -302,7 +302,7 @@ b4_location_define])])[
/// Pop \a n symbols the three stacks. /// Pop \a n symbols the three stacks.
inline void yypop_ (unsigned int n = 1); inline void yypop_ (unsigned int n = 1);
/* Constants. */ // Constants.
enum enum
{ {
yyeof_ = 0, yyeof_ = 0,
@@ -326,7 +326,7 @@ b4_public_types_define])[
[b4_token_defines [b4_token_defines
#ifndef ]b4_api_PREFIX[STYPE #ifndef ]b4_api_PREFIX[STYPE
/* Redirection for backward compatibility. */ // Redirection for backward compatibility.
# define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type # define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type
#endif #endif
])[ ])[
@@ -342,7 +342,7 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
** Define the ]b4_namespace_ref[::parser class. ** Define the ]b4_namespace_ref[::parser class.
*/ */
/* C++ LALR(1) parser skeleton written by Akim Demaille. */ // C++ LALR(1) parser skeleton written by Akim Demaille.
]b4_cpp_guard_open([b4_spec_defines_file])[ ]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[ ]b4_shared_declarations[
@@ -367,14 +367,14 @@ m4_if(b4_prefix, [yy], [],
]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], ]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
[b4_shared_declarations])[ [b4_shared_declarations])[
/* User implementation prologue. */ // User implementation prologue.
]b4_user_post_prologue[ ]b4_user_post_prologue[
]b4_percent_code_get[ ]b4_percent_code_get[
#ifndef YY_ #ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS # if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS # if ENABLE_NLS
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
# define YY_(msgid) dgettext ("bison-runtime", msgid) # define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif # endif
# endif # endif
@@ -387,13 +387,13 @@ m4_if(b4_prefix, [yy], [],
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) [#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
]b4_yylloc_default_define])[ ]b4_yylloc_default_define])[
/* Suppress unused-variable warnings by "using" E. */ // Suppress unused-variable warnings by "using" E.
#define YYUSE(e) ((void) (e)) #define YYUSE(E) ((void) (E))
/* Enable debugging if requested. */ // Enable debugging if requested.
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
/* A pseudo ostream that takes yydebug_ into account. */ // A pseudo ostream that takes yydebug_ into account.
# define YYCDEBUG if (yydebug_) (*yycdebug_) # define YYCDEBUG if (yydebug_) (*yycdebug_)
# define YY_SYMBOL_PRINT(Title, Symbol) \ # define YY_SYMBOL_PRINT(Title, Symbol) \
@@ -418,14 +418,14 @@ m4_if(b4_prefix, [yy], [],
yystack_print_ (); \ yystack_print_ (); \
} while (false) } while (false)
#else /* !]b4_api_PREFIX[DEBUG */ #else // !]b4_api_PREFIX[DEBUG
# define YYCDEBUG if (false) std::cerr # define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol) # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void>(0) # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
# define YY_STACK_PRINT() static_cast<void>(0) # define YY_STACK_PRINT() static_cast<void>(0)
#endif /* !]b4_api_PREFIX[DEBUG */ #endif // !]b4_api_PREFIX[DEBUG
#define yyerrok (yyerrstatus_ = 0) #define yyerrok (yyerrstatus_ = 0)
#define yyclearin (yyempty = true) #define yyclearin (yyempty = true)
@@ -460,7 +460,7 @@ m4_if(b4_prefix, [yy], [],
case '\\': case '\\':
if (*++yyp != '\\') if (*++yyp != '\\')
goto do_not_strip_quotes; goto do_not_strip_quotes;
/* Fall through. */ // Fall through.
default: default:
yyr += *yyp; yyr += *yyp;
break; break;
@@ -685,7 +685,7 @@ m4_if(b4_prefix, [yy], [],
]m4_ifdef([b4_initial_action], [ ]m4_ifdef([b4_initial_action], [
b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl
/* User initialization code. */ // User initialization code.
b4_user_initial_action b4_user_initial_action
b4_dollar_popdef])[]dnl b4_dollar_popdef])[]dnl
@@ -700,21 +700,21 @@ b4_dollar_popdef])[]dnl
yynewstate: yynewstate:
YYCDEBUG << "Entering state " << yystack_[0].state << std::endl; YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
/* Accept? */ // Accept?
if (yystack_[0].state == yyfinal_) if (yystack_[0].state == yyfinal_)
goto yyacceptlab; goto yyacceptlab;
goto yybackup; goto yybackup;
/* Backup. */ // Backup.
yybackup: yybackup:
/* Try to take a decision without lookahead. */ // Try to take a decision without lookahead.
yyn = yypact_[yystack_[0].state]; yyn = yypact_[yystack_[0].state];
if (yy_pact_value_is_default_ (yyn)) if (yy_pact_value_is_default_ (yyn))
goto yydefault; goto yydefault;
/* Read a lookahead token. */ // Read a lookahead token.
if (yyempty) if (yyempty)
{ {
YYCDEBUG << "Reading a token: "; YYCDEBUG << "Reading a token: ";
@@ -744,7 +744,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type) if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type)
goto yydefault; goto yydefault;
/* Reduce or error. */ // Reduce or error.
yyn = yytable_[yyn]; yyn = yytable_[yyn];
if (yyn <= 0) if (yyn <= 0)
{ {
@@ -754,15 +754,14 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
goto yyreduce; goto yyreduce;
} }
/* Discard the token being shifted. */ // Discard the token being shifted.
yyempty = true; yyempty = true;
/* Count tokens shifted since error; after three, turn off error // Count tokens shifted since error; after three, turn off error status.
status. */
if (yyerrstatus_) if (yyerrstatus_)
--yyerrstatus_; --yyerrstatus_;
/* Shift the lookahead token. */ // Shift the lookahead token.
yypush_ ("Shifting", yyn, yyla); yypush_ ("Shifting", yyn, yyla);
goto yynewstate; goto yynewstate;
@@ -839,7 +838,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
yylen = 0; yylen = 0;
YY_STACK_PRINT (); YY_STACK_PRINT ();
/* Shift the result of the reduction. */ // Shift the result of the reduction.
yypush_ (YY_NULL, yylhs); yypush_ (YY_NULL, yylhs);
goto yynewstate; goto yynewstate;
@@ -847,7 +846,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
| yyerrlab -- here on detecting error. | | yyerrlab -- here on detecting error. |
`--------------------------------------*/ `--------------------------------------*/
yyerrlab: yyerrlab:
/* If not already recovering from an error, report this error. */ // If not already recovering from an error, report this error.
if (!yyerrstatus_) if (!yyerrstatus_)
{ {
++yynerrs_; ++yynerrs_;
@@ -863,7 +862,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
/* If just tried and failed to reuse lookahead token after an /* If just tried and failed to reuse lookahead token after an
error, discard it. */ error, discard it. */
/* Return failure if at end of input. */ // Return failure if at end of input.
if (yyla.type == yyeof_) if (yyla.type == yyeof_)
YYABORT; YYABORT;
else if (!yyempty) else if (!yyempty)
@@ -873,8 +872,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
} }
} }
/* Else will try to reuse lookahead token after shifting the error // Else will try to reuse lookahead token after shifting the error token.
token. */
goto yyerrlab1; goto yyerrlab1;
@@ -901,7 +899,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
| yyerrlab1 -- common code for both syntax error and YYERROR. | | yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/ `-------------------------------------------------------------*/
yyerrlab1: yyerrlab1:
yyerrstatus_ = 3; /* Each real token shifted decrements this. */ yyerrstatus_ = 3; // Each real token shifted decrements this.
{ {
stack_symbol_type error_token; stack_symbol_type error_token;
for (;;) for (;;)
@@ -931,18 +929,18 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
yyerror_range[2].location = yyla.location; yyerror_range[2].location = yyla.location;
YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[ YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[
/* Shift the error token. */ // Shift the error token.
error_token.state = yyn; error_token.state = yyn;
yypush_ ("Shifting", error_token); yypush_ ("Shifting", error_token);
} }
goto yynewstate; goto yynewstate;
/* Accept. */ // Accept.
yyacceptlab: yyacceptlab:
yyresult = 0; yyresult = 0;
goto yyreturn; goto yyreturn;
/* Abort. */ // Abort.
yyabortlab: yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
@@ -1037,7 +1035,7 @@ b4_error_verbose_if([state_type yystate, int yytoken],
YYCHECK. In other words, skip the first -YYN actions for YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */ this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0; int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */ // Stay within bounds of both yycheck and yytname.
int yychecklim = yylast_ - yyn + 1; int yychecklim = yylast_ - yyn + 1;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
for (int yyx = yyxbegin; yyx < yyxend; ++yyx) for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
@@ -1093,8 +1091,8 @@ b4_error_verbose_if([state_type yystate, int yytoken],
]b4_parser_tables_define[ ]b4_parser_tables_define[
]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ ]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at \a yyntokens_, nonterminals. */ // First, the terminals, then, starting at \a yyntokens_, nonterminals.
const char* const char*
const ]b4_parser_class_name[::yytname_[] = const ]b4_parser_class_name[::yytname_[] =
{ {
@@ -1123,10 +1121,10 @@ b4_error_verbose_if([state_type yystate, int yytoken],
{ {
unsigned int yylno = yyrline_[yyrule]; unsigned int yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule]; int yynrhs = yyr2_[yyrule];
/* Print the symbols being reduced, and their result. */ // Print the symbols being reduced, and their result.
*yycdebug_ << "Reducing stack by rule " << yyrule - 1 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
<< " (line " << yylno << "):" << std::endl; << " (line " << yylno << "):" << std::endl;
/* The symbols being reduced. */ // The symbols being reduced.
for (int yyi = 0; yyi < yynrhs; yyi++) for (int yyi = 0; yyi < yynrhs; yyi++)
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
]b4_rhs_data(yynrhs, yyi + 1)[); ]b4_rhs_data(yynrhs, yyi + 1)[);