Run ClassConcept without void main(string[] args)

Hi Community,

i created a concept "Test" which is derived from baselang.ClassConcept. The generator will create a java class with a main() method, so that the class can be executed.

What is the simplest way to execute it directly within mps with a right click - like in the case of classconcepts containing a main().

1 comment
Hi, Daniel,

We have a concept IMainClass from a language jetbrains.mps.execution.util designed for that purpose. Execution works automatically for concepts that implement it (but the context menu will appear only after first generation of a node).

IMainClass concept has two behavior methods, which you can override if you wish:
  • getUnitName which returnes a fully qualified name of a class to be executed. By default it returnes the name of the class generated from this node.
  • isNodeRunnable should return true for nodes that can be executed. By default it always returnes true.


Please sign in to leave a comment.