missing YYEMPTY #define in C skeleton
"Todd C. Miller" <[email protected]>
| Newsgroups | gmane.comp.parsers.bison.bugs |
|---|---|
| Message-ID | <[email protected]> |
When generating a C parser, YYEMPTY is present in enum yytokentype but there is no corresponding #define like there is for the other values. There is a special case for YYEMPTY in b4_token_enums but no corresponding case in b4_token_defines. Something like the following works, but is quite ugly. I expected to be able to use b4_token_define([-2]) here but that produces an error. Someone more familiar with bison's m4 macros can probably come up with a much better fix. - todd Index: data/skeletons/c.m4 --- data/skeletons/c.m4.orig +++ data/skeletons/c.m4 @@ -510,6 +510,7 @@ m4_define([b4_token_define], # Output the definition of the tokens. m4_define([b4_token_defines], [b4_any_token_visible_if([/* Token kinds. */ +#define ]b4_symbol([-2], [id])[ -2 m4_join([ ], b4_symbol_map([b4_token_define])) ])])