bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

In version 3.0.2, "malformed" YYSTYPE produced with '%defines' if '%defi


From: Gabriel Czernikier
Subject: In version 3.0.2, "malformed" YYSTYPE produced with '%defines' if '%define api.value.type union' in use
Date: Mon, 29 May 2017 11:34:40 -0300

The '%defines' declaration arranges for Bison to produce a header file
containing among others, a definition for YYSTYPE if it wasn't defined by
the user.

YYSTYPE members are computed from the semantic type declarations, which at
user's choice could be a '%define api.value.type union' followed type tags
being real C types. In this latter case, the definition of YYSTYPE has
duplicated members, with the obvious outcome that the C compiler will
reject the "malformed" union.

It suffices to reproduce this to add the '%defines' declaration to the
mfcalc example showed in Bison's manual, chapter 2. The place where to find
the "malformed" YYSTYPE is a Bison's output header file named XYZ.tab.h,
with XYZ.y being the name given to the grammar file.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]