Пример #1
0
 public TempModule(Set<ModelRootDescriptor> modelRoots) {
   SModuleId id = ModuleId.regular();
   SModuleReference reference = new ModuleReference("TempModule" + id, id);
   setModuleReference(reference);
   myDescriptor = new ModuleDescriptor();
   myDescriptor.getModelRootDescriptors().addAll(modelRoots);
   setModuleDescriptor(myDescriptor, false);
 }
Пример #2
0
 /**
  * Create a model with a tree of nodes.
  *
  * <p>It's an instance method as I envision model to be owned by this class, which would keep
  * extra info about created model (e.g. number of initial nodes to get rid of constants like
  * (3*5*2 + 3*5 + 3) from the tests code
  *
  * @param nodesAtLevel number of child elements for each parent (i.e. of previous level) element.
  *     Each node at level i has nodesAtLevel[i] children
  */
 public SModel createModel(@Nullable int... nodesAtLevel) {
   final SNode top = createNode(nodesAtLevel);
   final jetbrains.mps.smodel.SModel modelData =
       new jetbrains.mps.smodel.SModel(
           new SModelReference(
               new ModuleReference("M", ModuleId.regular()), SModelId.generate(), "m"));
   for (SNode c : top.getChildren(ourRole)) {
     modelData.addRootNode(c);
   }
   assert myNeedEditableModel;
   return myModel = new TestModelBase(modelData);
 }
Пример #3
0
 public EvaluationModule() {
   SModuleReference reference =
       new ModuleReference("Evaluation Container Module", ModuleId.regular());
   setModuleReference(reference);
   myDescriptor = new ModuleDescriptor();
 }