pushNewRecursionContext method
Like {@link #enterRule} but for recursive rules. Make the current context the child of the incoming localctx.
Implementation
void pushNewRecursionContext(
ParserRuleContext localctx,
int state,
int? ruleIndex,
) {
assert(context != null);
final previous = context!;
previous.parent = localctx;
previous.invokingState = state;
previous.stop = _input.LT(-1);
context = localctx;
context!.start = previous.start;
if (buildParseTree) {
context!.addAnyChild(previous);
}
if (_parseListeners != null) {
triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules
}
}