[aspectc-user] Puma.

Matthias Urban matthias.urban at pure-systems.com
Mon Oct 23 22:47:08 CEST 2006

Hi Robert,

> I know some of these questions have come up recently, but I'd really like to 
> know what the status of libpuma is.

It's still in development. There are some bugs to fix, some missing 
semantic analyses, some features to implement. And of course a lot to 

> While aspectc++ seems to be the 'product', libpuma itself is of far more use 
> to me personally, and it seems rather neglected. I've been trying to piece 
> together how things work with a combination of the sparse doxygen docs and a 
> paper from 2001, since when the API seems to have changed greatly.

That's true, especially the semantic objects have changed a lot.

> While of course I could delve into the source to see how things are done, 
> that's made more difficult by the fact that it's partially written in a 
> strange metalanguage.

Do you mean .lem and .ora files?? .lem files are grammar files for the 
parser generator Lemon. .ora files are token description files for the 
scanner generator Orange. The syntax of these files is quite equal to 
the syntax lex and bison expect.

> The sort of thing I'm trying to figure out at the moment is how to get a 
> classdb for a whole project or set of files, now that 
> CClassDatabase::Expand() has been abolished.

Well, the class database is now a member of the translation unit object 
created for a parsed file. And it is destroyed automatically when the 
translation unit object is destroyed. What you can do is to write your 
own meta class database (Puma does not yet have one) that collects the 
information from all the class databases of the translation units you 
have parsed. Sorry, but this has changed quite a lot.

> So, what I'm asking is whether libpuma is going to remain a kind of internal 
> utility library for aspectc++ or whether it's going to become more accessible 
> & useful for outside projects. Because it seems a bit of a shame at the 
> moment as it looks incredibly useful and competent.

There are already some other projects using Puma to analyse and 
transform C/C++ source code. It's not intended to be used only by the 
AspectC++ compiler. Btw, we are currently preparing a direct access to 
the development tree of Puma, so people will be able to download a 
recent version of Puma.

> p.s. (don't you hate it when people stick on unrelated p.s.'s?) To be able to 
> compile against libpuma, I had to modify the headers to prove empty functions 
> ( '{}' ) for the virtuals Unit::~Unit(), Unit::name() and Unit::print(). 
> Otherwise it wouldn't link. Is this normal?

No, this is definitely not normal. These three methods are defined in 
Unit.cc, so you should not need to provide own implementations. Can you 
compile and link the example applications in the Puma/examples directory?

Best regards,

More information about the aspectc-user mailing list