Re: Error with grammar arguments

Rob Casey <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <CAAN1oa9XVOurnQLT=fRO0pgRn9XdjRpOgBpeVHNTZaBY1u+x9Q@mail.gmail.com>
Thanks again for the assistance Chris and Hans.  I found a path through my
grammar where $$ was not explicitly set within a rule action which would
explain identifier and array_spec_init having the same pointer value.

On Wed, Dec 19, 2018 at 8:42 AM Rob Casey <[email protected]> wrote:

> Thanks for the tip Chris, Hans.  I have a straight-forward unit test where
> this issue is manifesting, so I will explore this with respect to lexer
> token allocation.
>
>
> On Wed, Dec 19, 2018 at 8:21 AM Hans Åberg <[email protected]> wrote:
>
>>
>> > On 18 Dec 2018, at 20:06, Rob Casey <[email protected]> wrote:
>> >
>> > Yes - That is correct Chris. I am allocating memory within Flex for
>> tokens.
>> > This issue first manifest itself when I started to add code for the
>> proper
>> > freeing on this memory (where no longer required) within grammar
>> actions.
>>
>> It looks like a lexer issue, same pointer passed to the Bison parser. You
>> might write out the strings to see whether it is overwritten or not written
>> the second time.
>>
>> > On Wed, 19 Dec. 2018, 04:40 Chris verBurg <[email protected]
>> wrote:
>> >
>> >> Rob,
>> >>
>> >> To ask a sanity question, you do strdup (or otherwise allocate fresh
>> >> memory for) yytext on the Flex side when returning tokens, yes?
>> >>
>> >> -Chris
>>
>>
>>
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.