On 8 Nov 2007, at 10:49, Richard Gill wrote:

I started learning flex/bison some days ago to write a parser. Nearly
all my parser works well, but I've a problem with a rule which matches
well but gives a wrong result in $n. I checked the lexer (flex) did
extract right token.

There is a quite common newbie error to not copy the token that the Flex generated lexer points. It just points to a buffer, temporarily '\0' terminated, and changed back. Bison then makes several calls, and if given just a pointer in the buffer, there will be some jumble.

  Hans Aberg




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to