Added the workaround to collect all the grammar productions when
calculating reify types.