Article View: comp.unix.programmer
Article #1018Re: yacc/bison question
From: Dan Salomon
Date: Fri, 12 Oct 1990 21:40
Date: Fri, 12 Oct 1990 21:40
20 lines
1257 bytes
1257 bytes
In article <122@bwilab3.UUCP> chris@bwilab3.UUCP (Chris Curtin) writes: > > >I am looking for a way to have multiple yacc/bison routines in a program. I >also need to be able to name them anything, not just yyparse1 etc. > I once needed two lex-yacc parsers in the same program. I used the stream editor "sed" to edit the C code generated by lex & yacc on one of the parsers. It replaced every occurence of "yy" with "ww". This worked because all lex-yacc externals start with "yy". I also supplied the needed external procedures such as "wwerror". My sed script also renamed the main parser routine, but kept the same number of letters, just to be safe. This approach worked fine, but it was just quick & dirty code for an experiment; it wasn't production quality code. -- Dan Salomon -- salomon@ccu.UManitoba.CA
Technical Details
Message-ID:
<1990Oct12.214040.18748@ccu.umanitoba.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!ccu.umanitoba.ca!salomonReferences:
<122@bwilab3.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!ccu.umanitoba.ca!salomon From: salomon@ccu.umanitoba.ca (Dan Salomon) Newsgroups: comp.unix.programmer Subject: Re: yacc/bison question Keywords: yacc bison Message-ID: <1990Oct12.214040.18748@ccu.umanitoba.ca> Date: 12 Oct 90 21:40:40 GMT References: <122@bwilab3.UUCP> Organization: University of Manitoba, Winnipeg, Canada Lines: 20