Thank you very much. This is really excellent work, and for us it is
really useful. We are making an open source BSD license style tool
called ROSE for easily building C/C++ translators which takes the
source code as input and outputs source code. Our tool understand the
C/C++ syntax, unlike normal compilers it can understand the syntax of a
library and you can easily work within the AST to analyze and change
the AST. The aim of the tool is scientific computing and especially
optimization of code which uses high level abstractions, but the tool
is general and can be applied to a lot of software engineering
problems.
Since our intermediate representation is an AST and our frontend is a
compiler frontend we lost some information about the part of the
preprocessor directives which is evaluated as negative, we had
knowledge about the macro declarations but no knowledge about the
macros calls and also no simple solution to some details about how many
digits the floating point values is declared with in the code (we
handle the floating point value as value not string, but now we will
probably have both). It seems like we are now able to extract this
information using Wave and that is excellent, but we are yet to hook it
up to our tool. So expect us to use Wave on some of the most advanced
C/C++ codes out there. :)
Thanks
Andreas
Andreas Sæbjørnsen wrote:
> The hooks you are proposing satisfies my needs very well and
> appreciate that you add these hooks to Wave as it makes and
> will make my life a lot easier. I agree to your point on the
> comments and can build the rest I need on top of Wave. When
> and how should I expect to be able to test a new Wave version
> with these hooks?
I added the discussed preprocessing hooks to the Wave library (see the Boost
CVS::HEAD). Additionally I added a new sample application demonstrating the
new hooks (it's called advanced_hooks). This sample outputs not only the
preprocessed tokens, but additionally any conditional directive found and
the complete non-expanded source code from false conditional blocks. I.e.
for the following snippet
#define TEST 1
#if defined(TEST)
"TEST was defined: " TEST
#else
"TEST was not defined!"
#endif
the generated output looks like:
//"#if defined(TEST)
"TEST was defined: " 1
//"#else
//"TEST was not defined!"
//"#endif
HTH
Regards Hartmut
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users