This project is no longer being worked on at LRDE.
Thanks to the keyword
, and almost by accident, C++ is a very special language where one can not only specify what a program will do once compiled, but in addition one can specify how the compiler
will compile a program. This feature gave birth to powerful programming techniques, commonly referred to as ``metaprogramming''. Because of its committment in the Olena
projects, the LRDE has developped expertize in metaprogramming. Unfortunately the implementation is tricky and very error-prone.
Starting from the simple idea that ``we want metaprogramming efficiency, but we don't want to write it'', the Transformers
project was initiated. It aims at converting naive (but decent) C++ programming into high-speed (but indecent) C++ source code. To this end, several tasks must be addressed: basically the Transformers
project aims at designing a set of tools to manipulate C++ programs.
we use to build those tools comes mainly from XT
Its main goal is to ease the use of static C++ programming patterns, such as the ones which are currently in use in Olena
by letting the programmer use classical (human readable) C++ code and transform it into efficient generic code.
There are several steps to go before we have a usable tool.
project focuses on standard compliance and uses an extensible front-end which is divided in two main processes:
Using the C99 (ISO/IEC 9899) or C++03 (ISO/IEC 14882-2003) standard, Transformers
aims to parse any C or C++ source file. It is designed to allow grammar extensions (see Class Namespaces
extension) and easy transformations. Since these grammars are ambiguous, a generalized parser (SGLR
) is used to produce a parse forest from the input source file, which must be disambiguated afterwards.
In order to disambiguate the parse forest, Transformers
uses the attribute grammar formalism. Since the disambiguation should not be separated from the grammar, a tool was written to add attributes in the SDF grammar, using Statego code. An evaluator will then propagate contextual information and eventually identify invalid trees in the parse forest.
For more information, see CTransformers
- Type checker.
- AST manipulation framework.
You can subscribe to the Transformers
mailing lists on the following pages: