From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: Newbie needs Bison help Date: 9 Oct 2001 12:04:46 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 47 Message-ID: <9pup4u$sle$1@antares.lu.erisoft.se> References: NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thomas Hutto (huttothomas AT hotmail DOT com) wrote: : I've RTFM'd till I sick. So maybe there is some help out there, pretty : please? : Need to implement YYPRINT. : So in the C-section add : #define YYDEBUG 1 : #define YYPRINT(a,b,c) yyprint(a,b,c) : In the Bisson types section I must have : %union : { : char rxch; : int rxint : str rxstr; : } for the YYSTACK's type. : Which yields a : typedef union { : char rxch; : int rxint : str rxstr; : }YYSTYPE; : in the parser code _AFTER_ the stuff from the C-Section. : This means that when I prototype my : stactic void yyprint(FILE *F, int type, YYSTYPE value); : function the compiler complains because it has not yet seen the typedef for : the union. : Anyway to make Bisson behave other than directly editing the generated : C-Code (y.tab.c)? Have a hunch that TFM left off a critical step and I'm : not good enough at C-Code to figure what it is. : I tried to cobble up a forward declaration for the union without success. Try the "-d" option to bison and #include "y.tab.h" in the C section. Right, MartinS