[comp.lang.misc] YACC & LEX

venky@probtek.UUCP (venkatesh nadamuni) (06/16/90)

I am using lex and yacc to write a parser which converts one
data format to another. I would like this parsing routine to be
a menu sub fuction of another main program. When this routine is called by selecting the menu function for the first time,
It does its job right - translates, reports errors etc. 
However, when the routine is called again, the globals that
have been set earlier are not initialized to their appropriate values. 
For instance, When I convert File1.inp (which has errors 
in line 102) to File1.out and then I try to run the routine on 
File2.inp, It still reports errors from previous File1.inp. 
Is there any way of reinitialising the YACC globals at runtime ?

reed@usceast.UUCP (Patrick Reed) (06/17/90)

In article <111@probtek.UUCP> venky@probtek.UUCP (venkatesh nadamuni) writes:
>I am using lex and yacc to write a parser which converts one
>data format to another. I would like this parsing routine to be
>a menu sub fuction of another main program.... 
>File2.inp, It still reports errors from previous File1.inp. 
>Is there any way of reinitialising the YACC globals at runtime ?

If you are looking for a simple but possibly crude method,
you could setup your parser as seperate program and then
fork and exec it from the menu program, passing it file
names and whatever else in command line arguments or a
temporary data file.

p. reed