What's New in MPS 2018.1

SModel language enhancements

In some cases, you have to deal with raw pointers (like SNodeReference or SModelReference). Working with them can be puzzling since it's hard to create and operate them. To make working with pointers easier, we bring new types and operations in SModel language.

Node pointer

We have made working with node pointers easier, by introducing a new "node-ptr<>" type. These pointers can be resolved to the actual nodes via the "resolve" operation. The "node-ptr/ ... /" expression is a replacement for the old "nodePointer/ ... /" construct, which is already deprecated. Migration scripts are created to take care of the conversion of the expressions.

Setting references with pointers

When setting a target to a reference link, there is no need to access the target node. A pointer to the target is enough. The "set ptr" operation applicable to reference link access expressions sets the reference target to the specified pointers. To check that a node is the one specified by a node pointer, the new "is" operation should be used.

Strict typing rules for smodel types

The typing rules for SModel types have been made stricter. The SNodeReference interface methods are no longer available on “node-ptr" values. The downcast operator should be used to explicitly obtain SNodeReference. Additionally, the "pointer" operation on node instances now returns "node-ptr" instead of the regular SNodeReference.

Node-ptr expressions in reference macro

The reference macro was modified to accept node-ptr expressions. We verify the pointer type returned from the reference macro in accordance with the type of the reference.

Node Id to specify pointer

Now you can use the model name and node ID to specify a pointer to a non-named concept instance or for hard coding a reference as a string.

Model pointers

The "model-reference" type has been refactored into "model-ptr<>". This pointer can be resolved to the actual model via the "resolve" operation.

New Migration scripts

We have introduced a couple of migration scripts that may help you migrate old SModel Language constructs like the node/.../` expressions, undesirable quotations or downcasts. To run them, go to Tools -> Scripts -> Enhancements... and choose "SModel Language Enhancements (node-ptr<> and model-ptr)". Also, in the same window, there is the "Use node pointers in reference macro queries" option available that handles old constructions in the generator macros.

Improved scoping for SModel queries

Smodel queries now behave more intuitively towards the scope they operate on. If a scope is declared as a parameter to a specific query, the query is executed on the whole scope including any read-only models, not only from editable models, like it was before.

Editor

Show reflective editor for the subtree

Now you can show the reflective editor for a whole subtree. To do so, select the node and press Cmd/Ctrl+Shift+[ or choose “Show reflective editor for subtree” from the context menu. For going back to the regular editor, press Cmd/Ctrl+], Cmd/Ctrl+Shift+] or right-click the option “Show regular editor for the Subtree”. Showing the reflective editor for just the current node is still available by pressing Cmd/Ctrl+[ or from the context menu.

Transformation menu for property and reference cells

The transformation menu language has been consistently enhanced to support property and reference cells. Property and reference transformation menu parts allow you to customize the menus for property and reference cells better than the “inline menus” used previously.

The two key advantages are:

  • They can be attached to any cell; not just property and reference cells.
  • They can be applied to the completion as well as to the other locations – context assistant, context menu, and side-transformations.