Issue with INSPECTOR and Generator

Hi I'm new to MPS, I was executing Constants example by following in youtobe instructions.

Two things I did not work for me.

1. While configuring editor for Constants, in the inspector section, there is Style option, to define style name, in autopopulate KeyWord is not there, instead I can find Comment and StubImplementation.

-> Can any body help me to resolve this? is any thing changed in new version of MPS

2.After configuring Generator same steps followed in video tutorial. when preview generated code, I see following output but not a java code

   Model processed:r:27a83f2c-1987-42c5-8ada-d795e01d4976(Constants.constants)
   Context node:r:27a83f2c-1987-42c5-8ada-d795e01d4976(Constants.constants)/6120843235542339530
   Text generation completed successfully
   None of generated text units reference context node

How to resolve this?

Thanks,

Shiva B.

1
5 comments

Hi Shiva,

the KeyWord style is defined in BaseLanguageStyle, which comes from the j.m.baseLanguage.editor model. You need to import this model into your editor model (Control + M) to make the stylesheet available in your editor definitions.

As for the generator, could you post your current generator code?

Vaclav

2
Avatar
Permanently deleted user

Thank you Vaclav for response,

I fixed 1st as you suggested. for 2nd Generation  I have simple code :

(Cars is a root concept and contains listOfCars:Car )

---------default code -----

root template
input Cars

public class mapped_cars {

}

 Here after this, when I go to solution and click on preview generated text, I get above mentioned text, not a java code

 

 

1

Do you have a root mapping rule configured in the main mapping configuration?

 

2
Avatar
Permanently deleted user

I setup again a project for Constants freshly, I'm getting JAVA code with Constants project and concepts I created. Java Code generation is working here.

I will check with my Cars example, may be I might have missed something.

Thank you for your time,

It helped a lot.

----------- mappings in main ------

root mapping rules:
concept Cars --> mapped_cars

inheritors false
condition <always>
keep input root default

1

Also please always make sure that you have rebuilt your language and generator definition before you try to generate your models.

Vaclav
2

Please sign in to leave a comment.