Semantics driven disambiguation
- Renaud Durlin
- Transformers, context-free grammar, attribute grammarStratego, ASF, SDF, disambiguation, parsing, program transformation, term rewriting
An elegant approach to manage ambiguous grammars consists in using a generalized LR parser which will not produce a parse tree but a parse forest. An additional step, called disambiguation, occurring just after the parsing, is then necessary. The disambiguation process consists in analyzing the parse forest to choose the only good parse tree using semantics rules. We use this approach in Transformers with the attribute grammars formalism. The lab work will be a comparison between this formalism and two other methods of disambiguation: the first one using ASF+SDF and the second one using Stratego language. The goal of this comparison will try to emphasize that attribute grammars are perfect to solve the disambiguation problem. Another thing will be to find the weakness of this method compared to the two others for a possible improvement of the system used in Transformers.