mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Simplify the C++ parser constructor.
* data/lalr1.cc (debug_): Rename as... (yydebug_): so that the parser's internals are always in the yy* pseudo namespace. Adjust uses. (b4_parse_param_decl): Remove the leading comma as it is now only called as unique argument list. (Parser::Parser): Remove the constructor accepting a location and an initial debugging level. Remove from the other ctor the argument for the debugging level. (debug_level_type, debug_level, set_debug_level): New. * tests/actions.at, tests/calc.at, tests/regression.at: Adjust constructor calls.
This commit is contained in:
@@ -320,7 +320,8 @@ static bool yydebug;
|
||||
int
|
||||
yyparse ()
|
||||
{
|
||||
yy::Parser parser (yydebug);
|
||||
yy::Parser parser;
|
||||
parser.set_debug_level (yydebug);
|
||||
return parser.parse ();
|
||||
}
|
||||
],
|
||||
|
||||
@@ -136,7 +136,8 @@ yy::Parser::error_ ()
|
||||
int
|
||||
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
|
||||
{
|
||||
yy::Parser parser (!!YYDEBUG[]AT_PARAM_IF([, result, count]));
|
||||
yy::Parser parser[]AT_PARAM_IF([ (result, count)]);
|
||||
parser.set_debug_level (!!YYDEBUG);
|
||||
return parser.parse ();
|
||||
}
|
||||
],
|
||||
|
||||
@@ -735,7 +735,8 @@ yy::Parser::error_ ()
|
||||
int
|
||||
yyparse (void)
|
||||
{
|
||||
yy::Parser parser (!!YYDEBUG);
|
||||
yy::Parser parser;
|
||||
parser.set_debug_level (!!YYDEBUG);
|
||||
return parser.parse ();
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user