For even integer the LSB needs to be 0/2/4/6/8.and middle and MSB can be any no. from 0 to 9.Now as we have to generate all even integers upto 998 i.e 3 digits so we need to generate all even integers of one and two digits also.
S->0/2/4/6/8 produces all even integers of one digit.S->AB generates all even integers of two digits.
The grammar can be written as:
S->AB/AAB/0/2/4/6/8
A->0/1/2/3/4/5/6/7/8/9
B->0/2/4/6/8