lua-users home
lua-l archive

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


On Tue, Mar 4, 2014 at 7:37 PM, Wesley Smith <wesley.hoke@gmail.com> wrote:
> It might be good design inspiration for someone wanting to make a pure
> Lua version.  The entire thing is only 1600 lines, which includes a
> bootstrapped interpreter of standard LPEG syntax.

Have a look at this, for Lua 5.1 / 5.2 (/ 5.3?) and by extension LuaJIT:

 - https://github.com/pygy/LuLPeg

and this for LuaJIT and maybe stock Lua + LuaFFI (but in that case
likely slower than the above.):

 - https://github.com/sacek/LPegLJ

LuLPeg may need some cleanup / refactoring (you never stop learning),
but it is functional.

LPegLJ is actually ahead of LPeg. It implements the left recursion
strategy described in http://arxiv.org/abs/1207.0443.

-- Pierre-Yves