lua-users home
lua-l archive

Re: BNF to LPEG

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


2016年04月09日 8:27 GMT+02:00 Chris Emerson <chris-lua@mail.nosreme.org>:
> As an example from the paper, the regular expression "(ba|a)*a" is not, as you
> might expect, converted to the structurally similar:
>
> ((P"ba" + P"a")^0) * P"a"
That is the sort of thing I don't mind having to do manually.
With LPeg, there is no need to express every single case in
the PEG itself, you've got all of Lua to help you. P(1)^0/myfunc
if nothing else works.

AltStyle によって変換されたページ (->オリジナル) /