mylang
所属分类:编程语言基础
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-08-01 01:29:20
上 传 者:
sh-1993
说明: 用于学习目的的编程语言实现,
(Programming language implementation for learning purposes,)
文件列表:
.editorconfig (162, 2023-08-26)
.vscode/ (0, 2023-08-26)
.vscode/launch.json (282, 2023-08-26)
.vscode/tasks.json (864, 2023-08-26)
Cargo.lock (28437, 2023-08-26)
Cargo.toml (272, 2023-08-26)
LICENSE (1072, 2023-08-26)
crates/ (0, 2023-08-26)
crates/ast/ (0, 2023-08-26)
crates/ast/Cargo.toml (173, 2023-08-26)
crates/ast/src/ (0, 2023-08-26)
crates/ast/src/expr.rs (620, 2023-08-26)
crates/ast/src/lib.rs (91, 2023-08-26)
crates/ast/src/stmt.rs (413, 2023-08-26)
crates/ast_interp/ (0, 2023-08-26)
crates/ast_interp/Cargo.toml (327, 2023-08-26)
crates/ast_interp/src/ (0, 2023-08-26)
crates/ast_interp/src/entity.rs (1709, 2023-08-26)
crates/ast_interp/src/lib.rs (4962, 2023-08-26)
crates/ast_interp/src/main.rs (1070, 2023-08-26)
crates/ast_interp/src/snapshots/ (0, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__i32_lit.snap (115, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__i32_lit_plus_i32_lit.snap (115, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__i32_lit_plus_str_lit.snap (159, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__str_lit.snap (117, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__str_lit_plus_i32_lit.snap (159, 2023-08-26)
crates/ast_interp/src/snapshots/mylang_ast_interp__tests__str_lit_plus_str_lit.snap (159, 2023-08-26)
crates/bytecode/ (0, 2023-08-26)
crates/bytecode/Cargo.toml (141, 2023-08-26)
crates/bytecode/src/ (0, 2023-08-26)
... ...
# mylang
[![CI](https://github.com/0918nobita/mylang/actions/workflows/check.yml/badge.svg)](https://github.com/0918nobita/mylang/actions/workflows/check.yml)
趣味で少しずつ作っている自作プログラミング言語処理系です。
## ワークスペースについて
### バイナリ
- [レキサ](./crates/lexer): ソースコードをトークン列に変換する
- [パーサ](./crates/parser): トークン列を AST に変換する
- [抽象構文木インタプリタ](./crates/ast_interp): AST を解釈実行する
- [バイトコードコンパイラ](./crates/bytecode_compiler): AST をバイトコードに変換する
- [仮想マシン](./crates/vm): バイトコードを実行する
- [言語サーバ](./crates/lsp_server)
### ライブラリ
- [トークン](./crates/token)
- [抽象構文木](./crates/ast)
- [バイトコード](./crates/bytecode)
- [CLI 実装支援ライブラリ](./crates/cli_ext)
## サンプルコードの実行方法
### AST を解釈実行する場合
```bash
cd examples
cargo run --bin mylang_lexer -- -o hello.tok.json hello.mylang
cargo run --bin mylang_parser -- -o hello.ast.json hello.tok.json
cargo run --bin mylang_ast_interp -- hello.ast.json
```
### AST をバイトコードに変換してから VM で実行する場合
```bash
cd examples
./hello
```
近期下载者:
相关文件:
收藏者: