Original in Russian: http://programmingmindstream.blogspot.ru/2015/08/blog-post_86.html
The previous series was here – Description of the meta-meta-model.
In that article the meta-meta-model containing ONE element, <<@meta>>, was described.
Now let us describe the meta-model consisting of two elements: UMLCategory and UMLClass.
https://bitbucket.org/lulinalex/mindstream/src/1938252ed6bebe61707a18a3c3033a1bc0647d2d/Examples/Scripts/CodeGeneration/CodeGen5.ms.script?at=B284
What we get is as follows:
The previous series was here – Description of the meta-meta-model.
In that article the meta-meta-model containing ONE element, <<@meta>>, was described.
Now let us describe the meta-model consisting of two elements: UMLCategory and UMLClass.
https://bitbucket.org/lulinalex/mindstream/src/1938252ed6bebe61707a18a3c3033a1bc0647d2d/Examples/Scripts/CodeGeneration/CodeGen5.ms.script?at=B284
What we get is as follows:
USES metaMACRO.ms.dict ; Test CodeGen // is meta information that allows binding the documentation to the code elements. Consequently, the documentation is available from the script engine. %SUMMARY ' 'That is where we determine axiomatic of meta-meta model and extract it in a separate dictionary later. ' ; // %SUMMARY // --------------------------------------------------------------------------- meta-meta-model-begin 'That is where we determine axiomatic of meta-meta model and then separate it in a dictionary. ' StereotypeStereotypeProducer meta %SUMMARY ' Base element of meta-model determined This is the element that allows us to pull the rest “by hair out of the swamp” Other primitives are derived from this one ' ; // %SUMMARY ; // meta meta-meta-model-end // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- meta-model-begin 'That is where we determine axiomatic of meta model and then separate it in a dictionary. Next we will determine the UML concepts – https://en.wikipedia.org/wiki/Unified_Modeling_Language There are CATEGORIES and CLASSES in it Actually, they merely differ from each other, however, let it be so for it was so decided by some wise men Let’s start with them: ' <<@meta>> UMLCategory %SUMMARY ' Category on UML ' ; // %SUMMARY ; // UMLCategory <<@meta>> UMLClass %SUMMARY ' Class on UML ' ; // %SUMMARY ; // UMLClass meta-model-end // --------------------------------------------------------------------------- USES CodeDump.ms.dict // - the CodeDump.ms.dict is loaded so we can “see” the DumpElement word; @SELF DumpElement // - the CodeGen element and its contents are dumped in a standard output device. // We only do it to debug what we’ve written. ; // CodeGen CodeGen
Комментариев нет:
Отправить комментарий