[idl] add toString method to structures