class PTRANS
****
The context for a code transformation from AS form to AM form.


Flattened version is here

Ancestors
STRANS CS_COMPONENT

Descendants
TRANS



Public


Readable Attributes
attr cur_cohort:AM_LOCAL_EXPR;
****
attr cur_lock:$AM_STMT;
**** lock branch.
attr cur_par_ob:AM_LOCAL_EXPR;
**** only par helper object
attr cur_param_ob:AM_LOCAL_EXPR;
**** If the current routine implements a fork or a par then cur_param_ob is the helper object

Writable Attributes
attr cur_cohort:AM_LOCAL_EXPR;
****
attr cur_lock:$AM_STMT;
**** lock branch.
attr cur_par_ob:AM_LOCAL_EXPR;
**** only par helper object
attr cur_param_ob:AM_LOCAL_EXPR;
**** If the current routine implements a fork or a par then cur_param_ob is the helper object

Constants
const att_code := 13;
const do_direct_export : BOOL := true;
**** should be true except for debug
const do_helper_export : BOOL := false;
**** should be false except for debug
const do_helper_import : BOOL := true;
**** should be true except for debug
const export_code := 2;
const frk_code := 11;
const import_code := 1;
const par_code := 12;

Features
any_context_err(e:AS_ANY_EXPR, tp:$TP)
append_export_in_list(l:AS_STMT_LIST,on_exit_only:BOOL)
as_for_import_export(imporexp:INT,body:AS_STMT_LIST,
as_for_p_sys(n:IDENT,body:AS_STMT_LIST, source:SFILE_ID):$AS_STMT
as_for_sys_import_export(imporexp:INT,body:AS_STMT_LIST,
as_of_local_in_helpers(local:IDENT,helper:AM_LOCAL_EXPR,
attach_without_attach_err(s:AS_ATTACH_STMT)
check_pSather_stmt_for_return(t:$AS_STMT)
cohort_context_err(e:AS_COHORT_EXPR, tp:$TP)
cohort_outside_par_fork_err(s:AS_COHORT_EXPR)
far_context_err(e:AS_FAR_EXPR, tp:$TP)
fork_outside_par_err(s:AS_FORK_STMT)
has_export(s:SIG):BOOL
has_import(s:SIG):BOOL
here_context_err(e:AS_HERE_EXPR, tp:$TP)
insert_import(l:AS_STMT_LIST,source:SFILE_ID)
insert_import_after(t:$AS_STMT)
is_in_lock:BOOL
**** is called in non-pSather programs as well
is_in_par_or_fork:BOOL
**** is called in non-pSather programs as well
is_sys_export(s:SIG):BOOL
is_sys_import(s:SIG):BOOL
iter_call_out_of_loop_err
**** this is called in non-pSather programs as well
last_declared_helper:AM_LOCAL_EXPR
last_declared_par_helper:AM_LOCAL_EXPR
link_helper_stmt(newid_ob:IDENT,body:AS_STMT_LIST,
local_is_in_helpers(local:IDENT,helper:AM_LOCAL_EXPR):BOOL
local_is_in_par_helpers(local:IDENT,helper:AM_LOCAL_EXPR):BOOL
main
name_of_local_in_helpers(local:IDENT,helper:AM_LOCAL_EXPR):FLIST{IDENT}
near_context_err(e:AS_NEAR_EXPR, tp:$TP)
previous(s:$AS_STMT):$AS_STMT
show_elements_of_tp(tp:$TP)
sys_closure_nest(ncs:$AM_EXPR)
sys_closure_self(sig:SIG)
transform_any_expr(e:AS_ANY_EXPR, tp:$TP):$AM_EXPR
transform_at_expr(e:AS_AT_EXPR, tp:$TP):$AM_EXPR
transform_attach_stmt(s:AS_ATTACH_STMT):$AM_STMT
transform_case_stmt(s:AS_CASE_STMT):$AM_STMT
**** this is called in non-pSather programs as well
transform_cohort_expr(e:AS_COHORT_EXPR, tp:$TP):$AM_EXPR
transform_far_expr(e:AS_FAR_EXPR, tp:$TP):$AM_EXPR
transform_fork_stmt(s:AS_FORK_STMT):$AM_STMT
transform_here_expr(e:AS_HERE_EXPR, tp:$TP):$AM_EXPR
transform_if_stmt(s:AS_IF_STMT):$AM_STMT
**** this is called in non-pSather programs as well
transform_interf_attach_stmt(s:AS_INTERF_ATTACH_STMT):$AM_STMT
transform_lock_stmt(s:AS_LOCK_STMT):$AM_STMT
transform_near_expr(e:AS_NEAR_EXPR, tp:$TP):$AM_EXPR
transform_pSather_assign_stmt_err(s:AS_ASSIGN_STMT)
transform_pSather_expr(e:$AS_EXPR, tp:$TP):$AM_EXPR
transform_pSather_local_assign(loc:AM_LOCAL_EXPR,s:AS_ASSIGN_STMT)
transform_pSather_rout_elt_stuff(as:AS_ROUT_DEF)
transform_pSather_stmt(s:$AS_STMT):$AM_STMT
transform_par_stmt(s:AS_PAR_STMT):$AM_STMT
transform_stmt_list(l:AS_STMT_LIST):$AM_STMT
**** this is called in non-pSather programs as well!
transform_sync_stmt(s:AS_SYNC_STMT):$AM_STMT
transform_unlock_stmt(s:AS_UNLOCK_STMT):$AM_STMT
transform_where_expr(e:AS_WHERE_EXPR, tp:$TP):$AM_EXPR
transform_with_near_stmt(s:AS_WITH_NEAR_STMT):$AM_STMT
unlock_in_par_fork_err(s:AS_UNLOCK_STMT)
unlock_outside_lock_err(s:AS_UNLOCK_STMT)
where_context_err(e:AS_WHERE_EXPR, tp:$TP)
with_near_locals_only_err(i:AS_IDENT_LIST)
with_near_non_ref_err(i:AS_IDENT_LIST)

Iters
active_locals_and_params!:AM_LOCAL_EXPR


Private

add_helper_to_tbls(helper:IDENT,orig_cl_params:ARRAY{$TP}):TP_CLASS
create_helper_object(s:$AS_STMT,newid_ob:IDENT,newid_cl:IDENT,
create_helper_object_stmt(newid_ob:IDENT,newid_cl:IDENT,
is_in_loop_and_calls_iter(e:$AS_EXPR):BOOL
is_of_type_attach(tp:$TP):BOOL
prev_export(p:$AS_STMT,s:$AS_STMT,l:AS_STMT_LIST)
turn_into_routine(routname:IDENT,helper_ob:IDENT,helper_cl:IDENT,
update_routine_in_tbls(cur_class_tp:TP_CLASS,newrout:AS_ROUT_DEF)