From: Akim Demaille Date: Mon, 28 Jan 2013 13:22:51 +0000 (+0100) Subject: c++: formatting and comment changes X-Git-Tag: v2.7.90~153 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/5f87211cb40944a1f81631542404db93f869aa8f c++: formatting and comment changes * data/c++.m4, data/lalr1.cc, data/stack.hh, data/variant.hh: Fix indentation. Fix some comments. --- diff --git a/data/c++.m4 b/data/c++.m4 index 2d45bc82..f9fcb9d2 100644 --- a/data/c++.m4 +++ b/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; }; diff --git a/data/lalr1.cc b/data/lalr1.cc index 2b1949e4..a195602c 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -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 void - ]b4_parser_class_name[::yy_destroy_ (const char* yymsg, - basic_symbol& yysym) const + ]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol& 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); diff --git a/data/stack.hh b/data/stack.hh index 61fbde2b..7ed55606 100644 --- a/data/stack.hh +++ b/data/stack.hh @@ -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]; } diff --git a/data/variant.hh b/data/variant.hh index 1b033886..c96cfeb6 100644 --- a/data/variant.hh +++ b/data/variant.hh @@ -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 void @@ -175,7 +176,8 @@ m4_define([b4_variant_define], std::swap (as(), other.as()); } - /// Assign the content of \a other to this. + /// Move the content of \a other to this. + /// /// Destroys \a other. template void @@ -188,7 +190,6 @@ m4_define([b4_variant_define], } /// Copy the content of \a other to this. - /// Destroys \a other. template void copy (const variant& 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;])[