constant method

ConstantContext constant()

Implementation

ConstantContext constant() {
  dynamic _localctx = ConstantContext(context, state);
  enterRule(_localctx, 66, RULE_constant);
  int _la;
  try {
    state = 465;
    errorHandler.sync(this);
    switch (interpreter!.adaptivePredict(tokenStream, 46, context)) {
    case 1:
      enterOuterAlt(_localctx, 1);
      state = 453;
      fullIdent();
      break;
    case 2:
      enterOuterAlt(_localctx, 2);
      state = 455;
      errorHandler.sync(this);
      _la = tokenStream.LA(1)!;
      if (_la == TOKEN_PLUS || _la == TOKEN_MINUS) {
        state = 454;
        _la = tokenStream.LA(1)!;
        if (!(_la == TOKEN_PLUS || _la == TOKEN_MINUS)) {
        errorHandler.recoverInline(this);
        } else {
          if ( tokenStream.LA(1)! == IntStream.EOF ) matchedEOF = true;
          errorHandler.reportMatch(this);
          consume();
        }
      }

      state = 457;
      intLit();
      break;
    case 3:
      enterOuterAlt(_localctx, 3);
      state = 459;
      errorHandler.sync(this);
      _la = tokenStream.LA(1)!;
      if (_la == TOKEN_PLUS || _la == TOKEN_MINUS) {
        state = 458;
        _la = tokenStream.LA(1)!;
        if (!(_la == TOKEN_PLUS || _la == TOKEN_MINUS)) {
        errorHandler.recoverInline(this);
        } else {
          if ( tokenStream.LA(1)! == IntStream.EOF ) matchedEOF = true;
          errorHandler.reportMatch(this);
          consume();
        }
      }

      state = 461;
      floatLit();
      break;
    case 4:
      enterOuterAlt(_localctx, 4);
      state = 462;
      strLit();
      break;
    case 5:
      enterOuterAlt(_localctx, 5);
      state = 463;
      boolLit();
      break;
    case 6:
      enterOuterAlt(_localctx, 6);
      state = 464;
      blockLit();
      break;
    }
  } on RecognitionException catch (re) {
    _localctx.exception = re;
    errorHandler.reportError(this, re);
    errorHandler.recover(this, re);
  } finally {
    exitRule();
  }
  return _localctx;
}