Back to Search
Start Over
Error reporting in Parsing Expression Grammars
- Source :
- Repositório Institucional da UFRN, Universidade Federal do Rio Grande do Norte (UFRN), instacron:UFRN
- Publication Year :
- 2016
- Publisher :
- Elsevier BV, 2016.
-
Abstract
- Parsing Expression Grammars (PEGs) describe top-down parsers. Unfortunately, the error-reporting techniques used in conventional top-down parsers do not directly apply to parsers based on Parsing Expression Grammars (PEGs), so they have to be somehow simulated. While the PEG formalism has no account of semantic actions, actual PEG implementations add them, and we show how to simulate an error-reporting heuristic through these semantic actions. We also propose a complementary error reporting strategy that may lead to better error messages: labeled failures. This approach is inspired by exception handling of programming languages, and lets a PEG define different kinds of failure, with each ordered choice operator specifying which kinds it catches. Labeled failures give a way to annotate grammars for better error reporting, to express some of the error reporting strategies used by deterministic parser combinators, and to encode predictive top-down parsing in a PEG.<br />Comment: Preprint (plus appendix) submitted to Science of Computer Programming
- Subjects :
- FOS: Computer and information sciences
Formal Languages and Automata Theory (cs.FL)
Computer science
Computer Science - Formal Languages and Automata Theory
02 engineering and technology
Top-down parsing
computer.software_genre
Parser combinators
Parser combinator
0202 electrical engineering, electronic engineering, information engineering
Parsing
Error reporting
Computer Science - Programming Languages
business.industry
020207 software engineering
Parsing expression grammar
TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES
Packrat parsing
020201 artificial intelligence & image processing
S-attributed grammar
Top-down parsing language
Parsing expression grammars
Artificial intelligence
L-attributed grammar
business
computer
Software
Natural language processing
Programming Languages (cs.PL)
Bottom-up parsing
Subjects
Details
- ISSN :
- 01676423
- Volume :
- 132
- Database :
- OpenAIRE
- Journal :
- Science of Computer Programming
- Accession number :
- edsair.doi.dedup.....b72fc37bf593c851814c66dfe66a2171
- Full Text :
- https://doi.org/10.1016/j.scico.2016.08.004