making terminal and nonterminal vectors stack allocated