FreeBSD/contrib/gcc/cp/parser.c
/* Consume tokens up through a non-nested END token.  */
Consume tokens up through a non-nested END token.
Consume tokens up through a non - nested END token .
static void
cp_parser_cache_group (cp_parser *parser,
		       enum cpp_ttype end,
		       unsigned depth)
{
  while (true)
    {
      cp_token *token;
      if ((end == CPP_CLOSE_PAREN || depth == 0)
	  && cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
	return;
      if (cp_lexer_next_token_is (parser->lexer, CPP_EOF)
	  || (end != CPP_PRAGMA_EOL
	      && cp_lexer_next_token_is (parser->lexer, CPP_PRAGMA_EOL)))
	return;
      token = cp_lexer_consume_token (parser->lexer);
      if (token->type == CPP_OPEN_BRACE)
	{
	  cp_parser_cache_group (parser, CPP_CLOSE_BRACE, depth + 1);
	  if (depth == 0)
	    return;
	}
      else if (token->type == CPP_OPEN_PAREN)
	cp_parser_cache_group (parser, CPP_CLOSE_PAREN, depth + 1);
      else if (token->type == CPP_PRAGMA)
	cp_parser_cache_group (parser, CPP_PRAGMA_EOL, depth + 1);
      else if (token->type == end)
	return;
    }
}
static void cp_parser_cache_group ( cp_parser * parser , enum cpp_ttype end , unsigned depth ) { while ( true ) { cp_token * token ; if ( ( end == CPP_CLOSE_PAREN || depth == 0 ) && cp_lexer_next_token_is ( parser -> lexer , CPP_SEMICOLON ) ) return ; if ( cp_lexer_next_token_is ( parser -> lexer , CPP_EOF ) || ( end != CPP_PRAGMA_EOL && cp_lexer_next_token_is ( parser -> lexer , CPP_PRAGMA_EOL ) ) ) return ; token = cp_lexer_consume_token ( parser -> lexer ) ; if ( token -> type == CPP_OPEN_BRACE ) { cp_parser_cache_group ( parser , CPP_CLOSE_BRACE , depth + 1 ) ; if ( depth == 0 ) return ; } else if ( token -> type == CPP_OPEN_PAREN ) cp_parser_cache_group ( parser , CPP_CLOSE_PAREN , depth + 1 ) ; else if ( token -> type == CPP_PRAGMA ) cp_parser_cache_group ( parser , CPP_PRAGMA_EOL , depth + 1 ) ; else if ( token -> type == end ) return ; } }
Consume tokens up through a non-nested END token.
Consume tokens up through a non - nested END token .
/* Abort a parenthesized expression if we encounter a brace.  */ /* If we've reached the end of the file, stop.  */ /* Consume the next token.  */ /* See if it starts a new group.  */