void CfrTil_Namespace_UsingFirst ( ) { Namespace * ns = Namespace_Find ( ( byte* ) _DataStack_Pop ( ) ) ; if ( ns ) { _Namespace_AddToUsingList ( ns ) ; } }
void _CfrTil_Namespace_NotUsing ( byte * name ) { Namespace * ns = Namespace_Find ( name ) ; if ( ns ) { _Namespace_RemoveFromUsingList ( ns ) ; _Q_->OVT_CfrTil->InNamespace = _Namespace_FirstOnUsingList ( ) ; //( Namespace* ) _Tree_Map_FromANode ( dlnode_Next ( ( dlnode* ) ns ), ( cMapFunction_1 ) _Namespace_IsUsing ) ; } }
void _CfrTil_RemoveNamespaceFromUsingListAndClear ( byte * name ) { _Namespace_RemoveFromUsingListAndClear ( Namespace_Find ( name ) ) ; }
int32 _CfrTil_VariableValueGet ( byte* nameSpace, byte * name ) { return _Namespace_VariableValueGet ( Namespace_Find ( nameSpace ), name ) ; }
void _CfrTil_Init ( CfrTil * cfrTil, Namespace * nss ) { uint32 type = CFRTIL ; _Q_->OVT_CfrTil = cfrTil ; // TODO : organize these buffers and their use cfrTil->OriginalInputLineB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->InputLineB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->SourceCodeSPB = _Buffer_NewPermanent ( SOURCE_CODE_BUFFER_SIZE ) ; cfrTil->LambdaCalculusPB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->TokenB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->PrintfB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->Scratch1B = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->StringB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->DebugB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->DebugB1 = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->DebugB2 = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->StringInsertB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->StringInsertB2 = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->StringInsertB3 = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->TabCompletionBuf = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->StringMacroB = _Buffer_NewPermanent ( BUFFER_SIZE ) ; cfrTil->OriginalInputLine = Buffer_Data ( cfrTil->OriginalInputLineB ) ; cfrTil->SourceCodeScratchPad = Buffer_Data ( cfrTil->SourceCodeSPB ) ; cfrTil->LispPrintBuffer = Buffer_Data ( cfrTil->LambdaCalculusPB ) ; cfrTil->TokenBuffer = Buffer_Data ( cfrTil->TokenB ) ; SetState ( cfrTil, CFRTIL_RUN | OPTIMIZE_ON | INLINE_ON, true ) ; if ( _Q_->Verbosity > 2 ) Printf ( ( byte* ) "\nSystem Memory is being reallocated. " ) ; cfrTil->ContextStack = Stack_New ( 256, type ) ; cfrTil->ObjectStack = Stack_New ( 1 * K, type ) ; cfrTil->DebugStateStack = Stack_New ( 1 * K, type ) ; _Stack_Push ( cfrTil->DebugStateStack, 0 ) ; cfrTil->TokenList = _dllist_New ( type ) ; cfrTil->DebugWordList = _dllist_New ( type ) ; _Context_ = cfrTil->Context0 = _Context_New ( cfrTil, type ) ; cfrTil->Debugger0 = _Debugger_New ( type ) ; // nb : must be after System_NamespacesInit cfrTil->cs_CpuState = CpuState_New ( type ) ; if ( cfrTil->SaveDsp && cfrTil->DataStack )// with _Q_->RestartCondition = STOP from Debugger_Stop { Dsp = cfrTil->SaveDsp ; } else { cfrTil->DataStack = Stack_New ( _Q_->DataStackSize, CFRTIL ) ; _CfrTil_DataStack_Init ( cfrTil ) ; } if ( nss ) { cfrTil->Namespaces = nss ; } else { _CfrTil_NamespacesInit ( cfrTil ) ; } cfrTil->StoreWord = _Word_FindAny ( ( byte* ) "store" ) ; cfrTil->PokeWord = _Word_FindAny ( ( byte* ) "poke" ) ; cfrTil->LispNamespace = Namespace_Find ( ( byte* ) "Lisp" ) ; CfrTil_MachineCodePrimitive_AddWords ( ) ; // in any case we need to reinit these for eg. debugger->SaveCpuState (), etc. CfrTil_ReadTables_Setup ( cfrTil ) ; CfrTil_LexerTables_Setup ( cfrTil ) ; cfrTil->LC = 0 ; //LC_New ( ) ; //cfrTil->SCA_BlockedIndex = - 1 ; }
void Finder_SetNamedQualifyingNamespace ( Finder * finder, byte * name ) { finder->QualifyingNamespace = Namespace_Find ( name ) ; }