From: Dario Teixeira <dario.teixeira@nleyten.com>
To: Jacques-Henri Jourdan <jacques-henri.jourdan@normalesup.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Menhir grammar with sequences delimited by same token
Date: Sun, 08 May 2016 14:43:21 +0100 [thread overview]
Message-ID: <43a466d4c7f145b0a6de709185ced949@nleyten.com> (raw)
In-Reply-To: <f296d0e3-7cbe-55b7-211c-fe180711735f@normalesup.org>
Hi,
And thanks for the prompt reply!
> The priority mechanism won't help, because the LR1 automaton does not
> contain the necessary information for deciding whether to shift or
> reduce.
Alas...
> The solution might be to use parameterized non-terminals, but all the
> non-exponential solutions I can think of do not pass the termination
> checker for parameterized non-terminals.
Hmm, I'll have to take a closer look at that feature of Menhir.
> I have, however, another proposition : if you allow markup areas not be
> well nested, then you can simply have an environment recording, for
> each
> style, whether it is currently in use or not.
In the old version, the top-most parsing layer (generated via Menhir)
would
only see tokens such as BEGIN_BOLD/END_BOLD. There was an intermediate
layer between the lexer and the parser which had a simple state machine
that translated raw BOLD tokens into the BEGIN_BOLD/END_BOLD tokens.
I'm now trying to minimise the "magic" in the intermediate layer, which
is why I wondered if there was an elegant pure Menhir solution.
Best regards,
Dario Teixeira
next prev parent reply other threads:[~2016-05-08 13:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 9:33 Dario Teixeira
2016-05-08 10:27 ` Jacques-Henri Jourdan
2016-05-08 11:57 ` Sébastien Hinderer
2016-05-08 14:16 ` Dario Teixeira
2016-05-08 13:43 ` Dario Teixeira [this message]
2016-05-08 21:29 ` Jacques-Henri Jourdan
2016-05-08 13:35 ` Allan Wegan
2016-05-08 14:19 ` 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=43a466d4c7f145b0a6de709185ced949@nleyten.com \
--to=dario.teixeira@nleyten.com \
--cc=caml-list@inria.fr \
--cc=jacques-henri.jourdan@normalesup.org \
/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