breaking up parsing table construction logic