def _build_goto_table(grammar, item_sets, item_set_transitions):
    """
    Returns a list of dictionaries mapping from non-terminal symbols to the
    state that should follow.

    The items in the list correspond to items in the list of item sets.
    """
    gotos = []
    for transitions in item_set_transitions:
        gotos.append(
            {
                symbol: state
                for symbol, state in transitions.items()
                if grammar.is_nonterminal(symbol)
            }
        )
    return gotos