c: make the symbol kind definition nicer to read

From

    enum yysymbol_kind_t
    {
      YYSYMBOL_YYEMPTY = -2,
      YYSYMBOL_YYEOF = 0,
      YYSYMBOL_YYERROR = 1,
      YYSYMBOL_YYUNDEF = 2,

to

    enum yysymbol_kind_t
    {
      YYSYMBOL_YYEMPTY = -2,
      YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
      YYSYMBOL_YYERROR = 1,                    /* error  */
      YYSYMBOL_YYUNDEF = 2,                    /* $undefined  */

* data/skeletons/bison.m4 (b4_last_symbol): New.
(b4_symbol_enum, b4_symbol_enums): Reformat the output.
* data/skeletons/c.m4
This commit is contained in:
Akim Demaille
2020-04-06 07:36:00 +02:00
parent 10e61eec6d
commit e657f04b62
4 changed files with 120 additions and 119 deletions

View File

@@ -188,13 +188,11 @@ m4_define([b4_token_enums],
m4_define([b4_declare_symbol_enum],
[[enum symbol_kind_type
{
]m4_join([,
],
]b4_symbol_kind([-2])[ = -2,
b4_symbol_map([b4_symbol_enum]),
[YYNTOKENS = ]b4_tokens_number[ ///< Number of tokens.])[
YYNTOKENS = ]b4_tokens_number[, ///< Number of tokens.
]b4_symbol_kind([-2])[ = -2,
]b4_symbol_foreach([ b4_symbol_enum])[
};
]])])
]])