From: Dario Teixeira <darioteixeira@yahoo.com>
To: "Francois.Pottier@inria.fr" <Francois.Pottier@inria.fr>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] New release of Menhir (20141215)
Date: Fri, 26 Dec 2014 11:13:30 +0000 (UTC) [thread overview]
Message-ID: <1100699448.864923.1419592410621.JavaMail.yahoo@jws100188.mail.ne1.yahoo.com> (raw)
In-Reply-To: <20141224233002.GE7225@yquem.inria.fr>
Hi,
> Hmm, maybe. The new API will probably allow you to inspect the stack (which is
> basically a list of pairs of a state and a semantic value) and to inspect a
> state (which can be viewed as a set of LR(1) items). I don't know whether that
> would offer you a simple way of deciding when to switch from one lexer to
> another...
I suspect it will *at least* be an improvement over the current situation.
Consider the following rule:
inline:
| ...
| LINK OPEN RAW END OPEN inline* END
| ...
Suppose that by default I'm using a 'general' lexer. However, upon encountering
that first OPEN token, I must switch to a 'raw' lexer and then switch back to the
'general' lexer upon encountering the first END token. This lexer dance won't
happen with the second OPEN token, though.
Anyway, as long as I know which state Menhir is in, choosing the right lexer
should be an easy task. It may require a large lookup table on my part to map
state to lexer, but at least that's a lot less hairy than the current approach.
Best regards,
Dario Teixeira
next prev parent reply other threads:[~2014-12-26 11:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 20:14 Francois Pottier
2014-12-18 12:45 ` Gerd Stolpmann
2014-12-18 14:19 ` Nicolas Ojeda Bar
2014-12-18 15:20 ` Daniel Bünzli
2014-12-18 15:34 ` Simon Cruanes
2014-12-18 16:02 ` Nicolas Ojeda Bar
2014-12-18 15:25 ` Gerd Stolpmann
2014-12-18 17:25 ` Francois Pottier
2014-12-22 11:13 ` oleg
2014-12-22 18:40 ` Dario Teixeira
2014-12-24 23:30 ` Francois Pottier
2014-12-26 11:13 ` Dario Teixeira [this message]
2014-12-26 11:31 ` Frédéric Bour
2014-12-26 12:16 ` Dario Teixeira
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=1100699448.864923.1419592410621.JavaMail.yahoo@jws100188.mail.ne1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=Francois.Pottier@inria.fr \
--cc=caml-list@inria.fr \
/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