[aspectc-user] More Fun with TAO

Andreas Gal gal at uci.edu
Thu Aug 7 21:49:28 CEST 2003


Hi Gary,

"advice" is a keyword for the parser and thus cannot be used for 
member/variable names. We tried to introduce as few keywords as possible 
(advice, aspect, pointcut) to reduce collisions with legacy code. Pointcut 
functions (base, derived, cflow, ...) are for example _not_ keywords. To 
allow advice/aspect/pointcut in member/variable names we would have to 
relax the AspectC++ grammar, which would make parsing even more of a 
headache then it already is. For the time being you could use

#define advice _advice
...
#undef

around the offending function. As far as I can see, the only feasible way 
to cope with this problem without changing the problematic source code is 
to introduce a command line switch that prefixes all builtin AC++ 
keywords with some prefix. For example, instead of "advice" "__advice" 
would be expected for advice declarations. GCC does some similar hacks 
(inline, _inline, __inline) to solve exactly the same problem. This is 
really an ugly kludge, maybe Matthias has a better idea.

Andreas

> ===========================================================================
>   static int madvise (caddr_t addr,
>                       size_t len,
>                       int advice);
> ===========================================================================
> 
> Naturally, ac++ is complaining that "advice" is not valid in the middle
> of a member declaration. I can see this issue coming up elsewhere, as
> well. Any chance that ac++ will be able to deal with this sort of thing?
> 
>    Thanks.
> 
> 					Gary Duzan
> 					BBN Technologies
> 					A Verizon Company
> 
> 
> p.s. In case anyone is wondering, I'm exploring the possibility of using
>      AspectJ and AspectC++ as back-ends to QuO ( http://www.quality-objects.com/ )
>      as an alternative to the delegate classes we emit now, which must be
>      added to the code manually.
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
> 

-- 
Dipl. Inf. Andreas Gal                       Tel: none
School of Information & Computer Science     Fax: (949)-824-4056
University of California, Irvine          Office: CS/E 138
Irvine, CA 92697-3430                      Email: gal at uci.edu




More information about the aspectc-user mailing list