Exception handling for error reporting in parsing expression grammars

6Citations
Citations of this article
15Readers
Mendeley users who have this article in their library.
Get full text

Abstract

Parsing Expression Grammars (PEGs) are a new formalism to describe a top-down parser of a language. However, error handling techniques that are often applied to top-down parsers are not directly applicable to PEGs. This problem is usually solved in PEGs using a heuristic that helps to simulate the error reporting technique from top-down parsers, but the error messages are generic. We propose the introduction of labeled failures to PEGs for error reporting, as labels help to produce more meaningful error messages. The labeled failures approach is close to that of generating and handling exceptions often used in programming languages, being useful to annotate and label grammar pieces that should not fail. Moreover, our approach is an extension to the PEGs formalism that is expressive enough to implement some previous work on parser combinators. Finally, labeled failures are also useful to compose grammars preserving the error messages of each separate grammar. © 2013 Springer-Verlag.

Cite

CITATION STYLE

APA

Maidl, A. M., Mascarenhas, F., & Ierusalimschy, R. (2013). Exception handling for error reporting in parsing expression grammars. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 8129 LNCS, pp. 1–15). Springer Verlag. https://doi.org/10.1007/978-3-642-40922-6_1

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free