mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: formatting and comment changes
* data/c++.m4, data/lalr1.cc, data/stack.hh, data/variant.hh: Fix indentation. Fix some comments.
This commit is contained in:
15
data/c++.m4
15
data/c++.m4
@@ -176,20 +176,18 @@ m4_define([b4_public_types_declare],
|
||||
inline basic_symbol (const basic_symbol& other);
|
||||
|
||||
/// Constructor for valueless symbols.
|
||||
inline basic_symbol (]b4_join(
|
||||
[typename Base::value_type t],
|
||||
b4_locations_if([const location_type& l]))[);
|
||||
inline basic_symbol (typename Base::value_type t]b4_locations_if([,
|
||||
const location_type& l])[);
|
||||
|
||||
/// Constructor for symbols with semantic value.
|
||||
inline basic_symbol (]b4_join(
|
||||
[typename Base::value_type t],
|
||||
[const semantic_type& v],
|
||||
b4_locations_if([const location_type& l]))[);
|
||||
inline basic_symbol (typename Base::value_type t,
|
||||
const semantic_type& v]b4_locations_if([,
|
||||
const location_type& l])[);
|
||||
|
||||
/// Assignment operator.
|
||||
inline basic_symbol& operator= (const basic_symbol& other);
|
||||
|
||||
/// Destructive move, \a s is emptied.
|
||||
/// Destructive move, \a s is emptied into this.
|
||||
inline void move (basic_symbol& s);
|
||||
|
||||
/// The semantic value.
|
||||
@@ -220,6 +218,7 @@ m4_define([b4_public_types_declare],
|
||||
/// The token.
|
||||
inline token_type token () const;
|
||||
|
||||
/// The type used to store the symbol type.
|
||||
typedef token_type value_type;
|
||||
};
|
||||
|
||||
|
||||
@@ -287,6 +287,7 @@ b4_location_define])])[
|
||||
/// The type (corresponding to \a state).
|
||||
inline int type_get () const;
|
||||
|
||||
/// The type used to store the symbol type.
|
||||
typedef state_type value_type;
|
||||
};
|
||||
|
||||
@@ -497,12 +498,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||
#endif]b4_parse_param_cons[
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
]b4_parser_class_name::~b4_parser_class_name[ ()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
/*---------------.
|
||||
@@ -530,10 +529,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
return yystos_[state];
|
||||
}
|
||||
|
||||
|
||||
template <typename Base>
|
||||
void
|
||||
]b4_parser_class_name[::yy_destroy_ (const char* yymsg,
|
||||
basic_symbol<Base>& yysym) const
|
||||
]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
|
||||
{
|
||||
if (yymsg)
|
||||
YY_SYMBOL_PRINT (yymsg, yysym);
|
||||
@@ -574,8 +573,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s,
|
||||
symbol_type& sym)
|
||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym)
|
||||
{
|
||||
if (m)
|
||||
YY_SYMBOL_PRINT (m, sym);
|
||||
|
||||
@@ -41,14 +41,14 @@ m4_define([b4_stack_define],
|
||||
|
||||
inline
|
||||
T&
|
||||
operator [] (unsigned int i)
|
||||
operator[] (unsigned int i)
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
inline
|
||||
const T&
|
||||
operator [] (unsigned int i) const
|
||||
operator[] (unsigned int i) const
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
@@ -159,11 +159,12 @@ m4_define([b4_variant_define],
|
||||
}
|
||||
|
||||
/// Swap the content with \a other, of same type.
|
||||
///
|
||||
/// Both variants must be built beforehand, because swapping the actual
|
||||
/// data requires reading it (with as()), and this is not possible on
|
||||
/// unconstructed variants: it would require some dynamic testing, which
|
||||
/// should not be the variant's responsability.
|
||||
/// Swapping between built and ((possibly) non-built is done with
|
||||
/// Swapping between built and (possibly) non-built is done with
|
||||
/// variant::move ().
|
||||
template <typename T>
|
||||
void
|
||||
@@ -175,7 +176,8 @@ m4_define([b4_variant_define],
|
||||
std::swap (as<T>(), other.as<T>());
|
||||
}
|
||||
|
||||
/// Assign the content of \a other to this.
|
||||
/// Move the content of \a other to this.
|
||||
///
|
||||
/// Destroys \a other.
|
||||
template <typename T>
|
||||
void
|
||||
@@ -188,7 +190,6 @@ m4_define([b4_variant_define],
|
||||
}
|
||||
|
||||
/// Copy the content of \a other to this.
|
||||
/// Destroys \a other.
|
||||
template <typename T>
|
||||
void
|
||||
copy (const variant<S>& other)
|
||||
@@ -227,7 +228,8 @@ m4_define([b4_variant_define],
|
||||
long double align_me;
|
||||
char raw[S];
|
||||
} buffer;]b4_parse_assert_if([
|
||||
/// Whether something is contained.
|
||||
|
||||
/// Whether the content is built.
|
||||
bool built;
|
||||
/// If defined, the name of the stored type.
|
||||
const char* tname;])[
|
||||
|
||||
Reference in New Issue
Block a user