|Yacc error recovery: can you avoid memory leaks? email@example.com.OZ.AU (1992-09-25)|
|From:||firstname.lastname@example.org.OZ.AU (Fergus James HENDERSON)|
|Organization:||Computer Science, University of Melbourne, Australia|
|Date:||Fri, 25 Sep 1992 04:05:17 GMT|
|Summary:||Yacc error recovery seems fatally flawed|
|Keywords:||yacc, errors, comment|
I am using Yacc in a fairly standard manner to generate a parse tree for
my input programs. I want to avoid memory leaks in my parser.
When-ever there is a syntax error in the input, yacc will simply pop
tokens off the token stack, without releasing the storage for the parse
tree associated with these tokens.
Is there a version of Yacc or Bison that avoids these problems?
Fergus Henderson email@example.com.OZ.AU
[Careful use of error productions should let you get enough control to free
up storage. The manual for MKS yacc goes into some detail explaining how to
do so. MKS catches errors before doing default reductions, so it's easier
in their version than in others. -John]
Return to the
Search the comp.compilers archives again.