Dear Daniel, I think this problem is currently inherent of Bison. In the tab.h generated by Bison, there are normally only three things that are incorporated:
1. The enumeration of the tokens 2. The YYSTYPE definition and yylval declaration 3. The YYLTYPE definition and yylloc declaration Notice that nothing else, even the header files that you specify in the first section of the .y file, is incorporated. Thus, your problem can not be eliminated by Bison itself..... The way I dealt with this problem is as follows: Suppose the header file generated by Bison is grammar.h. Now you write a new header file structdef.h, including your where_cls definition. In the first section of your lex.lex, you INCLUDE structdef.h BEFORE YOU INCLUDE grammar.h. THis causes the definition of your structure to appear in lex.yy.c before the definition of YYSTYPE. Yinpeng _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison