Esempio n. 1
0
void CpRemBlock( void )
{
    sym_id      rb;

    if( EmptyCSList() == FALSE ) {
        StmtErr( SP_BLK_IN_STRUCTURE );
    }
    AddCSNode( CS_REMOTEBLOCK );
    CSHead->bottom = NextLabel();
    CSHead->branch = NextLabel();
    GBranch( CSHead->branch );
    if( BlockName( SY_RB_DEFINED ) ) {
        rb = CITNode->sym_ptr;
        if( ( rb->ns.flags & SY_REFERENCED ) == 0 ) {
            rb->ns.si.rb.ref_count = 0;
        }
        rb->ns.si.rb.ref_count++;
        CSHead->cs_info.rb = rb;
        GStartBlock();
        BIStartRBorEP( rb );
    }
    AdvanceITPtr();
    ReqEOS();
    StNumbers.in_remote = TRUE;
    ClearRem();
}
Esempio n. 2
0
void CpEntry( void )
{
    entry_pt    *entry;
    bool        in_subr;
    sym_id      sym;

    if( ( ProgSw & PS_IN_SUBPROGRAM ) == 0 ) {
        StmtErr( SR_ILL_IN_PROG );
    }
    if( !EmptyCSList() ) {
        Error( EY_NOT_IN_CS );
    }
    if( ReqName( NAME_FUNCTION ) ) {
        in_subr = (SubProgId->u.ns.flags & SY_SUBPROG_TYPE) == SY_SUBROUTINE;
        sym = LkSym();
        if( ( sym->u.ns.flags & (SY_USAGE|SY_SUB_PARM|SY_IN_EC|SY_SAVED) ) ||
                ( in_subr && (sym->u.ns.flags & SY_TYPE) ) ) {
            IllName( sym );
        } else {
            sym->u.ns.u1.s.typ = CITNode->typ;
            sym->u.ns.flags &= SY_TYPE;
            if( in_subr ) {
                sym->u.ns.flags |= SY_USAGE | SY_SUBPROGRAM | SY_SENTRY |
                                   SY_SUBROUTINE | SY_REFERENCED;
            } else {
                sym->u.ns.flags |= SY_USAGE | SY_SUBPROGRAM | SY_SENTRY |
                                   SY_FUNCTION;
            }
            STFnShadow( sym );
            entry = AddEntryPt( sym );
            AdvanceITPtr();
            if( Options & OPT_TRACE ) {
                GSetSrcLine();
            }
            if( RecOpenParen() ) {
                ParmList( in_subr, entry );
                ReqCloseParen();
                ReqNOpn();
                AdvanceITPtr();
            }
            BIStartRBorEP( sym );
            ReqEOS();
        }
    }
    SgmtSw &= ~SG_PROLOG_DONE;       // indicate we need prologue
}