Navigation
Synopsis Ambiguity diagnosis suggests changes to syntax definitions to make them non-ambiguous.
Description The Ambiguity library, a.k.a. DrAmbiguity, contains a diagnosis tool that can help you find the causes of ambiguous parse trees and possible Disambiguations to solve them in a SyntaxDefinition. DrAmbiguity is a library that processes any parse forest produced by a parser generated from Rascal's SyntaxDefinitions. Please read Disambiguation first.
Examples
import Ambiguity;
diagnose(t); // for any t of which you know it contains an ambiguity
Benefits
Pitfalls
  • DrAmbiguity does not scale to large parse trees, so please first make your example smaller.
  • DrAmbiguity proposes several Disambiguations for each ambiguity, only few of which make sense from a language design point of view!
  • DrAmbiguity is now only a library function, while it should be integrated into the Rascal IDE
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.