Coding style changes.

* data/lalr1.cc (b4_symbol_constructor_declaration_)
	(b4_symbol_constructor_declarations)
	(b4_symbol_constructor_definition_)
	(b4_symbol_constructor_definitions)
	(b4_yytranslate_definition): Rename as...
	(b4_symbol_constructor_declare_)
	(b4_symbol_constructor_declare)
	(b4_symbol_constructor_define_)
	(b4_symbol_constructor_define)
	(b4_yytranslate_define): these.
	* data/variant.hh (b4_variant_definition): Rename as...
	(b4_variant_define): this.
This commit is contained in:
Akim Demaille
2008-12-31 15:12:50 +01:00
parent b47b6ff7fd
commit 5f5a90dff6
3 changed files with 42 additions and 26 deletions

View File

@@ -1,3 +1,19 @@
2009-03-02 Akim Demaille <demaille@gostai.com>
Coding style changes.
* data/lalr1.cc (b4_symbol_constructor_declaration_)
(b4_symbol_constructor_declarations)
(b4_symbol_constructor_definition_)
(b4_symbol_constructor_definitions)
(b4_yytranslate_definition): Rename as...
(b4_symbol_constructor_declare_)
(b4_symbol_constructor_declare)
(b4_symbol_constructor_define_)
(b4_symbol_constructor_define)
(b4_yytranslate_define): these.
* data/variant.hh (b4_variant_definition): Rename as...
(b4_variant_define): this.
2009-03-02 Akim Demaille <demaille@gostai.com> 2009-03-02 Akim Demaille <demaille@gostai.com>
Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if. Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.

View File

@@ -114,11 +114,11 @@ m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl m4_popdef([b4_dollar_dollar])dnl
])]) ])])
# b4_symbol_constructor_declaration_(SYMBOL-NUMBER) # b4_symbol_constructor_declare_(SYMBOL-NUMBER)
# ------------------------------------------------- # ---------------------------------------------
# Declare the overloaded version of make_symbol for the (common) type of # Declare the overloaded version of make_symbol for the (common) type of
# these SYMBOL-NUMBERS. Use at class-level. # these SYMBOL-NUMBERS. Use at class-level.
m4_define([b4_symbol_constructor_declaration_], m4_define([b4_symbol_constructor_declare_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], [b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
[ static inline [ static inline
symbol_type symbol_type
@@ -130,21 +130,21 @@ b4_args(b4_symbol_if([$1], [has_type],
])])]) ])])])
# b4_symbol_constructor_declarations # b4_symbol_constructor_declare
# ---------------------------------- # -----------------------------
# Declare symbol constructors for all the value types. # Declare symbol constructors for all the value types.
# Use at class-level. # Use at class-level.
m4_define([b4_symbol_constructor_declarations], m4_define([b4_symbol_constructor_declare],
[b4_variant_if([ [b4_variant_if([
// Symbol constructors declarations. // Symbol constructors declarations.
b4_symbol_foreach([b4_symbol_constructor_declaration_])])]) b4_symbol_foreach([b4_symbol_constructor_declare_])])])
# b4_symbol_constructor_definition_(SYMBOL-NUMBER) # b4_symbol_constructor_define_(SYMBOL-NUMBER)
# ------------------------------------------------ # --------------------------------------------
# Define symbol constructor for this SYMBOL-NUMBER. # Define symbol constructor for this SYMBOL-NUMBER.
m4_define([b4_symbol_constructor_definition_], m4_define([b4_symbol_constructor_define_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], [b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
[ b4_parser_class_name::symbol_type [ b4_parser_class_name::symbol_type
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
@@ -160,20 +160,20 @@ b4_args(b4_symbol_if([$1], [has_type],
])])]) ])])])
# b4_symbol_constructor_definitions # b4_symbol_constructor_define
# ---------------------------------- # ----------------------------
# Define the overloaded versions of make_symbol for all the value types. # Define the overloaded versions of make_symbol for all the value types.
m4_define([b4_symbol_constructor_definitions], m4_define([b4_symbol_constructor_define],
[b4_variant_if([ [b4_variant_if([
// Implementation of make_symbol for each symbol type. // Implementation of make_symbol for each symbol type.
b4_symbol_foreach([b4_symbol_constructor_definition_])])]) b4_symbol_foreach([b4_symbol_constructor_define_])])])
# b4_yytranslate_definition # b4_yytranslate_define
# ------------------------- # ---------------------
# Define yytranslate_. Sometimes we want it in the header file, # Define yytranslate_. Sometimes we want it in the header file,
# sometimes the cc file suffices. # sometimes the cc file suffices.
m4_define([b4_yytranslate_definition], m4_define([b4_yytranslate_define],
[[ // Symbol number corresponding to token number t. [[ // Symbol number corresponding to token number t.
]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::token_number_type
]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type], ]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
@@ -237,7 +237,7 @@ dnl FIXME: This is wrong, we want computed header guards.
]b4_namespace_open[ ]b4_namespace_open[
]b4_locations_if([ class position; ]b4_locations_if([ class position;
class location;])[ class location;])[
]b4_variant_if([b4_variant_definition])[ ]b4_variant_if([b4_variant_define])[
]b4_namespace_close[ ]b4_namespace_close[
]b4_locations_if([#include "location.hh"])[ ]b4_locations_if([#include "location.hh"])[
@@ -287,7 +287,7 @@ do { \
{ {
public: public:
]b4_public_types_declare[ ]b4_public_types_declare[
]b4_symbol_constructor_declarations[ ]b4_symbol_constructor_declare[
/// Build a parser object. /// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[); ]b4_parser_class_name[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ (); virtual ~]b4_parser_class_name[ ();
@@ -435,9 +435,9 @@ do { \
]b4_parse_param_vars[ ]b4_parse_param_vars[
}; };
]b4_lex_symbol_if([b4_yytranslate_definition ]b4_lex_symbol_if([b4_yytranslate_define
b4_public_types_define b4_public_types_define
b4_symbol_constructor_definitions])[ b4_symbol_constructor_define])[
]b4_namespace_close[ ]b4_namespace_close[
]b4_percent_define_flag_if([[global_tokens_and_yystype]], ]b4_percent_define_flag_if([[global_tokens_and_yystype]],
@@ -588,7 +588,7 @@ b4_percent_code_get[]dnl
`---------------*/ `---------------*/
]b4_lex_symbol_if([], [b4_public_types_define ]b4_lex_symbol_if([], [b4_public_types_define
b4_symbol_constructor_definitions])[ b4_symbol_constructor_define])[
// stack_symbol_type. // stack_symbol_type.
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type () ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type ()
@@ -1146,7 +1146,7 @@ b4_error_verbose_if([int yystate, int yytoken],
} }
#endif // YYDEBUG #endif // YYDEBUG
]b4_lex_symbol_if([], [b4_yytranslate_definition])[ ]b4_lex_symbol_if([], [b4_yytranslate_define])[
]b4_namespace_close[ ]b4_namespace_close[
]b4_epilogue[]dnl ]b4_epilogue[]dnl
m4_divert_pop(0) m4_divert_pop(0)

View File

@@ -75,10 +75,10 @@ m4_map([b4_char_sizeof_], [$@])dnl
])]) ])])
# b4_variant_definition # b4_variant_define
# --------------------- # -----------------
# Define "variant". # Define "variant".
m4_define([b4_variant_definition], m4_define([b4_variant_define],
[[ [[
/// A char[S] buffer to store and retrieve objects. /// A char[S] buffer to store and retrieve objects.
/// ///