To enable PAUL to be used as a library, the switch statement that links names to attribute constructors should be replaced with a map. There should be a API call to register custom attribute constructors in the map.
I suppose I should describe what we need functionally and leave the implementation to you. In general, we need an ability to establish an arbitrary list of attribute types. The PAUL configuration file has a list of name attribute types, and we need to add custom attributes to the list. We might even want to exclude some of the predefined attributes or perhaps rename them.
It might be nice to have something like,
static struct { const char *name; (SgAttribute *)(*ctor)(void) } attriblist[] = {
{ "attrib1", attr1ctr },
{ "attrib2", attr2ctr },
{ "attrib3", attr3ctr},
{ 0 }
};
int
main(int argc, char **argv) {
paulInit(attriblist);
}