[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
all: fix confusion between token ctor and symbol ctor
From: |
Akim Demaille |
Subject: |
all: fix confusion between token ctor and symbol ctor |
Date: |
Sun, 1 Aug 2021 09:55:52 +0200 |
commit 9b6065303b75d26a7eb53c2842e4c7e3b4f919a2
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Sun Jun 6 08:10:19 2021 +0200
all: fix confusion between token ctor and symbol ctor
The symbol constructors are genuine constructors. Token constructors
are plain functions that construct tokens.
diff --git a/data/skeletons/c++.m4 b/data/skeletons/c++.m4
index cd6fdb039..97905d192 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 d524f582f..b69df1a77 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 2b08b2d85..efc67a7d4 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])])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- all: fix confusion between token ctor and symbol ctor,
Akim Demaille <=