Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gllghr/HappyAlexExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

A very simple example of using the Haskell parser and lexer generators Happy and Alex. This uses the Alex monad along with Happy to get a continuation-based parser and lexer. It took me quite a while to figure out how to get it right, maybe this will help save someone else a little time. 

To compile:

alex Lexer.x
happy Parser.y

and then load Parser.hs in GHCi, and

*Parser> parse "[asdf dd [a [ddd vvv aaa] asdf]]"
Right (Brack (S "asdf") (S "dd") (Brack (S "a") (Brack (S "ddd") (S "vvv") (S "aaa")) (S "asdf")))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published