From: Goswin von Brederlow <goswin-v-b@web.de>
To: Micha <micha-1@fantasymail.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] The lexer hack
Date: Sat, 14 Nov 2009 20:09:13 +0100 [thread overview]
Message-ID: <87hbsw3ova.fsf@frosties.localdomain> (raw)
In-Reply-To: <200911141720.13847.micha-1@fantasymail.de> (Micha's message of "Sat, 14 Nov 2009 17:20:13 +0100")
Micha <micha-1@fantasymail.de> writes:
> On Tuesday, 10. November 2009 15:42:52 Dario Teixeira wrote:
>> Hi,
>>
>> I'm creating a parser for a LaTeX-ish language that features verbatim
>> blocks. To handle them I want to switch lexers on-the-fly, depending on the
>> parsing context. Therefore, I need the state from the (Menhir generated)
>> parser to influence the lexing process (I believe this is called the "lexer
>> hack" in compiler lore).
>
> if the lexer cannot decide it on the tokens seen, a packrat parser (like
> Aurochs) may be a better choice, since in a PEG there is no seperate lexer,
> it's all one grammar, so you don't have this problem.
>
> Michael
There usualy must be something present to support '(* <vebatim
text> *)' and '"<verbatim text>"', i.e. comments and strings.
Find out what is recommended for those and adapt it.
MfG
Goswin
prev parent reply other threads:[~2009-11-14 19:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 14:42 Dario Teixeira
2009-11-10 17:35 ` [Caml-list] " David Allsopp
2009-11-10 20:02 ` Dario Teixeira
2009-11-14 16:20 ` Micha
2009-11-14 18:08 ` Dario Teixeira
2009-11-14 19:09 ` Goswin von Brederlow [this message]
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=87hbsw3ova.fsf@frosties.localdomain \
--to=goswin-v-b@web.de \
--cc=caml-list@yquem.inria.fr \
--cc=micha-1@fantasymail.de \
/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