D Parsing (again)/ D grammar
Vladimir Kazanov via Digitalmars-d
digitalmars-d at puremagic.com
Thu Oct 2 06:49:10 PDT 2014
Hello, everyone!
Recently, I have been doing some experimental work related to
generalized parser generators. It is not yet ready for a public
release, I am not even sure it will ever be. Anyway, right now I
am considering adding D as a target for parser generation.
Actually, it's more than that: the grand target is to be able to
generate a D language parser in D. With Python, for example, it
is rather easy, as I can just mechanically transform the original
grammar into a suitable form and be done with it.
The generator itself is quite powerful, theoretically it should
be able to handle all context-free grammar (see
http://dotat.at/tmp/gll.pdf for theory).
There is a grammar page on dlang.org
(http://dlang.org/grammar.html). I have also found a related
discussion in the forum
(http://forum.dlang.org/thread/bwsofbnigfbrxwouiobj@forum.dlang.org).
From the discussion I found out that D parser is a hand-made
RD-parser with "a few tricks"(c).
So, my questions:
1. How realistic is the grammar? Is it a real one or just a
sketch of sorts? Is it something developers use to build the
parser?
2. There's also a D grammar for Pegged. How good is it? Can it be
used as a starting point to build a parser?
More information about the Digitalmars-d
mailing list