2 ms·
When I lookup "ghc parser" I get this page [0] that says the GHC parser is built from Happy [1], a Yacc-like parser generator. Grammar is here [2]. Could you l
by eatonphil 5y ago
When I lookup "ghc parser" I get this page [0] that says the GHC parser is built from Happy [1], a Yacc-like parser generator. Grammar is here [2].
Could you link me to where you see GHC's parser using parser combinators?
[0] https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/parser https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compil...
[1] https://www.haskell.org/happy/ https://www.haskell.org/happy/
[2] https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Parser.y https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GH...
- thewakalix 5y agoI was scanning the GHC source by eye, and misunderstood a comment about the "parsing monad". (Alex, the equivalent of lex, uses monads to describe actions, but I thought that monads were the main interface to the lexer.) Thanks for the correction.