lua-users home
lua-l archive

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


Hi,

for our C++11 PEG library, the PEGTL (Parsing Expression Grammar Template Library), we have included a PEGified version of the Lua
5.3 grammar as example.

There are many more production rules than the grammar in the Lua documentation contains; it is both lexer and parser, does all Lua
literals, knows all operator precedence levels, and is optimised to reduce back-tracking in some cases.

The grammar should be complete and correct, it is now at the point where it seemingly parses all of lua-5.3.0-test/*.lua, however it
is only the grammar, not a compiler or AST generator.

We are announcing this here for anybody who might be interested in using this for ... well, basically whatever it might be useful
for ... hoping that C++11 will not scare everybody off.

The PEGTL is under the MIT license and available at https://github.com/ColinH/PEGTL, the Lua grammar is in
https://github.com/ColinH/PEGTL/blob/master/examples/lua53_parse.cc .

Regards, Colin