caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Micha <micha-1@fantasymail.de>
To: caml-list@yquem.inria.fr
Cc: Dario Teixeira <darioteixeira@yahoo.com>
Subject: Re: [Caml-list] The lexer hack
Date: Sat, 14 Nov 2009 17:20:13 +0100	[thread overview]
Message-ID: <200911141720.13847.micha-1@fantasymail.de> (raw)
In-Reply-To: <514622.64398.qm@web111510.mail.gq1.yahoo.com>

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


  parent reply	other threads:[~2009-11-14 16:20 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 [this message]
2009-11-14 18:08   ` Dario Teixeira
2009-11-14 19:09   ` Goswin von Brederlow

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=200911141720.13847.micha-1@fantasymail.de \
    --to=micha-1@fantasymail.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.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;
as well as URLs for NNTP newsgroup(s).