Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ehwan/lua_rust
lua syntax parser & interpreter in Rust
https://github.com/ehwan/lua_rust
compiler glr-parsing lalr1 lua rust
Last synced: 25 days ago
JSON representation
lua syntax parser & interpreter in Rust
- Host: GitHub
- URL: https://github.com/ehwan/lua_rust
- Owner: ehwan
- License: apache-2.0
- Created: 2024-09-04T00:46:42.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-19T03:37:20.000Z (about 2 months ago)
- Last Synced: 2024-09-29T15:22:40.683Z (about 1 month ago)
- Topics: compiler, glr-parsing, lalr1, lua, rust
- Language: Rust
- Homepage:
- Size: 136 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# lua_rust
lua syntax parser & interpreter in Rust- Greatly in progress
- LALR(1), GLR parser
- syntax referenced from [lua 5.4 reference manual](https://www.lua.org/manual/5.4/manual.html)## project structure
- `tokenizer`: tokenizing lua code string.
- `parser`: parsing tokenized lua code into AST.
- `semantics`: semantic analysis of generated AST. It generates a `Enhanced AST` which contains more information than the original AST.
- stack offset of local variables
- scope checking for `return`, `break`, `goto`, `label`, ...
- split function definition into separated Chunks
- `lua_ir` : generate IRs from enhanced AST, and run on virtual machine (WIP)## Cargo Features
- `32bit`: use 32bit integer and float for `lua numeric` type
- `diag`: enable `to_diag()` function for `ParseError`## how to run
```
$ cargo run
```will print the pretty-formatted `Debug` output of the AST ( `"{:#?}"` )