
Clément Vasseur.
C++ disambiguation in Transformers.
CSI Seminar May 2003
C++ parsing is the most critical part of the Transformers project, which should allow us to perform various program transformations on C++ source code. The C++ grammar is well known to be very ambiguous and difficult to parse. More precisely, it is impossible to correctly parse C++ without semantic informations, such as type-name symbol tables. Our approach uses the sglr technology : instead of building a parse tree, we have a parse forest with each possible parse tree, and we must eliminate the wrong ones. This is the "disambiguation" process. Using the Stratego language, we need to gather various semantic informations from the parse forest, to be able to cut the wrong trees, because at the end we need only one tree. This part is quite complicated because C++ allows a lot of non-trivial programming constructs, like templates.
In this presentation, we will see how the Transformers project allow us to perform transformations on C++ source code, and we will focus on the disambiguation problem.
to top