Child pages
  • MPS project structure

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Here's a major difference that MPS brings along - programs are not in text form. Ever.
You might be used to the fact that any programming is done in text. You edit text. The text is than parsed by a parser to build an AST. Grammars are typically used to define parsers. AST is then used as the core data structure to work with your program further, either by the compiler to generate runnable code or by an IDE to give you clever code assistance, refactorings and static code analysis.
Now, seeing that AST is such a useful, flexible and powerful data structure, how would it help if we could work with AST from the very beginning, avoiding text, grammar and parsers altogether? Well, this is exactly what MPS does.

Programs To give your code some structure, programs in MPS are stored inside organized into models. Models are Think of models as somewhat similar to compilation units of in text based languages. For To give you an example, BaseLanguage, the bottom-line language in MPS' counterpart of Java - baseLanguage - , which builds on Java and extends it in many ways, uses models so that each model represents a Java package. Each model consists Models typically consist of root nodes, which are similar to represent top level declarations in text base languages, and non-root nodes. For example, in baseLanguage, root nodes are BaseLanguage classes, interfaces, and enums are root nodes. (You can read more about nodes here ). Also models store

Models need to hold their meta information about themselves:

  • models they use (imported models)
  • languages they are written in (in used languages section);
  • models they use (imported models);
  • devkits they use (devkits section)

This meta information can be altered in Model Properties of the model's pop-up menu or using Alt + Enter when positioned on the model.



To Models themselves are the most fine-grained grouping elements. Modules organize models as into higher level entities, we have a module concept. A module typically consists of a set of models plus meta information that describes its several models acompanied with meta information describing module's properties and dependencies. MPS operates with distinguishes several kinds types of modules: solutions, languages, devkits, and generators.
We'll now talk about the meta-information structure as well as the individual module types in detail.

module meta information
module meta information