[Please keep the cc to the list so that others may follow.]
On 3 Aug 2010, at 22:26, Sasan Forghani wrote:
Thank you for the response. However, I don't understand your second statement about properly allocating. In the Bison script, I have IDENTIFIER specified as type <blIdentifier>. And in the ( expr ) production, expr should have its value allocated by the IDENTIFIER production further down. And that is getting allocated because I also have a strcpy at the end of the IDENTIFIER production. Can you please explain further. Thanks.
A common error is not allocating the buffers correctly. If the lexer is generated by Flex, it just gives a pointer to the identified text which must be copied over to a newly created buffer, before passed to the parser.
SImilarly, in the parser, the $$ value must be allocated a buffer if it is not just a point to a $k value.
I could see in your code how you are doing. So just mentioned it just in case.
_______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison