finish the main module of lexical analysis