@Override
	protected int visitDecisionState(DecisionState p) {
		int predictedAlt = super.visitDecisionState(p);
		if( p.getNumberOfTransitions() > 1) {
//			System.out.println("decision "+p.decision+": "+predictedAlt);
			if( p.decision == this.overrideDecision &&
				this._input.index() == this.overrideDecisionInputIndex )
			{
				overrideDecisionRoot = (GrammarInterpreterRuleContext)getContext();
			}
		}

		GrammarInterpreterRuleContext ctx = (GrammarInterpreterRuleContext)_ctx;
		if ( decisionStatesThatSetOuterAltNumInContext.get(p.stateNumber) ) {
			ctx.outerAltNum = predictedAlt;
			Rule r = g.getRule(p.ruleIndex);
			if ( atn.ruleToStartState[r.index].isLeftRecursiveRule ) {
				int[] alts = stateToAltsMap[p.stateNumber];
				LeftRecursiveRule lr = (LeftRecursiveRule) g.getRule(p.ruleIndex);
				if (p.getStateType() == ATNState.BLOCK_START) {
					if ( alts==null ) {
						alts = lr.getPrimaryAlts();
						stateToAltsMap[p.stateNumber] = alts; // cache it
					}
				}
				else if ( p.getStateType() == ATNState.STAR_BLOCK_START ) {
					if ( alts==null ) {
						alts = lr.getRecursiveOpAlts();
						stateToAltsMap[p.stateNumber] = alts; // cache it
					}
				}
				ctx.outerAltNum = alts[predictedAlt];
			}
		}

		return predictedAlt;
	}
Override this method so that we can record which alternative
 was taken at each decision point. For non-left recursive rules,
 it's simple. Set decisionStatesThatSetOuterAltNumInContext
 indicates which decision states should set the outer alternative number.

 <p>Left recursive rules are much more complicated to deal with:
 there is typically a decision for the primary alternatives and a
 decision to choose between the recursive operator alternatives.
 For example, the following left recursive rule has two primary and 2
 recursive alternatives.</p>

		 e : e '*' e
		   | '-' INT
		   | e '+' e
		   | ID
		   ;
 <p>ANTLR rewrites that rule to be</p>

		 e[int precedence]
			 : ('-' INT | ID)
			 ( {...}? '*' e[5]
			 | {...}? '+' e[3]
			 )*
			;

 <p>So, there are two decisions associated with picking the outermost alt.
 This complicates our tracking significantly. The outermost alternative number
 is a function of the decision (ATN state) within a left recursive rule and the
 predicted alternative coming back from adaptivePredict().

 We use stateToAltsMap as a cache to avoid expensive calls to
 getRecursiveOpAlts().
tool/src/org/antlr/v4/tool/GrammarParserInterpreter.java