FreeBSD/contrib/gcc/cp/parser.c
/* Parse an Objective-C method definition list.  */
Parse an Objective-C method definition list.
Parse an Objective - C method definition list .
static void
cp_parser_objc_method_definition_list (cp_parser* parser)
{
  cp_token *token = cp_lexer_peek_token (parser->lexer);
  while (token->keyword != RID_AT_END && token->type != CPP_EOF)
    {
      tree meth;
      if (token->type == CPP_PLUS || token->type == CPP_MINUS)
      {
	cp_token *ptk;
	tree sig, attribute;
	push_deferring_access_checks (dk_deferred);
	sig = cp_parser_objc_method_signature (parser, &attribute);
	objc_start_method_definition (sig, attribute);
	  if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
	    cp_lexer_consume_token (parser->lexer);
	ptk = cp_lexer_peek_token (parser->lexer);
	if (ptk->type == CPP_OPEN_BRACE)
	{
		perform_deferred_access_checks ();
		stop_deferring_access_checks ();
		meth = cp_parser_function_definition_after_declarator (parser,
								      false);
		pop_deferring_access_checks ();
		objc_finish_method_definition (meth);
	}
	else
		cp_parser_require (parser, CPP_OPEN_BRACE, "`{'");
      }
      else if (token->keyword == RID_AT_PROPERTY)
	objc_cp_parser_at_property (parser);
      else
	cp_parser_objc_interstitial_code (parser);
      token = cp_lexer_peek_token (parser->lexer);
    }
  cp_parser_require_keyword (parser, RID_AT_END, "`@end'");
  objc_finish_implementation ();
}
static void cp_parser_objc_method_definition_list ( cp_parser * parser ) { cp_token * token = cp_lexer_peek_token ( parser -> lexer ) ; while ( token -> keyword != RID_AT_END && token -> type != CPP_EOF ) { tree meth ; if ( token -> type == CPP_PLUS || token -> type == CPP_MINUS ) { cp_token * ptk ; tree sig , attribute ; push_deferring_access_checks ( dk_deferred ) ; sig = cp_parser_objc_method_signature ( parser , & attribute ) ; objc_start_method_definition ( sig , attribute ) ; if ( cp_lexer_next_token_is ( parser -> lexer , CPP_SEMICOLON ) ) cp_lexer_consume_token ( parser -> lexer ) ; ptk = cp_lexer_peek_token ( parser -> lexer ) ; if ( ptk -> type == CPP_OPEN_BRACE ) { perform_deferred_access_checks ( ) ; stop_deferring_access_checks ( ) ; meth = cp_parser_function_definition_after_declarator ( parser , false ) ; pop_deferring_access_checks ( ) ; objc_finish_method_definition ( meth ) ; } else cp_parser_require ( parser , CPP_OPEN_BRACE , " " ) ; } else if ( token -> keyword == RID_AT_PROPERTY ) objc_cp_parser_at_property ( parser ) ; else cp_parser_objc_interstitial_code ( parser ) ; token = cp_lexer_peek_token ( parser -> lexer ) ; } cp_parser_require_keyword ( parser , RID_AT_END , " " ) ; objc_finish_implementation ( ) ; }
Parse an Objective-C method definition list.
Parse an Objective - C method definition list .
/* APPLE LOCAL 4093475 */ /* APPLE LOCAL radar 4290840 */ /* APPLE LOCAL begin radar 3803157 - objc attribute */ /* APPLE LOCAL end radar 3803157 - objc attribute */ /* For historical reasons, we accept an optional semicolon.  */ /* APPLE LOCAL begin radar 4290840 */ /* Check for all possibilities of illegal lookahead tokens. */ /* APPLE LOCAL radar 6271728 */ /* APPLE LOCAL begin radar 6271728 */ /* APPLE LOCAL end radar 6271728 */ /* APPLE LOCAL end radar 4290840 */ /* APPLE LOCAL begin C* interface */ /* APPLE LOCAL end C* interface */ /* Allow for interspersed non-ObjC++ code.  */ /* APPLE LOCAL 4093475 */