[aspectc-user] libpuma -- docs, mostly
Olaf Spinczyk
Olaf.Spinczyk at informatik.uni-erlangen.de
Sun Nov 12 18:09:57 CET 2006
Hi Adriaan,
just to give you some advice where to look at ...
* from the class database, i.e. objects that represent classes,
functions, attributes, etc. you can find the associated concrete systax
tree with the 'Tree()' method.
* from the syntax tree you can go down to the token level ('token()' and
end_token()' methods.
* each Token object can be checked whether it is generated by macro
expansion ('is_macro_generated()' method).
* the unit to which a macro-generated token belongs is a macro body. You
can find this unit by calling 'belonging_to()' on the Token object. The
unit can now savely be casted into a MacroUnit, which gives you more
information, e.g. about the macro call ("FOO").
With this information it shouldn't be difficult for you to track down
uses of FOO.
If you see a chance to let us participate in your fp6 project or future
f7 projects, let me know ... ;-)
Best regards,
Olaf
Adriaan de Groot wrote:
> Hi,
>
> Recently Robert Scott has been asking questions on this list about Puma; he's
> sort of my "advance man" in this. We're involved in a european fp6 research
> project that needs to analyze C++ source code. KDE source code, obviously
> from my email address :) We need to analyze both pre-processed and raw
> (before the preprocessor runs) code. I'm having a devil of a time tracking
> things down because the header files don't contain much in the way of
> comments and the documentation PDF is from 2001 since when most things have
> changed. I'm going with Puma as contained in the 1.0pre3 tarball of aspectc++
> (which doesn't build as is, but Robert had gone down this road already and
> put up some signposts).
>
> Puma *seems* to be the most interesting candidate library for parsing since it
> claims to be able to handle the preprocessor syntax tree as well (unlike,
> say, Elsa which needs pre-processed source).
>
>
> Suppose I have source code like this:
>
> #define FOO 1
> int i = FOO;
>
> I want to track down uses of FOO. The preprocessor syntax tree won't have the
> int i declaration, while the C++ syntax tree won't have the symbol foo (but
> rather integer symbol 1). How do I do it? [ I can imagine that the answer
> lies at a level below puma, actually: just let lemon chew over it. ]
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
More information about the aspectc-user
mailing list