FreeBSD/contrib/gcc/cp/parser.c
/* Parse an optional declaration-sequence.

   declaration-seq:
     declaration
     declaration-seq declaration  */
Parse an optional declaration-sequence.
Parse an optional declaration - sequence .
static void
cp_parser_declaration_seq_opt (cp_parser* parser)
{
  while (true)
    {
      cp_token *token;
      token = cp_lexer_peek_token (parser->lexer);
      if (token->type == CPP_CLOSE_BRACE
	  || token->type == CPP_EOF
	  || token->type == CPP_PRAGMA_EOL)
	break;
      if (token->type == CPP_SEMICOLON)
	{
	  cp_lexer_consume_token (parser->lexer);
	  if (pedantic && !in_system_header)
	    pedwarn ("extra %<;%>");
	  continue;
	}
      if (!parser->implicit_extern_c && token->implicit_extern_c)
	{
	  push_lang_context (lang_name_c);
	  parser->implicit_extern_c = true;
	}
      else if (parser->implicit_extern_c && !token->implicit_extern_c)
	{
	  pop_lang_context ();
	  parser->implicit_extern_c = false;
	}
      if (token->type == CPP_PRAGMA)
	{
	  cp_parser_pragma (parser, pragma_external);
	  continue;
	}
      cp_parser_declaration (parser);
    }
}
static void cp_parser_declaration_seq_opt ( cp_parser * parser ) { while ( true ) { cp_token * token ; token = cp_lexer_peek_token ( parser -> lexer ) ; if ( token -> type == CPP_CLOSE_BRACE || token -> type == CPP_EOF || token -> type == CPP_PRAGMA_EOL ) break ; if ( token -> type == CPP_SEMICOLON ) { cp_lexer_consume_token ( parser -> lexer ) ; if ( pedantic && ! in_system_header ) pedwarn ( " " ) ; continue ; } if ( ! parser -> implicit_extern_c && token -> implicit_extern_c ) { push_lang_context ( lang_name_c ) ; parser -> implicit_extern_c = true ; } else if ( parser -> implicit_extern_c && ! token -> implicit_extern_c ) { pop_lang_context ( ) ; parser -> implicit_extern_c = false ; } if ( token -> type == CPP_PRAGMA ) { cp_parser_pragma ( parser , pragma_external ) ; continue ; } cp_parser_declaration ( parser ) ; } }
Parse an optional declaration-sequence.
Parse an optional declaration - sequence .
/* A declaration consisting of a single semicolon is
	     invalid.  Allow it unless we're being pedantic.  */ /* If we're entering or exiting a region that's implicitly
	 extern "C", modify the lang context appropriately.  */ /* A top-level declaration can consist solely of a #pragma.
	     A nested declaration cannot, so this is done here and not
	     in cp_parser_declaration.  (A #pragma at block scope is
	     handled in cp_parser_statement.)  */ /* Parse the declaration itself.  */