Tutorial for MPS 1.5 ?

Friendly greetings !

I'm new to MPS and jetbrain's tools.

I'm willing to learn MPS and downloaded the current release for linux (MPS 1.5), but the tutorial look like outdated.

Contextual menu name and behaviour do not work as expected in the tutorial. i could manage it to create the 1st Calculator Structure, but i can't find a way to create the sandbox.

Are you planning to update the tutorial soon ?

is there a new tutorial hidden somewhere ?

what version of MPS is used by the tutorial ?

I'll probably download the MPS version used by the tutorial, then use the 1.5 version once i understood the basic concept of MPS.

Thank you very much.

*hugs*

0
18 comments

Hi!

I'm willing to learn MPS and downloaded the current release for linux (MPS 1.5), but the tutorial look like outdated.

Contextual menu name and behaviour do not work as expected in the tutorial. i could manage it to create the 1st Calculator Structure, but i can't find a way to create the sandbox.

Are you planning to update the tutorial soon ?

is there a new tutorial hidden somewhere ?

You are right - MPS tutorial is outdated now. We are going to update it ASAP. Unfortunately there is no newer tutorial version now, sorry..

what version of MPS is used by the tutorial ?

I'll probably download the MPS version used by the tutorial, then use the 1.5 version once i understood the basic concept of MPS.

I think MPS 1.1 was used to create this tutorial. You can download and use it. Nevertheless I suggest you to stay with the latest version (1.5) and try passing through the tutorial there. Latest MPS version contains a number of new features + other improvements, so I suggest you using it. :-)

0
Avatar
Permanently deleted user

ok thank you.

I will retry ... and/or wait for the new tutorial version :-)

0
Avatar
Permanently deleted user

No, it was MPS 1.0, not 1.1. You can see it on the screenshots.

0
Avatar
Permanently deleted user

Can you help please ?

I am stuck here : http://www.jetbrains.com/mps/docs/tutorial.html#Creating_an_editor_for_Calculator

After creating the editor, i'm supposed to right click on sandbox -> Create Root Node -> Calculator

but " [S] jetbrains.mps.tutorial.calculator.sandbox " do not have any child so i can't right click on sandbox.

I can right click on the root [S] thingy, and create a new "model" of "model from source".

I bet that i should create a "model". but it ask for a model name, a stereotype and some other stuff.

What to do please ? Thank you :-)

screenshot attached



Attachment(s):
MPS.jpg
0

Hi!

but " [S] jetbrains.mps.tutorial.calculator.sandbox " do not have any child so i can't right click on sandbox.

I can right click on the root [S] thingy, and create a new "model" of "model from source".

I bet that i should create a "model". but it ask for a model name, a stereotype and some other stuff.

Right, it was changed - new version of MPS will create "solution" (root  node with "S" icon in project tree) for you but will not create new  model instance in this solution ("sandbox" node on tutorial screen  shots), so to make it working you need to create new model instance  manually:

  • - right-click onto solution node and choose "New->Model" from the pop-up  menu
  • specify model name ("sandbox") and press "OK" button -> "Model Properties" dialog appears
  • in "Used languages" section of "Model Properties" dialog press "+" and choose "jetbrains.mps.tutorial.calculator" language
  • click "Ok" -> new model will be created

Now you can:

right click on sandbox -> Create Root Node -> Calculator

Sorry again for inconveniences - we are going to update tutorial ASAP!

0
Avatar
Permanently deleted user

it worked. thank you :-)

0

Hi!

MPS Tutorial was recently updated in accordance with MPS 1.5 release state.

0
Avatar
Permanently deleted user

\o/ \o/

0
Avatar
Permanently deleted user

Hi,

i just finished to translate a tutorial which describes how one can write a bean-extension for the BaseLang. You can find it here. Originally it was written as accompanying text for an article i published within the german JAVA MAGAZIN 06/10.

It actually is based on MPS 1.1 but i wrote an appropriate update for 1.5 here.

There is also a FAQ here and i also collected some ideas for maybe-projects (some already started) here.

I would be very appreciated for any feedback or any desire to participate!

Feel free to contact me via mirkoDOTrichterATcompagoDOTde.

Regards, Mirko

0
Avatar
Permanently deleted user

Did anybody else try the updates Tutorial: http://www.jetbrains.com/mps/docs/tutorial.html

I installed JetBrains MPS 1.5 (build 6411) and did the tutorial.


Now I am stuck here:

"The only thing that's left is handling the InputFieldReference. We don't have a generator for it yet. To create it,     we need to define a reduction rule. Reduction rules are applied to all the nodes that are copied during generation,     for example, in $COPY_SRC$ macro. Let's create the corresponding reduction rule in the mapping configuration:"

At language generation I am getting 1 error and 2 warnungs:

The error is "No reference in role "localVariableDeclaration" (declaration cadinality is 1)"

the error points to the reduction rule in generator\main.

The two warnungs are pointing to the two lines with i = ...

Does anybody else have this error? Is there a solution?

When I click "ignore errors" at language generation I am getting this output from the generator (bold line marks the error):

  public void update() {
    int i_a = 0;
    int i_b = 0;
    int i_c = 0;
    try {
      i_a = Integer.parseInt(inputField_a.getText());
      i_b = Integer.parseInt(inputField_b.getText());
      i_c = Integer.parseInt(inputField_c.getText());
    } catch (NumberFormatException e) {
      // just ignore it
    }
    .setText("" + (2 + 3 + 9 + i_a));
  }

0
Avatar
Permanently deleted user

I have the same problem. The interesting thing is that if you take a look at the

picture in the tutorial, the mentioned line also appears in red.

I've attached a picture that shows the error.



Attachment(s):
mps.png
0
Avatar
Permanently deleted user

Well, they say and know that there is a problem. But the tutorial sais:

Don't worry about the red color of the resulting node. Red color here means that local variable reference doesn't     have a target local variable declaration. But we don't need it here, since we will set a target with a reference     macro.

But we have to worry cause the generated code is broken ...

0
Avatar
Permanently deleted user

If we ignore such line, the try-catch block statement appears as blank. In addition, MPS does report the mentioned error at the line that was shown on the previous picture.

0
Avatar
Permanently deleted user

I am now able to generate the block statement of the try-catch. Once I go to "Generate Text" from the sanbox, it outputs the Java code correctly.

However, it is still not possible to generate the language (it reports 1 error and 1 warning). I also tried the calculator-sample that comes with MPS, and guess what: it has the same error. So, at least now I feel confortable to state that the error is not being caused by anything I have typed.

Anyways, the problem persists :-(

0
Avatar
Permanently deleted user

Here's the error reported by the model checker.



Attachment(s):
error.png
0

Hi!

Concerning the problem reported by ModelChecker - it looks like I missed it because I was passing tutorial with ModelChecker switched off. :-O

Anyway, for now I suggest you to press "ignore" in ModelChecker dialog, so you will be able to generate calculator language code properly. We have a bug report asking to correct this problem with ModelChecker and I'm going to modify MPS Tutorial text to reflect this problem ASAP.

0

Hi!

You should be able to generate language code properly if you press "ignore" button in ModelChecker dialog (see my posting below).

Concerning the compilation problems in generated code - it looks like the reason was either in incorrect generator state (you was not able to generate it) or you made some mistakes in generator itself... I hope, ignoring ModelChecker errors should correct all these problems.

0

Hi!

MPS tutorial was updated to work around this problem:

Don't worry about the red color of the resulting node.

part was removed from there. With the current version of this tutorial you should be able to create corresponding template without any errors. See updated implementing generator tutorial part.

0

Please sign in to leave a comment.