rewrite lexer parser

rewrite lexer parser:
functions new_lexer and new_parser
I might use them in the future