optionName method

OptionNameContext optionName()

Implementation

OptionNameContext optionName() {
  dynamic _localctx = OptionNameContext(context, state);
  enterRule(_localctx, 12, RULE_optionName);
  int _la;
  try {
    state = 170;
    errorHandler.sync(this);
    switch (tokenStream.LA(1)!) {
    case TOKEN_SYNTAX:
    case TOKEN_IMPORT:
    case TOKEN_WEAK:
    case TOKEN_PUBLIC:
    case TOKEN_PACKAGE:
    case TOKEN_OPTION:
    case TOKEN_REPEATED:
    case TOKEN_ONEOF:
    case TOKEN_MAP:
    case TOKEN_INT32:
    case TOKEN_INT64:
    case TOKEN_UINT32:
    case TOKEN_UINT64:
    case TOKEN_SINT32:
    case TOKEN_SINT64:
    case TOKEN_FIXED32:
    case TOKEN_FIXED64:
    case TOKEN_SFIXED32:
    case TOKEN_SFIXED64:
    case TOKEN_BOOL:
    case TOKEN_STRING:
    case TOKEN_DOUBLE:
    case TOKEN_FLOAT:
    case TOKEN_BYTES:
    case TOKEN_RESERVED:
    case TOKEN_TO:
    case TOKEN_MAX:
    case TOKEN_ENUM:
    case TOKEN_MESSAGE:
    case TOKEN_SERVICE:
    case TOKEN_RPC:
    case TOKEN_STREAM:
    case TOKEN_RETURNS:
    case TOKEN_BOOL_LIT:
    case TOKEN_IDENTIFIER:
      enterOuterAlt(_localctx, 1);
      state = 162;
      fullIdent();
      break;
    case TOKEN_LP:
      enterOuterAlt(_localctx, 2);
      state = 163;
      match(TOKEN_LP);
      state = 164;
      fullIdent();
      state = 165;
      match(TOKEN_RP);
      state = 168;
      errorHandler.sync(this);
      _la = tokenStream.LA(1)!;
      if (_la == TOKEN_DOT) {
        state = 166;
        match(TOKEN_DOT);
        state = 167;
        fullIdent();
      }

      break;
    default:
      throw NoViableAltException(this);
    }
  } on RecognitionException catch (re) {
    _localctx.exception = re;
    errorHandler.reportError(this, re);
    errorHandler.recover(this, re);
  } finally {
    exitRule();
  }
  return _localctx;
}