Hostname: page-component-7479d7b7d-pfhbr Total loading time: 0 Render date: 2024-07-13T19:44:51.697Z Has data issue: false hasContentIssue false

Predictive parser combinators need four values to report errors

Published online by Cambridge University Press:  07 November 2008

Andrew Partridge
Affiliation:
Department of Computer Science, University of TasmaniaGPO Box 252C, Hobart, Tasmania 7001, Australia (e-mail: {A.S.Partridge, D.A.Wright}@cs.utas.edu.au)
David Wright
Affiliation:
Department of Computer Science, University of TasmaniaGPO Box 252C, Hobart, Tasmania 7001, Australia (e-mail: {A.S.Partridge, D.A.Wright}@cs.utas.edu.au)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

A combinator-based parser is a parser constructed directly from a BNF grammar, using higher-order functions (combinators) to model the alternative and sequencing operations of BNF. This paper describes a method for constructing parser combinators that can be used to build efficient predictive parsers which accurately report the cause of parsing errors. The method uses parsers that return values (parse trees or error indications) decorated with one of four tags.

Type
Articles
Copyright
Copyright © Cambridge University Press 1996

References

Aho, A. V., Sethi, R. and Ullman, J. D. (1986) Compilers: Principles, Techniques, and Tools. Addison-Wesley.Google Scholar
Appel, A. W. (1992) Compiling with continuations. Cambridge University Press.Google Scholar
Fokker, J. (1995) Functional Parsers. In Advanced Functional Programming: Lecture Notes in Computer Science, 925, Jeuring, J. and Meijer, E. (editors). Springer-Verlag.Google Scholar
Hutton, G. (1992) Higher-order functions for parsing. Journal of Functional Programming, 2(3): 323343.CrossRefGoogle Scholar
Jones, M. (1994) Gofer 2.30 release notes, http://www.cs.nott.ac.uk:80/Department/Staff/mpj/.Google Scholar
Lewis, P. M. II and Stearns, R. E. (1968) Syntax-directed transduction. J. ACM, 15(3): 465488.CrossRefGoogle Scholar
Wadler, P. (1985) How to Replace Failure by a List of Successes. Functional Programming Languages and Computer Architecture: Lecture Notes in Computer Science, 201, pp. 113128. Springer-Verlag.CrossRefGoogle Scholar
Wadler, P. (1990) Comprehending Monads. In Proceedings of the 1990 ACM Conference on LISP and Functional Programming, pp. 6178. ACM.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.