пятница, 30 сентября 2016 г.

#1272. Просто код

PROGRAM DictionaryByName.ms.script

USES
 ElementsRTTI.ms.dict
;

USES
 GarantMetaModel.ms.dict
;

USES
 CollectElements.ms.dict
;

USES
 Log.ms.dict
;

CollectInAllDictionaries: 
( 
  STRING IN aDictName 
 '%%InjectedBy ' aDictName FindInFile 
 OR ( 'MELINK Stereotype st_ScriptKeywordsPack ;' aDictName FindInFile )
 DUP ? ( Log: ( [ 'Collect Injected: ' aDictName ] strings:Cat ) )
) 
(
  IN aWord
 aWord .Dependencies
 .filter> .IsInjects
 .map> .Target
 if ( aWord .IsScriptKeywordsPack ) then
 begin
  .join> ( aWord .Inherits )
 end // ( aWord .IsScriptKeywordsPack )
) // CollectInAllDictionaries:
 '.ms.model.script.inj' '_InjectedElements' OutCollected

CollectInAllDictionaries: 
( 
  STRING IN aDictName 
 '%%ImplementedBy ' aDictName FindInFile
 DUP ? ( Log: ( [ 'Collect Implementors: ' aDictName ] strings:Cat ) )
) 
(
  IN aWord
 aWord .Implements
 .filter> ( 
   IN anElement
  RULES 
   ( anElement .IsVCMFormDefinition )
    true
   ( anElement .IsAtom )
    true
   DEFAULT
    false
  ; // RULES   
 ) // .filter>
) // CollectInAllDictionaries:
 '.ms.model.script.impl' '_Implementors' OutCollected

Комментариев нет:

Отправить комментарий