Abstract

Parsing Expression Grammars (PEGs) are a formalism for specifying the syntax of programming languages which can be viewed as a description of a recursive descent parser for the language it describes. An issue that users of PEG-based parsers face is poor reporting of syntax errors on the part of PEG-based parsers. Labeled failures are an extension to PEGs that aims to address this issue by annotating a PEG with labels corresponding to syntax errors, improving the quality of error messages generated by a PEG-based parser. An alternative formulation of PEGs gives the meaning of a PEG by translation into a program of a virtual parsing machine. In this paper, we present an updated semantics for PEGs with labeled failures, and we show how to extend the parsing machine to support them. We also prove the correctness of the translation from PEGs with labels to programs of this extended parsing machine, and we evaluate the use of labeled failures on PEG-based parsers which implement their own ad-hoc error reporting strategy.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call