@Override
	public Handle optional(GrammarAST optAST, Handle blk) {
		BlockStartState blkStart = (BlockStartState)blk.left;
		ATNState blkEnd = blk.right;
		preventEpsilonOptionalBlocks.add(new Triple<Rule, ATNState, ATNState>(currentRule, blkStart, blkEnd));

		boolean greedy = ((QuantifierAST)optAST).isGreedy();
		blkStart.nonGreedy = !greedy;
		epsilon(blkStart, blk.right, !greedy);

		optAST.atnState = blk.left;
		return blk;
	}
From {@code (A)?} build either:

<pre>
 o--A-&gt;o
 |     ^
 o----&gt;|
</pre>

or, if {@code A} is a block, just add an empty alt to the end of the
block
tool/src/org/antlr/v4/automata/ParserATNFactory.java