https://github.com/jonathanwoollett-light/linked-syntax-tree
A doubly-linked syntax tree.
https://github.com/jonathanwoollett-light/linked-syntax-tree
Last synced: 3 months ago
JSON representation
A doubly-linked syntax tree.
- Host: GitHub
- URL: https://github.com/jonathanwoollett-light/linked-syntax-tree
- Owner: JonathanWoollett-Light
- Created: 2023-06-10T23:09:42.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-31T19:26:58.000Z (almost 2 years ago)
- Last Synced: 2025-03-02T01:29:10.609Z (3 months ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# linked-syntax-tree
[](https://crates.io/crates/linked-syntax-tree)
[](https://docs.rs/linked-syntax-tree)A doubly-linked syntax tree.
Offers functionality similar to [`std::collections::LinkedList`](https://doc.rust-lang.org/std/collections/struct.LinkedList.html).
Some code:
```text
x = -10
loop
x = x + 1
if x
break
x = 2
```can be represented as:
```text
┌──────────┐
│x = -10 │
└──────────┘
│
┌──────────┐
│loop │
└──────────┘
│ ╲
┌──────────┐ ┌─────────┐
│x = 2 │ │x = x + 1│
└──────────┘ └─────────┘
│
┌─────────┐
│if x │
└─────────┘
╲
┌─────────┐
│break │
└─────────┘
```I personally am using this to contain an AST for compile-time evaluate.