FreeBSD/contrib/gcc/cp/parser.c
/* Parse an Objective-C params list.  */
Parse an Objective-C params list.
Parse an Objective - C params list .
static tree
cp_parser_objc_method_keyword_params (cp_parser* parser, tree* attributes)
{
  tree params = NULL_TREE;
  bool maybe_unary_selector_p = true;
  cp_token *token = cp_lexer_peek_token (parser->lexer);
  while (cp_parser_objc_selector_p (token->type) || token->type == CPP_COLON)
    {
      tree selector = NULL_TREE, typename, identifier;
      tree attr = NULL_TREE;
      if (token->type != CPP_COLON)
	selector = cp_parser_objc_selector (parser);
      if (maybe_unary_selector_p
	&& cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
      {
	cp_parser_objc_maybe_attributes (parser, attributes);
	if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
		return selector;
      }
      maybe_unary_selector_p = false;
      cp_parser_require (parser, CPP_COLON, "`:'");
      typename = cp_parser_objc_typename (parser);
      cp_parser_objc_maybe_attributes (parser, &attr);
      identifier = cp_parser_identifier (parser);
      cp_parser_objc_maybe_attributes (parser, attributes);
      params
	= chainon (params,
		   objc_build_keyword_decl (selector,
					    typename,
					    identifier, attr));
      token = cp_lexer_peek_token (parser->lexer);
    }
  if (params == NULL_TREE)
    {
      cp_parser_error (parser, "objective-c++ method declaration is expected");
      return error_mark_node;
    }
  return params;
}
static tree cp_parser_objc_method_keyword_params ( cp_parser * parser , tree * attributes ) { tree params = NULL_TREE ; bool maybe_unary_selector_p = true ; cp_token * token = cp_lexer_peek_token ( parser -> lexer ) ; while ( cp_parser_objc_selector_p ( token -> type ) || token -> type == CPP_COLON ) { tree selector = NULL_TREE , typename , identifier ; tree attr = NULL_TREE ; if ( token -> type != CPP_COLON ) selector = cp_parser_objc_selector ( parser ) ; if ( maybe_unary_selector_p && cp_lexer_next_token_is_not ( parser -> lexer , CPP_COLON ) ) { cp_parser_objc_maybe_attributes ( parser , attributes ) ; if ( cp_lexer_next_token_is_not ( parser -> lexer , CPP_COLON ) ) return selector ; } maybe_unary_selector_p = false ; cp_parser_require ( parser , CPP_COLON , " " ) ; typename = cp_parser_objc_typename ( parser ) ; cp_parser_objc_maybe_attributes ( parser , & attr ) ; identifier = cp_parser_identifier ( parser ) ; cp_parser_objc_maybe_attributes ( parser , attributes ) ; params = chainon ( params , objc_build_keyword_decl ( selector , typename , identifier , attr ) ) ; token = cp_lexer_peek_token ( parser -> lexer ) ; } if ( params == NULL_TREE ) { cp_parser_error ( parser , " " ) ; return error_mark_node ; } return params ; }
Parse an Objective-C params list.
Parse an Objective - C params list .
/* APPLE LOCAL end radar 3803157 - objc attribute */ /* APPLE LOCAL radar 4157812 */ /* Detect if we have a unary selector.  */ /* APPLE LOCAL begin radar 3803157 - objc attribute */ /* APPLE LOCAL end radar 3803157 - objc attribute */ /* APPLE LOCAL radar 4157812 */ /* APPLE LOCAL radar 3803157 - objc attribute */ /* APPLE LOCAL radar 4157812 */ /* APPLE LOCAL begin radar 4290840 */ /* APPLE LOCAL end radar 4290840 */