Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)