mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
* data/c.m4 (b4_token_enum): Always define the enum of tokens,
even if empty. * data/lalrl1.cc, data/glr.cc (parser::token_type): New. * doc/bison.texinfo (Calc++ Scanner): Use it.
This commit is contained in:
@@ -34,16 +34,15 @@ m4_define_default([b4_filename_type], [std::string])
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -----------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
# Output the definition of the tokens as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[m4_if([$@], [[]], [],
|
||||
[/* Tokens. */
|
||||
enum yytokentype {
|
||||
m4_map_sep([ b4_token_enum], [,
|
||||
],
|
||||
[$@])
|
||||
};
|
||||
])])
|
||||
])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
|
||||
@@ -312,6 +312,8 @@ b4_syncline([@oline@], [@ofile@])
|
||||
{
|
||||
]b4_token_enums(b4_tokens)[
|
||||
};
|
||||
/// Token type.
|
||||
typedef token::yytokentype token_type;
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||
|
||||
@@ -120,6 +120,8 @@ b4_syncline([@oline@], [@ofile@])
|
||||
{
|
||||
]b4_token_enums(b4_tokens)[
|
||||
};
|
||||
/// Token type.
|
||||
typedef token::yytokentype token_type;
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||
|
||||
Reference in New Issue
Block a user