From: utzoo!decvax!decwrl!sun!megatest!fortune!hpda!hplabs!sri-unix!lee@utexas-11.arpa Newsgroups: net.unix-wizards Title: Reply to: yystype problems with yacc Article-I.D.: sri-arpa.823 Posted: Tue Mar 22 08:06:00 1983 Received: Wed Apr 6 03:40:13 1983 From: William L. Lee III As far as I know, there isn't a good mechanism to override the define of YYSTYPE. One solution is what you suggest, i.e. #define YYSTYPE union unionname or something along those lines. The preprocessor doesn't know about typedefs so the obvious solution doesn't work. You could do something like this though- #define YYSTYPE YYSTYPE1 typedef union unionname YYSTYPE1; A little messy but it works. Another solution that almost works is to use the -R flag on the preprocessor to allow for recursive macros. Then you can say #define YYSTYPE YYSTYPE The problem here is that you get a macro recursion overflow. A solution here is to add a flag to the preprocessor (-Y) that stops recursion if the token is defined as itself. Some versions of the C preprocessor allow this type of construct. If anyone knows of cleaner ways to deal with redefining YYSTYPE to be a typedef, I'd like to know. -------