Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: two (or more) lex's/yacc's in one executable Message-ID: <14674@smoke.brl.mil> Date: 6 Dec 90 22:43:30 GMT References: <1990Dec6.200944.13037@cs.columbia.edu> Organization: U.S. Army Ballistic Research Laboratory (BRL), APG, MD. Lines: 13 In article <1990Dec6.200944.13037@cs.columbia.edu>, leland@cs writes: - I've tried this kludge: create a header file that re-#define's all the - names 'yyfoo' in lex/yacc set #1 to be named, say, set1yyfoo, and all - those in set #2 to be named set2yyfoo. This has worked for me in the - past, but won't in this particular instance because the generated - code includes calls to yyless() and yywrap(), which are in the LEX - library (-ll), the contents of which I cannot rename. So that doesn't - work. But it almost does -- Since "lex" produces C source, you can #define set1yyless yyless, etc. before the lex output to be compiled, thereby turning these selected reference back into calls to the shared library functions. (I assume the lex library does not maintain internal state.) Brought to you by Super Global Mega Corp .com