Error with grammar arguments

2018-12-18 Thread Rob Casey
Hello, I have a (large) grammar where I have code similar to that below: | identifier ':' array_spec_init { log_debug( "%p", $identifier ); log_debug( "%p", $array_spec_init ); } When this grammar is run, the following is shown in the output: Stack no

Re: Error with grammar arguments

2018-12-18 Thread Chris verBurg
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 On Tue, Dec 18, 2018 at 9:15 AM Rob Casey wrote: > Hello, > > I have a (large) grammar where I have code similar to that below: > > | identifier

Re: Error with grammar arguments

2018-12-18 Thread Rob Casey
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. On Wed, 19 Dec. 2018, 04:40 Chris verBurg Rob, > > To ask a sanity quest

Re: Error with grammar arguments

2018-12-18 Thread Hans Åberg
> On 18 Dec 2018, at 20:06, Rob Casey 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

Re: Error with grammar arguments

2018-12-18 Thread Rob Casey
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 wrote: > > > On 18 Dec 2018, at 20:06, Rob Casey wrote: > > > > Yes - That is correct

Re: Error with grammar arguments

2018-12-18 Thread Rob Casey
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 wrote: > Thanks for the tip Chris, H

Bison 3.2.3 released [stable]

2018-12-18 Thread Akim Demaille
Bison 3.2.3 is a bug fix release of Bison 3.2. Bison 3.2 brought massive improvements to the deterministic C++ skeleton, lalr1.cc. When variants are enabled and the compiler supports C++11 or better, move-only types can now be used for semantic values. C++98 support is not deprecated. Please se