void CgCallBackNewCtored( // NEW OBJECT WAS CTOR'ED SE* se_del, // - state entry for delete during CTOR throw FN_CTL* fctl ) // - function information { cg_name expr; // - emitted expression patch_entry* pe; // - entry when patching cg_type type; // - not used CondInfoNewCtorBeg( fctl ); expr = CgExprPopType( &type ); CgCommaBefore( expr, type ); pe = CarveAlloc( carve_patch_se ); pe->se = se_del; expr = CgExprPopType( &type ); expr = CgCallBackLeft( expr , &callBackNewCtorBeg , pe , type ); expr = CgComma( emitPatch( &pe->patch ), expr, type ); CgExprPush( expr, type ); CondInfoNewCtorEnd( fctl ); expr = CgExprPopType( &type ); CgCommaOptional( expr, type ); pe = CarveAlloc( carve_patch_se ); pe->se = se_del; expr = CgExprPopType( &type ); expr = CgSideEffect( expr, emitPatch( &pe->patch ), type ); expr = CgCallBackRight( expr , &callBackNewCtorEnd , pe , type ); CgExprPush( expr, type ); }
cg_name CgCallBackCtorStart( // SET A CALL BACK FOR A CTOR-TEST : START cg_name expr, // - expression cg_type type, // - type of expression SE* se ) // - state entry to be inserted on call back { expr = genCtorFlagClr( expr, type, se ); expr = CgCallBackLeft( expr, &setSeCtorTest, se, type ); return expr; }
static void condInfoCallBack( // SET A CALL-BACK void (*rtn)( void* ), // - call-back routine bool on_left ) // - true ==> call-back on left { cg_name expr; // - top expression cg_type type; // - top type COND_STK* stk; // - stack ptr stk = PstkTopElement( &stack_cond_blks ); expr = CgExprPopType( &type ); if( on_left ) { expr = CgCallBackLeft( expr, rtn, stk, type ); } else { expr = CgCallBackRight( expr, rtn, stk, type ); } CgExprPush( expr, type ); }
cg_name CgCallBackTempCtor( // SET CALL BACKS FOR TEMP CTORED cg_name expr, // - expression cg_type type, // - type of expression SE* se ) // - state entry to be inserted on call back { temp_entry* te; // - entry for ctored temporary cg_name emit; // - emitted expression te = CarveAlloc( carve_temp_entry ); te->se = se; te->patch = NULL; expr = CgCallBackLeft( expr, &setTempStart, te, type ); emit = emitPatch( &te->patch ); if( emit != NULL ) { expr = CgSideEffect( expr, emit, type ); } expr = CgCallBackRight( expr, &setTempDone, te, type ); return expr; }