[aspectc-user] unknown error?

Jamal Siadat siadat at cpsc.ucalgary.ca
Thu Jun 30 08:52:21 CEST 2005


Hi,
I tried making up this silly example just to address an issue that I had
with the Ac++ project that I've been working on but I keep getting an
error that I'm not sure how to deal with.

I have two classes A and B.

#ifndef __A_H_
#define __A_H_
class A {
 public:
  int j;
  int a(const char *name, float b);
 private:
  int p;
};
#endif


#ifndef __B_H_
#define __B_H_
#include "A.h"
class B {
 public:
  int j;
  int a(const char *name, float b);
 private:
  int p;
};
#endif


as you can see A is included in B. I have devised an aspect to add a
member of type B to A.

#ifndef __asp_ah__
#define __asp_ah__
#include <iostream.h>
#include "B.h"
using namespace std;
//int jeee ( int r, int y){ int e = r+y; return e;}

aspect asp  {
pointcut calls()=  "A" ;
advice calls() : B Z;

};

#endif

But unfortunatly I keep getting : asp.ah:10: error: invalid member
declaration near token `Z'. I just want to add B to it. I have tried
making Z a pointer as well but I still keep getting: asp.ah:10: error:
invalid member declaration near token `*'. Is there anyway to solve this
issue? I know this is just a toy example but it will really help.

Thanks in advance,






More information about the aspectc-user mailing list