bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 7/8] bison: use consistently "token kind", not "token type"


From: Akim Demaille
Subject: [PATCH 7/8] bison: use consistently "token kind", not "token type"
Date: Sun, 5 Apr 2020 16:30:02 +0200

* src/output.c, src/reader.c, src/scan-gram.l, src/tables.c: here.
---
 examples/c++/README.md | 2 +-
 src/output.c           | 4 +---
 src/reader.c           | 6 +++---
 src/scan-gram.l        | 2 +-
 src/tables.c           | 2 +-
 tests/local.at         | 2 +-
 6 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/examples/c++/README.md b/examples/c++/README.md
index 3b8bad03..78e643e3 100644
--- a/examples/c++/README.md
+++ b/examples/c++/README.md
@@ -8,7 +8,7 @@ afterwards.
 ## simple.yy - Simple example in C++14
 A very simple example in C++, based on variants and symbol constructors.
 Variants allow to use any C++ type as semantic value type, and symbol
-constructors ensure consistency between declared token type and effective
+constructors ensure consistency between declared token kind and effective
 semantic value.
 
 Run as `./simple`.
diff --git a/src/output.c b/src/output.c
index d0d5c1a2..451d92ee 100644
--- a/src/output.c
+++ b/src/output.c
@@ -596,9 +596,7 @@ prepare_symbol_definitions (void)
 static void
 prepare_actions (void)
 {
-  /* Figure out the actions for the specified state, indexed by
-     lookahead token type.  */
-
+  /* Figure out the actions for the specified state.  */
   muscle_insert_rule_number_table ("defact", yydefact,
                                    yydefact[0], 1, nstates);
 
diff --git a/src/reader.c b/src/reader.c
index e0a3a699..c386f433 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -817,9 +817,9 @@ check_and_convert_grammar (void)
   /* Assign the symbols their symbol numbers.  */
   symbols_pack ();
 
-  /* Scan rule actions after invoking symbol_check_alias_consistency (in
-     symbols_pack above) so that token types are set correctly before the rule
-     action type checking.
+  /* Scan rule actions after invoking symbol_check_alias_consistency
+     (in symbols_pack above) so that token types are set correctly
+     before the rule action type checking.
 
      Before invoking grammar_rule_check_and_complete (in packgram
      below) on any rule, make sure all actions have already been
diff --git a/src/scan-gram.l b/src/scan-gram.l
index 94e8a8ba..19573f3c 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -51,7 +51,7 @@ static boundary scanner_cursor;
 
 #define YY_USER_ACTION  location_compute (loc, &scanner_cursor, yytext, 
yyleng);
 
-/* Report that yytext is an extension, and evaluate to its token type.  */
+/* Report that yytext is an extension, and evaluate to its token kind.  */
 #define BISON_DIRECTIVE(Directive)                              \
   (bison_directive (loc, yytext), PERCENT_ ## Directive)
 
diff --git a/src/tables.c b/src/tables.c
index b6a8404a..b165f0fb 100644
--- a/src/tables.c
+++ b/src/tables.c
@@ -412,7 +412,7 @@ save_row (state_number s)
 
 /*------------------------------------------------------------------.
 | Figure out the actions for the specified state, indexed by        |
-| lookahead token type.                                             |
+| lookahead token kind.                                             |
 |                                                                   |
 | The YYDEFACT table is output now.  The detailed info is saved for |
 | putting into YYTABLE later.                                       |
diff --git a/tests/local.at b/tests/local.at
index 92e616c4..7626c04b 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -519,7 +519,7 @@ m4_define([AT_DATA_GRAMMAR], [AT_LANG_DISPATCH([$0], $@)])
 # AT_YYLEX_DEFINE([INPUT], [ACTION])
 # ----------------------------------
 # INPUT can be empty, or in double quotes, or a list (in braces).
-# ACTION may compute yylval for instance, using "res" as token type,
+# ACTION may compute yylval for instance, using "res" as token kind,
 # and "toknum" as the number of calls to yylex (starting at 0).
 m4_define([AT_YYLEX_PROTOTYPE],
 [AT_YYLEX_RETURN AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl
-- 
2.26.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]