Xref: utzoo comp.unix.questions:15093 comp.lang.c:20085 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!bobg+ From: bobg+@andrew.cmu.edu (Robert Steven Glickstein) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: Hiding Yacc vars Message-ID: Date: 21 Jul 89 21:43:27 GMT References: Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Lines: 53 In-Reply-To: > Excerpts from ext.nn.comp.unix.questions: 13-Jun-89 Hiding Yacc vars > Robert S. Glickstein@and (1274) > I'm sure some of you have encountered this problem before. Both Yacc > and Lex make all of their identifiers external, when in fact they should > be static. This becomes a major problem when you have large software > projects in which zillions of libraries are linked together, any two of > which might define yyparse, yytext, yylength, etc., leading to a name > conflict. > [...] > The right solution (short of hacking Yacc and Lex > themselves) is to run the output files through a postprocessor to make > all the "yy"-something declarations static. [...] > Anyway, does such a postprocessor exist? If not, I plan to write one; > how much interest do you folks have in seeing it written? Well, I've written the above-described postprocessor, and it works like a charm. It's called yyhide, and for those of you who are drooling at the thought of getting your hands on it, it will be available in the Andrew system distributed with X11R4. I couldn't have written this program without the help of several netters, who assisted with Yacc problems and various semantic questions. Thanks to them, and let's hope that someday soon, better versions of Yacc and Lex will become available which will make yyhide obsolete. _______________________________ Bob Glickstein, System Designer Information Technology Center room 220 Carnegie Mellon University Pittsburgh, PA 15213-3890 (412) 268-6743 Mail to: bobg+@andrew.cmu.edu UUCP: ...!harvard!andrew.cmu.edu!bobg 101 USES FOR A DEAD MICROPROCESSOR (1) Scarecrow for centipedes (2) Dead cat brush (3) Hair barrettes (4) Cleats (5) Self-piercing earrings (6) Fungus trellis (7) False eyelashes (8) Prosthetic dog claws . . . (99) Window garden harrow (pulled behind Tonka tractors) (100) Killer velcro (101) Currency