implement batch lexing