|
From: | Richard Gill |
Subject: | Re: token extraction problem within a rule |
Date: | Thu, 8 Nov 2007 14:19:00 +0100 |
[In followups, please cc the list, so that others can follow.] 2007/11/8, Hans Aberg <address@hidden>:
On 8 Nov 2007, at 10:49, Richard Gill wrote:I started learning flex/bison some days ago to write a parser. Nearlyall my parser works well, but I've a problem with a rule which matcheswell 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
Hmmm, I see what you mean; sure it's something like that. In fact, I'm just creating the parser, and debug it without using the data. With a real process behind, I guess I wouldn't had this problem. Thanks to have pointed that to me! Regards -- Richard 'riri' GILL jabber: address@hidden http://riri.houbathecat.info http://nasgaia.org « Frimousse en excessivité émousse son expressivité »
[Prev in Thread] | Current Thread | [Next in Thread] |