A modal method for the analysis of surface relief gratings made with anisotropic material is presented. The structure is decomposed into a series of cascaded discontinuities between planar waveguides with stratified anisotropic dielectric. The basic problem is formulated by an integral equation which is solved numerically by the method of moments. The mode functions of the periodic region are assumed as basis functions to represent the unknown field on the junctions. Each junction is viewed as a waveguide junction problem and has been characterized by the generalized scattering matrix (GSM). The diffraction efficiencies of the grating are determined by combining the various GSM. In this way, the analysis method is stable and can be applied also to deep gratings.