Basic notions

This chapter describes basic MPS notions: nodes, concepts, and language. These are key to understanding how MPS works. However, they depend on one other so much that it's impossible to describe them one by one. This section gives only the shortest definitions for each notion. For details, consult the sections devoted to nodes, concept (structure language), and languages (project structure).

Almost everything you work with in the MPS editor is an AST-node, belonging to an Abstract Syntax Tree (AST). In this documentation we use a shorter name, node, for AST-node.

Nodes form a tree. Each node has a parent node (except root nodes), child nodes, properties, and references to other nodes.

AST-nodes are contained in models. In each model there are some distinguished nodes that don't have a parent, called root nodes. For example, in baseLanguage (MPS' counterpart of Java), the root nodes are classes, interfaces, and enums.

Each node stores a reference to its declaration, its concept. A concept defines the class of nodes and specifies structure of nodes in that class. It specifies which children, properties, and references an instance of a node can have. Concept declarations form an inheritance hierarchy. If one concept extends another, it inherits all children, properties, and references from its parent. Concept declarations are nodes themselves. Moreover, they are instances of a special concept, ConceptDeclaration, which is an instance of itself.

A language is a set of concepts with additional information. This additional information is grouped into different language aspects. They describe different features of a language: its editor, completion menu, typesystem, generator, etc. A language can extend another language, meaning that it can use any concept of extended language as a type for its children and references, and can be inherited from any concept of extended language.

Labels

 
(None)