[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: push parser
From: |
Joel E. Denny |
Subject: |
Re: push parser |
Date: |
Sun, 1 Jul 2007 20:30:17 -0400 (EDT) |
On Mon, 25 Jun 2007, Bob Rossi wrote:
> Section 3.7.10 describes the pure parser. I think it would be
> appropriate to describe the push parser in section 3.7.11.
Seems fine.
> In section 4.2.4 the manual describes the "Calling Conventions for
> Pure Parsers". Off the top of my head, I don't think the push parser
> effects this particular mode so I don't think we would need to change
> this section. Do you?
I believe all the information in this section is correct even if you use
%push-parser or %push-pull-parser. Of course, we'll want to document the
effect of %pure-parser in those cases, but that documentation probably
belongs in your new section 3.7.11.
> In the section "Appendix A Bison Symbols", some variables are described.
> It states when certain variables will be global, so that the user could
> potentially get access to them.
For a pure push parser, yynerrs is a member of yypstate, but yychar,
yylloc, and yylval are local variables in yypush_parse. So, that
documentation needs to be updated. There may be other places besides
Appendix A.
For an impure parser, regardless of whether it's push, all four of those
variables are global.
> In a few of these, it describes the
> difference when the push parser option is used. I can't really remember
> how you eventually got the push parser working. What are the valid
> combinations of options with pure/push/normal parsing? Should we
> describe them all in a manual?
The user can declare either %push-parser or %push-pull-parser. If he
declares both, the last one declared has precedence, but I'm not sure
that's permanent behavior. The user should just declare one or the other.
You can use %pure-parser in combination with either %push-parser or
%push-pull-parser.
Actually, we would get automatic checking for conflicting push
declarations if we converted %push-* to a single %define. Maybe:
%define push_pull "pull" // default
%define push_pull "push"
%define push_pull "both"
I even wonder if %pure-parser should be deprecated and we should add:
%define pure_parser
Bison would then complain automatically when any of these declarations
have no effect for the chosen skeleton.
> One other question, is it important to have an example in the manual
> showing how the push parser works?
I think that would be great.
Thanks for working on this.