BNF grammar for D?
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Fri Oct 12 12:57:18 PDT 2012
On Fri, 12 Oct 2012 16:16:10 +0100
Russel Winder <russel at winder.org.uk> wrote:
> On Fri, 2012-10-12 at 16:59 +0200, Paulo Pinto wrote:
> […]
> >
> > My grammar knowledge is a bit rusty, but isn't EBNF only possible
> > for LR(K) languages?
>
> Mentioning EBNF turns out to be a red herring. Indeed mention of BNF
> is a red herring also. What is actually needed is a Wisent grammar
> file. Wisent is Bison. Bison is YACC. So we are looking for an LALR(1)
> grammar.
>
> > Is is possible for D?
>
> Pass.
>
I'm pretty sure a correct D grammar is impossible in LALR(1), unless
maybe there's a way to manually resolve shift-reduce/reduce-reduce
conflicts. You might be able to get close, though. LALR(k) or GLR
might be possible.
More information about the Digitalmars-d
mailing list