enterOuterAlt method

void enterOuterAlt(
  1. ParserRuleContext localctx,
  2. int altNum
)

Implementation

void enterOuterAlt(ParserRuleContext localctx, int altNum) {
  assert(context != null);
  localctx.altNumber = altNum;
  // if we have new localctx, make sure we replace existing ctx
  // that is previous child of parse tree
  if (buildParseTree && context != localctx) {
    final parent = context!.parent;
    if (parent != null) {
      parent.removeLastChild();
      parent.addAnyChild(localctx);
    }
  }
  context = localctx;
}