[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: push parser
From: |
Bob Rossi |
Subject: |
Re: push parser |
Date: |
Mon, 25 Sep 2006 10:28:23 -0400 |
User-agent: |
Mutt/1.5.11 |
On Thu, Sep 21, 2006 at 07:03:47AM -0400, Bob Rossi wrote:
> On Wed, Sep 20, 2006 at 09:58:30PM -0700, Paul Eggert wrote:
> > >> One way to address this issue would be to have two entry points:
> > >>
> > >> status = yypushparse (ctx, ch, yylloc);
> > >>
> > >> for tokens that have no semantic value, and
> > >>
> > >> status = yypushparseval (ctx, ch, yylval, yylloc);
> > >>
> > >> for tokens that do.
> > >>
> > >> Another possibility, which will avoid a copy in some cases if semantic
> > >> values are large, is to pass a pointer:
> > >>
> > >> status = yypushparse (ctx, ch, &yylval, yylloc);
> > >>
> > >> where you pass a NULL pointer if the token has no semantic value. If
> > >> the copying issue is of concern, it may also make sense to pass yylloc's
> > >> address too:
> > >>
> > >> status = yypushparse (ctx, ch, &yylval, &yylloc);
> > >>
> > >> I don't know whether the copying concern is enough to affect
> > >> performance, though.
> > >
> > > I'm not decided on how to modify the yypushparse function parameters.
> > > Have you made up your mind?
> >
> > If it doesn't matter to you, let's use the second method (passing
> > the addresses). We can always change it later if it turns
> > out to have a problem.
>
> OK, I liked the second approach better myself. I'll look into it.
I have a small patch that get's me this far:
status = yypushparse (ctx, ch, &yylval);
What should I do about yylval?
I can attempt to make yypushparse have an extra parameter when locations
are enabled. Does that sound correct?
Thanks,
Bob Rossi
- push parser, Bob Rossi, 2006/09/16
- Re: push parser, Paul Eggert, 2006/09/16
- Re: push parser, Bob Rossi, 2006/09/18
- Re: push parser, Paul Eggert, 2006/09/18
- Re: push parser, Bob Rossi, 2006/09/20
- Re: push parser, Paul Eggert, 2006/09/21
- Re: push parser, Bob Rossi, 2006/09/21
- Re: push parser,
Bob Rossi <=
- Re: push parser, Bob Rossi, 2006/09/25
- Re: push parser, Paul Eggert, 2006/09/26
- Re: push parser, Bob Rossi, 2006/09/26
- Re: push parser, Paul Eggert, 2006/09/26
- Re: push parser, Bob Rossi, 2006/09/27
- Re: push parser, Paul Eggert, 2006/09/27
- Re: push parser, Bob Rossi, 2006/09/27
- Re: push parser, Bob Rossi, 2006/09/27
- Re: push parser, Paul Eggert, 2006/09/27
- Re: push parser, Bob Rossi, 2006/09/27