FreeBSD/contrib/gcc/cp/parser.c
/* Returns name of the next clause.
   If the clause is not recognized PRAGMA_OMP_CLAUSE_NONE is returned and
   the token is not consumed.  Otherwise appropriate pragma_omp_clause is
   returned and the token is consumed.  */
Returns name of the next clause.
If the clause is not recognized PRAGMA_OMP_CLAUSE_NONE is returned and
the token is not consumed.  Otherwise appropriate pragma_omp_clause is
returned and the token is consumed.
Returns name of the next clause . If the clause is not recognized PRAGMA_OMP_CLAUSE_NONE is returned and the token is not consumed . Otherwise appropriate pragma_omp_clause is returned and the token is consumed .
static pragma_omp_clause
cp_parser_omp_clause_name (cp_parser *parser)
{
  pragma_omp_clause result = PRAGMA_OMP_CLAUSE_NONE;
  if (cp_lexer_next_token_is_keyword (parser->lexer, RID_IF))
    result = PRAGMA_OMP_CLAUSE_IF;
  else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_DEFAULT))
    result = PRAGMA_OMP_CLAUSE_DEFAULT;
  else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_PRIVATE))
    result = PRAGMA_OMP_CLAUSE_PRIVATE;
  else if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
    {
      tree id = cp_lexer_peek_token (parser->lexer)->u.value;
      const char *p = IDENTIFIER_POINTER (id);
      switch (p[0])
	{
	case 'c':
	  if (!strcmp ("copyin", p))
	    result = PRAGMA_OMP_CLAUSE_COPYIN;
	  else if (!strcmp ("copyprivate", p))
	    result = PRAGMA_OMP_CLAUSE_COPYPRIVATE;
	  break;
	case 'f':
	  if (!strcmp ("firstprivate", p))
	    result = PRAGMA_OMP_CLAUSE_FIRSTPRIVATE;
	  break;
	case 'l':
	  if (!strcmp ("lastprivate", p))
	    result = PRAGMA_OMP_CLAUSE_LASTPRIVATE;
	  break;
	case 'n':
	  if (!strcmp ("nowait", p))
	    result = PRAGMA_OMP_CLAUSE_NOWAIT;
	  else if (!strcmp ("num_threads", p))
	    result = PRAGMA_OMP_CLAUSE_NUM_THREADS;
	  break;
	case 'o':
	  if (!strcmp ("ordered", p))
	    result = PRAGMA_OMP_CLAUSE_ORDERED;
	  break;
	case 'r':
	  if (!strcmp ("reduction", p))
	    result = PRAGMA_OMP_CLAUSE_REDUCTION;
	  break;
	case 's':
	  if (!strcmp ("schedule", p))
	    result = PRAGMA_OMP_CLAUSE_SCHEDULE;
	  else if (!strcmp ("shared", p))
	    result = PRAGMA_OMP_CLAUSE_SHARED;
	  break;
	}
    }
  if (result != PRAGMA_OMP_CLAUSE_NONE)
    cp_lexer_consume_token (parser->lexer);
  return result;
}
static pragma_omp_clause cp_parser_omp_clause_name ( cp_parser * parser ) { pragma_omp_clause result = PRAGMA_OMP_CLAUSE_NONE ; if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_IF ) ) result = PRAGMA_OMP_CLAUSE_IF ; else if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_DEFAULT ) ) result = PRAGMA_OMP_CLAUSE_DEFAULT ; else if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_PRIVATE ) ) result = PRAGMA_OMP_CLAUSE_PRIVATE ; else if ( cp_lexer_next_token_is ( parser -> lexer , CPP_NAME ) ) { tree id = cp_lexer_peek_token ( parser -> lexer ) -> u . value ; const char * p = IDENTIFIER_POINTER ( id ) ; switch ( p [ 0 ] ) { case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_COPYIN ; else if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_COPYPRIVATE ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_FIRSTPRIVATE ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_LASTPRIVATE ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_NOWAIT ; else if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_NUM_THREADS ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_ORDERED ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_REDUCTION ; break ; case ' ' : if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_SCHEDULE ; else if ( ! strcmp ( " " , p ) ) result = PRAGMA_OMP_CLAUSE_SHARED ; break ; } } if ( result != PRAGMA_OMP_CLAUSE_NONE ) cp_lexer_consume_token ( parser -> lexer ) ; return result ; }
Returns name of the next clause.
Returns name of the next clause .