mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
api.value.type: diagnose guaranteed failure with --yacc
Instead of generating invalid C code, generate an error when --yacc and '%define api.value.type union' are used together. * data/bison.m4: Issue an error in this case. * tests/types.at (%yacc vs. %define api.value.type union): New, check this error. * doc/bison.texi (Type Generation): Document it. * tests/output.at: Check that '-o y.tab.c' and '-y' behave equally wrt generated file names. * NEWS (Use of YACC='bison -y'): New. Promote the use of 'bison -o y.tab.c'.
This commit is contained in:
@@ -3795,6 +3795,11 @@ yylval.TOK_INT = 42;
|
||||
return TOK_INT;
|
||||
@end example
|
||||
|
||||
This Bison extension cannot work if @code{%yacc} (or
|
||||
@option{-y}/@option{--yacc}) is enabled, as POSIX mandates that Yacc
|
||||
generate tokens as macros (e.g., @samp{#define INT 258}, or @samp{#define
|
||||
TOK_INT 258}).
|
||||
|
||||
This feature is new, and user feedback would be most welcome.
|
||||
|
||||
A similar feature is provided for C++ that in addition overcomes C++
|
||||
|
||||
Reference in New Issue
Block a user