Binding generation is really difficult to approach as a general problem, which is why I've found that SWIG unfortunately doesn't help much in non-trivial cases.
All the good bindings I use are generated by custom systems (ie, usually some Python scripts) tailored for the specific way their library works.