unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Ian Grant <ian.a.n.grant@googlemail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Parsing
Date: Thu, 09 Oct 2014 19:20:11 -0400	[thread overview]
Message-ID: <87mw94zv84.fsf@netris.org> (raw)
In-Reply-To: <CAKFjmdw1ncFXPL0tP_nsCOg6X3559Nmur=S-gj=fNvByRYG=1w@mail.gmail.com> (Ian Grant's message of "Mon, 15 Sep 2014 13:36:44 -0400")

Ian Grant <ian.a.n.grant@googlemail.com> writes:

> LALR parser generators are not the last word in parsing technology.
[...]
> Important examples of grammars which are not LALR parsable include
> ASN.1 and Standard ML.
[...]
> But I think the problem of parsing has actually been solved. Tom
> Ridge's "p3" combinator parsers with oracles will parse any
> unambiguous CFG in polynomial time complexity at most O^3, or possibly
> O^2, I need to check, in the length of the input. The advantage of
> combinator parsers is that they parse top-down, in a way which follows
> the natural structure of the grammar. So errors can be explained to
> the user (and the developer!) in terms of the actual derivations
> (parsing decisions) taken on the input, This is not the case with
> bottom-up parsers such as LALR.
>
> It would be really good to have a p3-like parser generator working in
> Guile.

I agree that combinator parsers would be a useful addition to Guile.

> Again, one cold implement the recursive parser combinators in
> scheme-generated lightning. If this were done abstractly then Guile
> could generate fast machine code parsers for any host language.

I would prefer to work within the framework of our compiler tower,
and have the combinator parsers generate one of our higher-level
intermediate languages, if not scheme itself (via syntax-case macros).
This should enable our compiler to analyze the combined program and
perform partial evaluation between the generated parser and other scheme
code.  For many reasons, it makes sense to keep our code generation in
one place.

      Thanks,
        Mark
        



      parent reply	other threads:[~2014-10-09 23:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 17:36 Parsing Ian Grant
2014-09-15 18:29 ` Parsing Stefan Israelsson Tampe
2014-09-15 19:59   ` Parsing Ian Grant
2014-09-15 20:20     ` Parsing Ian Grant
2014-09-15 20:38     ` Parsing Stefan Israelsson Tampe
2014-09-17  0:10       ` Parsing Ian Grant
2014-09-15 20:45     ` Parsing Ian Grant
2014-10-09 23:20 ` Mark H Weaver [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

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mw94zv84.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guile-devel@gnu.org \
    --cc=ian.a.n.grant@googlemail.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 read-only IMAP folder(s) and NNTP newsgroup(s).