[aspectc-user] Aspects for statements

Olaf Spinczyk os at aspectc.org
Wed Aug 24 14:11:28 CEST 2011


Hi Melanie!

AspectC++ does not have a language feature that allows you modify the 
control flow at *any* statement. We are currently experimenting with 
annotations on statement level, but this is probably not what you want. 
All statements would have to be tagged.

An alternative might be a custom code transformation based on our Puma 
framework. The Puma source code is part of the AspectC++ source code 
tarball. If you are familiar with C++, I think you could build a simple 
code transformation like the one you described with Puma in a few days.

Best regards,

Olaf


On 08/24/2011 10:31 AM, Melanie Diepenbeck wrote:
> Hi,
>
> I'm new to AspectC++ and I'm trying to  create pointcuts for statements.
> A very simple case would look like this:
>
> int main () {
>    int x = 10;
>    int y = 20;
>
>    while (x != y) {
>      if (x<  y) {
>        x++;
>      } else {
>        y--;
>      }
>    }
>    cout<<  "X is "<<  x<<  " and Y is "<<  y<<  endl;
>
>    return 0;
> }
>
> For every statement I would like to add some maintenance information by means
> of AspectC++, e.g. how often a line (x++; y--) is being executing, or some
> printout of the current status.
>
> Is there some way I can create an advice that describes any statement (or a
> specific one?) in a program?
>
> Thank in advance.
>
> Best regards,
>
> Melanie
> _______________________________________________
> 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