I know how to embed Lua in other languages, but I would like to re-use ONLY the parser to parse code and give me the result as AST for instance. What is the easiest way of doing that with the Lua platform?
Thanks!
Someone already made an ANTLR grammar for the Lua language:
http://www.antlr3.org/grammar/1178608849736/Lua.g
Or if you're using ANTLR v4:
https://github.com/antlr/grammars-v4/blob/master/lua/Lua.g4
I've used ANTLR on a couple projects with good results. It will generate a C (ANTLR v3) or C++ (ANTLR v2) parser including AST generation if you ask for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With