'Return this node as if it were declared as an extension class'

def as_cclass(self):

    if self.is_py3_style_class:
        error(self.classobj.pos, 'Python3    style    class    could    not    be    represented    as    C    class')
        return
    bases = self.classobj.bases.args
    if (len(bases) == 0):
        base_class_name = None
        base_class_module = None
    elif (len(bases) == 1):
        base = bases[0]
        path = []
        from .ExprNodes import AttributeNode, NameNode
        while isinstance(base, AttributeNode):
            path.insert(0, base.attribute)
            base = base.obj
        if isinstance(base, NameNode):
            path.insert(0, base.name)
            base_class_name = path[(-1)]
            if (len(path) > 1):
                base_class_module = u'.'.join(path[:(-1)])
            else:
                base_class_module = None
        else:
            error(self.classobj.bases.args.pos, 'Invalid    base    class')
    else:
        error(self.classobj.bases.args.pos, 'C    class    may    only    have    one    base    class')
        return None
    return CClassDefNode(self.pos, visibility='private', module_name=None, class_name=self.name, base_class_module=base_class_module, base_class_name=base_class_name, decorators=self.decorators, body=self.body, in_pxd=False, doc=self.doc)
