Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ygg-lang/yggdrasil.rs
yggdrasil compiler with rust runtime
https://github.com/ygg-lang/yggdrasil.rs
codegen compiler highlighter interpreter lexer parser parser-combinators parser-generator peg
Last synced: 3 months ago
JSON representation
yggdrasil compiler with rust runtime
- Host: GitHub
- URL: https://github.com/ygg-lang/yggdrasil.rs
- Owner: ygg-lang
- License: mpl-2.0
- Created: 2021-10-04T13:37:27.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T16:40:09.000Z (7 months ago)
- Last Synced: 2024-05-29T02:16:21.630Z (5 months ago)
- Topics: codegen, compiler, highlighter, interpreter, lexer, parser, parser-combinators, parser-generator, peg
- Language: Rust
- Homepage: https://docs.rs/yggdrasil-rt/latest/yggdrasil_rt/
- Size: 2.63 MB
- Stars: 21
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
README
# Yggdrasil Generative Grammar
## Features
## Language Tutorial
- basic syntax
| Name | Description |
|:----------:|------------------------------|
| `a?` | Optional element |
| `a*` | Zero or more elements |
| `a+` | One or more elements |
| `a b` | Sequence of elements |
| `a \| b` | Alternative of branch |
| `name:e` | Mark element with given name |
| `#Name` | Mark branch with given name |
| `^rule` | Remark element |
| `@macro()` | Macro call |
| `ANY` | Any unicode characters |
| `IGNORED` | All rules marked as ignored |- `class` vs `union`
The same syntax `A | B` performs differently in `class` and `union` context.
```yggdrasil
// expand `A | B` as class
class TestA {
| tag_a:A
| tag_b:B
}
// expand `A | B` as union
union TestB {
| A #BranchA
| B #BranchB
}
``````rust
struct TestA {
tag_a: A,
tag_b: B,
}enum TestB {
BranchA(A),
BranchB(B),
}
```- examples
You can learn more from [project-yggdrasil](https://github.com/ygg-lang/project-yggdrasil/tree/master/languages).
## Tools
- [JetBrains Support](https://plugins.jetbrains.com/plugin/20594-yggdrasil-support)