generate parser from template