Пример #1
0
void ConversionDiagLR           // DIAGNOSE LEFT, RIGHT OPERANDS
    ( TYPE left                 // - left type
    , TYPE right )              // - right type
{
    if( NULL != left ) {
        InfMsgPtr( INF_LEFT_OPERAND_TYPE, left );
    }
    if( NULL != right ) {
        InfMsgPtr( INF_RIGHT_OPERAND_TYPE, right );
    }
}
Пример #2
0
static void infMsgType(         // DISPLAY INFORMATION FOR A CONVERSION TYPE
    MSG_NUM msg_num,            // - message number
    TYPE type )                 // - TYPE in error
{
    TYPE cl_type;               // - type, when class or ref to class

    InfMsgPtr( msg_num, type );
    cl_type = ClassTypeForType( type );
    if( cl_type != NULL && !TypeDefined( cl_type ) ) {
        InfMsgPtr( INF_CLASS_NOT_DEFINED, cl_type );
    } else {
        TYPE ptr_type = PointerTypeEquivalent( type );
        if( NULL != ptr_type ) {
            type_flag not_used;
            cl_type = StructType( TypePointedAt( type, &not_used ) );
            if( NULL != cl_type && !TypeDefined( cl_type ) ) {
                InfMsgPtr( INF_CLASS_NOT_DEFINED, cl_type );
            }
        }
    }
}
Пример #3
0
static boolean segmentIsCode(
    fe_seg_id segid )           // - function symbol
{
    PC_SEGMENT *seg;

    seg = segIdLookup( segid );
    if( ( seg->attrs & EXEC ) == 0 ) {
        CErr( ERR_CODE_IN_NONCODE_SEG, seg->name );
        InfMsgPtr( INF_CODE_SEGMENT_SUFFIX, CODE_ENDING );
        return( FALSE );
    }
    return( TRUE );
}
Пример #4
0
void CmdLnCtxInfo(              // PRINT CONTEXT INFO
    void )
{
    CTX_CL* entry;              // - current entry
    VBUF buf;                   // - buffer

    VbufInit( &buf );
    for( entry = VstkTop( &cmdLnContexts )
       ; entry != NULL
       ; entry = VstkNext( &cmdLnContexts, entry ) ) {
        VbufRewind( &buf );
        switch( entry->base.ctx_type ) {
          case CTX_CLTYPE_ENV :
            VbufConcChr( &buf, '@' );
            VbufConcStr( &buf, entry->env.var );
            break;
          case CTX_CLTYPE_FC :
            VbufConcStr( &buf, "batch file of commands, line " );
            VbufConcDecimal( &buf, CompInfo.fc_file_line );
            break;
          case CTX_CLTYPE_PGM :
            VbufConcStr( &buf, "command line" );
            break;
          case CTX_CLTYPE_FILE :
            VbufConcStr( &buf, SrcFileFullName( entry->file.source ) );
            break;
          DbgDefault( "bad command-line context" );
        }
        if( entry->base.sw_ptr != NULL ) {
            size_t size;
            char const * not_used;
            char const* old = CmdScanAddr();
            CmdScanInit( entry->base.sw_ptr );
            CmdScanChar();
            size = CmdScanOption( &not_used ) + 1;
            CmdScanInit( old );
            VbufConcStr( &buf, ", switch: " );
            for( old = entry->base.sw_ptr; size > 0; ++old, --size ) {
                VbufConcChr( &buf, *old );
            }
        }
        InfMsgPtr( INF_SWITCH, VbufString( &buf ) );
    }
    VbufFree( &buf );
}