Hi,

Hopefully any of you have either a clue about bison or an idea how to
solve this problem.

What happens now is that during parsing memory is allocated.  If
everything is parsed there is a set of malloc'ed memory all pointing
to each other, etc.

The main problem is in case of a syntax error.  In that case all of
the state should be released (free all memory structures).  But I have
no idea how to do that;  yyparse just returns an error.  I need a way
to make bison return a valid structure so I can check if parsing
failed and release all of the memory.

One solution to this problem is making a big list of all memory
allocated while scanning and parsing.  When parsing fails you just
free all of this memory.  Otherwise everything is freed when the
datastructures are about to be de-allocated.

But I prefer a solution using bison stuff, otherwise I'll just use the
solution I described above.

--
Marco



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to