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