* data/lalr1.cc, tests/c++.at: Formatting changes.
{
YYCDEBUG << "Reading a token: ";
try
{
YYCDEBUG << "Reading a token: ";
try
-[ yyla = b4_function_call([yylex], [symbol_type],
+[ yyla = b4_function_call([yylex], [symbol_type],
m4_ifdef([b4_lex_param], b4_lex_param));],
m4_ifdef([b4_lex_param], b4_lex_param));],
-[ yyla.type = yytranslate_ (b4_function_call([yylex], [int],
+[ yyla.type = yytranslate_ (b4_function_call([yylex], [int],
[b4_api_PREFIX[STYPE*], [&yyla.value]][]dnl
b4_locations_if([, [[location*], [&yyla.location]]])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
[b4_api_PREFIX[STYPE*], [&yyla.value]][]dnl
b4_locations_if([, [[location*], [&yyla.location]]])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
catch (const syntax_error& yyexc)
catch (const syntax_error& yyexc)
- {
- error (yyexc);
- goto yyerrlab1;
- }
+ {
+ error (yyexc);
+ goto yyerrlab1;
+ }
yyempty = false;
}
YY_SYMBOL_PRINT ("Next token is", yyla);
yyempty = false;
}
YY_SYMBOL_PRINT ("Next token is", yyla);
// Perform the reduction.
YY_REDUCE_PRINT (yyn);
try
// Perform the reduction.
YY_REDUCE_PRINT (yyn);
try
catch (const syntax_error& yyexc)
catch (const syntax_error& yyexc)
- {
- error (yyexc);
- YYERROR;
- }
+ {
+ error (yyexc);
+ YYERROR;
+ }
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
]b4_variant_if([[
// Destroy the rhs symbols.
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
]b4_variant_if([[
// Destroy the rhs symbols.
operator<<(std::ostream& o, const strings_type& s)
{
o << '(';
operator<<(std::ostream& o, const strings_type& s)
{
o << '(';
- for (strings_type::const_iterator i = s.begin(); i != s.end (); ++i)
+ for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
{
if (i != s.begin ())
o << ", ";
{
if (i != s.begin ())
o << ", ";
{
std::ostringstream o;
o << t;
{
std::ostringstream o;
o << t;
// digraph for the left square bracket.
%type <::std::list<std::string>> list result;
// digraph for the left square bracket.
%type <::std::list<std::string>> list result;
-%printer { debug_stream() << $][$; }
+%printer { yyo << $][$; }
<int> <::std::string> <::std::list<std::string>>;
%%
<int> <::std::string> <::std::list<std::string>>;
%%
list:
/* nothing */ { /* Generates an empty string list */ }
list:
/* nothing */ { /* Generates an empty string list */ }
-| list item { std::swap($][$,$][1); $$.push_back($][2); }
-| list error { std::swap($][$,$][1); }
+| list item { std::swap ($][$,$][1); $$.push_back ($][2); }
+| list error { std::swap ($][$,$][1); }
- TEXT { std::swap($][$,$][1); }
-| NUMBER { if ($][1 == 3) YYERROR; else $][$ = string_cast($][1); }
+ TEXT { std::swap ($][$,$][1); }
+| NUMBER { if ($][1 == 3) YYERROR; else $][$ = string_cast ($][1); }
;
%%
#define STAGE_MAX 5
static
#if defined USE_LEX_SYMBOL
;
%%
#define STAGE_MAX 5
static
#if defined USE_LEX_SYMBOL
-yy::parser::symbol_type yylex()
+yy::parser::symbol_type yylex ()
-yy::parser::token_type yylex(yy::parser::semantic_type* yylval,
- yy::parser::location_type* yylloc)
+yy::parser::token_type yylex (yy::parser::semantic_type* yylval,
+ yy::parser::location_type* yylloc)
#endif
{
#ifndef USE_LEX_SYMBOL
#endif
{
#ifndef USE_LEX_SYMBOL
return yy::parser::make_NUMBER (stage, location_type ());
#else
# if defined ONE_STAGE_BUILD
return yy::parser::make_NUMBER (stage, location_type ());
#else
# if defined ONE_STAGE_BUILD
# else
yylval->build<int>() = stage;
# endif
# else
yylval->build<int>() = stage;
# endif
return token::TEXT;
#endif
}
return token::TEXT;
#endif
}
-yy::parser::error(const yy::parser::location_type&,
- const std::string& message)
+yy::parser::error (const yy::parser::location_type&,
+ const std::string& message)
{
std::cerr << message << std::endl;
}
{
std::cerr << message << std::endl;
}
- p.set_debug_level(!!getenv("YYDEBUG"));
- return p.parse();
+ p.set_debug_level (!!getenv ("YYDEBUG"));
+ return p.parse ();
- throw yy::parser::syntax_error("invalid expression");
+ throw yy::parser::syntax_error ("invalid expression");
switch (int res = *input++)
{
case 'l':
switch (int res = *input++)
{
case 'l':
- throw yy::parser::syntax_error("invalid character");
+ throw yy::parser::syntax_error ("invalid character");
main ()
{
yy::parser parser;
main ()
{
yy::parser parser;
- parser.set_debug_level(!!getenv("YYDEBUG"));
+ parser.set_debug_level (!!getenv ("YYDEBUG"));
return parser.parse ();
}
]])
return parser.parse ();
}
]])