Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques-Henri Jourdan <jacques-henri.jourdan@normalesup.org>
To: Dario Teixeira <dario.teixeira@nleyten.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Menhir grammar with sequences delimited by same token
Date: Sun, 8 May 2016 23:29:04 +0200	[thread overview]
Message-ID: <814dd903-513b-2846-346a-4b5909e9c564@normalesup.org> (raw)
In-Reply-To: <43a466d4c7f145b0a6de709185ced949@nleyten.com>


[-- Attachment #1.1: Type: text/plain, Size: 1039 bytes --]


>> 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.
>

I see. Even if you could find a way to tell menhir what you want,
AFAICT, the size of the automaton will grow exponentially with the
number of kinds of tags, so this does not seems to be a good idea.

I think that you can either do it by hand just before parsing (as you
do) or just after parsing (as Sebastien proposed).

-- 
JH

> Best regards,
> Dario Teixeira



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-05-08 21:29 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
2016-05-08 21:29     ` Jacques-Henri Jourdan [this message]
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=814dd903-513b-2846-346a-4b5909e9c564@normalesup.org \
    --to=jacques-henri.jourdan@normalesup.org \
    --cc=caml-list@inria.fr \
    --cc=dario.teixeira@nleyten.com \
    /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