Skip to content

This is a simple LL(1) grammar tokenizer & parser written in Go.

License

Notifications You must be signed in to change notification settings

MassiGy/LL1p.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ll1p.go

This is a simple LL(1) grammar tokenizer & parser written in Go. LL(1) stands for:

  • Left to right tokenization.
  • Leftmost 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