Crates.io | linked-syntax-tree |
lib.rs | linked-syntax-tree |
version | 0.2.0 |
source | src |
created_at | 2023-06-10 23:23:04.53421 |
updated_at | 2023-07-14 23:31:58.09456 |
description | A doubly-linked syntax tree. |
homepage | |
repository | https://github.com/JonathanWoollett-Light/linked-syntax-tree |
max_upload_size | |
id | 887125 |
size | 80,703 |
A doubly-linked syntax tree.
Offers functionality similar to std::collections::LinkedList
.
Some code:
x = -10
loop
x = x + 1
if x
break
x = 2
can be represented as:
┌──────────┐
│x = -10 │
└──────────┘
│
┌──────────┐
│loop │
└──────────┘
│ ╲
┌──────────┐ ┌─────────┐
│x = 2 │ │x = x + 1│
└──────────┘ └─────────┘
│
┌─────────┐
│if x │
└─────────┘
╲
┌─────────┐
│break │
└─────────┘
I personally am using this to contain an AST for compile-time evaluate.