Ambiguity detection: scaling to scannerless

  • Authors:
  • Hendrikus J. S. Basten;Paul Klint;Jurgen J. Vinju

  • Affiliations:
  • Centrum Wiskunde & Informatica, Amsterdam, The Netherlands;Centrum Wiskunde & Informatica, Amsterdam, The Netherlands;Centrum Wiskunde & Informatica, Amsterdam, The Netherlands

  • Venue:
  • SLE'11 Proceedings of the 4th international conference on Software Language Engineering
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Static ambiguity detection would be an important aspect of language workbenches for textual software languages. However, the challenge is that automatic ambiguity detection in context-free grammars is undecidable in general. Sophisticated approximations and optimizations do exist, but these do not scale to grammars for so-called "scannerless parsers", as of yet. We extend previous work on ambiguity detection for context-free grammars to cover disambiguation techniques that are typical for scannerless parsing, such as longest match and reserved keywords. This paper contributes a new algorithm for ambiguity detection in character-level grammars, a prototype implementation of this algorithm and validation on several real grammars. The total run-time of ambiguity detection for character-level grammars for languages such as C and Java is significantly reduced, without loss of precision. The result is that efficient ambiguity detection in realistic grammars is possible and may therefore become a tool in language workbenches.