From: Dario Teixeira <darioteixeira@yahoo.com>
To: caml-list@inria.fr, Jeff Shaw <shawjef3@msu.edu>
Subject: Re: [Caml-list] Re: The lexer hack
Date: Tue, 10 Nov 2009 08:26:23 -0800 (PST) [thread overview]
Message-ID: <698547.213.qm@web111509.mail.gq1.yahoo.com> (raw)
In-Reply-To: <4AF98624.70106@msu.edu>
Hi,
> You could write your lexers in Menhir and make them part of
> your grammar. I know this isn't a terribly easy solution but
> it would be elegant IMO.
I thought of scannerless parsing, but the input is UTF8 encoded,
which makes using Ulex all the more convenient and less error-prone.
Anyway, I was looking at Dypgen's early actions, and an idea
occurred to me: I can create dummy empty actions that simply
change a global "parsing context" variable:
inline:
| (...)
| BEGIN_VERB enter_verb RAW END_VERB exit_verb {Ast.Verbatim $3}
| (...)
enter_verb: /* empty */ {Global.context := Global.Verbatim}
exit_verb: /* empty */ {Global.context := Global.General}
Still hackish, but better than creating a state machine...
Cheers,
Dario Teixeira
next prev parent reply other threads:[~2009-11-10 16:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 15:26 Jeff Shaw
2009-11-10 16:26 ` Dario Teixeira [this message]
2009-11-10 16:33 ` [Caml-list] " Francois Pottier
2009-11-10 16:48 ` Dario Teixeira
2009-11-11 11:03 ` Martin Jambon
2009-11-14 18: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=698547.213.qm@web111509.mail.gq1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@inria.fr \
--cc=shawjef3@msu.edu \
/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