my-cc-mode: Handle imenu for both C++ and Java