Versions Compared

Key

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

Generator User Guide

Table of Contents
maxLevel4
minLevel2
locationtop
includePagestrue

Introduction

Generator is a part of language specification that defines the denotational semantics for a language's concepts.

MPS follows the model-to-model transformation approach. Generator specifies the translation of constructions in the input language to constructions in the output language. The process of model-to-model transformation may involve many intermediate models and results in the output model where all constructions are in language whose semantics are already defined elsewhere.

For instance, most concepts in baseLanguage (classes, methods etc) are "machine understandable", wherefore baseLanguage is often used as an output language.

Target assets are created by applying model-to-text transformation, which must be supported by the output language. The language aspect for that is called TextGen and is available as a separate tab in concept's editor. MPS provides destructive update of generated assets only.

For instance, baseLanguage's TextGen aspect generates *.java files at the following location:
<generator output path>\<model name>\<ClassName>.java
where:
Generator output path - is specified in the module which owns the input model (see MPS modules).
Model name - is a path segment created by replacing '.' with the file separator in the input model's name.

Include Page
MPSD1:Generator Overview
MPSD1:Generator Overview

Include Page
MPSD1:Generator Language
MPSD1:Generator Language

Include Page
MPSD1:The Generator Algorithm
MPSD1:The Generator Algorithm

Include Page
MPSD1: Mapping Priorities
MPSD1: Mapping Priorities

Examples

If you're feeling like it's time for more practical experience, check out the generator demos.
The demos contain examples of usage of all concepts discussed above.


Previous Next