Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/massigy/ll1p.go
This is a simple LL(1) grammar tokenizer & parser written in Go.
https://github.com/massigy/ll1p.go
go-programming-language golang grammar-parser language-theory ll1-grammar ll1-parser parser regular-expression tokenizer
Last synced: 3 days ago
JSON representation
This is a simple LL(1) grammar tokenizer & parser written in Go.
- Host: GitHub
- URL: https://github.com/massigy/ll1p.go
- Owner: MassiGy
- License: other
- Created: 2024-07-20T13:39:01.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-07-20T13:49:47.000Z (7 months ago)
- Last Synced: 2024-07-20T15:01:55.206Z (7 months ago)
- Topics: go-programming-language, golang, grammar-parser, language-theory, ll1-grammar, ll1-parser, parser, regular-expression, tokenizer
- Language: Go
- Homepage:
- Size: 111 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ll1p.go
This is a simple LL(1) grammar tokenizer & parser written in Go.
LL(1) stands for:
- **L**eft to right tokenization.
- **L**eftmost token is a terminal token.
- Only **1** peek ahead is necessary for the parsing.For this project, the grammar/language is simple. It is basically a language that supports pairs with parentheses.
Our grammar is :
> Node -> Char | Pair> Char -> [a-z]
> Pair -> ( . Node . Space . Node . )
Legend :
> '.' (dot) is the concatination operator.## Demo
![demo.png](demo.png)