Rigorous Coupled-Wave Approach for Sandwich Gratings