@Override
	protected void exitBlockSet(GrammarAST tree) {
		for (Map.Entry<String, MutableInt> entry : frequencies.peek().entrySet()) {
			// This visitor counts a block set as a sequence of elements, not a
			// sequence of alternatives of elements. Reset the count back to 1
			// for all items when leaving the set to ensure duplicate entries in
			// the set are treated as a maximum of one item.
			entry.getValue().v = 1;
		}

		if (minFrequencies.peek().size() > 1) {
			// Everything is optional
			minFrequencies.peek().clear();
		}

		frequencies.push(combineAndClip(frequencies.pop(), frequencies.pop(), 2));
		minFrequencies.push(combineAndClip(minFrequencies.pop(), minFrequencies.pop(), 2));
	}
Generate a frequency set as the union of two input sets, with the
values clipped to a specified maximum value. If an element is
contained in both sets, the value for the output, prior to clipping,
will be the sum of the two input values.

@param a The first set.
@param b The second set.
@param clip The maximum value to allow for any output.
@return The sum of the two sets, with the individual elements clipped
to the maximum value given by {@code clip}.
tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java