llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Parse an attribute-list.

   attribute-list:
     attribute
     attribute-list , attribute

   attribute:
     identifier
     identifier ( identifier )
     identifier ( identifier , expression-list )
     identifier ( expression-list )

   Returns a TREE_LIST, or NULL_TREE on error.  Each node corresponds
   to an attribute.  The TREE_PURPOSE of each node is the identifier
   indicating which attribute is in use.  The TREE_VALUE represents
   the arguments, if any.  */
Parse an attribute-list.



Returns a TREE_LIST, or NULL_TREE on error.  Each node corresponds
to an attribute.  The TREE_PURPOSE of each node is the identifier
indicating which attribute is in use.  The TREE_VALUE represents
the arguments, if any.
Parse an attribute - list . Returns a TREE_LIST or NULL_TREE on error . Each node corresponds to an attribute . The TREE_PURPOSE of each node is the identifier indicating which attribute is in use . The TREE_VALUE represents the arguments if any .
static tree
cp_parser_attribute_list (cp_parser* parser)
{
  tree attribute_list = NULL_TREE;
  bool save_translate_strings_p = parser->translate_strings_p;
  parser->translate_strings_p = false;
  while (true)
    {
      cp_token *token;
      tree identifier;
      tree attribute;
      token = cp_lexer_peek_token (parser->lexer);
      if (token->type == CPP_NAME
	  || token->type == CPP_KEYWORD)
	{
	  tree arguments = NULL_TREE;
	  token = cp_lexer_consume_token (parser->lexer);
	  identifier = token->u.value;
	  attribute = build_tree_list (identifier, NULL_TREE);
	  token = cp_lexer_peek_token (parser->lexer);
	  if (token->type == CPP_OPEN_PAREN)
	    {
	      arguments = cp_parser_parenthesized_expression_list
			  (parser, true, false,
			   NULL);
	      TREE_VALUE (attribute) = arguments;
	    }
	  if (arguments != error_mark_node)
	    {
	      TREE_CHAIN (attribute) = attribute_list;
	      attribute_list = attribute;
	    }
	  token = cp_lexer_peek_token (parser->lexer);
	}
      if (token->type != CPP_COMMA)
	break;
      cp_lexer_consume_token (parser->lexer);
    }
  parser->translate_strings_p = save_translate_strings_p;
  return nreverse (attribute_list);
}
static tree cp_parser_attribute_list ( cp_parser * parser ) { tree attribute_list = NULL_TREE ; bool save_translate_strings_p = parser -> translate_strings_p ; parser -> translate_strings_p = false ; while ( true ) { cp_token * token ; tree identifier ; tree attribute ; token = cp_lexer_peek_token ( parser -> lexer ) ; if ( token -> type == CPP_NAME || token -> type == CPP_KEYWORD ) { tree arguments = NULL_TREE ; token = cp_lexer_consume_token ( parser -> lexer ) ; identifier = token -> u . value ; attribute = build_tree_list ( identifier , NULL_TREE ) ; token = cp_lexer_peek_token ( parser -> lexer ) ; if ( token -> type == CPP_OPEN_PAREN ) { arguments = cp_parser_parenthesized_expression_list ( parser , true , false , NULL ) ; TREE_VALUE ( attribute ) = arguments ; } if ( arguments != error_mark_node ) { TREE_CHAIN ( attribute ) = attribute_list ; attribute_list = attribute ; } token = cp_lexer_peek_token ( parser -> lexer ) ; } if ( token -> type != CPP_COMMA ) break ; cp_lexer_consume_token ( parser -> lexer ) ; } parser -> translate_strings_p = save_translate_strings_p ; return nreverse ( attribute_list ) ; }
Parse an attribute-list.
Parse an attribute - list .
/* Look for the identifier.  We also allow keywords here; for
	 example `__attribute__ ((const))' is legal.  */ /* Consume the token.  */ /* Save away the identifier that indicates which attribute
	     this is.  */ /* Peek at the next token.  */ /* If it's an `(', then parse the attribute arguments.  */ /*cast_p=*/ /*non_constant_p=*/ /* Save the arguments away.  */ /* Add this attribute to the list.  */ /* Now, look for more attributes.  If the next token isn't a
	 `,', we're done.  */ /* Consume the comma and keep going.  */ /* We built up the list in reverse order.  */