An efficient context-free parsing algorithm
Communications of the ACM
The predictive analyzer and a path elimination technique
Communications of the ACM
POPL '73 Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems
Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems
Packrat parsing:: simple, powerful, lazy, linear time, functional pearl
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
ESOP '09 Proceedings of the 18th European Symposium on Programming Languages and Systems: Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009
Formal verification of a realistic compiler
Communications of the ACM - Barbara Liskov: ACM's A.M. Turing Award Winner
Modular and efficient top-down parsing for ambiguous left-recursive grammars
IWPT '07 Proceedings of the 10th International Conference on Parsing Technologies
Parser combinators for ambiguous left-recursive grammars
PADL'08 Proceedings of the 10th international conference on Practical aspects of declarative languages
Proceedings of the 15th ACM SIGPLAN international conference on Functional programming
Lazy combinators for executable specifications of general attribute grammars
PADL'10 Proceedings of the 12th international conference on Practical Aspects of Declarative Languages
TRX: a formally verified parser interpreter
ESOP'10 Proceedings of the 19th European conference on Programming Languages and Systems
Left recursion in parsing expression grammars
SBLP'12 Proceedings of the 16th Brazilian conference on Programming Languages
CakeML: a verified implementation of ML
Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
A mechanisation of some context-free language theory in HOL4
Journal of Computer and System Sciences
Hi-index | 0.00 |
Parsers for context-free grammars can be implemented directly and naturally in a functional style known as “combinator parsing”, using recursion following the structure of the grammar rules. However, naive implementations fail to terminate on left-recursive grammars, and despite extensive research the only complete parsers for general context-free grammars are constructed using other techniques such as Earley parsing. Our main contribution is to show how to construct simple, sound and complete parser implementations directly from grammar specifications, for all context-free grammars, based on combinator parsing. We then construct a generic parser generator and show that generated parsers are sound and complete. The formal proofs are mechanized using the HOL4 theorem prover. Memoized parsers based on our approach are polynomial-time in the size of the input. Preliminary real-world performance testing on highly ambiguous grammars indicates our parsers are faster than those generated by the popular Happy parser generator.