Clone wiki

MindStream / Articles in English / Description of the meta-meta-model

Original in Russian

The previous series was here – Take your mind off objects emulation for a while and let’s get to meta-model and code generation

I have “decorated” it a bit.

https://bitbucket.org/lulinalex/mindstream/src/87bd8df93e76bb4d154a75cf9652e8263c251050/Examples/Scripts/CodeGeneration/CodeGen3.ms.script?at=B284

The result is as follows:

USES
 metaMACRO.ms.dict
;

Test CodeGen
 // %SUMMARY это is meta information that allows linking the documentation to the code elements.
//   Consequently, the documentation is available from the script engine.
 %SUMMARY '
 That is where we test meta-model building, model building and then code generation.'
 ;

// ---------------------------------------------------------------------------

meta-meta-model-begin
 'That is where we determine axiomatic of meta-meta model and extract it in a separate dictionary later.
 '

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
 ' This is where we determine axiomatic of the specific model.
  We will extract it in a separate dictionary later.

  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

Lets start with them:
  '

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

Again, the code is somewhat “self-documented”.

See the following words:

%SUMMARY
meta-meta-model-begin
meta-model-begin

Some time later I will tell about the self-descriptiveness” and how to use.

Let me give you a hint – “requirements and tests”,  UseCase, TDD and BDD.

Updated