Exemple #1
0
void    FCAssignedGOTOList( void ) {
//============================

// Perform assigned GOTO with list.

    sel_handle          s;
    label_handle        label;
    sym_id              sn;
    sym_id              var;
    obj_ptr             curr_obj;

    var = GetPtr();
    curr_obj = FCodeTell( 0 );
    s = CGSelInit();
    for(;;) {
        sn = GetPtr();
        if( sn == NULL ) break;
        if( ( sn->u.st.flags & SN_IN_GOTO_LIST ) == 0 ) {
            sn->u.st.flags |= SN_IN_GOTO_LIST;
            label = GetStmtLabel( sn );
            CGSelCase( s, label, sn->u.st.address );
        }
    }
    label = BENewLabel();
    CGSelOther( s, label );
    CGSelect( s, CGUnary( O_POINTS, CGFEName( var, TY_INTEGER ), TY_INTEGER ) );
    CGControl( O_LABEL, NULL, label );
    BEFiniLabel( label );
    FCodeSeek( curr_obj );
    for(;;) {
        sn = GetPtr();
        if( sn == NULL ) break;
        sn->u.st.flags &= ~SN_IN_GOTO_LIST;
        RefStmtLabel( sn );
    }
}
Exemple #2
0
void CgSwitchCase               // GENERATE CODE FOR SWITCH CASE
    ( long case_value )         // - case value
{
    CGSelCase( switch_id(), switch_label(), case_value );
}