Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dingyi222666/lua-parser
A Lua 5.3 Lexer & Parser written in pure Kotlin.
https://github.com/dingyi222666/lua-parser
ast kotlin kotlin-library kotlin-multiplatform lexer lua lua-lexer lua-parser luaparse parser
Last synced: 11 days ago
JSON representation
A Lua 5.3 Lexer & Parser written in pure Kotlin.
- Host: GitHub
- URL: https://github.com/dingyi222666/lua-parser
- Owner: dingyi222666
- License: apache-2.0
- Created: 2023-02-01T14:45:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-19T19:21:03.000Z (about 2 months ago)
- Last Synced: 2024-10-11T09:46:34.963Z (27 days ago)
- Topics: ast, kotlin, kotlin-library, kotlin-multiplatform, lexer, lua, lua-lexer, lua-parser, luaparse, parser
- Language: Kotlin
- Homepage:
- Size: 746 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-parser
## _work in progress_
A Lua 5.3 Lexer & Parser written in pure Kotlin.
## Features
- [X] Kotlin Multiplatform support (JVM / JS / Native)
- [x] Parse source to AST
- [x] Transform AST to source code
- [ ] Semantic analysis. Provide type information (Work in progress)## Usage
- Add the dependency to your gradle file
```kotlin
implementation("io.github.dingyi222666:luaparser:1.0.3")
```Ok. Use it like this:
```kotlin
val lexer = LuaLexer("print('hello world')")
val parser = LuaParser()val root = parser.parse(lexer)
println(AST2Lua().asCode(root))
```More usage coming soon.
## Special thanks
[GavinHigham/lpil53](https://github.com/GavinHigham/lpil53)
[fstirlitz/luaparse](https://github.com/fstirlitz/luaparse)
[Rosemose/sora-editor](https://github.com/Rosemoe/sora-editor/blob/main/language-java/src/main/java/io/github/rosemoe/sora/langs/java/JavaTextTokenizer.java)