Semantics Driven Disambiguation: A Comparison of Different Approaches

  • Authors:
  • Akim Demaille;Renaud Durlin;Nicolas Pierron;Benoît Sigoure

  • Affiliations:
  • EPITA Research and Development Laboratory (LRDE), 14-16, rue Voltaire - FR-94276 Le Kremlin-Bicêtre Cedex - France;EPITA Research and Development Laboratory (LRDE), 14-16, rue Voltaire - FR-94276 Le Kremlin-Bicêtre Cedex - France;EPITA Research and Development Laboratory (LRDE), 14-16, rue Voltaire - FR-94276 Le Kremlin-Bicêtre Cedex - France;EPITA Research and Development Laboratory (LRDE), 14-16, rue Voltaire - FR-94276 Le Kremlin-Bicêtre Cedex - France

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Context-sensitive languages such as or can be parsed using a context-free but ambiguous grammar, which requires another stage, disambiguation, in order to select the single parse tree that complies with the language's semantical rules. Naturally, large and complex languages induce large and complex disambiguation stages. If, in addition, the parser should be extensible, for instance to enable the embedding of domain specific languages, the disambiguation techniques should feature traditional software-engineering qualities: modularity, extensibility, scalability and expressiveness. We evaluate three approaches to write disambiguation filters for SDF grammars: algebraic equations with ASF, rewrite-rules with programmable traversals for Stratego, and attribute grammars with TAG (TransformersAttribute Grammar), our system. To this end we introduce Phenix, a highly ambiguous language. Its ''standard'' grammar exhibits ambiguities inspired by those found in the and standard grammars. To evaluate modularity, the grammar is layered: it starts with a small core language, and several layers add new features, new production rules, and new ambiguities.