another chunk of parser_generator and a bug fix for missing end_prod call