@@ -1592,16 +1592,19 @@ gfc_match_if (gfc_statement *if_type)
15921592 match ("assign" , gfc_match_assign , ST_LABEL_ASSIGNMENT )
15931593 match ("backspace" , gfc_match_backspace , ST_BACKSPACE )
15941594 match ("call" , gfc_match_call , ST_CALL )
1595+ match ("change team" , gfc_match_change_team , ST_CHANGE_TEAM )
15951596 match ("close" , gfc_match_close , ST_CLOSE )
15961597 match ("continue" , gfc_match_continue , ST_CONTINUE )
15971598 match ("cycle" , gfc_match_cycle , ST_CYCLE )
15981599 match ("deallocate" , gfc_match_deallocate , ST_DEALLOCATE )
15991600 match ("end file" , gfc_match_endfile , ST_END_FILE )
1601+ match ("end team" , gfc_match_end_team , ST_END_TEAM )
16001602 match ("error stop" , gfc_match_error_stop , ST_ERROR_STOP )
16011603 match ("event post" , gfc_match_event_post , ST_EVENT_POST )
16021604 match ("event wait" , gfc_match_event_wait , ST_EVENT_WAIT )
16031605 match ("exit" , gfc_match_exit , ST_EXIT )
16041606 match ("fail image" , gfc_match_fail_image , ST_FAIL_IMAGE )
1607+ match ("form team" , gfc_match_form_team , ST_FORM_TEAM )
16051608 match ("flush" , gfc_match_flush , ST_FLUSH )
16061609 match ("forall" , match_simple_forall , ST_FORALL )
16071610 match ("go to" , gfc_match_goto , ST_GOTO )
@@ -1617,6 +1620,7 @@ gfc_match_if (gfc_statement *if_type)
16171620 match ("rewind" , gfc_match_rewind , ST_REWIND )
16181621 match ("stop" , gfc_match_stop , ST_STOP )
16191622 match ("wait" , gfc_match_wait , ST_WAIT )
1623+ match ("sync team" , gfc_match_sync_team , ST_SYNC_TEAM )
16201624 match ("sync all" , gfc_match_sync_all , ST_SYNC_CALL );
16211625 match ("sync images" , gfc_match_sync_images , ST_SYNC_IMAGES );
16221626 match ("sync memory" , gfc_match_sync_memory , ST_SYNC_MEMORY );
@@ -1656,7 +1660,6 @@ gfc_match_if (gfc_statement *if_type)
16561660 gfc_free_expr (expr );
16571661 return MATCH_ERROR ;
16581662 }
1659-
16601663 /* At this point, we've matched the single IF and the action clause
16611664 is in new_st. Rearrange things so that the IF statement appears
16621665 in new_st. */
@@ -3287,6 +3290,136 @@ gfc_match_fail_image (void)
32873290 return MATCH_ERROR ;
32883291}
32893292
3293+ /* Match a FORM TEAM statement. */
3294+
3295+ match
3296+ gfc_match_form_team (void )
3297+ {
3298+ match m ;
3299+ gfc_expr * teamid ,* team ;
3300+
3301+ if (!gfc_notify_std (GFC_STD_F2008_TS , "FORM TEAM statement at %C" ))
3302+ return MATCH_ERROR ;
3303+
3304+ if (gfc_match_char ('(' ) == MATCH_NO )
3305+ goto syntax ;
3306+
3307+ new_st .op = EXEC_FORM_TEAM ;
3308+
3309+ if (gfc_match ("%e" , & teamid ) != MATCH_YES )
3310+ goto syntax ;
3311+ m = gfc_match_char (',' );
3312+ if (m == MATCH_ERROR )
3313+ goto syntax ;
3314+ if (gfc_match ("%e" , & team ) != MATCH_YES )
3315+ goto syntax ;
3316+
3317+ m = gfc_match_char (')' );
3318+ if (m == MATCH_NO )
3319+ goto syntax ;
3320+
3321+ new_st .expr1 = teamid ;
3322+ new_st .expr2 = team ;
3323+
3324+ return MATCH_YES ;
3325+
3326+ syntax :
3327+ gfc_syntax_error (ST_FORM_TEAM );
3328+
3329+ return MATCH_ERROR ;
3330+ }
3331+
3332+ /* Match a CHANGE TEAM statement. */
3333+
3334+ match
3335+ gfc_match_change_team (void )
3336+ {
3337+ match m ;
3338+ gfc_expr * team ;
3339+
3340+ if (!gfc_notify_std (GFC_STD_F2008_TS , "CHANGE TEAM statement at %C" ))
3341+ return MATCH_ERROR ;
3342+
3343+ if (gfc_match_char ('(' ) == MATCH_NO )
3344+ goto syntax ;
3345+
3346+ new_st .op = EXEC_CHANGE_TEAM ;
3347+
3348+ /* if (gfc_match ("%e", &teamid) != MATCH_YES) */
3349+ /* goto syntax; */
3350+ /* m = gfc_match_char (','); */
3351+ /* if (m == MATCH_ERROR) */
3352+ /* goto syntax; */
3353+ if (gfc_match ("%e" , & team ) != MATCH_YES )
3354+ goto syntax ;
3355+
3356+ m = gfc_match_char (')' );
3357+ if (m == MATCH_NO )
3358+ goto syntax ;
3359+
3360+ new_st .expr1 = team ;
3361+
3362+ return MATCH_YES ;
3363+
3364+ syntax :
3365+ gfc_syntax_error (ST_CHANGE_TEAM );
3366+
3367+ return MATCH_ERROR ;
3368+ }
3369+
3370+ /* Match a END TEAM statement. */
3371+
3372+ match
3373+ gfc_match_end_team (void )
3374+ {
3375+ if (!gfc_notify_std (GFC_STD_F2008_TS , "END TEAM statement at %C" ))
3376+ return MATCH_ERROR ;
3377+
3378+ if (gfc_match_char ('(' ) == MATCH_YES )
3379+ goto syntax ;
3380+
3381+ new_st .op = EXEC_END_TEAM ;
3382+
3383+ return MATCH_YES ;
3384+
3385+ syntax :
3386+ gfc_syntax_error (ST_END_TEAM );
3387+
3388+ return MATCH_ERROR ;
3389+ }
3390+
3391+ /* Match a SYNC TEAM statement. */
3392+
3393+ match
3394+ gfc_match_sync_team (void )
3395+ {
3396+ match m ;
3397+ gfc_expr * team ;
3398+
3399+ if (!gfc_notify_std (GFC_STD_F2008_TS , "SYNC TEAM statement at %C" ))
3400+ return MATCH_ERROR ;
3401+
3402+ if (gfc_match_char ('(' ) == MATCH_NO )
3403+ goto syntax ;
3404+
3405+ new_st .op = EXEC_SYNC_TEAM ;
3406+
3407+ if (gfc_match ("%e" , & team ) != MATCH_YES )
3408+ goto syntax ;
3409+
3410+ m = gfc_match_char (')' );
3411+ if (m == MATCH_NO )
3412+ goto syntax ;
3413+
3414+ new_st .expr1 = team ;
3415+
3416+ return MATCH_YES ;
3417+
3418+ syntax :
3419+ gfc_syntax_error (ST_SYNC_TEAM );
3420+
3421+ return MATCH_ERROR ;
3422+ }
32903423
32913424/* Match LOCK/UNLOCK statement. Syntax:
32923425 LOCK ( lock-variable [ , lock-stat-list ] )
0 commit comments