Title
Exception Handling For Error Reporting In Parsing Expression Grammars
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.
Year
DOI
Venue
2013
10.1007/978-3-642-40922-6_1
PROGRAMMING LANGUAGES, SBLP 2013
Keywords
Field
DocType
parsing, error reporting, parsing expression grammars, packrat parsing, parser combinators
Rule-based machine translation,Heuristic,Programming language,Computer science,Exception handling,Grammar,Parsing expression grammar,Artificial intelligence,Natural language processing,Parsing,Parser combinator,Formalism (philosophy)
Conference
Volume
ISSN
Citations 
8129
0302-9743
3
PageRank 
References 
Authors
0.41
8
3
Name
Order
Citations
PageRank
André Murbach Maidl1173.10
Fabio Mascarenhas2285.29
Roberto Ierusalimschy346354.25