FreeBSD/contrib/gcc/cp/parser.c
/* Parse the arguments and selectors comprising an Objective-C message.

   objc-message-args:
     objc-selector
     objc-selector-args
     objc-selector-args , objc-comma-args

   objc-selector-args:
     objc-selector [opt] : assignment-expression
     objc-selector-args objc-selector [opt] : assignment-expression

   objc-comma-args:
     assignment-expression
     objc-comma-args , assignment-expression

   Returns a TREE_LIST, with TREE_PURPOSE containing a list of
   selector arguments and TREE_VALUE containing a list of comma
   arguments.  */
Parse the arguments and selectors comprising an Objective-C message.





Returns a TREE_LIST, with TREE_PURPOSE containing a list of
selector arguments and TREE_VALUE containing a list of comma
arguments.
Parse the arguments and selectors comprising an Objective - C message . Returns a TREE_LIST with TREE_PURPOSE containing a list of selector arguments and TREE_VALUE containing a list of comma arguments .
static tree
cp_parser_objc_message_args (cp_parser* parser)
{
  tree sel_args = NULL_TREE, addl_args = 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, arg;
      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))
	return build_tree_list (selector, NULL_TREE);
      maybe_unary_selector_p = false;
      cp_parser_require (parser, CPP_COLON, "`:'");
      arg = cp_parser_assignment_expression (parser, false);
      sel_args
	= chainon (sel_args,
		   build_tree_list (selector, arg));
      token = cp_lexer_peek_token (parser->lexer);
    }
  while (token->type == CPP_COMMA)
    {
      tree arg;
      cp_lexer_consume_token (parser->lexer);
      arg = cp_parser_assignment_expression (parser, false);
      addl_args
	= chainon (addl_args,
		   build_tree_list (NULL_TREE, arg));
      token = cp_lexer_peek_token (parser->lexer);
    }
  return build_tree_list (sel_args, addl_args);
}
static tree cp_parser_objc_message_args ( cp_parser * parser ) { tree sel_args = NULL_TREE , addl_args = 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 , arg ; 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 ) ) return build_tree_list ( selector , NULL_TREE ) ; maybe_unary_selector_p = false ; cp_parser_require ( parser , CPP_COLON , " " ) ; arg = cp_parser_assignment_expression ( parser , false ) ; sel_args = chainon ( sel_args , build_tree_list ( selector , arg ) ) ; token = cp_lexer_peek_token ( parser -> lexer ) ; } while ( token -> type == CPP_COMMA ) { tree arg ; cp_lexer_consume_token ( parser -> lexer ) ; arg = cp_parser_assignment_expression ( parser , false ) ; addl_args = chainon ( addl_args , build_tree_list ( NULL_TREE , arg ) ) ; token = cp_lexer_peek_token ( parser -> lexer ) ; } return build_tree_list ( sel_args , addl_args ) ; }
Parse the arguments and selectors comprising an Objective-C message.
Parse the arguments and selectors comprising an Objective - C message .
/* Detect if we have a unary selector.  */ /* Handle non-selector arguments, if any. */