@Override
			public Integer visitAdd(VisitorCalcParser.AddContext ctx) {
				Integer left = visit(ctx.expr(0));
				Integer right = visit(ctx.expr(1));
				if (ctx.ADD() != null) {
					return left + right;
				}
				else {
					return left - right;
				}
			}
This test verifies that the visitor correctly dispatches calls for labeled outer alternatives.
runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestVisitors.java