What is the advantage of using a parser generator like happy as opposed to using parser combinators?

后端 未结 5 1275
情歌与酒
情歌与酒 2021-01-31 17:44

To learn how to write and parse a context-free grammar I want to choose a tool. For Haskell, there are two big options: Happy, which generates a parser from a grammar descriptio

5条回答
  •  长发绾君心
    2021-01-31 18:23

    This is the traditional decision: do I use lex/yacc (happy) or do I write my own (mostly recursive descent) parser, only that the parsec library is like a DSL for doing it right.

    If one has experience with the yacc/lex approach, using happy will be a smaller learning curve.

提交回复
热议问题