rewrite lexer, first pass parser