Abstract
Parser combinators are higher-order functions used to build parsers as executable specifications of grammars. Some existing implementations are only able to handle limited ambiguity, some have exponential time and/or space complexity for ambiguous input, most cannot accommodate left-recursive grammars. This paper describes combinators, implemented in Haskell, which overcome all of these limitations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aho, A.V., Ullman, J.D.: The Theory of Parsing, Translation, and Compiling, vol. I: Parsing. Prentice-Hall, Englewood Cliffs (1972)
Burge, W.H.: Recursive Programming Techniques. Addison-Wesley, Reading (1975)
Carroll, J.: Efficiency in large-scale parsing systems – parser comparison (2003), http://informatics.sussex.ac.uk/research/nlp/carroll/elsps.html
Earley, J.: An efficient context-free parsing algorithm. Communications of the ACM 13(2), 94–102 (1970)
Fairburn, J.: Making form follow function: An exercise in functional programming style. Cambridge Comp. Lab. Technical Report No. 89 (1986)
Ford, B.: Packrat parsing: Simple, powerful, lazy, linear time. In: ICFP, pp. 36–47 (2002)
Frost, R.A.: Realization of natural language interfaces using lazy functional programming. ACM Comp. Surv. 38(4) Article 11 (2006)
Frost, R.A.: Using memoization to achieve polynomial complexity of purely functional executable specifications of non-deterministic top-down parsers. SIGPLAN Notices 29(4), 23–30 (1994)
Frost, R.A., Hafiz, R., Callaghan.: Modular and efficient top-down parsing for ambiguous left-recursive grammars. In: Proc. of the Tenth Int. Conf. on Parsing Technologies, pp. 109–120. ACL Press (2007)
Frost, R.A., Hafiz, R.: A new top-down parsing algorithm to accommodate ambiguity and left recursion in polynomial time. SIGPLAN Notices 42(5), 46–54 (2006)
Hutton, G., Meijer, E.: Monadic parser combinators. J. of Functional Programming 8(4), 437–444 (1995)
Johnson, M.: Squibs and discussions: Memoization in top-down parsing. Computational Linguistics 21(3), 405–417 (1995)
Kuno, S.: The augmented predictive analyzer for context-free languages — its relative efficiency. Communications of the ACM 9(11), 810–823 (1966)
Lickman, P.: Parsing With Fixed Points. Master’s Th., Oxford (1995)
Nederhof, M.J., Koster, C.H.A.: Top-down parsing for left-recursive grammars. Technical Report 93–10. Research Institute for Declarative Systems, Department of Informatics, Faculty of Mathematics and Informatics, Katholieke Universiteit, Nijmegen (1993)
Norvig, P.: Techniques for automatic memoization with applications to context-free parsing. Computational Linguistics 17(1), 91–98 (1991)
Shiel, B.A.: Observations on context-free parsing. Technical Reports TR 12–76, Center for Research in Computing Technology, Aiken Computational Laboratory, Harvard University (1976)
Tomita, M.: Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems. Kluwer Academic Publishers, Boston, MA (1986)
Wadler, P.: How to replace failure by a list of successes. In: Jouannaud, J.-P. (ed.) Functional Programming Languages and Computer Architecture. LNCS, vol. 201, pp. 113–128. Springer, Heidelberg (1985)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Frost, R.A., Hafiz, R., Callaghan, P. (2007). Parser Combinators for Ambiguous Left-Recursive Grammars. In: Hudak, P., Warren, D.S. (eds) Practical Aspects of Declarative Languages. PADL 2008. Lecture Notes in Computer Science, vol 4902. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-77442-6_12
Download citation
DOI: https://doi.org/10.1007/978-3-540-77442-6_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-77441-9
Online ISBN: 978-3-540-77442-6
eBook Packages: Computer ScienceComputer Science (R0)