rewrite the lexical program