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

Method enterOuterAlt

runtime/Python3/src/antlr4/Parser.py:388–396  ·  view source on GitHub ↗
(self, localctx:ParserRuleContext, altNum:int)

Source from the content-addressed store, hash-verified

386 self._ctx = self._ctx.parentCtx
387
388 def enterOuterAlt(self, localctx:ParserRuleContext, altNum:int):
389 localctx.setAltNumber(altNum)
390 # if we have new localctx, make sure we replace existing ctx
391 # that is previous child of parse tree
392 if self.buildParseTrees and self._ctx != localctx:
393 if self._ctx.parentCtx is not None:
394 self._ctx.parentCtx.removeLastChild()
395 self._ctx.parentCtx.addChild(localctx)
396 self._ctx = localctx
397
398 # Get the precedence level for the top-most precedence rule.
399 #

Callers 15

progMethod · 0.45
funcMethod · 0.45
bodyMethod · 0.45
argMethod · 0.45
statMethod · 0.45
exprMethod · 0.45
primaryMethod · 0.45
primaryExpressionMethod · 0.45
genericSelectionMethod · 0.45
genericAssocListMethod · 0.45
genericAssociationMethod · 0.45
postfixExpressionMethod · 0.45

Calls 3

setAltNumberMethod · 0.45
removeLastChildMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected