[aspectc-user] Using puma to print out class member names

Sunder, Shyam (MSTG - NY) s_sunder at ml.com
Wed Dec 29 23:30:50 CET 2004


Hi,

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...

I am trying to print out the member names of a particular class. After a
fair amount of trial and error, I got to this stage:

#include "Puma/ErrorStream.h"
#include "Puma/CProject.h"
#include "Puma/CClassDatabase.h"
#include "Puma/PathIterator.h"
#include "Puma/CFunctionInfo.h"
#include "Puma/CTypeInfo.h"
#include "Puma/CClassInfo.h"
#include "Puma/CAttributeInfo.h"

#include <iostream>

using namespace Puma;

int main(int argc, char** argv)
{
    ErrorStream err;
    CProject project(err);
    project.scanFile("tests/A.h")->print(std::cout);    

    CClassDatabase classdb(project);

    classdb.Dump(std::cout);

    DString d = classdb.ClassInfo(0)->AttributeInfo()->Name();
    std::cout << d.c_str() << std::endl;

    return 0;
}

However, The program crashes:

#pragma once

class A
{
public:
    int a;

private:
    int b;
assertion "index >= 0 && index < count" failed: file
"/home/matthias/Projekte/Cvsdir/Puma/gen/step1/inc/Puma/VoidPtrArray.h",
line 186
};Aborted (core dumped)


Any ideas?

Thanks

Shyam
--------------------------------------------------------

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 mailing list