Add classes corresponding to nonterminal symbols