Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!apple!snorkelwacker!husc6!spdcc!ima!esegue!compilers-sender From: meissner@osf.org Newsgroups: comp.compilers Subject: Two pass compiler using YACC? Keywords: yacc, parse Message-ID: <9009061603.AA23000@curley.osf.org> Date: 6 Sep 90 16:03:39 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: meissner@osf.org Organization: Compilers Central Lines: 24 Approved: compilers@esegue.segue.boston.ma.us In-Reply-To: jar@florida.eng.ileaf.com's message of 3 Sep 90 01:04:55 GMT | [re using two yacc grammars in the same program] | IMHO the cleanest solution lies in use of the C preprocessor (as do so | many solutions :-) ). | | Suppose that the only multiply defined external were yyparse and yyerror. | | Create a file called "pass1.h" containing the lines: | | #define yyparse pass1_yyparse | #define yyerror pass1_yyerror | ... The problem with this type of solution is that a different version of yacc may define more yy external names. If this is the case, you are hosed. Just because the yacc that your computer vendor only uses those two symbols today, means diddly squat when you load the new release, or go to a different machine. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.