Diagnosability Analysis of a Class of Hierarchical State Machines