def _build_shift_table(grammar, item_sets, item_set_transitions):
    """
    Returns a list of maps from terminal symbols to shift actions.

    A shift action is simply an index into the item_set array.
    """
    shifts = []
    for transitions in item_set_transitions:
        shifts.append(
            {
                symbol: state
                for symbol, state in transitions.items()
                if grammar.is_terminal(symbol)
            }
        )
    return shifts