mkapidocs.py: add namespaces, classes and structs to a scope chain