Skip to main content

Lund University Publications

LUND UNIVERSITY LIBRARIES

Natural and flexible error recovery for generated parsers

de Jonge, Maartje ; Söderberg, Emma LU orcid ; Technology, Delft University and Visser, Eelco (2010) International Conference on Software Language Engineering, 2009 In Lecture Notes in Computer Science 5969. p.204-223
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
; ; and
organization
publishing date
type
Chapter in Book/Report/Conference proceeding
publication status
published
subject
host publication
Software Language Engineering : Second International Conference, SLE 2009, Denver, CO, USA, October 5-6, 2009, Revised Selected Papers - Second International Conference, SLE 2009, Denver, CO, USA, October 5-6, 2009, Revised Selected Papers
series title
Lecture Notes in Computer Science
volume
5969
pages
204 - 223
publisher
Springer
conference name
International Conference on Software Language Engineering, 2009
conference location
Denver, Colorado, United States
conference dates
2009-10-05 - 2009-10-06
external identifiers
  • scopus:77951546373
ISSN
1611-3349
0302-9743
ISBN
978-3-642-12106-7
978-3-642-12107-4
DOI
10.1007/978-3-642-12107-4_16
language
English
LU publication?
yes
id
e9290156-9092-491f-ba17-767e5b90ca11 (old id 1468465)
date added to LUP
2016-04-04 13:27:49
date last changed
2024-01-05 07:26:02
@inbook{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 Technology, Delft University and Visser, Eelco}},
  booktitle    = {{Software Language Engineering : Second International Conference, SLE 2009, Denver, CO, USA, October 5-6, 2009, Revised Selected Papers}},
  isbn         = {{978-3-642-12106-7}},
  issn         = {{1611-3349}},
  language     = {{eng}},
  pages        = {{204--223}},
  publisher    = {{Springer}},
  series       = {{Lecture Notes in Computer Science}},
  title        = {{Natural and flexible error recovery for generated parsers}},
  url          = {{http://dx.doi.org/10.1007/978-3-642-12107-4_16}},
  doi          = {{10.1007/978-3-642-12107-4_16}},
  volume       = {{5969}},
  year         = {{2010}},
}