[aspectc-user] Modifying C++ code?

Olaf Spinczyk os at aspectc.org
Wed Oct 22 17:32:10 CEST 2008


Hi,

translate the Puma example "ccparser". It can be used to print the
syntax tree and semantic information of your C++ code. Start with a very
simple function that uses the ? operator. It will tell you what you
looking for. The classes that are used for the construction of syntax
trees can be found in CTree.h. The classes that are used to store the
results of the semantic analysis are located in Puma/src/infos. There is
also a description some classes in Puma/doc/UsersManual.

An example on how to find function calls can be found in the AspectC++
implementation (TrackerDog.h + .cc).

Best regards,

Olaf

Gordon Schumacher wrote:
> Olaf Spinczyk wrote:
>   
>> The ability to manipulat the source code is completely independent of
>> the MatchCollector class. I would recommend to check out the latest
>> Puma version from our subversion repository. Then have a look into
>> Puma/examples/sync. This example is well-commented and demonstrates
>> how to implement a new C++ keyword with Puma. The resulting demo tool
>> accepts 'synchronized' as a keyword and transforms the input files in
>> order to implement thread synchronization by means of the pthread
>> library.
>>     
>
> I'd been looking at that at some point and had lost track of it
> somewhere along the way :)
> On further investigation, yes, this is very close to what I need.
>
> Is there somewhere that you can point me (perhaps in the AspectC++
> code?) as an example of walking the syntactic tree?  Particularly what I
> need to do is search for operators (the ternary ? in specific), and then
> identify the expressions that are associated to them.
>
>   





More information about the aspectc-user mailing list