3 ms·
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 l
by WorldMaker 9y ago
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.
- chubot 9y agoWhat'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?
- louthy 9y agoParser combinators can do look-ahead and backtracking, yes. You definitely pay for it in efficiency however (especially look-ahead).