m3-sys/m3cc/gcc-apple/gcc/c-parser.c
/* Parse part of a direct declarator or direct abstract declarator,
   given that some (in INNER) has already been parsed; ID_PRESENT is
   true if an identifier is present, false for an abstract
   declarator.  */
Parse part of a direct declarator or direct abstract declarator,
given that some (in INNER) has already been parsed; ID_PRESENT is
true if an identifier is present, false for an abstract
declarator.
Parse part of a direct declarator or direct abstract declarator given that some ( in INNER ) has already been parsed ; ID_PRESENT is true if an identifier is present false for an abstract declarator .
static struct c_declarator *
c_parser_direct_declarator_inner (c_parser *parser, bool id_present,
				  struct c_declarator *inner)
{
  if (c_parser_next_token_is (parser, CPP_OPEN_SQUARE))
    {
      struct c_declarator *declarator;
      struct c_declspecs *quals_attrs = build_null_declspecs ();
      bool static_seen;
      bool star_seen;
      tree dimen;
      c_parser_consume_token (parser);
      c_parser_declspecs (parser, quals_attrs, false, false, true);
      static_seen = c_parser_next_token_is_keyword (parser, RID_STATIC);
      if (static_seen)
	c_parser_consume_token (parser);
      if (static_seen && !quals_attrs->declspecs_seen_p)
	c_parser_declspecs (parser, quals_attrs, false, false, true);
      if (!quals_attrs->declspecs_seen_p)
	quals_attrs = NULL;
      if (static_seen)
	{
	  star_seen = false;
	  dimen = c_parser_expr_no_commas (parser, NULL).value;
	}
      else
	{
	  if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE))
	    {
	      dimen = NULL_TREE;
	      star_seen = false;
	    }
	  else if (c_parser_next_token_is (parser, CPP_MULT))
	    {
	      if (c_parser_peek_2nd_token (parser)->type == CPP_CLOSE_SQUARE)
		{
		  dimen = NULL_TREE;
		  star_seen = true;
		  c_parser_consume_token (parser);
		}
	      else
		{
		  star_seen = false;
		  dimen = c_parser_expr_no_commas (parser, NULL).value;
		}
	    }
	  else
	    {
	      star_seen = false;
	      dimen = c_parser_expr_no_commas (parser, NULL).value;
	    }
	}
      if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE))
	c_parser_consume_token (parser);
      else
	{
	  c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE,
				     "expected %<]%>");
	  return NULL;
	}
      declarator = build_array_declarator (dimen, quals_attrs, static_seen,
					   star_seen);
      if (declarator == NULL)
	return NULL;
      inner = set_array_declarator_inner (declarator, inner, !id_present);
      return c_parser_direct_declarator_inner (parser, id_present, inner);
    }
  else if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
    {
      tree attrs;
      struct c_arg_info *args;
      c_parser_consume_token (parser);
      attrs = c_parser_attributes (parser);
      args = c_parser_parms_declarator (parser, id_present, attrs);
      if (args == NULL)
	return NULL;
      else
	{
	  inner = build_function_declarator (args, inner);
	  return c_parser_direct_declarator_inner (parser, id_present, inner);
	}
    }
  return inner;
}
static struct c_declarator * c_parser_direct_declarator_inner ( c_parser * parser , bool id_present , struct c_declarator * inner ) { if ( c_parser_next_token_is ( parser , CPP_OPEN_SQUARE ) ) { struct c_declarator * declarator ; struct c_declspecs * quals_attrs = build_null_declspecs ( ) ; bool static_seen ; bool star_seen ; tree dimen ; c_parser_consume_token ( parser ) ; c_parser_declspecs ( parser , quals_attrs , false , false , true ) ; static_seen = c_parser_next_token_is_keyword ( parser , RID_STATIC ) ; if ( static_seen ) c_parser_consume_token ( parser ) ; if ( static_seen && ! quals_attrs -> declspecs_seen_p ) c_parser_declspecs ( parser , quals_attrs , false , false , true ) ; if ( ! quals_attrs -> declspecs_seen_p ) quals_attrs = NULL ; if ( static_seen ) { star_seen = false ; dimen = c_parser_expr_no_commas ( parser , NULL ) . value ; } else { if ( c_parser_next_token_is ( parser , CPP_CLOSE_SQUARE ) ) { dimen = NULL_TREE ; star_seen = false ; } else if ( c_parser_next_token_is ( parser , CPP_MULT ) ) { if ( c_parser_peek_2nd_token ( parser ) -> type == CPP_CLOSE_SQUARE ) { dimen = NULL_TREE ; star_seen = true ; c_parser_consume_token ( parser ) ; } else { star_seen = false ; dimen = c_parser_expr_no_commas ( parser , NULL ) . value ; } } else { star_seen = false ; dimen = c_parser_expr_no_commas ( parser , NULL ) . value ; } } if ( c_parser_next_token_is ( parser , CPP_CLOSE_SQUARE ) ) c_parser_consume_token ( parser ) ; else { c_parser_skip_until_found ( parser , CPP_CLOSE_SQUARE , " " ) ; return NULL ; } declarator = build_array_declarator ( dimen , quals_attrs , static_seen , star_seen ) ; if ( declarator == NULL ) return NULL ; inner = set_array_declarator_inner ( declarator , inner , ! id_present ) ; return c_parser_direct_declarator_inner ( parser , id_present , inner ) ; } else if ( c_parser_next_token_is ( parser , CPP_OPEN_PAREN ) ) { tree attrs ; struct c_arg_info * args ; c_parser_consume_token ( parser ) ; attrs = c_parser_attributes ( parser ) ; args = c_parser_parms_declarator ( parser , id_present , attrs ) ; if ( args == NULL ) return NULL ; else { inner = build_function_declarator ( args , inner ) ; return c_parser_direct_declarator_inner ( parser , id_present , inner ) ; } } return inner ; }
Parse part of a direct declarator or direct abstract declarator,
given that some (in INNER) has already been parsed; ID_PRESENT is
true if an identifier is present, false for an abstract
declarator.
Parse part of a direct declarator or direct abstract declarator given that some ( in INNER ) has already been parsed ; ID_PRESENT is true if an identifier is present false for an abstract declarator .
/* Parse a sequence of array declarators and parameter lists.  */ /* If "static" is present, there must be an array dimension.
	 Otherwise, there may be a dimension, "*", or no
	 dimension.  */