On 6/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
"Garrett Rooney" <[EMAIL PROTECTED]> wrote:
> >
> > Your grammer does not generate an empty string.  That means
> > if you call the parser with an EOF token first, without any
> > prior tokens, you are going to get a syntax error.  The
> > "yymajor==0" test was removed in order to get this to
> > work correctly.  Geert Janssen at IBM found this bug back
> > in November - his grammar does not generate an empty string
> > but lemon was not giving him a syntax error like it should
> > if he passed in an empty string.  If I add the yymajor==0
> > test back, it will reintroduce the bug.
>
> Hmm.  I don't believe that's happening, but I'll look into adding
> something to deal with that case.
>
> > Perhaps you are calling Parse() with EOF twice in a row
> > when you should only be calling it once?  That would trigger
> > the syntax error.  Or perhaps you should adjust your grammar
> > to accept an empty string?
>
> Nope, I only send EOF in one location, the lexer never produces it,
> and I only pass it in after I've run out of tokens from the lexer.
>
> > The %extra_argument that gets passed to the %syntax_error procedure
> > should be the %extra_argument that got passed into with the
> > call to Parse() that contained the EOF token.  If that %extra_argument
> > was NULL, then the %syntax_error procedure will get a NULL.
> > Perhaps you can either pass in a non-null parameter to Parse
> > or check for NULL in %syntax_error and branch accordingly.
>
> The extra argument passed in to the parse function is a pointer to
> memory on the stack.  It's just not possible for it to be null, unless
> something is messing with that value before it gets into the
> %syntax_error block...
>

I don't have any more ideas about what might be going wrong.
Can you send me a reproducible test case that I use to track
down the problem?

I've been a bit busy lately, so I haven't been able to look at this.
For now, if you want to download ETL from Subversion and build it with
that version of lempar.c just running "make check" should give you a
number of failures.  If you'd like me to package up a tarball you can
try out I can do that, but it'll probably take me a few days to get
around to it.

Thanks,

-garrett

Reply via email to