lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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).)

-- Roberto