yacc/bison question

Dan Salomon salomon at ccu.umanitoba.ca
Sat Oct 13 07:40:40 AEST 1990


In article <122 at bwilab3.UUCP> chris at 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 at ccu.UManitoba.CA



More information about the Comp.unix.programmer mailing list