Re: Markdown grammar definition language

Hi,

Maybe I'm missing something.  I've never worked with PEG, but I have worked
with context-free grammars, and I read the same post you linked to,
http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html.
 Just from that, I get the feeling that the author is correct that PEGs are
more suited to the task of parsing Markdown.  And there's also the fact
that John MacFarlane has already produced two (here is one:
https://github.com/jgm/peg-markdown/blob/master/markdown_parser.leg).

As for tools that generate parsers from PEGs, it seems that there are many.
 Here's the one used by peg-markdown:  http://piumarta.com/software/peg/,
and this page lists lots more:  http://bford.info/packrat/.

Cheers!
Chris


On Thu, Dec 20, 2012 at 2:42 AM, Dave Pawson <dave.pawson@gmail.com> wrote:

> Your comment re joining copied to W3C Chris
>
> On 19 December 2012 20:06, Chris Maloney <voldrani@gmail.com> wrote:
>
> > My opinion is that just because John MacFarlane found two edge cases that
> > PEG couldn't handle, doesn't mean that you should throw the baby out with
> > the bathwater.  PEG + English is probably the best way to go.  Clearly
> PEG
> > is a better choice than EBNF, and *much* better than plain English (which
> > would be very difficult to get free of ambiguities), or a reference
> > implementation (which would be opaque to humans and difficult to
> maintain).
> >
> > Maybe there is a way to define a PEG+ variant to handle the edge cases.
>
>
> 1. For the core profile we should be able to avoid edge cases.
>
> Try writing PEG for a para, no inlines, terminated with \n\n Chris, if
> that's
> something you could do.
>
> Question. With EBNF we can generate a parser directly. Is that the
> case with PEG?
>
> regards
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
>

Received on Thursday, 20 December 2012 21:21:57 UTC