[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to free symbols during error recovery
From: |
Laurence Finston |
Subject: |
Re: How to free symbols during error recovery |
Date: |
Fri, 8 Oct 2004 14:53:43 +0200 (MEST) |
On Fri, 8 Oct 2004, Akim Demaille wrote:
> >>> "Laurence" == Laurence Finston <address@hidden> writes:
>
> >> Again, I'm not taking _at all_ about error recovery :)
>
> > I don't understand. I'm talking about destroying objects when they
> > are popped from the stack, which happens when parse errors occur.
>
> Parse error != error recovery.
No, but I've been assuming that a parse error should cause error recovery
to be attempted, either by using the `error' token in rules, or in some
other way. Please bear with me if I'm not getting your point.
>
> But maybe you wrote this sentence before the following one which was
> above in your answer:
>
> > I've been assuming that when the `error' token isn't used anywhere,
> > `yyparse()' just returns 1 right away, without popping states from
> > the stack. It just occurred to me that this might not be the case.
>
> It is not, indeed.
>
Then I will either have to use `%destructor', make sure that I
always have a pointer to all dynamically allocated objects, or accept
that parse errors may cause memory leaks.
>
>
> > In other cases, I don't need a destructor because, like Oliver, I
> > take care of allocating and freeing memory by hand. If I'm missing
> > something here, please explain it.
>
> You don't seem to _need_ it, but I think you want it.
>
I certainly plan to look into using `%destructor'. Since I only take
responsibility for making sure 3DLDF runs on GNU systems, I won't
have the problem of getting it to work on non-free ones.
Laurence
- Re: How to free symbols during error recovery, (continued)
- Re: How to free symbols during error recovery, Laurence Finston, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery, Laurence Finston, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery, Laurence Finston, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery,
Laurence Finston <=
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery, Laurence Finston, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery, Oliver Boris Fischer, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/08
- Re: How to free symbols during error recovery, Oliver B. Fischer, 2004/10/08
- Re: How to free symbols during error recovery, Akim Demaille, 2004/10/11
- Re: How to free symbols during error recovery, Oliver Boris Fischer, 2004/10/12