mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
bison: use consistently "token kind", not "token type"
* src/output.c, src/reader.c, src/scan-gram.l, src/tables.c: here.
This commit is contained in:
@@ -8,7 +8,7 @@ afterwards.
|
|||||||
## simple.yy - Simple example in C++14
|
## simple.yy - Simple example in C++14
|
||||||
A very simple example in C++, based on variants and symbol constructors.
|
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
|
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.
|
semantic value.
|
||||||
|
|
||||||
Run as `./simple`.
|
Run as `./simple`.
|
||||||
|
|||||||
@@ -596,9 +596,7 @@ prepare_symbol_definitions (void)
|
|||||||
static void
|
static void
|
||||||
prepare_actions (void)
|
prepare_actions (void)
|
||||||
{
|
{
|
||||||
/* Figure out the actions for the specified state, indexed by
|
/* Figure out the actions for the specified state. */
|
||||||
lookahead token type. */
|
|
||||||
|
|
||||||
muscle_insert_rule_number_table ("defact", yydefact,
|
muscle_insert_rule_number_table ("defact", yydefact,
|
||||||
yydefact[0], 1, nstates);
|
yydefact[0], 1, nstates);
|
||||||
|
|
||||||
|
|||||||
@@ -817,9 +817,9 @@ check_and_convert_grammar (void)
|
|||||||
/* Assign the symbols their symbol numbers. */
|
/* Assign the symbols their symbol numbers. */
|
||||||
symbols_pack ();
|
symbols_pack ();
|
||||||
|
|
||||||
/* Scan rule actions after invoking symbol_check_alias_consistency (in
|
/* Scan rule actions after invoking symbol_check_alias_consistency
|
||||||
symbols_pack above) so that token types are set correctly before the rule
|
(in symbols_pack above) so that token types are set correctly
|
||||||
action type checking.
|
before the rule action type checking.
|
||||||
|
|
||||||
Before invoking grammar_rule_check_and_complete (in packgram
|
Before invoking grammar_rule_check_and_complete (in packgram
|
||||||
below) on any rule, make sure all actions have already been
|
below) on any rule, make sure all actions have already been
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ static boundary scanner_cursor;
|
|||||||
|
|
||||||
#define YY_USER_ACTION location_compute (loc, &scanner_cursor, yytext, yyleng);
|
#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) \
|
#define BISON_DIRECTIVE(Directive) \
|
||||||
(bison_directive (loc, yytext), PERCENT_ ## Directive)
|
(bison_directive (loc, yytext), PERCENT_ ## Directive)
|
||||||
|
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ save_row (state_number s)
|
|||||||
|
|
||||||
/*------------------------------------------------------------------.
|
/*------------------------------------------------------------------.
|
||||||
| Figure out the actions for the specified state, indexed by |
|
| 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 |
|
| The YYDEFACT table is output now. The detailed info is saved for |
|
||||||
| putting into YYTABLE later. |
|
| putting into YYTABLE later. |
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ m4_define([AT_DATA_GRAMMAR], [AT_LANG_DISPATCH([$0], $@)])
|
|||||||
# AT_YYLEX_DEFINE([INPUT], [ACTION])
|
# AT_YYLEX_DEFINE([INPUT], [ACTION])
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# INPUT can be empty, or in double quotes, or a list (in braces).
|
# 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).
|
# and "toknum" as the number of calls to yylex (starting at 0).
|
||||||
m4_define([AT_YYLEX_PROTOTYPE],
|
m4_define([AT_YYLEX_PROTOTYPE],
|
||||||
[AT_YYLEX_RETURN AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl
|
[AT_YYLEX_RETURN AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl
|
||||||
|
|||||||
Reference in New Issue
Block a user