help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing multiple files with same parser


From: Tadej Borovšak
Subject: Re: Parsing multiple files with same parser
Date: Sun, 18 Nov 2012 10:06:07 +0100

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
address@hidden
address@hidden
blog.borovsak.si




reply via email to

[Prev in Thread] Current Thread [Next in Thread]