|bison's yyparse() several times firstname.lastname@example.org (1994-05-19)|
|Re: bison's yyparse() several times Wilfred.Hansen@cs.cmu.edu (1994-05-20)|
|Re: bison's yyparse() several times email@example.com (1994-05-30)|
|From:||firstname.lastname@example.org (Hans Sundsfjord)|
|Keywords:||yacc, parse, comment|
|Organization:||University of Tromsoe|
|Date:||Thu, 19 May 1994 13:59:05 GMT|
I'm building an interpreter using GNU Bison (1.19). I have a problem with
invoking the parser more than once from a program. It always works fine
the first time I call yyparse(), but it always gets a "parse error" when I
call it again.
Have I missed some initialization or buffer flushing or .... something else?
(I have run the same thing with yacc-made yyparse() before, without
Well, it looks like this....
translate(char *in, char *out)
if ((infd = fopen(in, "r")) == NULL)
fprintf(stderr, "could not open input file: %s\n", in);
yyin = infd;
if ((outfd = fopen(out, "w")) == NULL)
fprintf(stderr, "could not open output file: %s\n", out);
yyout = outfd;
[I'd suspect a smashed pointer somewhere. If you don't need any of Bison's
unique features, you're probably better off with the smaller and faster
Berkeley Yacc anyway. -John]
Return to the
Search the comp.compilers archives again.