A Lua 5.3 Lexer & Parser written in pure Kotlin.
- Kotlin Multiplatform support (JVM / JS / Native)
- Parse source to AST
- Transform AST to source code
- Semantic analysis. Provide type information (Work in progress)
- Add the dependency to your gradle file
implementation("io.github.dingyi222666:luaparser:1.0.3")
Ok. Use it like this:
val lexer = LuaLexer("print('hello world')")
val parser = LuaParser()
val root = parser.parse(lexer)
println(AST2Lua().asCode(root))
More usage coming soon.