added new directives

This commit is contained in:
ALEXks
2024-12-05 12:50:36 +03:00
parent 77c46121a2
commit 21acea498e
18 changed files with 8906 additions and 9031 deletions

View File

@@ -1,10 +1,12 @@
acc_specification: acc_declare
| acc_routine
;
acc_directive: acc_region
| acc_end_region
| acc_checksection
| acc_end_checksection
| acc_get_actual
| acc_actual
| acc_routine
;
acc_region: ACC_REGION end_spec opt_clause
@@ -98,14 +100,46 @@ acc_end_region: ACC_END_REGION
acc_end_checksection: ACC_END_CHECKSECTION
{ $$ = get_bfnd(fi,ACC_END_CHECKSECTION_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
;
acc_declare: ACC_DECLARE in_dcl opt_double_colon acc_declare_list
{
$$ = get_bfnd(fi,ACC_DECLARE_DIR, SMNULL, $4, LLNULL, LLNULL);
}
;
acc_declare_list: declare_var
{ $$ = make_llnd(fi,EXPR_LIST, $1, LLNULL, SMNULL); }
| acc_declare_list COMMA declare_var
{ $$ = set_ll_list($1, $3, EXPR_LIST); }
;
declare_var: name
{
PTR_SYMB s;
s = make_scalar($1,TYNULL,LOCAL);
if((s->attr & PROCESSORS_BIT) ||(s->attr & TASK_BIT) || (s->attr & TEMPLATE_BIT) || (s->attr & ALIGN_BIT) || (s->attr & DISTRIBUTE_BIT) || (s->attr & DYNAMIC_BIT) || (s->attr & HEAP_BIT)|| (s->attr & DVM_POINTER_BIT) || (s->attr & INHERIT_BIT) ||(s->attr & SHADOW_BIT))
errstr("Inconsistent declaration of identifier %s", s->ident, 16);
$$ = make_llnd(fi,VAR_REF, LLNULL, LLNULL, s);
}
;
acc_routine: ACC_ROUTINE in_dcl opt_targets_clause
acc_routine: ACC_ROUTINE in_dcl opt_routine_clauses
{ $$ = get_bfnd(fi,ACC_ROUTINE_DIR,SMNULL,$3,LLNULL,LLNULL);}
;
opt_targets_clause: needkeyword keywordoff
{ $$ = LLNULL; }
| needkeyword targets_clause
{ $$ = $2;}
;
opt_routine_clauses:
{ $$ = LLNULL;}
| routine_clause_list
{ $$ = $1;}
;
routine_clause_list: routine_clause
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
| routine_clause_list routine_clause
{ $$ = set_ll_list($1,$2,EXPR_LIST); }
;
routine_clause: COMMA needkeyword PRIVATE LEFTPAR acc_declare_list RIGHTPAR
{ $$ = make_llnd(fi,ACC_PRIVATE_OP,$5,LLNULL,SMNULL);}
| COMMA needkeyword targets_clause
{ $$ = $3;}
;