collect terminals and non_terminals