Packrat parsing:: simple, powerful, lazy, linear time, functional pearl
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
Compiling Mercury to High-Level C Code
CC '02 Proceedings of the 11th International Conference on Compiler Construction
Better extensibility through modular syntax
Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation
Parsing Expression Grammar as a Primitive Recursive-Descent Parser with Backtracking
Fundamenta Informaticae - Special Issue on Concurrency Specification and Programming (CS&P)
Validity of the single processor approach to achieving large scale computing capabilities
AFIPS '67 (Spring) Proceedings of the April 18-20, 1967, spring joint computer conference
Packrat parsers can handle practical grammars in mostly constant space
Proceedings of the 9th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering
Hi-index | 0.00 |
Packrat parsing is a newly popular technique for efficiently implementing recursive descent parsers. Packrat parsing avoids the potential exponential costs of recursive descent parsing with backtracking by ensuring that each production rule in the grammar is tested at most once against each position in the input stream. This paper argues that (a) packrat parsers can be trivially implemented using a combination of definite clause grammar rules and memoing, and that (b) packrat parsing may actually be significantly less efficient than plain recursive descent with backtracking, but (c) memoing the recognizers of just one or two nonterminals, selected in accordance with Amdahl's law, can sometimes yield speedups. We present experimental evidence to support these claims.