Ejemplo n.º 1
0
 @Override
 protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts() {
   return Arrays.<MenuPart<TransformationMenuItem, TransformationMenuContext>>asList(
       new ConstraintsFilteringTransformationMenuPartDecorator(
           new AddMethodModifiersOnTypes.TransformationMenuPart_Group_svkn68_a0
               .TransformationMenuPart_Action_svkn68_a0a(),
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x6c6b6a1e379f9408L,
               "jetbrains.mps.baseLanguage.structure.MethodDeclaration")),
       new ConstraintsFilteringTransformationMenuPartDecorator(
           new AddMethodModifiersOnTypes.TransformationMenuPart_Group_svkn68_a0
               .TransformationMenuPart_Action_svkn68_b0a(),
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x6c6b6a1e379f9408L,
               "jetbrains.mps.baseLanguage.structure.MethodDeclaration")),
       new ConstraintsFilteringTransformationMenuPartDecorator(
           new AddMethodModifiersOnTypes.TransformationMenuPart_Group_svkn68_a0
               .TransformationMenuPart_Action_svkn68_c0a(),
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x6c6b6a1e379f9408L,
               "jetbrains.mps.baseLanguage.structure.MethodDeclaration")));
 }
 @Override
 @NotNull
 protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts(
     TransformationMenuContext _context) {
   List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result =
       new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>();
   if (ListSequence.fromListAndArray(
           new ArrayList<String>(),
           MenuLocations.LEFT_SIDE_TRANSFORM,
           MenuLocations.RIGHT_SIDE_TRANSFORM)
       .contains(_context.getMenuLocation())) {
     result.add(
         new DefaultConceptMenusTransformationMenuPart(
             SModelUtil.getDirectSuperConcepts(
                 MetaAdapterFactory.getConcept(
                     0xf3347d8a0e794f35L,
                     0x8ac91574f25c986fL,
                     0xbe3a0d5ba1a2c12L,
                     "jetbrains.mps.execution.commands.structure.ProcessType"))));
   }
   if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM)
       .contains(_context.getMenuLocation())) {
     result.add(
         new ConstraintsFilteringTransformationMenuPartDecorator(
             new ProcessType_TransformationMenu.TransformationMenuPart_Action_fvqin_a1(),
             MetaAdapterFactory.getConcept(
                 0xf3347d8a0e794f35L,
                 0x8ac91574f25c986fL,
                 0x87f99370d7e1ea3L,
                 "jetbrains.mps.execution.commands.structure.CommandProcessType")));
   }
   return result;
 }
Ejemplo n.º 3
0
 public static boolean baseMappingRule_Condition_1217891542034(
     final BaseMappingRuleContext _context) {
   return SNodeOperations.isInstanceOf(
       SLinkOperations.getTarget(
           SNodeOperations.as(
               SLinkOperations.getTarget(
                   _context.getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0xf3061a5392264cc5L,
                       0xa443f952ceaf5816L,
                       0x11b0d00332cL,
                       0xf8c77f1e97L,
                       "lValue")),
               MetaAdapterFactory.getConcept(
                   0xf3061a5392264cc5L,
                   0xa443f952ceaf5816L,
                   0x116b46a08c4L,
                   "jetbrains.mps.baseLanguage.structure.DotExpression")),
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x116b46a08c4L,
               0x116b46b36c4L,
               "operation")),
       MetaAdapterFactory.getConcept(
           0xd7706f639be2479cL,
           0xa3daae92af1e64d5L,
           0x11b8fe60348L,
           "jetbrains.mps.lang.generator.generationContext.structure.GenerationContextOp_UserObjectAccessBase"));
 }
 private static SNode _quotation_createNode_501tdc_a0a0b() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   SNode quotedNode_2 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x10c260e9444L,
               "jetbrains.mps.baseLanguage.collections.structure.SequenceType"),
           null,
           null,
           false);
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x7866978ea0f04cc7L,
               0x81bc4d213d9375e1L,
               0x10a2d94c0cdL,
               "jetbrains.mps.lang.smodel.structure.SModelType"),
           null,
           null,
           false);
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0x8388864671ce4f1cL,
           0x9c53c54016f6ad4fL,
           0x10c260e9444L,
           0x10c260ee40eL,
           "elementType"),
       quotedNode_2);
   return quotedNode_1;
 }
 /*package*/ static List<SConcept> getParameterConcepts_id2xELmDxyi2v(
     @NotNull SNode __thisNode__) {
   List<SConcept> result =
       ConceptFunction__BehaviorDescriptor.getParameterConcepts_id2xELmDxyi2v.invokeSpecial(
           __thisNode__);
   ListSequence.fromList(result)
       .addElement(
           MetaAdapterFactory.getConcept(
               0x13744753c81f424aL,
               0x9c1bcf8943bf4e86L,
               0x10e761b3745L,
               "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_model"));
   ListSequence.fromList(result)
       .addElement(
           MetaAdapterFactory.getConcept(
               0x13744753c81f424aL,
               0x9c1bcf8943bf4e86L,
               0x10e761c927aL,
               "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_operationContext"));
   ListSequence.fromList(result)
       .addElement(
           MetaAdapterFactory.getConcept(
               0xaee9cad2acd44608L,
               0xaef20004f6a1cdbdL,
               0x112284c7b8bL,
               "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_sourceNode"));
   return result;
 }
Ejemplo n.º 6
0
 @Override
 public boolean isApplicable(SNode node) {
   if (SNodeOperations.getParent(node) == null
       || !(SNodeOperations.isInstanceOf(
           SNodeOperations.getParent(node),
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8c108ca66L,
               "jetbrains.mps.baseLanguage.structure.ClassConcept")))) {
     return false;
   }
   if (!(SNodeOperations.isInstanceOf(
           node,
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8c108ca68L,
               "jetbrains.mps.baseLanguage.structure.FieldDeclaration")))
       && !(SNodeOperations.isInstanceOf(
           node,
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf93c84351fL,
               "jetbrains.mps.baseLanguage.structure.StaticFieldDeclaration")))) {
     return false;
   }
   return true;
 }
Ejemplo n.º 7
0
 public static boolean baseMappingRule_Condition_1196429868936(
     final BaseMappingRuleContext _context) {
   return SNodeOperations.isInstanceOf(
           TypeChecker.getInstance()
               .getTypeOf(
                   SLinkOperations.getTarget(
                       _context.getNode(),
                       MetaAdapterFactory.getContainmentLink(
                           0xf3061a5392264cc5L,
                           0xa443f952ceaf5816L,
                           0xfbdeb6fecfL,
                           0xfbdeb7a11cL,
                           "leftExpression"))),
           MetaAdapterFactory.getConcept(
               0xff24ab03965e4d15L,
               0x9aed52dc276658f4L,
               0x11686a0422aL,
               "jetbrains.mps.samples.complex.structure.ComplexType"))
       && SNodeOperations.isInstanceOf(
           TypeChecker.getInstance()
               .getTypeOf(
                   SLinkOperations.getTarget(
                       _context.getNode(),
                       MetaAdapterFactory.getContainmentLink(
                           0xf3061a5392264cc5L,
                           0xa443f952ceaf5816L,
                           0xfbdeb6fecfL,
                           0xfbdeb7a11bL,
                           "rightExpression"))),
           MetaAdapterFactory.getConcept(
               0xff24ab03965e4d15L,
               0x9aed52dc276658f4L,
               0x11686a0422aL,
               "jetbrains.mps.samples.complex.structure.ComplexType"));
 }
 @Override
 public void childRemoved(SModelChildEvent event) {
   if (SNodeOperations.isInstanceOf(
       ((SNode) event.getParent()),
       MetaAdapterFactory.getConcept(
           0xf3061a5392264cc5L,
           0xa443f952ceaf5816L,
           0x101d9d3ca30L,
           "jetbrains.mps.baseLanguage.structure.Classifier"))) {
     if (!(SNodeOperations.isInstanceOf(
         ((SNode) event.getChild()),
         MetaAdapterFactory.getConcept(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xf8cc56b1fcL,
             "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration")))) {
       return;
     }
   }
   if (SNodeOperations.isInstanceOf(
       ((SNode) event.getParent()),
       MetaAdapterFactory.getConcept(
           0xf3061a5392264cc5L,
           0xa443f952ceaf5816L,
           0xf8cc56b1fcL,
           "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration"))) {
     String role = event.getChildRole();
     if (!("parameter".equals(role))) {
       return;
     }
   }
   super.childRemoved(event);
 }
 @Deprecated
 private static boolean staticCanBeAChild_Old(
     SNode node,
     SNode parentNode,
     SNode link,
     SNode childConcept,
     final IOperationContext operationContext) {
   return (SNodeOperations.getNodeAncestor(
               parentNode,
               MetaAdapterFactory.getConcept(
                   0x22e72e4c0f6946ceL,
                   0x84036750153aa615L,
                   0x220f4a2c4aff4248L,
                   "jetbrains.mps.execution.configurations.structure.ExecuteBeforeTask_ConceptFunction"),
               true,
               false)
           != null)
       || (SNodeOperations.getNodeAncestor(
               parentNode,
               MetaAdapterFactory.getConcept(
                   0x22e72e4c0f6946ceL,
                   0x84036750153aa615L,
                   0x5532ce3cbd91002cL,
                   "jetbrains.mps.execution.configurations.structure.ExecuteConfiguration_Function"),
               true,
               false)
           != null);
 }
Ejemplo n.º 10
0
 @Override
 @NotNull
 protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts(
     TransformationMenuContext _context) {
   List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result =
       new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>();
   if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM)
       .contains(_context.getMenuLocation())) {
     result.add(
         new ConstraintsFilteringTransformationMenuPartDecorator(
             new postfix.TransformationMenuPart_Action_wa3l4q_a0(),
             MetaAdapterFactory.getConcept(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0x11adecdb4f0L,
                 "jetbrains.mps.baseLanguage.structure.PostfixIncrementExpression")));
     result.add(
         new ConstraintsFilteringTransformationMenuPartDecorator(
             new postfix.TransformationMenuPart_Action_wa3l4q_b0(),
             MetaAdapterFactory.getConcept(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0x11aded05fe6L,
                 "jetbrains.mps.baseLanguage.structure.PostfixDecrementExpression")));
   }
   return result;
 }
Ejemplo n.º 11
0
 public void execute(SNode node) {
   SNode expr =
       SNodeOperations.cast(
           node,
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8c37f506fL,
               "jetbrains.mps.baseLanguage.structure.Expression"));
   Object value =
       Expression__BehaviorDescriptor.getCompileTimeConstantValue_idi1LP2xI.invoke(
           expr, SNodeOperations.getModel(expr).getModule());
   if (value instanceof Boolean) {
     SNode v =
         SNodeFactoryOperations.replaceWithNewChild(
             expr,
             SNodeFactoryOperations.asInstanceConcept(
                 MetaAdapterFactory.getConcept(
                     0xf3061a5392264cc5L,
                     0xa443f952ceaf5816L,
                     0xf8cc56b201L,
                     "jetbrains.mps.baseLanguage.structure.BooleanConstant")));
     SPropertyOperations.set(
         v,
         MetaAdapterFactory.getProperty(
             0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b201L, 0xf8cc56b202L, "value"),
         "" + (((Boolean) value).booleanValue()));
   }
 }
Ejemplo n.º 12
0
 private boolean isApplicableToNode(final SNode node, final EditorContext editorContext) {
   return (SNodeOperations.getParent(node) != null)
       && SNodeOperations.isInstanceOf(
           SNodeOperations.getParent(node),
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0xf9eaff2517L,
               "jetbrains.mps.lang.editor.structure.CellModel_Collection"))
       && SNodeOperations.isInstanceOf(
           SLinkOperations.getTarget(
               SNodeOperations.cast(
                   SNodeOperations.getParent(node),
                   MetaAdapterFactory.getConcept(
                       0x18bc659203a64e29L,
                       0xa83a7ff23bde13baL,
                       0xf9eaff2517L,
                       "jetbrains.mps.lang.editor.structure.CellModel_Collection")),
               MetaAdapterFactory.getContainmentLink(
                   0x18bc659203a64e29L,
                   0xa83a7ff23bde13baL,
                   0xf9eaff2517L,
                   0x10192e0d3baL,
                   "cellLayout")),
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0x120150bb441L,
               "jetbrains.mps.lang.editor.structure.CellLayout_Indent"))
       && !(EditorCellModel_BehaviorDescriptor.isNewLine_idi0pLPAc.invoke(node));
 }
Ejemplo n.º 13
0
 private boolean needToComment(EditorContext editorContext) {
   if (SNodeOperations.isInstanceOf(
       SNodeOperations.getParent(myNode),
       MetaAdapterFactory.getConcept(
           0xceab519525ea4f22L,
           0x9b92103b95ca8c0cL,
           0x3dcc194340c24debL,
           "jetbrains.mps.lang.core.structure.BaseCommentAttribute"))) {
     return false;
   } else if ((SNodeOperations.getNodeAncestor(
           myNode,
           MetaAdapterFactory.getConcept(
               0xceab519525ea4f22L,
               0x9b92103b95ca8c0cL,
               0x3dcc194340c24debL,
               "jetbrains.mps.lang.core.structure.BaseCommentAttribute"),
           false,
           false)
       == null)) {
     return true;
   } else {
     Selection selection = editorContext.getSelectionManager().getSelection();
     if ((selection instanceof EditorCellLabelSelection
         && !(((EditorCellLabelSelection) selection).hasNonTrivialSelection()))) {
       return false;
     } else {
       return true;
     }
   }
 }
 /*package*/ static Scope getScope_id3fifI_xCJOQ(
     @NotNull SNode __thisNode__, SNode kind, SNode child) {
   if (SConceptOperations.isSubConceptOf(
       SNodeOperations.asSConcept(kind),
       MetaAdapterFactory.getConcept(
           0x18bc659203a64e29L,
           0xa83a7ff23bde13baL,
           0x11266742db0L,
           "jetbrains.mps.lang.editor.structure.TransformationMenuVariableDeclaration"))) {
     // For simplicity this does not take into account the position of the child, so variables
     // declared earlier may
     // (incorrectly) reference variables declared later.
     return new HidingByNameScope(
         MetaAdapterFactory.getConcept(
             0x18bc659203a64e29L,
             0xa83a7ff23bde13baL,
             0x11266742db0L,
             "jetbrains.mps.lang.editor.structure.TransformationMenuVariableDeclaration"),
         SNodeOperations.asSConcept(kind),
         new NamedElementsScope(
             SLinkOperations.getChildren(
                 __thisNode__,
                 MetaAdapterFactory.getContainmentLink(
                     0x18bc659203a64e29L,
                     0xa83a7ff23bde13baL,
                     0x671b36136d224047L,
                     0x6a3d2fa8211d204dL,
                     "variables"))),
         ScopeUtils.lazyParentScope(__thisNode__, kind));
   }
   return ScopeProvider__BehaviorDescriptor.getScope_id3fifI_xCJOQ.invokeSpecial(
       __thisNode__, kind, child);
 }
 @NotNull
 @Override
 protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts(
     final SubstituteMenuContext _context) {
   List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> result =
       new ArrayList<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>();
   result.add(
       new ConstraintsFilteringSubstituteMenuPartDecorator(
           new ContextHintsSpecification_SubstituteMenu
               .SubstituteMenuPart_Parameterized_yb5v9l_a(),
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0x3ae0865e9a712712L,
               "jetbrains.mps.lang.editor.structure.ExplicitHintsSpecification")));
   result.add(
       new ConstraintsFilteringSubstituteMenuPartDecorator(
           new SimpleConceptSubstituteMenuPart(
               MetaAdapterFactory.getConcept(
                   0x18bc659203a64e29L,
                   0xa83a7ff23bde13baL,
                   0x555cb285f801e1a1L,
                   "jetbrains.mps.lang.editor.structure.QueryHintsSpecification")),
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0x555cb285f801e1a1L,
               "jetbrains.mps.lang.editor.structure.QueryHintsSpecification")));
   return result;
 }
 private static SNode _quotation_createNode_f6ipu3_a0a4a1() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   SNode quotedNode_2 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "6354ebe7-c22a-4a0f-ac54-50b52ab9b065/f:java_stub#6354ebe7-c22a-4a0f-ac54-50b52ab9b065#java.util(JDK/java.util@java_stub)"),
           facade.createNodeId("~List")));
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_2.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_2,
           facade.createModelReference(
               "8865b7a8-5271-43d3-884c-6fd1d9cfdd34/f:java_stub#8865b7a8-5271-43d3-884c-6fd1d9cfdd34#org.jetbrains.mps.openapi.model(MPS.OpenAPI/org.jetbrains.mps.openapi.model@java_stub)"),
           facade.createNodeId("~SNode")));
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x102419671abL, "parameter"),
       quotedNode_2);
   return quotedNode_1;
 }
 private static Boolean hasParameterRefs_id6qD99pUaonP(@NotNull SNode __thisNode__) {
   SNode node = __thisNode__;
   node = SNodeOperations.getParent(node);
   while (node != null
       && !((SNodeOperations.isInstanceOf(
               node,
               MetaAdapterFactory.getInterfaceConcept(
                   0x7c9e280794ad4afcL,
                   0xadf0aaee45eb2895L,
                   0x48db75d5dc496a4fL,
                   "jetbrains.mps.samples.lambdaCalculus.structure.VariableOwner"))
           && !(ListSequence.fromList(
                   VariableOwner_BehaviorDescriptor.getVariables_id7M_MU5__$7C.invoke(
                       SNodeOperations.cast(
                           node,
                           MetaAdapterFactory.getInterfaceConcept(
                               0x7c9e280794ad4afcL,
                               0xadf0aaee45eb2895L,
                               0x48db75d5dc496a4fL,
                               "jetbrains.mps.samples.lambdaCalculus.structure.VariableOwner"))))
               .contains(
                   SNodeOperations.as(
                       __thisNode__,
                       MetaAdapterFactory.getConcept(
                           0x7c9e280794ad4afcL,
                           0xadf0aaee45eb2895L,
                           0x48db75d5dc496b12L,
                           "jetbrains.mps.samples.lambdaCalculus.structure.Variable"))))))) {
     node = SNodeOperations.getParent(node);
   }
   if (SNodeOperations.isInstanceOf(
       node,
       MetaAdapterFactory.getConcept(
           0x7c9e280794ad4afcL,
           0xadf0aaee45eb2895L,
           0x448ba254edbfc79fL,
           "jetbrains.mps.samples.lambdaCalculus.structure.LetExpression"))) {
     return true;
   }
   if (!(SNodeOperations.isInstanceOf(
       node,
       MetaAdapterFactory.getConcept(
           0x7c9e280794ad4afcL,
           0xadf0aaee45eb2895L,
           0x37d11ba7d7ec98e9L,
           "jetbrains.mps.samples.lambdaCalculus.structure.LambdaExpression")))) {
     return false;
   }
   return LambdaExpression_BehaviorDescriptor.isInFull_id6nQdzuslK0D.invoke(
       SNodeOperations.cast(
           node,
           MetaAdapterFactory.getConcept(
               0x7c9e280794ad4afcL,
               0xadf0aaee45eb2895L,
               0x37d11ba7d7ec98e9L,
               "jetbrains.mps.samples.lambdaCalculus.structure.LambdaExpression")));
 }
 private static List<SNode> getOuterVariables_id4zrttnsimEk(@NotNull SNode __thisNode__) {
   List<SNode> allVar =
       SNodeOperations.getNodeDescendants(
           __thisNode__,
           MetaAdapterFactory.getConcept(
               0x7c9e280794ad4afcL,
               0xadf0aaee45eb2895L,
               0x48db75d5dc496b12L,
               "jetbrains.mps.samples.lambdaCalculus.structure.Variable"),
           false,
           new SAbstractConcept[] {});
   List<SNode> allRef =
       SNodeOperations.getNodeDescendants(
           __thisNode__,
           MetaAdapterFactory.getConcept(
               0x7c9e280794ad4afcL,
               0xadf0aaee45eb2895L,
               0x48db75d5dc496b08L,
               "jetbrains.mps.samples.lambdaCalculus.structure.VariableReference"),
           false,
           new SAbstractConcept[] {});
   List<SNode> result = new ArrayList<SNode>();
   for (SNode ref : allRef) {
     if (!(ListSequence.fromList(allVar)
             .contains(
                 SLinkOperations.getTarget(
                     ref,
                     MetaAdapterFactory.getReferenceLink(
                         0x7c9e280794ad4afcL,
                         0xadf0aaee45eb2895L,
                         0x48db75d5dc496b08L,
                         0x48db75d5dc497af4L,
                         "variable"))))
         && !(ListSequence.fromList(result)
             .contains(
                 SLinkOperations.getTarget(
                     ref,
                     MetaAdapterFactory.getReferenceLink(
                         0x7c9e280794ad4afcL,
                         0xadf0aaee45eb2895L,
                         0x48db75d5dc496b08L,
                         0x48db75d5dc497af4L,
                         "variable"))))) {
       ListSequence.fromList(result)
           .addElement(
               SLinkOperations.getTarget(
                   ref,
                   MetaAdapterFactory.getReferenceLink(
                       0x7c9e280794ad4afcL,
                       0xadf0aaee45eb2895L,
                       0x48db75d5dc496b08L,
                       0x48db75d5dc497af4L,
                       "variable")));
     }
   }
   return result;
 }
Ejemplo n.º 19
0
 private void fillUsedLanguageRuntimes(
     SNode m, Set<SNode> runtimeLanguages, Set<SNode> runtimeSolutions) {
   for (SNode language : getUsedLanguages(m)) {
     boolean hasRuntime = false;
     for (SNode rdep :
         SLinkOperations.getChildren(
             language,
             MetaAdapterFactory.getContainmentLink(
                 0xcf935df46994e9cL,
                 0xa132fa109541cba3L,
                 0x2c446791464290f8L,
                 0x2c4467914643be24L,
                 "runtime"))) {
       if (!(SNodeOperations.isInstanceOf(
           rdep,
           MetaAdapterFactory.getConcept(
               0xcf935df46994e9cL,
               0xa132fa109541cba3L,
               0x2c4467914644b6e3L,
               "jetbrains.mps.build.mps.structure.BuildMps_ModuleSolutionRuntime")))) {
         hasRuntime = true;
         continue;
       }
       SNode runtimeSolution =
           SNodeOperations.as(
               toOriginal(
                   SLinkOperations.getTarget(
                       SNodeOperations.cast(
                           rdep,
                           MetaAdapterFactory.getConcept(
                               0xcf935df46994e9cL,
                               0xa132fa109541cba3L,
                               0x2c4467914644b6e3L,
                               "jetbrains.mps.build.mps.structure.BuildMps_ModuleSolutionRuntime")),
                       MetaAdapterFactory.getReferenceLink(
                           0xcf935df46994e9cL,
                           0xa132fa109541cba3L,
                           0x2c4467914644b6e3L,
                           0x2c4467914644b6e4L,
                           "solution"))),
               MetaAdapterFactory.getConcept(
                   0xcf935df46994e9cL,
                   0xa132fa109541cba3L,
                   0x2c446791464290f7L,
                   "jetbrains.mps.build.mps.structure.BuildMps_Solution"));
       if (runtimeSolution != null) {
         SetSequence.fromSet(runtimeSolutions).addElement(runtimeSolution);
       }
     }
     if (hasRuntime) {
       SetSequence.fromSet(runtimeLanguages).addElement(language);
     }
   }
 }
 public static List<SNode> call_getDescendants_3816167865390609214(
     SNode __thisNode__, SModel model) {
   List<SNode> result = new ArrayList<SNode>();
   SNode container =
       SNodeOperations.getNodeAncestor(
           __thisNode__,
           MetaAdapterFactory.getConcept(
               0x132aa4d8a3f7441cL,
               0xa7eb3fce23492c6aL,
               0x6524536b2e1a1e3bL,
               "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilders"),
           false,
           false);
   for (SNode builder :
       SimpleBuilders_BehaviorDescriptor.getDescendands_id4wDZIZrG$7X.invoke(container, model)) {
     for (SNode dcl :
         SLinkOperations.getChildren(
             builder,
             MetaAdapterFactory.getContainmentLink(
                 0x132aa4d8a3f7441cL,
                 0xa7eb3fce23492c6aL,
                 0x6524536b2e1a1e3bL,
                 0x6524536b2e1a1e3dL,
                 "builder"))) {
       if (SNodeOperations.isInstanceOf(
               dcl,
               MetaAdapterFactory.getConcept(
                   0x132aa4d8a3f7441cL,
                   0xa7eb3fce23492c6aL,
                   0x6524536b2e1a1e38L,
                   "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilderDeclaration"))
           && SimpleBuilderDeclaration_BehaviorDescriptor.isDescendant_id3jPK7hzRvLl.invoke(
               SNodeOperations.cast(
                   dcl,
                   MetaAdapterFactory.getConcept(
                       0x132aa4d8a3f7441cL,
                       0xa7eb3fce23492c6aL,
                       0x6524536b2e1a1e38L,
                       "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilderDeclaration")),
               __thisNode__)) {
         ListSequence.fromList(result)
             .addElement(
                 SNodeOperations.cast(
                     dcl,
                     MetaAdapterFactory.getConcept(
                         0x132aa4d8a3f7441cL,
                         0xa7eb3fce23492c6aL,
                         0x6524536b2e1a1e38L,
                         "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilderDeclaration")));
       }
     }
   }
   return result;
 }
Ejemplo n.º 21
0
 public static Object virtual_calculateCompileTimeConstantValue_1587718783752756055(
     SNode thisNode, Object leftValue, Object rightValue) {
   if (leftValue instanceof Number && rightValue instanceof Number) {
     Number a = (Number) leftValue;
     Number b = (Number) rightValue;
     if (BinaryOperation_Behavior.call_bothShouldBeWidenedTo_6205351058571053912(
         MetaAdapterFactory.getConcept(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xfbdeb6fecfL,
             "jetbrains.mps.baseLanguage.structure.BinaryOperation"),
         Double.class,
         a,
         b)) {
       return a.doubleValue() < b.doubleValue();
     }
     if (BinaryOperation_Behavior.call_bothShouldBeWidenedTo_6205351058571053912(
         MetaAdapterFactory.getConcept(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xfbdeb6fecfL,
             "jetbrains.mps.baseLanguage.structure.BinaryOperation"),
         Float.class,
         a,
         b)) {
       return a.floatValue() < b.floatValue();
     }
     if (BinaryOperation_Behavior.call_bothShouldBeWidenedTo_6205351058571053912(
         MetaAdapterFactory.getConcept(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xfbdeb6fecfL,
             "jetbrains.mps.baseLanguage.structure.BinaryOperation"),
         Long.class,
         a,
         b)) {
       return a.longValue() < b.longValue();
     }
     if (BinaryOperation_Behavior.call_bothShouldBeWidenedTo_6205351058571053912(
         MetaAdapterFactory.getConcept(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xfbdeb6fecfL,
             "jetbrains.mps.baseLanguage.structure.BinaryOperation"),
         Integer.class,
         a,
         b)) {
       return a.intValue() < b.intValue();
     }
   } else if (leftValue instanceof Character && rightValue instanceof Character) {
     return ((Character) leftValue).charValue() < ((Character) rightValue).charValue();
   }
   return null;
 }
 @Deprecated
 private static boolean staticCanBeAChild_Old(
     SNode node,
     SNode parentNode,
     SNode link,
     SNode childConcept,
     final IOperationContext operationContext) {
   SNode pnode =
       (SNodeOperations.isInstanceOf(
               parentNode,
               MetaAdapterFactory.getConcept(
                   0xcf935df46994e9cL,
                   0xa132fa109541cba3L,
                   0x14d3fb6fb843ebddL,
                   "jetbrains.mps.build.mps.structure.BuildMps_Group"))
           ? SNodeOperations.getParent(parentNode)
           : parentNode);
   return SNodeOperations.isInstanceOf(
               pnode,
               MetaAdapterFactory.getConcept(
                   0x798100da4f0a421aL,
                   0xb99171f8c50ce5d2L,
                   0x4df58c6f18f84a13L,
                   "jetbrains.mps.build.structure.BuildProject"))
           && ListSequence.fromList(
                   SLinkOperations.getChildren(
                       SNodeOperations.cast(
                           pnode,
                           MetaAdapterFactory.getConcept(
                               0x798100da4f0a421aL,
                               0xb99171f8c50ce5d2L,
                               0x4df58c6f18f84a13L,
                               "jetbrains.mps.build.structure.BuildProject")),
                       MetaAdapterFactory.getContainmentLink(
                           0x798100da4f0a421aL,
                           0xb99171f8c50ce5d2L,
                           0x4df58c6f18f84a13L,
                           0x5c3f3e2c1ce9ac70L,
                           "plugins")))
               .any(
                   new IWhereFilter<SNode>() {
                     public boolean accept(SNode it) {
                       return SNodeOperations.isInstanceOf(
                           it,
                           MetaAdapterFactory.getConcept(
                               0xcf935df46994e9cL,
                               0xa132fa109541cba3L,
                               0xc0bde9fc71699d9L,
                               "jetbrains.mps.build.mps.structure.BuildMPSPlugin"));
                     }
                   })
       || pnode.getConcept().getQualifiedName().startsWith("jetbrains.mps.lang.generator");
 }
Ejemplo n.º 23
0
 public void test_IntroduceFinalField() throws Exception {
   addNodeById("4038232163187008744");
   addNodeById("4038232163187008759");
   IntroduceFieldRefactoring refactoring = new IntroduceFieldRefactoring();
   refactoring.init(
       SNodeOperations.cast(
           getNodeById("4038232163187008754"),
           SNodeOperations.asSConcept(
               MetaAdapterFactory.getConcept(
                   MetaAdapterFactory.getLanguage(
                       0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"),
                   0xf8cc67c7fbL,
                   "PlusExpression"))),
       null);
   refactoring.setName("i");
   refactoring.setIsFinal(true);
   refactoring.setFieldInitializationPlace(FieldInitializationPlace.FIELD);
   refactoring.setVisibilityLevel(VisibilityLevel.PRIVATE);
   refactoring.doRefactoring();
   {
     List<SNode> nodesBefore =
         ListSequence.fromListAndArray(
             new ArrayList<SNode>(),
             SNodeOperations.cast(
                 getNodeById("4038232163187008745"),
                 SNodeOperations.asSConcept(
                     MetaAdapterFactory.getConcept(
                         MetaAdapterFactory.getLanguage(
                             0xf3061a5392264cc5L,
                             0xa443f952ceaf5816L,
                             "jetbrains.mps.baseLanguage"),
                         0xf8c108ca66L,
                         "ClassConcept"))));
     List<SNode> nodesAfter =
         ListSequence.fromListAndArray(
             new ArrayList<SNode>(),
             SNodeOperations.cast(
                 getNodeById("4038232163187008770"),
                 SNodeOperations.asSConcept(
                     MetaAdapterFactory.getConcept(
                         MetaAdapterFactory.getLanguage(
                             0xf3061a5392264cc5L,
                             0xa443f952ceaf5816L,
                             "jetbrains.mps.baseLanguage"),
                         0xf8c108ca66L,
                         "ClassConcept"))));
     Assert.assertNull(
         "The nodes '" + nodesBefore + "' and '" + nodesAfter + "' do not match!",
         new NodesMatcher().match(nodesBefore, nodesAfter));
   }
 }
 private static SNode _quotation_createNode_i6fkmm_a0c0b0a0h() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0xf9eaff2517L,
               "jetbrains.mps.lang.editor.structure.CellModel_Collection"),
           null,
           null,
           false);
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0x1143bd721ebL,
               "jetbrains.mps.lang.editor.structure.SelectableStyleSheetItem"),
           null,
           null,
           false);
   SNodeAccessUtil.setProperty(
       quotedNode_2,
       MetaAdapterFactory.getProperty(
           0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x1143bd1283bL, 0x1143bd161dbL, "flag"),
       "false");
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x11beb039542L, 0x11beb040d06L, "styleItem"),
       quotedNode_2);
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x18bc659203a64e29L,
               0xa83a7ff23bde13baL,
               0x120150bb441L,
               "jetbrains.mps.lang.editor.structure.CellLayout_Indent"),
           null,
           null,
           false);
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eaff2517L, 0x10192e0d3baL, "cellLayout"),
       quotedNode_3);
   return quotedNode_1;
 }
Ejemplo n.º 25
0
 protected SNode getLastReponse() {
   SNode last =
       SNodeOperations.as(
           ListSequence.fromList(
                   SLinkOperations.getChildren(
                       SLinkOperations.getTarget(
                           myRoot,
                           MetaAdapterFactory.getContainmentLink(
                               0xde1ad86d6e504a02L,
                               0xb306d4d17f64c375L,
                               0x15fb34051f725a2cL,
                               0x15fb34051f725bafL,
                               "history")),
                       MetaAdapterFactory.getContainmentLink(
                           0xde1ad86d6e504a02L,
                           0xb306d4d17f64c375L,
                           0xa835f28c1aa02beL,
                           0x63da33792b5df49aL,
                           "item")))
               .last(),
           MetaAdapterFactory.getConcept(
               0xde1ad86d6e504a02L,
               0xb306d4d17f64c375L,
               0x4e3b035171a5ba02L,
               "jetbrains.mps.console.base.structure.Response"));
   if (last != null) {
     return last;
   }
   return SLinkOperations.addNewChild(
       SLinkOperations.getTarget(
           myRoot,
           MetaAdapterFactory.getContainmentLink(
               0xde1ad86d6e504a02L,
               0xb306d4d17f64c375L,
               0x15fb34051f725a2cL,
               0x15fb34051f725bafL,
               "history")),
       MetaAdapterFactory.getContainmentLink(
           0xde1ad86d6e504a02L,
           0xb306d4d17f64c375L,
           0xa835f28c1aa02beL,
           0x63da33792b5df49aL,
           "item"),
       SNodeOperations.asInstanceConcept(
           MetaAdapterFactory.getConcept(
               0xde1ad86d6e504a02L,
               0xb306d4d17f64c375L,
               0x4e3b035171a5ba02L,
               "jetbrains.mps.console.base.structure.Response")));
 }
Ejemplo n.º 26
0
 @Override
 public void execute(@NotNull String pattern) {
   SNodeFactoryOperations.addNewChild(
       SNodeOperations.cast(
           SNodeOperations.getParent(_context.getNode()),
           MetaAdapterFactory.getConcept(
               0xfd3920347849419dL,
               0x907112563d152375L,
               0x1174a4d19ffL,
               "jetbrains.mps.baseLanguage.closures.structure.FunctionType")),
       MetaAdapterFactory.getContainmentLink(
           0xfd3920347849419dL,
           0x907112563d152375L,
           0x1174a4d19ffL,
           0x11ad99d9c36L,
           "throwsType"),
       SNodeFactoryOperations.asInstanceConcept(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8c37f506dL,
               "jetbrains.mps.baseLanguage.structure.Type")));
   SelectionUtil.selectLabelCellAnSetCaret(
       _context.getEditorContext(),
       ListSequence.fromList(
               SLinkOperations.getChildren(
                   SNodeOperations.cast(
                       SNodeOperations.getParent(_context.getNode()),
                       MetaAdapterFactory.getConcept(
                           0xfd3920347849419dL,
                           0x907112563d152375L,
                           0x1174a4d19ffL,
                           "jetbrains.mps.baseLanguage.closures.structure.FunctionType")),
                   MetaAdapterFactory.getContainmentLink(
                       0xfd3920347849419dL,
                       0x907112563d152375L,
                       0x1174a4d19ffL,
                       0x11ad99d9c36L,
                       "throwsType")))
           .first(),
       SelectionManager.FIRST_ERROR_CELL
           + "|"
           + SelectionManager.FOCUS_POLICY_CELL
           + "|"
           + SelectionManager.FIRST_EDITABLE_CELL
           + "|"
           + SelectionManager.FIRST_CELL,
       -1);
 }
 private static SNode _quotation_createNode_ynjj1y_a0a2() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   SNode quotedNode_2 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x10c25fb076aL,
               "jetbrains.mps.baseLanguage.collections.structure.ListType"),
           null,
           null,
           false);
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_2.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_2,
           facade.createModelReference(
               "1ed103c3-3aa6-49b7-9c21-6765ee11f224/java:jetbrains.mps.openapi.editor.cells(MPS.Editor/)"),
           facade.createNodeId("~SubstituteAction")));
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0x8388864671ce4f1cL,
           0x9c53c54016f6ad4fL,
           0x10c25fb076aL,
           0x10c25fe95c5L,
           "elementType"),
       quotedNode_2);
   return quotedNode_1;
 }
 public static int call_getIndexInContainingClass_3421461530438560434(SNode thisNode) {
   final SNode ancestor =
       SNodeOperations.getNodeAncestor(
           thisNode,
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101d9d3ca30L,
               "jetbrains.mps.baseLanguage.structure.Classifier"),
           false,
           false);
   int index =
       ListSequence.fromList(
                   SNodeOperations.getNodeDescendantsWhereConceptInList(
                       ancestor,
                       new SAbstractConcept[] {
                         MetaAdapterFactory.getConcept(
                             0xf3061a5392264cc5L,
                             0xa443f952ceaf5816L,
                             0x1107e0cb103L,
                             "jetbrains.mps.baseLanguage.structure.AnonymousClass"),
                         MetaAdapterFactory.getConcept(
                             0xdf345b11b8c74213L,
                             0xac6648d2a9b75d88L,
                             0x2f7b79225e746809L,
                             "jetbrains.mps.baseLanguageInternal.structure.InternalAnonymousClass")
                       },
                       false,
                       new SAbstractConcept[] {}))
               .where(
                   new IWhereFilter<SNode>() {
                     public boolean accept(SNode it) {
                       return SNodeOperations.getNodeAncestor(
                               it,
                               MetaAdapterFactory.getConcept(
                                   0xf3061a5392264cc5L,
                                   0xa443f952ceaf5816L,
                                   0x101d9d3ca30L,
                                   "jetbrains.mps.baseLanguage.structure.Classifier"),
                               false,
                               false)
                           == ancestor;
                     }
                   })
               .indexOf(thisNode)
           + 1;
   return index;
 }
 private static String getGroupPrefix_idhEwJa7y(@NotNull SNode __thisNode__) {
   String prefix = "";
   SNode parentGroup =
       SNodeOperations.getNodeAncestor(
           __thisNode__,
           MetaAdapterFactory.getConcept(
               0x28f9e4973b424291L,
               0xaeba0a1039153ab1L,
               0x1181da058d2L,
               "jetbrains.mps.lang.plugin.structure.ActionGroupDeclaration"),
           false,
           false);
   if (parentGroup != null) {
     prefix =
         ActionGroupDeclaration_BehaviorDescriptor.getGroupPrefix_idhEwJa7y.invoke(parentGroup)
             + SPropertyOperations.getString(
                 parentGroup,
                 MetaAdapterFactory.getProperty(
                     0xceab519525ea4f22L,
                     0x9b92103b95ca8c0cL,
                     0x110396eaaa4L,
                     0x110396ec041L,
                     "name"));
   }
   return prefix;
 }
 public SAbstractConcept getApplicableConcept() {
   return MetaAdapterFactory.getConcept(
       0xb401a68083254110L,
       0x8fd384331ff25befL,
       0x11621ab7715L,
       "jetbrains.mps.lang.generator.structure.IncludeMacro");
 }