help-bison
[Top][All Lists]
Advanced

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

Submission for manual (was: Non-greedy wildcard possible?)


From: Frank Heckenbach
Subject: Submission for manual (was: Non-greedy wildcard possible?)
Date: Thu, 10 Jun 2004 06:33:10 +0200
User-agent: semail 20040101

Hans Aberg wrote:

> >> The C++ example is important, because it shows how GLR can be used to
> >> resolve run-time parsing ambiguities.
> >
> >Sure. I just meant there should perhaps be an example without dprec
> >as a first step. -- Yes, I know, when I say this, I should rather
> >write and post such an example. I think I could write a short
> >example based on Pascal syntax, if wanted ...
> 
> The Bison manual should probably have more info on GLR -- if somebody is
> willing to write it.

OK, I've written something (attached), to be inserted after the
existing `GLR Parsers' section. Should I just post it to bug-bison,
or what to do with it?

While conceptually it may be preferable to put this simpler example
*before* the existing C++ example, I didn't do this because some
general words about GLR then would have to be moved from there to
the new section, and some rearrangements elsewhere might be
necessary. Someone else might want to do this if deemed useful ...

> Otherwise, I am thinking of versions where the lexer can provide several
> lexing alternatives, and then let the Bison GLR parser sort it out. This
> seems useful in human languages (including say common human usage of math).
> In such cases, lexer tweaking becomes very difficult, or impossible, so a
> GLR approach would probably be to be preferred.

I'm kind of doing this (see my recent mail with `"mixed" tokens').
Since there's no direct support for this in flex/bison, I'm just
using special tokens which represent a certain alternative
(including the respective semantic values for all cases) and which
are accepted in different meanings in the grammar. In the extreme
(general) case, the scanner can only return single characters, and
we have scannerless parsing as in the paper you showed me last year
(though for another purpose -- you cared about the precedence syntax
suggested there, but this it also the topic of the paper).

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)

Attachment: glr-simple.texi
Description: TeXInfo document


reply via email to

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