def parseCompositeTypes(src):
    typeMap = {'struct': CompositeType.CLASS_STRUCT, 'union': CompositeType.CLASS_UNION}
    matches = re.findall((((('typedef (struct|union)(\\s*' + IDENT_PTRN) + ')?\\s*{([^}]*)}\\s*(') + IDENT_PTRN) + ')\\s*;'), src)
    types = []
    for (type, structname, contents, typename) in matches:
        types.append(parseCompositeType(typeMap[type], typename, contents))
    return types
def parseCompositeTypes(src):
    typeMap = {'struct': CompositeType.CLASS_STRUCT, 'union': CompositeType.CLASS_UNION}
    matches = re.findall((((('typedef (struct|union)(\\s*' + IDENT_PTRN) + ')?\\s*{([^}]*)}\\s*(') + IDENT_PTRN) + ')\\s*;'), src)
    types = []
    for (type, structname, contents, typename) in matches:
        types.append(parseCompositeType(typeMap[type], typename, contents))
    return types