From: Francois Pottier <Francois.Pottier@inria.fr>
To: skaller <skaller@users.sourceforge.net>
Cc: Alessandro Baretta <a.baretta@barettadeit.com>,
Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] [ANNOUNCE] Alpha release of Menhir, an LR(1) parser generator for ocaml
Date: Thu, 15 Dec 2005 09:46:16 +0100 [thread overview]
Message-ID: <20051215084616.GC1966@yquem.inria.fr> (raw)
In-Reply-To: <1134594294.8942.82.camel@rosella>
On Thu, Dec 15, 2005 at 08:04:54AM +1100, skaller wrote:
> Interestingly the 'end of stream' issue discussed at length
> in the Menhir manual then applies also to the points
> of recursion.
That's a good point. Actually, we are planning to implement in Menhir a
mechanism that helps stop at some point and invoke an external lexer or parser
(this can be any piece of code that consumes characters off the input stream).
Doing this properly requires *not* reading the lookahead token. As you point
out, the problems that arise are similar to the way the end of stream is
handled.
> It would be really nice if I could write the
> production as:
>
> exprx: expr ~expr
>
> where ~expr means 'any token which forces a reduction
> of the whole expression' if you know what I mean.
No, I don't know exactly what you mean :) I need to think more to understand
if this construction makes sense. It makes the grammar self-referential, in a
way, so it at least has to be monotonic in order to make sense.
Our plan regarding calls to external lexers or parsers was to be more rigid,
that is, to require the current statement (or expression, or whatever) to be
unambiguously terminated (for instance, by a semicolon) at the point where the
external call is made. So what you do with statements would be accepted, but
what you do with expressions might be impossible.
--
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
next prev parent reply other threads:[~2005-12-15 8:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-12 17:58 Francois Pottier
2005-12-12 19:51 ` [Caml-list] " "Márk S. Zoltán"
2005-12-13 21:07 ` Nathaniel Gray
2005-12-14 6:08 ` skaller
2005-12-14 9:04 ` Francois Pottier
2005-12-14 10:27 ` Alessandro Baretta
2005-12-14 21:04 ` skaller
2005-12-15 8:46 ` Francois Pottier [this message]
2005-12-15 11:03 ` skaller
2005-12-14 20:51 ` skaller
2005-12-14 22:15 ` Joaquin Cuenca Abela
2005-12-15 8:40 ` Francois Pottier
2005-12-15 6:35 ` Stefan Monnier
2005-12-15 8:47 ` [Caml-list] " Francois Pottier
2005-12-15 16:41 ` Stefan Monnier
2005-12-15 16:50 ` Francois Pottier
2005-12-15 18:56 ` Stefan Monnier
2005-12-30 21:57 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051215084616.GC1966@yquem.inria.fr \
--to=francois.pottier@inria.fr \
--cc=a.baretta@barettadeit.com \
--cc=caml-list@yquem.inria.fr \
--cc=skaller@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox