rebuilding grammar and parser