Someone already made an ANTLR grammar for the Lua language:
http://www./grammar/1178608849736/Lua.g
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.
|
answered Jan 1 '12 at 1:29
|
|
|
|
And interesting question. v2 had several targets, including C++, Java, and C#. v3 supports C, Java, C#, Python, and Objective C. While it may be obvious why they added Python and Objective C, it's not so clear why they abandoned C++. One ANTLR maintainer said several times that he'd write a C++ target for ANTLR v3, but never did. Maybe others haven't tried because the cookie is wet (blogs./b/oldnewthing/archive/2009/12/01/9930480.aspx). How did the C++ target from v2 "disappear" from v3? That's because they redesigned the target API to make it easier to add languages.
–
John Zwinck
Jan 1 '12 at 14:12
|
|