ident method

IdentContext ident()

Implementation

IdentContext ident() {
  dynamic _localctx = IdentContext(context, state);
  enterRule(_localctx, 72, RULE_ident);
  try {
    state = 483;
    errorHandler.sync(this);
    switch (tokenStream.LA(1)!) {
    case TOKEN_IDENTIFIER:
      enterOuterAlt(_localctx, 1);
      state = 481;
      match(TOKEN_IDENTIFIER);
      break;
    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:
      enterOuterAlt(_localctx, 2);
      state = 482;
      keywords();
      break;
    default:
      throw NoViableAltException(this);
    }
  } on RecognitionException catch (re) {
    _localctx.exception = re;
    errorHandler.reportError(this, re);
    errorHandler.recover(this, re);
  } finally {
    exitRule();
  }
  return _localctx;
}