* data/c++.m4, data/lalr1.cc: More documentation.
Tidy.
* tests/c++.at (string_cast): Rename as...
(to_string): this C++11 name.
const semantic_type& v]b4_locations_if([,
const location_type& l])[);
const semantic_type& v]b4_locations_if([,
const location_type& l])[);
+ /// Destroy the symbol.
~basic_symbol ();
/// Destructive move, \a s is emptied into this.
~basic_symbol ();
/// Destructive move, \a s is emptied into this.
void move (by_type& that);
/// The (internal) type number (corresponding to \a type).
void move (by_type& that);
/// The (internal) type number (corresponding to \a type).
- /// -1 when this symbol is empty.
+ /// \a empty when empty.
symbol_number_type type_get () const;
/// The token.
token_type token () const;
symbol_number_type type_get () const;
/// The token.
token_type token () const;
+ /// The type number used to denote an empty symbol.
enum { empty = 0 };
/// The symbol type.
enum { empty = 0 };
/// The symbol type.
- /// -1 when this symbol is empty.
+ /// \a empty when empty.
token_number_type type;
};
token_number_type type;
};
void move (by_state& that);
/// The (internal) type number (corresponding to \a state).
void move (by_state& that);
/// The (internal) type number (corresponding to \a state).
- /// "empty" when empty.
+ /// \a empty when empty.
symbol_number_type type_get () const;
symbol_number_type type_get () const;
+ /// The state number used to denote an empty symbol.
enum { empty = 0 };
/// The state.
enum { empty = 0 };
/// The state.
+ /// \a empty when empty.
/// Pop \a n symbols the three stacks.
void yypop_ (unsigned int n = 1);
/// Pop \a n symbols the three stacks.
void yypop_ (unsigned int n = 1);
int
]b4_parser_class_name[::parse ()
{
int
]b4_parser_class_name[::parse ()
{
- /// Whether yyla contains a lookahead.
- bool yyempty = true;
-
// State.
int yyn;
/// Length of the RHS of the rule being reduced.
// State.
int yyn;
/// Length of the RHS of the rule being reduced.
int yynerrs_ = 0;
int yyerrstatus_ = 0;
int yynerrs_ = 0;
int yyerrstatus_ = 0;
+ /// Whether yyla contains a lookahead.
+ bool yyempty = true;
+
/// The lookahead symbol.
symbol_type yyla;]b4_locations_if([[
/// The lookahead symbol.
symbol_type yyla;]b4_locations_if([[
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
[state_type, symbol_number_type])[) const
{]b4_error_verbose_if([[
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
[state_type, symbol_number_type])[) const
{]b4_error_verbose_if([[
// Number of reported tokens (one for the "unexpected", one per
// "expected").
size_t yycount = 0;
// Number of reported tokens (one for the "unexpected", one per
// "expected").
size_t yycount = 0;
// Argument number.
size_t yyi = 0;
for (char const* yyp = yyformat; *yyp; ++yyp)
// Argument number.
size_t yyi = 0;
for (char const* yyp = yyformat; *yyp; ++yyp)
template <typename T>
inline
std::string
template <typename T>
inline
std::string
- string_cast (const T& t)
{
std::ostringstream o;
o << t;
{
std::ostringstream o;
o << t;
item:
TEXT { std::swap ($$,$][1); }
item:
TEXT { std::swap ($$,$][1); }
-| NUMBER { if ($][1 == 3) YYERROR; else $$ = string_cast ($][1); }
+| NUMBER { if ($][1 == 3) YYERROR; else $$ = to_string ($][1); }
;
%%
]AT_TOKEN_CTOR_IF([],
;
%%
]AT_TOKEN_CTOR_IF([],
}
else
{]AT_TOKEN_CTOR_IF([[
}
else
{]AT_TOKEN_CTOR_IF([[
- return parser::make_TEXT (string_cast (stage)]AT_LOCATION_IF([, location ()])[);]], [[
- yylval->BUILD (std::string, string_cast (stage));]AT_LOCATION_IF([
+ return parser::make_TEXT (to_string (stage)]AT_LOCATION_IF([, location ()])[);]], [[
+ yylval->BUILD (std::string, to_string (stage));]AT_LOCATION_IF([
*yylloc = location ();])[
return parser::token::TEXT;]])[
}
*yylloc = location ();])[
return parser::token::TEXT;]])[
}