Parse forest diagnostics with dr. ambiguity

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

  • Affiliations:
  • Centrum Wiskunde & Informatica (CWI), Amsterdam, The Netherlands;Centrum Wiskunde & Informatica (CWI), 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

In this paper we propose and evaluate a method for locating causes of ambiguity in context-free grammars by automatic analysis of parse forests. A parse forest is the set of parse trees of an ambiguous sentence. Deducing causes of ambiguity from observing parse forests is hard for grammar engineers because of (a) the size of the parse forests, (b) the complex shape of parse forests, and (c) the diversity of causes of ambiguity. We first analyze the diversity of ambiguities in grammars for programming languages and the diversity of solutions to these ambiguities. Then we introduce Dr. Ambiguity: a parse forest diagnostics tools that explains the causes of ambiguity by analyzing differences between parse trees and proposes solutions. We demonstrate its effectiveness using a small experiment with a grammar for Java 5.