Re: Question about token stack

2020-08-30 Thread Hegedüs Ervin
Hi Akim, thanks again, On Sun, Aug 30, 2020 at 06:19:09PM +0200, Akim Demaille wrote: > > Le 30 août 2020 à 18:06, Ervin Hegedüs a écrit : > > > > the documentation shows: > > > > https://www.gnu.org/software/bison/manual/html_node/Enabling-Traces.html > > > > the option -t (POSIX Yacc compli

Re: Question about token stack

2020-08-30 Thread Akim Demaille
> Le 30 août 2020 à 18:06, Ervin Hegedüs a écrit : > > the documentation shows: > > https://www.gnu.org/software/bison/manual/html_node/Enabling-Traces.html > > the option -t (POSIX Yacc compliant) > > the option --debug (Bison extension) Have a look at Bison's examples (e.g. https://gith

Re: Question about token stack

2020-08-30 Thread Ervin Hegedüs
Hi Akim On Sun, Aug 30, 2020 at 05:36:49PM +0200, Akim Demaille wrote: > > Le 30 août 2020 à 17:17, Ervin Hegedüs a écrit : > > > > in my parser code I got: > > > > #ifdef YYDEBUG > > yydebug = 1; > > #endif > > > > and I compiled the code: > > bison -d myparser.y > > flex -d mylexer.l > > gc

Re: Question about token stack

2020-08-30 Thread Akim Demaille
> Le 30 août 2020 à 17:17, Ervin Hegedüs a écrit : > > in my parser code I got: > > #ifdef YYDEBUG > yydebug = 1; > #endif > > and I compiled the code: > bison -d myparser.y > flex -d mylexer.l > gcc ... > > the output is: > > --accepting rule at line 52 ("ConfKey2") > --accepting rule at

Re: Question about token stack

2020-08-30 Thread Ervin Hegedüs
Hi Akim, thanks again. On Sun, Aug 30, 2020 at 05:04:50PM +0200, Akim Demaille wrote: > > > > Le 30 août 2020 à 16:36, Ervin Hegedüs a écrit : > > > > %destructor { printf("free() called\n"); free ($$); } <*> > > > > but it never called, and valgrind still shows that the block is > > still r

Re: Question about token stack

2020-08-30 Thread Akim Demaille
> Le 30 août 2020 à 16:36, Ervin Hegedüs a écrit : > > I just put: > > %destructor { printf("free() called\n"); free ($$); } <*> > > but it never called, and valgrind still shows that the block is > still reachable. You should add debug traces and study them. Pay special attention to the e

Re: Question about token stack

2020-08-30 Thread Akim Demaille
Hi Ervin, > Le 30 août 2020 à 11:44, Ervin Hegedüs a écrit : > > Hi all, > > and in parser: > > https://github.com/airween/flextest/blob/master/myparser.y#L52 > > config_directive_line: > T_CONFIG_DIRECTIVE T_CONFIG_DIRECTIVE_ARGUMENT { printf("'%s' '%s'\n", > $1, $2); free($1); free($2

Re: Question about token stack

2020-08-30 Thread Ervin Hegedüs
Hi Akim many thanks for your answer. On Sun, Aug 30, 2020 at 03:43:54PM +0200, Akim Demaille wrote: > Hi Ervin, > > > Le 30 août 2020 à 11:44, Ervin Hegedüs a écrit : > > > > How can I avoid this situation? Is that any "best-practice"? How > > can I access to pointers in stack to free them whe

Question about token stack

2020-08-30 Thread Ervin Hegedüs
Hi all, I could finish the handling of include files - both for explicit listing and using metacharacters (eg. config*.conf). You can check that here: https://github.com/airween/flextest (Note, this is just an example project...) I still have a question - as you can see, I've created a functio

Re: api.prefix history

2020-08-30 Thread Akim Demaille
Hi Matthew. > Le 25 août 2020 à 16:15, Matthew Fernandez a > écrit : > > Hello all, > > I accidentally stumbled across a quirk, that Bison 2.6 - 3.0 expects the > api.prefix option value to be given without braces. This surprised me because > the Bison %define summary [0] gives no relevant c