[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/11] skeletons: b4_args -> b4_join to prepare forthcoming chang
From: |
Akim Demaille |
Subject: |
[PATCH 05/11] skeletons: b4_args -> b4_join to prepare forthcoming changes |
Date: |
Fri, 3 Aug 2012 10:39:55 +0200 |
* data/bison.m4 (b4_args, _b4_args): Rename as...
(b4_join, _b4_join): these.
* data/c++.m4, data/lalr1.cc, data/variant.hh: Adjust.
---
data/bison.m4 | 14 +++++++-------
data/c++.m4 | 12 ++++++------
data/lalr1.cc | 14 +++++++-------
data/variant.hh | 6 +++---
4 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/data/bison.m4 b/data/bison.m4
index f2126ef..42a548d 100644
--- a/data/bison.m4
+++ b/data/bison.m4
@@ -206,23 +206,23 @@ m4_define([b4_subtract],
[m4_eval([$1 - $2])],
[($1) - ($2)])])
-# b4_args(ARG1, ...)
-# _b4_args(ARG1, ...)
+# b4_join(ARG1, ...)
+# _b4_join(ARG1, ...)
# -------------------
# Join with comma, skipping empty arguments.
-# b4_args calls itself recursively until it sees the first non-empty
-# argument, then calls _b4_args which prepends each non-empty argument
+# b4_join calls itself recursively until it sees the first non-empty
+# argument, then calls _b4_join which prepends each non-empty argument
# with a comma.
-m4_define([b4_args],
+m4_define([b4_join],
[m4_if([$#$1],
[1], [],
[m4_ifval([$1],
[$1[]_$0(m4_shift($@))],
[$0(m4_shift($@))])])])
-# _b4_args(ARGS1, ...)
+# _b4_join(ARGS1, ...)
# --------------------
-m4_define([_b4_args],
+m4_define([_b4_join],
[m4_if([$#$1],
[1], [],
[m4_ifval([$1], [, $1])[]$0(m4_shift($@))])])
diff --git a/data/c++.m4 b/data/c++.m4
index 62374be..4a7169c 100644
--- a/data/c++.m4
+++ b/data/c++.m4
@@ -158,7 +158,7 @@ m4_define([b4_public_types_declare],
/// Constructor.]b4_locations_if([
inline symbol_base_type (const location_type& l)])[;
- inline symbol_base_type (]b4_args(
+ inline symbol_base_type (]b4_join(
[const semantic_type& v],
b4_locations_if([const location_type& l]))[);
@@ -186,12 +186,12 @@ m4_define([b4_public_types_declare],
inline symbol_type ();
/// Constructor for tokens with semantic value.
- inline symbol_type (]b4_args([token_type t],
+ inline symbol_type (]b4_join([token_type t],
[const semantic_type& v],
b4_locations_if([const location_type&
l]))[);
/// Constructor for valueless tokens.
- inline symbol_type (]b4_args([token_type t],
+ inline symbol_type (]b4_join([token_type t],
b4_locations_if([const location_type&
l]))[);
/// The symbol type.
@@ -235,7 +235,7 @@ m4_define([b4_public_types_define],
template <typename Exact>
inline
- ]b4_parser_class_name[::symbol_base_type<Exact>::symbol_base_type (]b4_args(
+ ]b4_parser_class_name[::symbol_base_type<Exact>::symbol_base_type (]b4_join(
[const semantic_type& v],
b4_locations_if([const location_type& l]))[)
: value(v)]b4_locations_if([
@@ -276,7 +276,7 @@ m4_define([b4_public_types_define],
}
inline
- ]b4_parser_class_name[::symbol_type::symbol_type (]b4_args(
+ ]b4_parser_class_name[::symbol_type::symbol_type (]b4_join(
[token_type t],
b4_locations_if([const location_type& l]))[)
: super_type (]b4_locations_if([l])[)
@@ -285,7 +285,7 @@ m4_define([b4_public_types_define],
}
inline
- ]b4_parser_class_name[::symbol_type::symbol_type (]b4_args(
+ ]b4_parser_class_name[::symbol_type::symbol_type (]b4_join(
[token_type t],
[const semantic_type& v],
b4_locations_if([const location_type& l]))[)
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 8cf2043..b3e46e9 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -269,7 +269,7 @@ b4_location_define])])])[
inline stack_symbol_type ();
/// Constructor.
- inline stack_symbol_type (]b4_args([state_type s],
+ inline stack_symbol_type (]b4_join([state_type s],
[const semantic_type& v],
b4_locations_if([const location_type&
l]))[);
@@ -509,7 +509,7 @@ m4_if(b4_prefix, [yy], [],
{
}
- ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (]b4_args(
+ ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (]b4_join(
[state_type s],
[const semantic_type& v],
b4_locations_if([const location_type& l]))[)
@@ -575,13 +575,13 @@ m4_if(b4_prefix, [yy], [],
if (m)
YY_SYMBOL_PRINT (m, sym);
]b4_variant_if(
-[[ yystack_.push (stack_symbol_type (]b4_args(
+[[ yystack_.push (stack_symbol_type (]b4_join(
[s],
[semantic_type()],
b4_locations_if([sym.location]))[));
]b4_symbol_variant([[yystos_[s]]], [[yystack_[0].value]],
[build], [sym.value])],
-[[ yystack_.push (stack_symbol_type (]b4_args(
+[[ yystack_.push (stack_symbol_type (]b4_join(
[s],
[sym.value],
b4_locations_if([sym.location]))[));]])[
@@ -593,7 +593,7 @@ m4_if(b4_prefix, [yy], [],
if (m)
YY_SYMBOL_PRINT (m, s);
]b4_variant_if(
-[[ yystack_.push (stack_symbol_type (]b4_args(
+[[ yystack_.push (stack_symbol_type (]b4_join(
[s.state],
[semantic_type()],
b4_locations_if([s.location]))[));
@@ -852,7 +852,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
if (!yyerrstatus_)
{
++yynerrs_;
- error (]b4_args(b4_locations_if([yyla.location]),
+ error (]b4_join(b4_locations_if([yyla.location]),
[[yysyntax_error_ (yystack_[0].state,
yyempty ? yyempty_ :
yyla.type)]])[);
}
@@ -967,7 +967,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
void
]b4_parser_class_name[::error (const syntax_error& yyexc)
{
- error (]b4_args(b4_locations_if([yyexc.location]),
+ error (]b4_join(b4_locations_if([yyexc.location]),
[[yyexc.what()]])[);
}
diff --git a/data/variant.hh b/data/variant.hh
index 5895b29..65f0026 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -233,7 +233,7 @@ m4_define([b4_symbol_constructor_declare_],
[ static inline
symbol_type
make_[]b4_symbol_([$1], [id]) (dnl
-b4_args(b4_symbol_if([$1], [has_type],
+b4_join(b4_symbol_if([$1], [has_type],
[const b4_symbol([$1], [type])& v]),
b4_locations_if([const location_type& l])));
@@ -257,11 +257,11 @@ m4_define([b4_symbol_constructor_define_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
[ b4_parser_class_name::symbol_type
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
-b4_args(b4_symbol_if([$1], [has_type],
+b4_join(b4_symbol_if([$1], [has_type],
[const b4_symbol([$1], [type])& v]),
b4_locations_if([const location_type& l])))
{
- return symbol_type (b4_args([token::b4_symbol([$1], [id])],
+ return symbol_type (b4_join([token::b4_symbol([$1], [id])],
b4_symbol_if([$1], [has_type], [v]),
b4_locations_if([l])));
}
--
1.7.11.3
- [PATCH 00/11] {master} remove oldies: lint, YYPARSE_PARAM, and K&R support, Akim Demaille, 2012/08/03
- [PATCH 05/11] skeletons: b4_args -> b4_join to prepare forthcoming changes,
Akim Demaille <=
- [PATCH 03/11] YYPARSE_PARAM: drop support, Akim Demaille, 2012/08/03
- [PATCH 07/11] skeletons: simplify after knr removal, Akim Demaille, 2012/08/03
- [PATCH 01/11] todo: more items, Akim Demaille, 2012/08/03
- [PATCH 08/11] c++: fix a comment, Akim Demaille, 2012/08/03
- [PATCH 02/11] skeletons: remove K&R C support, Akim Demaille, 2012/08/03
- [PATCH 11/11] regen, Akim Demaille, 2012/08/03
- [PATCH 06/11] skeletons: renamings after knr removal, Akim Demaille, 2012/08/03
- [PATCH 10/11] remove support for lint, Akim Demaille, 2012/08/03
- [PATCH 09/11] skeletons: renamings after knr removal, Akim Demaille, 2012/08/03
- [PATCH 04/11] regen, Akim Demaille, 2012/08/03