Re:What the heck is a parser-combinator?
by userbinator on Wednesday June 21, 2017 @06:47AM
(#14602582)
It sounds vaguely like refactoring a recursive-descent parser.
[ Parent
| on HN ]
Re:What the heck is a parser-combinator?
by WorldMaker on Wednesday June 21, 2017 @11:49AM
(#14604810)
It can certainly help to look at a parser-combinatory as a more rigorous, less artisanal/home-cooked recursive-descent parser. Good parser-combinators offer a lot more than just recursive-descent ways of looking at the parsing world, but if you are familiar with how you might do things in a recursive-descent way I think that familiarity can help in learning a parser-combinatory library.
For similar reasons, too, I think PEG-style grammars are more often conceptually closer than BNF grammars for early learning/thinking in parser-combinators. But again a good parser-combinator library will have power beyond what you might consider the possibility space afforded by just PEG-style grammars, especially as you start to get into higher order combinators.
What's an example of something that can be recognized with parser combinator but not PEGs?
Do parser combinators have the notion of arbitrary lookahead or backtracking?