コード例 #1
0
ファイル: readTable.c プロジェクト: dennisj001/openvmtil
void
ReadTable_Newline ( ReadLiner * rl ) // '\n'
{
    if ( GetState ( _Context_->System0, ADD_READLINE_TO_HISTORY ) || GetState ( rl, ADD_TO_HISTORY ) )
    {
        _OpenVmTil_AddStringToHistoryList ( rl->InputLine ) ;
    }
    rl->LineNumber ++ ;
    //if ( ! GetState ( _Debugger_, DBG_COMMAND_LINE ) )
    {
        _ReadLine_AppendCharacter_Actual ( rl ) ;
        ReadLine_ShowCharacter ( rl ) ;
    }
    ReadLiner_Done ( rl ) ;
}
コード例 #2
0
ファイル: system.c プロジェクト: 8l/openvmtil
void
_CfrTil_Source ( Word *word, int32 addToHistoryFlag )
{
    if ( word )
    {
        char * name = c_dd ( word->Name ) ;
        uint64 category = word->CType ;
        if ( word->ContainingNamespace ) Printf ( ( byte* ) "\n%s.", word->ContainingNamespace->Name ) ;
        if ( category & OBJECT )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "object" ) ;
        }
        else if ( category & NAMESPACE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "namespace" ) ;
        }
        else if ( category & TEXT_MACRO )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "macro" ) ;
        }
        else if ( category & LOCAL_VARIABLE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "local variable" ) ;
        }
        else if ( category & STACK_VARIABLE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "stack variable" ) ;
        }
        else if ( category & VARIABLE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "variable" ) ;
        }
        else if ( category & CONSTANT )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "constant" ) ;
        }
        else if ( category & ALIAS )
        {
            Word * aword = Word_GetFromCodeAddress_NoAlias ( ( byte* ) ( block ) word->Definition ) ;
            if ( aword )
            {
                Printf ( ( byte* ) "%s alias for %s", name, ( char* ) c_dd ( aword->Name ) ) ;
                word = aword ;
            }
        }
        else if ( category & CPRIMITIVE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "primitive" ) ;
        }
        else if ( word->LType & T_LISP_COMPILED_WORD )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "lambdaCalculus compiled word" ) ;
        }
        else if ( category & CFRTIL_WORD )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "cfrTil compiled word" ) ;
        }
        else if ( word->LType & T_LISP_DEFINE )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "lambdaCalculus defined word" ) ;
        }
        else if ( category & BLOCK )
        {
            Printf ( ( byte* ) "%s <:> %s", name, "cfrTil compiled code block" ) ;
        }
        // else CfrTil_Exception ( 0, QUIT ) ;
        if ( category & INLINE ) Printf ( ( byte* ) ", %s", "inline" ) ;
        if ( category & IMMEDIATE ) Printf ( ( byte* ) ", %s", "immediate" ) ;
        if ( category & PREFIX ) Printf ( ( byte* ) ", %s", "prefix" ) ;
        if ( category & C_PREFIX ) Printf ( ( byte* ) ", %s", "c_prefix" ) ;
        if ( category & C_RETURN ) Printf ( ( byte* ) ", %s", "c_return" ) ;
        if ( category & INFIXABLE ) Printf ( ( byte* ) ", %s", "infixable" ) ;
        if ( category & INFIXABLE ) Printf ( ( byte* ) ", %s", "infixable" ) ;
        if ( word->W_pwd_WordData )
        {
            __Word_ShowSourceCode ( word ) ; // source code has newlines for multiline history
            if ( addToHistoryFlag ) _OpenVmTil_AddStringToHistoryList ( word->SourceCode ) ;
            if ( word->Filename ) Printf ( ( byte* ) "\nSource code file location of %s : \"%s\" at %d.%d", name, word->Filename, word->LineNumber, word->CursorPosition ) ;
            if ( ! ( category & CPRIMITIVE ) ) Printf ( ( byte* ) "\nCompiled with : %s%s%s", GetState ( word, COMPILED_OPTIMIZED ) ? "optimizeOn" : "optimizeOff", GetState ( word, COMPILED_INLINE ) ? ", inlineOn" : ", inlineOff",  
                GetState (_Context_, C_SYNTAX )? ", c_syntaxOn" : "", GetState (_Context_, INFIX_MODE )? ", infixOn" : "" ) ;
            if ( word->S_CodeSize ) Printf ( ( byte* ) " -- starting at address : 0x%x -- code size = %d bytes", word->Definition, word->S_CodeSize ) ;
            else Printf ( ( byte* ) " -- starting at address : 0x%x", word->Definition ) ;
        }
        Printf ( ( byte* ) "\n" ) ;
    }
}