member method

MemberContext member([
  1. int _p = 0
])

Implementation

MemberContext member([int _p = 0]) {
  final _parentctx = context;
  final _parentState = state;
  dynamic _localctx = MemberContext(context, _parentState);
  var _prevctx = _localctx;
  var _startState = 14;
  enterRecursionRule(_localctx, 14, RULE_member, _p);
  int _la;
  try {
    int _alt;
    enterOuterAlt(_localctx, 1);
    _localctx = PrimaryExprContext(_localctx);
    context = _localctx;
    _prevctx = _localctx;

    state = 100;
    primary();
    context!.stop = tokenStream.LT(-1);
    state = 126;
    errorHandler.sync(this);
    _alt = interpreter!.adaptivePredict(tokenStream, 13, context);
    while (_alt != 2 && _alt != ATN.INVALID_ALT_NUMBER) {
      if (_alt == 1) {
        if (parseListeners != null) triggerExitRuleEvent();
        _prevctx = _localctx;
        state = 124;
        errorHandler.sync(this);
        switch (interpreter!.adaptivePredict(tokenStream, 12, context)) {
          case 1:
            _localctx =
                SelectContext(new MemberContext(_parentctx, _parentState));
            pushNewRecursionContext(_localctx, _startState, RULE_member);
            state = 102;
            if (!(precpred(context, 3))) {
              throw FailedPredicateException(this, "precpred(context, 3)");
            }
            state = 103;
            _localctx.op = match(TOKEN_DOT);
            state = 105;
            errorHandler.sync(this);
            _la = tokenStream.LA(1)!;
            if (_la == TOKEN_QUESTIONMARK) {
              state = 104;
              _localctx.opt = match(TOKEN_QUESTIONMARK);
            }

            state = 107;
            _localctx.id = match(TOKEN_IDENTIFIER);
            break;
          case 2:
            _localctx = MemberCallContext(
                new MemberContext(_parentctx, _parentState));
            pushNewRecursionContext(_localctx, _startState, RULE_member);
            state = 108;
            if (!(precpred(context, 2))) {
              throw FailedPredicateException(this, "precpred(context, 2)");
            }
            state = 109;
            _localctx.op = match(TOKEN_DOT);
            state = 110;
            _localctx.id = match(TOKEN_IDENTIFIER);
            state = 111;
            _localctx.open = match(TOKEN_LPAREN);
            state = 113;
            errorHandler.sync(this);
            _la = tokenStream.LA(1)!;
            if (((_la) & ~0x3f) == 0 &&
                bitwiseAnd(pow(2, _la), 135762105344) != 0) {
              state = 112;
              _localctx.args = exprList();
            }

            state = 115;
            match(TOKEN_RPAREN);
            break;
          case 3:
            _localctx =
                IndexContext(new MemberContext(_parentctx, _parentState));
            pushNewRecursionContext(_localctx, _startState, RULE_member);
            state = 116;
            if (!(precpred(context, 1))) {
              throw FailedPredicateException(this, "precpred(context, 1)");
            }
            state = 117;
            _localctx.op = match(TOKEN_LBRACKET);
            state = 119;
            errorHandler.sync(this);
            _la = tokenStream.LA(1)!;
            if (_la == TOKEN_QUESTIONMARK) {
              state = 118;
              _localctx.opt = match(TOKEN_QUESTIONMARK);
            }

            state = 121;
            _localctx.index = expr();
            state = 122;
            match(TOKEN_RPRACKET);
            break;
        }
      }
      state = 128;
      errorHandler.sync(this);
      _alt = interpreter!.adaptivePredict(tokenStream, 13, context);
    }
  } on RecognitionException catch (re) {
    _localctx.exception = re;
    errorHandler.reportError(this, re);
    errorHandler.recover(this, re);
  } finally {
    unrollRecursionContexts(_parentctx);
  }
  return _localctx;
}