contrib/gcc-4.4/gcc/c-parser.c
/* Skip tokens until we have consumed an entire block, or until we
   have consumed a non-nested ';'.  */
Skip tokens until we have consumed an entire block, or until we
have consumed a non-nested ';'.
Skip tokens until we have consumed an entire block or until we have consumed a non - nested ' ; ' .
static void
c_parser_skip_to_end_of_block_or_statement (c_parser *parser)
{
  unsigned nesting_depth = 0;
  bool save_error = parser->error;
  while (true)
    {
      c_token *token;
      token = c_parser_peek_token (parser);
      switch (token->type)
	{
	case CPP_EOF:
	  return;
	case CPP_PRAGMA_EOL:
	  if (parser->in_pragma)
	    return;
	  break;
	case CPP_SEMICOLON:
	  if (!nesting_depth)
	    {
	      c_parser_consume_token (parser);
	      goto finished;
	    }
	  break;
	case CPP_CLOSE_BRACE:
	  if (nesting_depth == 0 || --nesting_depth == 0)
	    {
	      c_parser_consume_token (parser);
	      goto finished;
	    }
	  break;
	case CPP_OPEN_BRACE:
	  ++nesting_depth;
	  break;
	case CPP_PRAGMA:
	  c_parser_consume_pragma (parser);
	  c_parser_skip_to_pragma_eol (parser);
	  parser->error = save_error;
	  continue;
	default:
	  break;
	}
      c_parser_consume_token (parser);
    }
 finished:
  parser->error = false;
}
static void c_parser_skip_to_end_of_block_or_statement ( c_parser * parser ) { unsigned nesting_depth = 0 ; bool save_error = parser -> error ; while ( true ) { c_token * token ; token = c_parser_peek_token ( parser ) ; switch ( token -> type ) { case CPP_EOF : return ; case CPP_PRAGMA_EOL : if ( parser -> in_pragma ) return ; break ; case CPP_SEMICOLON : if ( ! nesting_depth ) { c_parser_consume_token ( parser ) ; goto finished ; } break ; case CPP_CLOSE_BRACE : if ( nesting_depth == 0 || -- nesting_depth == 0 ) { c_parser_consume_token ( parser ) ; goto finished ; } break ; case CPP_OPEN_BRACE : ++ nesting_depth ; break ; case CPP_PRAGMA : c_parser_consume_pragma ( parser ) ; c_parser_skip_to_pragma_eol ( parser ) ; parser -> error = save_error ; continue ; default : break ; } c_parser_consume_token ( parser ) ; } finished : parser -> error = false ; }
Skip tokens until we have consumed an entire block, or until we
have consumed a non-nested ';'.
Skip tokens until we have consumed an entire block or until we have consumed a non - nested ' ; ' .
/* Peek at the next token.  */ /* If the next token is a ';', we have reached the
	     end of the statement.  */ /* Consume the ';'.  */ /* If the next token is a non-nested '}', then we have
	     reached the end of the current block.  */ /* If it the next token is a '{', then we are entering a new
	     block.  Consume the entire block.  */ /* If we see a pragma, consume the whole thing at once.  We
	     have some safeguards against consuming pragmas willy-nilly.
	     Normally, we'd expect to be here with parser->error set,
	     which disables these safeguards.  But it's possible to get
	     here for secondary error recovery, after parser->error has
	     been cleared.  */