Advanced

Natural and flexible error recovery for generated parsers

de Jonge, Maartje; Söderberg, Emma LU ; Kats, Lennart C. L. and Visser, Eelco (2009) International Conference on Software Language Engineering, 2009
Abstract
Parser generators are an indispensable tool for rapid language devel-

opment. However, they often fall short of the finesse of a hand-crafted parser, built

with the language semantics in mind. One area where generated parsers have pro-

vided unsatisfactory results is that of error recovery. Good error recovery is both

natural, giving recovery suggestions in line with the intention of the programmer;

and flexible, allowing it to be adapted according to language insights and lan-

guage changes. This paper describes a novel approach to error recovery, taking

into account not only the context-free grammar, but also indentation usage. We

base our approach on an extension of... (More)
Parser generators are an indispensable tool for rapid language devel-

opment. However, they often fall short of the finesse of a hand-crafted parser, built

with the language semantics in mind. One area where generated parsers have pro-

vided unsatisfactory results is that of error recovery. Good error recovery is both

natural, giving recovery suggestions in line with the intention of the programmer;

and flexible, allowing it to be adapted according to language insights and lan-

guage changes. This paper describes a novel approach to error recovery, taking

into account not only the context-free grammar, but also indentation usage. We

base our approach on an extension of the SGLR parser that supports fine-grained

error recovery rules and can be used to parse complex, composed languages. We

take a divide-and-conquer approach to error recovery: using indentation, erro-

neous regions of code are identified. These regions constrain the search space

for applying recovery rules, improving performance and ensuring recovery sug-

gestions local to the error. As a last resort, erroneous regions can be discarded.

Our approach also integrates bridge parsing to provide more accurate suggestions

for indentation-sensitive language constructs such as scopes. We evaluate our ap-

proach by comparison with the JDT Java parser used in Eclipse. (Less)
Please use this url to cite or link to this publication:
author
organization
publishing date
type
Contribution to conference
publication status
in press
subject
conference name
International Conference on Software Language Engineering, 2009
language
English
LU publication?
yes
id
e9290156-9092-491f-ba17-767e5b90ca11 (old id 1468465)
date added to LUP
2009-08-31 14:20:32
date last changed
2016-04-16 11:14:19
@misc{e9290156-9092-491f-ba17-767e5b90ca11,
  abstract     = {Parser generators are an indispensable tool for rapid language devel-<br/><br>
opment. However, they often fall short of the finesse of a hand-crafted parser, built<br/><br>
with the language semantics in mind. One area where generated parsers have pro-<br/><br>
vided unsatisfactory results is that of error recovery. Good error recovery is both<br/><br>
natural, giving recovery suggestions in line with the intention of the programmer;<br/><br>
and flexible, allowing it to be adapted according to language insights and lan-<br/><br>
guage changes. This paper describes a novel approach to error recovery, taking<br/><br>
into account not only the context-free grammar, but also indentation usage. We<br/><br>
base our approach on an extension of the SGLR parser that supports fine-grained<br/><br>
error recovery rules and can be used to parse complex, composed languages. We<br/><br>
take a divide-and-conquer approach to error recovery: using indentation, erro-<br/><br>
neous regions of code are identified. These regions constrain the search space<br/><br>
for applying recovery rules, improving performance and ensuring recovery sug-<br/><br>
gestions local to the error. As a last resort, erroneous regions can be discarded.<br/><br>
Our approach also integrates bridge parsing to provide more accurate suggestions<br/><br>
for indentation-sensitive language constructs such as scopes. We evaluate our ap-<br/><br>
proach by comparison with the JDT Java parser used in Eclipse.},
  author       = {de Jonge, Maartje and Söderberg, Emma and Kats, Lennart C. L. and Visser, Eelco},
  language     = {eng},
  title        = {Natural and flexible error recovery for generated parsers},
  year         = {2009},
}