Chris Jones wrote:
Forwarding this conversation to m.d.static-analysis.


Chris Jones wrote:
 > Unfortunately, no.  Porky.py operates on a representation of C++
 > programs that lacks information about include guards (and most other
 > preprocessor stuff).

Would you like to complete the support for preprocessor directives?


No, not really. Porky.py has a relatively small DSL designed for rewriting C++ expressions; it's a major scope creep to include preprocessor directives there.

However, you might find support for adding the ability to rewrite preprocessor directives to pork (the tool porky.py is built on). Off the top of my head, I don't know what this would entail, but others that read this newsgroup would know.


 > But it seems to me that include guards could be rewritten with a much
 > simpler tool, like sed.  Have you given that a try?

The stream editor is not appropriate because I need to extract text positions together with the found symbols. I have got the impression that the application of regular expressions is also potentially unsafe.

How do you think about a cooperation with the Wave class library?
http://www.boost.org/doc/libs/1_40_0/libs/wave/doc/preface.html
http://www.boost.org/doc/libs/1_40_0/libs/python/doc/index.html


I'm not really sure what your use case is. If it's just renaming a known set of include guards, I'd still give sed a shot (perhaps wrapped in a higher-level script that generates sed rewrite expressions based on filename).

Cheers,
Chris

 >> SF Markus Elfring wrote:
 >> Hello!
 >>
 >> I have read the article
>> "http://blog.mozilla.com/cjones/2009/08/04/introducing-porky-py-low-fat-pork/";.
 >> Now I am interested if the tool supports a specific maintenance task
 >> for C++ source files.
 >>
 >> I would like to rename include guards. Can preprocessor symbols be
 >> automatically adjusted?
 >>
 >> Regards,
 >> Markus
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis

Reply via email to