[aspectc-user] Using puma to print out class member names
Sunder, Shyam (MSTG - NY)
s_sunder at ml.com
Thu Dec 30 15:59:05 CET 2004
Tried that and I get this error:
cparser.cc: In function `void evalOptions(int, char**)':
cparser.cc:52: error: use of `TRACE_SCOPES' is ambiguous
cparser.cc:17: error: first declared as `int TRACE_SCOPES' here
also declared as `int Puma::TRACE_SCOPES' here
cparser.cc: In function `int main(int, char**)':
cparser.cc:82: error: `trace' undeclared (first use this function)
Also, does TARGET=linux-release invoke ac++ or ag++ ?
From: Olaf Spinczyk [mailto:Olaf.Spinczyk at informatik.uni-erlangen.de]
Sent: Thursday, December 30, 2004 9:52 AM
To: Sunder, Shyam (MSTG - NY)
Cc: aspectc-user at aspectc.org
Subject: Re: [aspectc-user] Using puma to print out class member names
you have to compile the examples/ccparser in ac-0.9-Sources-Woven with
"make TARGET=linux-release", because the Puma library was woven and
compiled in the linux-release configuration.
Sunder, Shyam (MSTG - NY) wrote:
> I tried compiling the example under
> ac-0.9-Sources-Woven/Puma/examples/ccparser but it fails because of
> includes in Syntax.h and Parser.h that are used in CCParser.h.
> -----Original Message-----
> From: Olaf Spinczyk [mailto:Olaf.Spinczyk at informatik.uni-erlangen.de]
> Sent: Thursday, December 30, 2004 4:49 AM
> To: Sunder, Shyam (MSTG - NY)
> Cc: aspectc-user at aspectc.org
> Subject: Re: [aspectc-user] Using puma to print out class member names
> Sunder, Shyam (MSTG - NY) wrote:
>>I am not sure if this is the right mailing list for asking questions
>>about the Puma parser. I'm going to try my luck...
> Well, there is no better mailing list for this question yet. We'll
> one if the number of Puma question will increase.
>>I am trying to print out the member names of a particular class. After
>>fair amount of trial and error, I got to this stage:
>>using namespace Puma;
>>int main(int argc, char** argv)
>> ErrorStream err;
>> CProject project(err);
>> CClassDatabase classdb(project);
>> DString d = classdb.ClassInfo(0)->AttributeInfo()->Name();
>> std::cout << d.c_str() << std::endl;
>> return 0;
>>However, The program crashes:
>> int a;
>> int b;
>>assertion "index >= 0 && index < count" failed: file
>>};Aborted (core dumped)
> Yes, there are two problems.
> First of all, you didn't *parse* the input file. You only scanned it,
> which means that Puma converted the characters in your input file into
> sequence of tokens. Look into Puma/examples/ccparser/ccparser.cc to
> out how to parse an input file and dump the results.
> The second problem is that you call ClassInfo (0)->AttributeInfo ().
> This is wrong, because AttributeInfo () checks if your class-db object
> is an attribute and converts the object pointer into an
> pointer if it is an attribute. In this case the object is not an
> attribute (it is the first class in the class-db) and AttributeInfo ()
> returns 0.
> What you probably want here is the list of attributes defined in a
> class. This can be obtained with the Attributes() and
> Attribute(unsigned) functions, which CClassInfo inherits from
> I hope this helps,
> If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy,
retain or redistribute it. Click here for important additional terms
relating to this e-mail. http://www.ml.com/email_terms/
More information about the aspectc-user