[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/9] style: comment changes about token numbers
From: |
Akim Demaille |
Subject: |
[PATCH 1/9] style: comment changes about token numbers |
Date: |
Sat, 28 Mar 2020 18:39:58 +0100 |
* data/skeletons/bison.m4, data/skeletons/c.m4: here.
---
data/skeletons/bison.m4 | 15 ++++++++-------
data/skeletons/c.m4 | 10 +++++-----
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/data/skeletons/bison.m4 b/data/skeletons/bison.m4
index ae4154c9..ec5cb5c8 100644
--- a/data/skeletons/bison.m4
+++ b/data/skeletons/bison.m4
@@ -384,22 +384,21 @@ m4_define([b4_glr_cc_if],
## Symbols. ##
## --------- ##
-# For a description of the Symbol handling, see README.
+# For a description of the Symbol handling, see README.md.
#
# The following macros provide access to symbol related values.
# __b4_symbol(NUM, FIELD)
# -----------------------
-# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
-# undefined.
+# Fetch FIELD of symbol #NUM. Fail if undefined.
m4_define([__b4_symbol],
[m4_indir([b4_symbol($1, $2)])])
# _b4_symbol(NUM, FIELD)
# ----------------------
-# Recover a FIELD about symbol #NUM (or "orig NUM"). Fails if
-# undefined.
+# Fetch FIELD of symbol #NUM (or "orig NUM", see README.md).
+# Fail if undefined.
m4_define([_b4_symbol],
[m4_ifdef([b4_symbol($1, number)],
[__b4_symbol(m4_indir([b4_symbol($1, number)]), $2)],
@@ -409,8 +408,9 @@ m4_define([_b4_symbol],
# b4_symbol(NUM, FIELD)
# ---------------------
-# Recover a FIELD about symbol #NUM (or "orig NUM"). Fails if
-# undefined. If FIELD = id, prepend the token prefix.
+# Fetch FIELD of symbol #NUM (or "orig NUM"). Fail if undefined.
+#
+# If FIELD = id, prepend the token prefix.
m4_define([b4_symbol],
[m4_case([$2],
[id], [m4_do([b4_percent_define_get([api.token.prefix])],
@@ -530,6 +530,7 @@ m4_define([b4_any_token_visible_if],
# b4_token_format(FORMAT, NUM)
# ----------------------------
+# If token NUM has a visible ID, format FORMAT with ID, USER_NUMBER.
m4_define([b4_token_format],
[b4_token_visible_if([$2],
[m4_format([[$1]],
diff --git a/data/skeletons/c.m4 b/data/skeletons/c.m4
index 06610ecb..6b2fed2e 100644
--- a/data/skeletons/c.m4
+++ b/data/skeletons/c.m4
@@ -425,9 +425,9 @@ static const b4_int_type_for([$2]) yy$1[[]] =
])
-## ------------------------- ##
-## Assigning token numbers. ##
-## ------------------------- ##
+## -------------------------- ##
+## (External) token numbers. ##
+## -------------------------- ##
# b4_token_define(TOKEN-NUM)
# --------------------------
@@ -454,7 +454,7 @@ m4_define([b4_token_enum],
# b4_token_enums
# --------------
-# Output the definition of the tokens (if there are) as enums.
+# The definition of the tokens (if there are) as enums.
m4_define([b4_token_enums],
[b4_any_token_visible_if([[/* Token type. */
#ifndef ]b4_api_PREFIX[TOKENTYPE
@@ -471,7 +471,7 @@ m4_define([b4_token_enums],
# b4_token_enums_defines
# ----------------------
-# Output the definition of the tokens (if there are any) as enums and,
+# The definition of the tokens (if there are any) as enums and,
# if POSIX Yacc is enabled, as #defines.
m4_define([b4_token_enums_defines],
[b4_token_enums[]b4_yacc_if([b4_token_defines])])
--
2.25.1
- [PATCH 0/9] Introduce and use yysymbol_code_t, Akim Demaille, 2020/03/28
- [PATCH 1/9] style: comment changes about token numbers,
Akim Demaille <=
- [PATCH 3/9] regen, Akim Demaille, 2020/03/28
- [PATCH 4/9] yacc.c: use yysymbol_code_t instead of int for yytoken, Akim Demaille, 2020/03/28
- [PATCH 5/9] yacc.c: also define a symbol number for the empty token, Akim Demaille, 2020/03/28
- [PATCH 6/9] regen, Akim Demaille, 2020/03/28
- [PATCH 7/9] yacc.c: prefer YYSYMBOL_YYERROR to YYSYMBOL_error, Akim Demaille, 2020/03/28
- [PATCH 9/9] bistromathic: use symbol numbers instead of YYTRANSLATE, Akim Demaille, 2020/03/28
- [PATCH 2/9] yacc.c: introduce an enum that defines the symbol's number, Akim Demaille, 2020/03/28
- [PATCH 8/9] regen, Akim Demaille, 2020/03/28