Skip to content

JonathanWoollett-Light/linked-syntax-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linked-syntax-tree

Crates.io docs

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.

About

A doubly-linked syntax tree.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages