Exemple #1
0
void
CfrTil_Key ( )
{
#if 0    
    ReadLine_Key ( _Context_->ReadLiner0 ) ;
    _DataStack_Push ( _Context_->ReadLiner0->InputKeyedCharacter ) ;
#else
    _DataStack_Push ( Key ( ) ) ;

#endif    
}
Exemple #2
0
void
CfrTil_dlsym ( )
{
    char * sym = ( char* ) _DataStack_Pop ( ) ;
    char * lib = ( char* ) _DataStack_Pop ( ) ;
    _DataStack_Push ( ( int ) _dlsym ( lib, sym ) ) ;
}
Exemple #3
0
void
File_Tell ( )
{
    FILE * file = ( FILE * ) _DataStack_Pop ( ) ;
    int32 result = ftell ( file ) ;
    _DataStack_Push ( result ) ;
}
Exemple #4
0
void
CfrTil_Filename ( )
{
    byte * filename = _Context_->ReadLiner0->bp_Filename ;
    if ( ! filename ) filename = ( byte* ) "command line" ;
    _DataStack_Push ( ( int32 ) filename ) ;
}
Exemple #5
0
void
CfrTil_Parse ( )
{
    Lexer * lexer = _Context_->Lexer0 ;
    byte * token = ( byte* ) _DataStack_Pop ( ) ;
    Lexer_ParseObject ( lexer, token ) ;
    _DataStack_Push ( lexer->Literal ) ;
}
Exemple #6
0
void
File_Open ( )
{
    byte * filename = ( byte* ) _DataStack_Pop ( ) ;
    FILE * file = fopen ( ( char* ) filename, "r" ) ;
    if ( file == NULL )
    {
        perror ( "\nFile_Open error : " ) ;
        CfrTil_Quit ( ) ;
    }
    else _DataStack_Push ( ( int32 ) file ) ;
}
Exemple #7
0
void
File_Read ( )
{
    int32 size = _DataStack_Pop ( ) ;
    byte * ptr = ( byte * ) _DataStack_Pop ( ) ;
    FILE * file = ( FILE * ) _DataStack_Pop ( ) ;
    int32 result = fread ( ptr, size, 1, file ) ;
    _DataStack_Push ( result ) ;
    if ( result != size )
    {
        if ( ! feof ( file ) )
        {
            if ( ferror ( file ) )
            {
                perror ( "\nFile_Read error : " ) ;
                CfrTil_Quit ( ) ;
            }
        }
    }
}
Exemple #8
0
void
_CfrTil_EndBlock1 ( BlockInfo * bi )
{
    Compiler * compiler = _Context_->Compiler0 ;
    if ( _Stack_IsEmpty ( compiler->BlockStack ) )
    {
        _CfrTil_InstallGotoCallPoints_Keyed ( bi, GI_RETURN ) ;
        if ( compiler->NumberOfRegisterVariables && ( compiler->NumberOfStackVariables == 1 ) &&
            Compiler_GetState ( compiler, ( RETURN_TOS | RETURN_EAX ) ) )
        {
            bi->bp_First = bi->Start ;
            if ( Compiler_GetState ( compiler, RETURN_EAX ) )
            {
                Compile_Move_EAX_To_TOS ( DSP ) ;
            }
        }
        else if ( _Compiler_IsFrameNecessary ( compiler ) && ( ! GetState ( compiler, DONT_REMOVE_STACK_VARIABLES ) ) )
        {
            if ( Compiler_GetState ( compiler, SAVE_ESP ) ) // SAVE_ESP is set by 'return'
            {
                _ESP_Setup ( ) ;
                bi->bp_First = bi->FrameStart ;
            }
            else bi->bp_First = bi->AfterEspSave ; // 3 : after ESP_Save code in frame setup code
            _Compiler_RemoveLocalFrame ( compiler ) ;
        }
        else
        {
            bi->bp_First = bi->Start ;
        }
    }
    _Compile_Return ( ) ;
    _DataStack_Push ( ( int32 ) bi->bp_First ) ;
    bi->bp_Last = Here ;
    _SetOffsetForCallOrJump ( bi->JumpOffset, Here, 0 ) ;
}
Exemple #9
0
void
CfrTil_Kbhit ( void )
{
    _DataStack_Push ( ( int32 ) kbhit ( ) ) ;
}
Exemple #10
0
void
File_Exists ()
{
    byte * name = ( byte* ) _DataStack_Pop ( ) ;
    _DataStack_Push ( _File_Exists ( name ) ) ;
}
Exemple #11
0
void
File_Size ( )
{
    FILE * file = ( FILE * ) _DataStack_Pop ( ) ;
    _DataStack_Push ( _File_Size ( file ) ) ;
}
Exemple #12
0
void
CfrTil_Interpreter_IsDone ( )
{
    _DataStack_Push ( GetState ( _Context_->Interpreter0, END_OF_FILE | END_OF_STRING | INTERPRETER_DONE ) ) ;
}
Exemple #13
0
void
CfrTil_LineCharacterNumber ( )
{
    _DataStack_Push ( ( int32 ) _Context_->ReadLiner0->InputLineCharacterNumber ) ;
}
Exemple #14
0
void
CfrTil_Interpret_ReadToList ( )
{
    dllist * interpList = _CfrTil_Interpret_ReadToList ( ) ;
    _DataStack_Push ( ( int32 ) interpList ) ;
}
Exemple #15
0
void
CfrTil_Token ( )
{
    _DataStack_Push ( ( int32 ) Lexer_ReadToken ( _Context_->Lexer0 ) ) ;
}
Exemple #16
0
void
CfrTil_AllocateNew ( )
{
    _DataStack_Push ( ( int32 ) _CfrTil_AllocateNew ( _DataStack_Pop ( ), OBJECT_MEMORY ) ) ;
}
Exemple #17
0
void
CfrTil_DataStack_Size ( )
{
    _DataStack_Push ( DataStack_Depth ( ) ) ;
}
Exemple #18
0
void
CfrTil_Debugger_Verbosity ( )
{
    _DataStack_Push ( ( int32 ) & _Debugger_->Verbosity ) ;
}
Exemple #19
0
void
CfrTil_Postfix_Find ( )
{
    Word * word = Finder_Word_FindUsing ( _Context_->Finder0, ( byte* ) _DataStack_Pop ( ) ) ;
    _DataStack_Push ( ( int32 ) word ) ;
}
Exemple #20
0
void
CfrTil_Find ( )
{
    _DataStack_Push ( ( int32 ) Finder_FindToken ( _Context_->Finder0, _Context_->Lexer0->OriginalToken ) ) ;
}
Exemple #21
0
void
CfrTil_LineNumber ( )
{
    _DataStack_Push ( ( int32 ) _Context_->ReadLiner0->i32_LineNumber ) ;
}
Exemple #22
0
void
CfrTil_TokenToWord ()
{
    byte * token = (byte*) _DataStack_Pop ( ) ;
    _DataStack_Push ( (int32) _Interpreter_TokenToWord ( _Context_->Interpreter0, token ) ) ;
}