Hiding Yacc vars

Robert Steven Glickstein bobg+ at andrew.cmu.edu
Sat Jul 22 07:43:27 AEST 1989


> Excerpts from ext.nn.comp.unix.questions: 13-Jun-89 Hiding Yacc vars
> Robert S. Glickstein at 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+ at 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



More information about the Comp.unix.questions mailing list