Hi, I've been using bison for the C parser in one of my perl modules for a couple of years now. (http://search.cpan.org/~mhx/Convert-Binary-C/)
I recently noticed the %destructor feature and it looks as it would solve a problem that has long been on my todo list. Right now I'm collecting all objects that I don't reference otherwise in various lists so I can free them when the parser exits (when it exits normally, the lists are usually empty). However, maintaining these lists is time-consuming (both in programming time and execution time). I've now rewritten my parser to make use of %destructor, and it works fine generally. The only case where it doesn't work is when a parser stack overflow is detected. I can see from the generated parser code that a parser stack overflow error bypasses yydestruct(). My question: Is there a reason why the %destructor code isn't called upon parser stack overflow? I don't see a reason, because when the stack overflow is detected, the whole stack is still valid and even the items about to be pushed on the stack are valid and known to the parser. So it should at least be possible to do a correct cleanup of the parser stack. Thanks, Marcus -- One of the most overlooked advantages to computers is... If they do foul up, there's no law against whacking them around a little. -- Joe Martin _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison