MPS User's Guide

Skip to end of metadata
Go to start of metadata

Beginner's Fast Track to MPS

Here's our offer for new comers: Try our new Fast Track to MPS page, which was designed specifically for developers, who are completely new to MPS and prefer a guided tour through the MPS landscape. You will walk the beaten path one step at a time, following clear marks that show you where to go next. The information is structured so that you progress from simpler concepts to the more involved ones and at the end of the journey you'll understand MPS and will be able to use it effectively on your projects.

Not a language designer yet? Try out one of the other MPS user guides

You do not need to design your own languages and DSLs to benefit from MPS. You may well enjoy using languages designed and developed by somebody else. These languages are typically distributed as language plugins for Java IDEs or they may come bundled with their own standalone IDEs. Since using existing languages is a much simpler tasks than creating them, we prepared dedicated user guides covering the topics required by DSL users.

MPS User Guide for Language Designers

Welcome to MPS. This User Guide will navigate you through the many concepts and usage patterns that MPS offers and will give you a hand whenever you need to know more details about any particular aspect of the system.
First, the Introduction section will offer a high-level overview of the basic notions and their roles. In the second section, named Using MPS, you'll get familiar with the interface through which you'll communicate with MPS. Although very small, there still are some differences between how you interact with MPS and how you typically use other common programming tools.

In the third section, called Defining Languages, we'll get to the meat of MPS. We'll show details on how to define the many aspects of your custom languages - their structure, editors, generators and type systems rules. The IDE integration section will then provide some additional context necessary to help you improve the IDE aspect of your languages and integrate them nicely into MPS.

The Platform languages section gives you details on all languages bundled with MPS including the corner stone language of MPS - the BaseLanguage. Whatever didn't fit the mentioned scheme was placed into the last Miscelaneous section.

For your convenience, you also view the user guide in a single page or as pdf.

Tutorials and cookbooks

Don't forget to check out our tutorials and focused cookbooks listed in the Tutorials and Cookbooks sections, to learn more about individual aspects of MPS

Before you start

MPS glossary

Abstract Syntax Tree (AST) a logical representation of code in memory (and disk) in the shape of a tree forest that describes hierarchies of nodes. These nodes have a notion of a parent-child relationship. Additionally, two nodes can be mutually connected with explicit references that go across the hierarchy structure.
BaseLanguage a projectional clone of Java 6. I follows the Java specification and is 1:1 compatible with Java 6. Additionally, MPS provides several handy extensiont to BaseLanguagem such dates, collections, closures and many others.
Code generation the process of transfromation code from one model (AST) into another model. For example, code describing a set of business rules can be transformed into plain Java so that it can be compiled with javac and run as part of an enterprise application.
DevKit A package of related languages that have been grouped for user convenience.
Domain Specific Language (DSL) a language dedicated to a particular problem domain, typically created with the aim of simplicity and greater expressivity compared to a general purpose language.
Language plugin a packaged library ( a zip file) containing all the required elements in order to use a language either inside either IntelliJ IDEA or MPS.
Projectional editor an editor that allows the user to edit the AST representation of code directly, while mimicing the behavior of a text editor to some extent. The user sees text on teh screen and edits it, however, in reality the text is only an illusion (projection) of an AST.
Module The top-level organization element of an MPS project that typically groups several models together. It can have three basic types: Solution, Language and DevKit and may depend on other modules and models.
Model A lower-level organizational element grouping individual concepts. It may depend on other models.
Structure A language aspect defining all types (concepts) of AST nodes that can be used in the language together with their relationships.
Concept A definition that describes the abstract structure of a syntax element. E.g. the IfStatement concepts says that an if holds a boolean Expression and up-to two StatementLists.
Constraints A language aspect holding additional restrictions on concepts, their properties and relationships.
Behavior Allows the language designer to define behavior of the language concepts.
Editor Holds vizualization definitions of individual language concepts. Since the way concepts are viewed and edited on the screen can be customized, the editors specify how the user will interact with the language.
Scope The set of elements that are visible and applicable to a particular position within a program. Typically only a sub-set of all elements of a particular kind can be used at any given program location.
Typesystem A set of rules that validate and infer types of concepts in a program. 
Actions User-invoked commands that may perform changes to the code. Actions can be attached to keyboard shortcuts or menu items.
Intention actions Context-sensitive actions offered to the language user through a small pop-up window triggered by the Alt + Enter key shortcut. These actions typically perform a relatively local refactoring to the code under carret or a selected block of code.
Surround With intention actions Intentions applicable to a selected block of code that wrap the block by another concept. E.g. Surround with Try-Catch.
Refactoring A potentially substantial automated change in code structure triggered by a user action.

Frequently Asked Questions (FAQ)

Check out the FAQ document to get some of your questions answered before you even ask them.

User guide for language designers

  1. Introduction to MPS
  2. Using MPS
  3. Defining Languages
  4. Languages for IDE Integration
  5. IDE tools
  6. Platform Languages
  7. Delivering languages to the users and Java IDE integration
  8. Tutorials
  9. Cookbooks
  10. Miscellaneous
Did not find the answers?
Post your questions to our discussion forum!
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Page: Base Language Page: Base Language Extensions Style Guide Page: Basic notions Page: Behavior Page: Build languages (obsolete) Page: Closures Page: Collections language Page: Constraints Page: Copyrights Page: Dates language Page: Data flow Page: Editor Page: Find usages Page: Generator Page: Intentions Page: Language tests language Page: MPS project structure Page: Plugin Page: Regexp language Page: SModel language Page: Structure Page: Tuples Page: Typesystem Page: Unit test language Page: XML language Page: Builders Page: Changes highlighting Page: Commanding the editor Page: Debugger Page: GWT Support Page: Other languages Page: Pattern Page: TextGen Page: Type Extension Methods Page: Cookbook - Type System Page: Dataflow Page: Version Control Page: BaseLanguage Coding Cookbook Page: HowTo -- Integrating into the MPS Make Framework Page: HowTo -- Adding additional Tools (aka Views) Page: HowTo -- Integration with the Data Flow Engine Page: HowTo -- MPS and Git Page: HowTo -- MPS and ant Page: FAQ Page: Regular expressions Page: Run Configurations Page: Using MPS Debugger Page: Building IntelliJ IDEA language plugins Page: Using MPS inside IntelliJ IDEA Page: Building MPS language plugins Page: MPS screen-casts Page: Finding your way out Page: Build Language Page: Extension support Page: Suppressing Errors Page: Refactoring Page: Dependencies Analyzer Page: Module Dependencies Tool Page: Building standalone IDEs for your languages Page: Commenting out Page: Documentation comments Page: MPS user guide for Java developers (IntelliJ IDEA) Page: Glossary Page: MPS user guide for DSL users Page: Where to find language plugins Page: IDE configuration Page: Scopes Page: Generator cookbook Page: Editor cookbook Page: Removing bootstrapping dependency problems Page: Fast Track to MPS Page: Open API - accessing models from code