|
I've written a recursive descent Lua parser in _javascript_,
http://oxyc.github.com/luaparse/. This was done for my bachelor's thesis
and I'm planning to continue working on it to to add some missing
features.
The implementation has put a lot of focus on performance, currently it
parses 5000 syntax nodes (1200 SLOC) in ~2ms with Node.js. In contrast a
simple parser generated by Jison (http://zaach.github.com/jison/) parses
the same code in ~110ms. I also benchmarked the Jison parser using my
own lexer, putting it at ~50ms.
Essential features that are currently missing but hopefully coming soon:
- Tolerant error handling
- Location tracking
I hope someone can find use of this.
--
Oskar Schöldström