[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: BNF to LPEG
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 7 Apr 2016 10:22:15 -0300
> Is there a module that can convert BNF to LPEG?
> The test case being the Lua grammar in §9 of in the manual.
Not that I know. Such a conversion is tricky for at least two reasons:
- Usually, BNF assumes a separate scanner, while LPeg works directly
on the character level.
- Although BNF and LPeg may look similar, they have different meanings.
(If the BNF is LL(n), then a corresponding LPeg would have equal
meaning, but the scanner problem is still there. In particular, the
Lua grammar in the manual is not LL(n).)