Hi all.

Dne 17.11.2012 (sob) ob 23:48 +0100 je Tadej Borovšak napisal(a):
> Relevant piece of code that causes my parser to error-out looks like
> this (this code is placed in the last section of my parser.y file,
> inside main function):
> 
> /* Open input stream etc. */
> yyparse ();
> /* Close input stream and reopen it */
> /* Flush flex buffer using YY_FLUSH_BUFFER */
> yyparse ();

I'm replying to myself just to let you know that the main cause of error
was hidden deep down in one of my functions that handles creation of
symbol table.

Since one week ago I knew nothing about flex/bison, I quickly wrote a
prototype application to learn about them. I used static array as my
symbol table and did no duplicate checking. I created enough space for
my test samples and since this was a while ago, I forgot about it.

When I started testing parsing file twice, I forgot to properly resize
this array and by some strange coincidence, my array overflow manifested
itself as a syntax error, reported by bison.

Sorry for all the noise and thank you for all your help.

Cheers,
Tadej

-- 
Tadej Borovšak
tadej.borov...@gmail.com
tadeb...@gmail.com
blog.borovsak.si


_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to