Cannot reproduce tutorial

Hi All,

I am having trouble reproducing the Calculator tutorial.  I am stuck at the part immediately after creating the InputField. The generated editor does not seem to work.
I think the problem might be in how I am creating the Calculator editor.

Everything in my project looks just like the online tutorial.  However, I have noticed that the Calculator editor definition changes when I rebuild my project after creating the InputField editor definition.

Here is a screenshot of my Calculator editor just before I build my project...
mps_before_build.JPG


Here is a screenshot of my Calculator editor after I build my project, notice that the name 'inputField' has changed to 'smodelAttribute'...
mps_after_build.JPG


Is this supposed to happen?

In the generated editor I am not able to enter multiple input element using the generated editor, here is a screenshot showing the error that occurs in the editor when I type 'input width' and then hit Enter...
mps_editor_error.JPG



Can anybody tell me what has gone wrong with my project?
I am using the latest build... v2.02, MPS-20.7651

Thanks,
  • ted
3 comments
Comment actions Permalink
OK, it turns out that I lied when I said that everything in my project looked just like the tutorial.
I had set the cardinality of inputField to 0..1 instead of 0...n.   That's why 'inputField' is red in the screenshot before my build - the editor is trying to tell me that I can't use inputField in that cell.....
0
Comment actions Permalink
Hello!
Is it clear now or not?
The cell that looks like
(-|%some_filed%|/empty cell|<default>|-)
prettyPrint(); Is the editor for the collection. When you're editing the single child (or reference) the editor should look like this
%some_field%
prettyPrint(); or this:
%some_field%->{name}
prettyPrint();
The first case means that you include the editor for the 'some_field' (useful when some_field is a child and you're going to create and edit it within the parent),
and the second case means that you will refer to another concept instance (not suitable for children, just for references) and {name} is a field of some_field that will be shown when you select the target of this reference.

  – Alexey
0
Comment actions Permalink
The only addition to the above: whenever you see something red in the MPS editor, it most likely means the program is invalid. To check what is wrong, there is a tool "Model Checker" (see context menu on a model, language or solution).
0

Please sign in to leave a comment.