MCPcopy
hub / github.com/antlr/antlr4 / pushNewRecursionContext

Method pushNewRecursionContext

runtime/JavaScript/src/antlr4/Parser.js:434–446  ·  view source on GitHub ↗
(localctx, state, ruleIndex)

Source from the content-addressed store, hash-verified

432
433 // Like {@link //enterRule} but for recursive rules.
434 pushNewRecursionContext(localctx, state, ruleIndex) {
435 const previous = this._ctx;
436 previous.parentCtx = localctx;
437 previous.invokingState = state;
438 previous.stop = this._input.LT(-1);
439
440 this._ctx = localctx;
441 this._ctx.start = previous.start;
442 if (this.buildParseTrees) {
443 this._ctx.addChild(previous);
444 }
445 this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules
446 }
447
448 unrollRecursionContexts(parentCtx) {
449 this._precedenceStack.pop();

Callers

nothing calls this directly

Calls 3

triggerEnterRuleEventMethod · 0.95
LTMethod · 0.65
addChildMethod · 0.45

Tested by

no test coverage detected