summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2021-06-06 08:10:19 +0200
committerAkim Demaille <akim.demaille@gmail.com>2021-08-01 09:55:39 +0200
commit9b6065303b75d26a7eb53c2842e4c7e3b4f919a2 (patch)
tree41b800787aa77add50f61c5f2399c5e9d024094e /data
parent5325292e5db716a0f52e1a331351e6c0d21b23d9 (diff)
downloadbison-9b6065303b75d26a7eb53c2842e4c7e3b4f919a2.tar.gz
all: fix confusion between token ctor and symbol ctor
The symbol constructors are genuine constructors. Token constructors are plain functions that construct tokens.
Diffstat (limited to 'data')
-rw-r--r--data/skeletons/c++.m44
-rw-r--r--data/skeletons/d.m411
-rw-r--r--data/skeletons/variant.hh12
3 files changed, 14 insertions, 13 deletions
diff --git a/data/skeletons/c++.m4 b/data/skeletons/c++.m4
index cd6fdb03..97905d19 100644
--- a/data/skeletons/c++.m4
+++ b/data/skeletons/c++.m4
@@ -458,7 +458,7 @@ m4_define([b4_symbol_type_define],
symbol_type () {}
/// Constructor for valueless symbols, and symbols from each type.
-]b4_type_foreach([_b4_token_constructor_define])dnl
+]b4_type_foreach([_b4_symbol_constructor_define])dnl
])[};
]])
@@ -576,7 +576,7 @@ m4_define([b4_public_types_define],
# b4_token_constructor_define
# ----------------------------
-# Define symbol constructors for all the value types.
+# Define make_FOO for all the token kinds.
# Use at class-level. Redefined in variant.hh.
m4_define([b4_token_constructor_define], [])
diff --git a/data/skeletons/d.m4 b/data/skeletons/d.m4
index d524f582..b69df1a7 100644
--- a/data/skeletons/d.m4
+++ b/data/skeletons/d.m4
@@ -209,9 +209,9 @@ m4_define([b4_symbol_translate],
[[_($1)]])
-# _b4_token_constructor_define
-# ----------------------------
-# Define make_symbol for a value type.
+# _b4_token_constructor_define(SYMBOL-NUM)
+# ----------------------------------------
+# Define Symbol.FOO for SYMBOL-NUM.
m4_define([_b4_token_constructor_define],
[b4_token_visible_if([$1],
[[
@@ -226,13 +226,14 @@ m4_define([_b4_token_constructor_define],
# b4_token_constructor_define
# ---------------------------
-# Define the overloaded versions of make_symbol for all the value types.
+# Define Symbol.FOO for each token kind FOO.
m4_define([b4_token_constructor_define],
[[
/* Implementation of token constructors for each symbol type visible to
* the user. The code generates static methods that have the same names
* as the TokenKinds.
- */]b4_symbol_foreach([_b4_token_constructor_define])])
+ */]b4_symbol_foreach([_b4_token_constructor_define])dnl
+])
## -------------- ##
## Symbol kinds. ##
diff --git a/data/skeletons/variant.hh b/data/skeletons/variant.hh
index 2b08b2d8..efc67a7d 100644
--- a/data/skeletons/variant.hh
+++ b/data/skeletons/variant.hh
@@ -458,11 +458,11 @@ m4_define([b4_tok_in],
-# _b4_token_constructor_define(SYMBOL-NUM...)
-# -------------------------------------------
-# Define a unique make_symbol for all the SYMBOL-NUM (they
+# _b4_symbol_constructor_define(SYMBOL-NUM...)
+# --------------------------------------------
+# Define a symbol_type constructor common to all the SYMBOL-NUM (they
# have the same type). Use at class-level.
-m4_define([_b4_token_constructor_define],
+m4_define([_b4_symbol_constructor_define],
[m4_ifval(_b4_includes_tokens($@),
[[#if 201103L <= YY_CPLUSPLUS
symbol_type (]b4_join(
@@ -517,7 +517,7 @@ m4_define([b4_basic_symbol_constructor_define],
# b4_token_constructor_define
# ---------------------------
-# Define the overloaded versions of make_symbol for all the value types.
+# Define the overloaded versions of make_FOO for all the token kinds.
m4_define([b4_token_constructor_define],
-[ // Implementation of make_symbol for each symbol type.
+[ // Implementation of make_symbol for each token kind.
b4_symbol_foreach([_b4_token_maker_define])])