The authors propose a structure-prediction framework for proteins that uses hidden Markov models (HMM) with a protein structure grammar. By adopting a protein structure grammar, the HMM makes it possible to treat global interactions, the interaction between two secondary structures which are apart in the sequence. In this framework, prediction of local and global structures are totally treated through global and local interactions which are expressed by the protein sequence grammar. The relations between some of the previous methods for secondary structure prediction and HMMs are discussed. Some experimental results on secondary structure prediction are included. The learning algorithms for the HMMs are presented.