public ParserRuleContext getInvokingContext(int ruleIndex) {
		ParserRuleContext p = _ctx;
		while ( p!=null ) {
			if ( p.getRuleIndex() == ruleIndex ) return p;
			p = (ParserRuleContext)p.parent;
		}
		return null;
	}
Like {@link #enterRule} but for recursive rules.
 Make the current context the child of the incoming localctx.
runtime/Java/src/org/antlr/v4/runtime/Parser.java