/*package*/ static String getPresentation_idhEwIMiw(@NotNull SNode __thisNode__) { return SConceptOperations.conceptAlias(SNodeOperations.getConcept(__thisNode__)) + "<" + BaseConcept__BehaviorDescriptor.getPresentation_idhEwIMiw.invoke( SLinkOperations.getTarget( __thisNode__, MetaAdapterFactory.getContainmentLink( 0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x116db7e6bcbL, 0x116db7f62a8L, "keyType"))) + "," + BaseConcept__BehaviorDescriptor.getPresentation_idhEwIMiw.invoke( SLinkOperations.getTarget( __thisNode__, MetaAdapterFactory.getContainmentLink( 0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x116db7e6bcbL, 0x116db7f8516L, "valueType"))) + ">"; }
public static void migrate(SRepository repo, SNode node) { // todo try to remove duplication here SNode movePart = SNodeOperations.getNodeAncestor( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, "jetbrains.mps.lang.migration.structure.MoveNodeMigrationPart"), false, false); if (SNodeOperations.isInstanceOf( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, "jetbrains.mps.lang.migration.structure.MoveConcept"))) { SNode mc = SNodeOperations.cast( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, "jetbrains.mps.lang.migration.structure.MoveConcept")); SNode from = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d15L, "fromNode")), repo); SNode to = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d17L, "toNode")), repo); if ((SLinkOperations.getTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6eaL, "sourceId")) == null) && (from != null)) { SLinkOperations.setTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6eaL, "sourceId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x5fea1eb9fefb6fe7L, "jetbrains.mps.lang.smodel.structure.ConceptId")), null)); ConceptId__BehaviorDescriptor.setConcept_id5ZE7FBYYR6j.invoke( SLinkOperations.getTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6eaL, "sourceId")), MetaAdapterByDeclaration.getConcept(from)); } if ((SLinkOperations.getTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6edL, "targetId")) == null) && (to != null)) { SLinkOperations.setTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6edL, "targetId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x5fea1eb9fefb6fe7L, "jetbrains.mps.lang.smodel.structure.ConceptId")), null)); ConceptId__BehaviorDescriptor.setConcept_id5ZE7FBYYR6j.invoke( SLinkOperations.getTarget( mc, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b6L, 0x74cb131f590ad6edL, "targetId")), MetaAdapterByDeclaration.getConcept(to)); } return; } if (SNodeOperations.isInstanceOf( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, "jetbrains.mps.lang.migration.structure.MoveContainmentLink"))) { SNode mcl = SNodeOperations.cast( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, "jetbrains.mps.lang.migration.structure.MoveContainmentLink")); SNode from = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d15L, "fromNode")), repo); SNode to = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d17L, "toNode")), repo); if ((SLinkOperations.getTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab5L, "sourceId")) == null) && (from != null)) { SLinkOperations.setTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab5L, "sourceId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x74cb131f5923b6e7L, "jetbrains.mps.lang.smodel.structure.ContainmentLinkId")), null)); ContainmentLinkId__BehaviorDescriptor.setLink_id7jb4LXp8VsD.invoke( SLinkOperations.getTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab5L, "sourceId")), MetaAdapterByDeclaration.getContainmentLink(from)); } if ((SLinkOperations.getTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab6L, "targetId")) == null) && (to != null)) { SLinkOperations.setTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab6L, "targetId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x74cb131f5923b6e7L, "jetbrains.mps.lang.smodel.structure.ContainmentLinkId")), null)); ContainmentLinkId__BehaviorDescriptor.setLink_id7jb4LXp8VsD.invoke( SLinkOperations.getTarget( mcl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741baL, 0x74cb131f592e8ab6L, "targetId")), MetaAdapterByDeclaration.getContainmentLink(to)); } return; } if (SNodeOperations.isInstanceOf( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, "jetbrains.mps.lang.migration.structure.MoveReferenceLink"))) { SNode mrl = SNodeOperations.cast( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, "jetbrains.mps.lang.migration.structure.MoveReferenceLink")); SNode from = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d15L, "fromNode")), repo); SNode to = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d17L, "toNode")), repo); if ((SLinkOperations.getTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abdL, "sourceId")) == null) && (from != null)) { SLinkOperations.setTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abdL, "sourceId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x74cb131f5923b6ecL, "jetbrains.mps.lang.smodel.structure.ReferenceLinkId")), null)); ReferenceLinkId__BehaviorDescriptor.setReference_id7jb4LXp9a6q.invoke( SLinkOperations.getTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abdL, "sourceId")), MetaAdapterByDeclaration.getReferenceLink(from)); } if ((SLinkOperations.getTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abeL, "targetId")) == null) && (to != null)) { SLinkOperations.setTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abeL, "targetId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x74cb131f5923b6ecL, "jetbrains.mps.lang.smodel.structure.ReferenceLinkId")), null)); ReferenceLinkId__BehaviorDescriptor.setReference_id7jb4LXp9a6q.invoke( SLinkOperations.getTarget( mrl, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b7L, 0x74cb131f592e8abeL, "targetId")), MetaAdapterByDeclaration.getReferenceLink(to)); } return; } if (SNodeOperations.isInstanceOf( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, "jetbrains.mps.lang.migration.structure.MoveProperty"))) { SNode mp = SNodeOperations.cast( node, MetaAdapterFactory.getConcept( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, "jetbrains.mps.lang.migration.structure.MoveProperty")); SNode from = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d15L, "fromNode")), repo); SNode to = AbstractNodeReference__BehaviorDescriptor.tryToFindNode_id6szrkDoc2K7.invoke( SLinkOperations.getTarget( movePart, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x67236d4a5830221eL, 0x67236d4a58343d17L, "toNode")), repo); if ((SLinkOperations.getTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8ab9L, "sourceId")) == null) && (from != null)) { SLinkOperations.setTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8ab9L, "sourceId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x5fea1eb9fefc235cL, "jetbrains.mps.lang.smodel.structure.PropertyId")), null)); PropertyId__BehaviorDescriptor.setProperty_id5ZE7FBYZ2jW.invoke( SLinkOperations.getTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8ab9L, "sourceId")), MetaAdapterByDeclaration.getProperty(from)); } if ((SLinkOperations.getTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8abaL, "targetId")) == null) && (to != null)) { SLinkOperations.setTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8abaL, "targetId"), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x5fea1eb9fefc235cL, "jetbrains.mps.lang.smodel.structure.PropertyId")), null)); PropertyId__BehaviorDescriptor.setProperty_id5ZE7FBYZ2jW.invoke( SLinkOperations.getTarget( mp, MetaAdapterFactory.getContainmentLink( 0x9074634404fd4286L, 0x97d5b46ae6a81709L, 0x2b3f57492c1741b9L, 0x74cb131f592e8abaL, "targetId")), MetaAdapterByDeclaration.getProperty(to)); } return; } throw new IllegalArgumentException( "Unknown concept:" + SNodeOperations.getConcept(node).getName()); }
public void applyRule( final SNode builder, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) { Language containingLanguage = as_46aqev_a0a0a1(SNodeOperations.getModel(builder).getModule(), Language.class); if (containingLanguage == null || SLinkOperations.getTarget( builder, MetaAdapterFactory.getReferenceLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e58d76a0L, "conceptDeclaration")) == null) { return; } Map<SNode, List<SNode>> duplicatingDeclarations = MapSequence.fromMap(new HashMap<SNode, List<SNode>>()); SModel dataFlowModel = SModuleOperations.getAspect(containingLanguage, "dataFlow"); if (dataFlowModel != null) { List<SNode> roots = SModelOperations.roots( dataFlowModel, MetaAdapterFactory.getConcept( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, "jetbrains.mps.lang.dataFlow.structure.DataFlowBuilderDeclaration")); for (SNode root : ListSequence.fromList(roots)) { if (root == builder || SLinkOperations.getTarget( root, MetaAdapterFactory.getReferenceLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e58d76a0L, "conceptDeclaration")) != SLinkOperations.getTarget( builder, MetaAdapterFactory.getReferenceLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e58d76a0L, "conceptDeclaration"))) { continue; } if (ListSequence.fromList( SLinkOperations.getChildren( builder, MetaAdapterFactory.getContainmentLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes"))) .isEmpty() && ListSequence.fromList( SLinkOperations.getChildren( root, MetaAdapterFactory.getContainmentLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes"))) .isEmpty()) { MapSequence.fromMap(duplicatingDeclarations) .put(root, ListSequence.fromList(new ArrayList<SNode>())); } else { for (SNode myMode : ListSequence.fromList( SLinkOperations.getChildren( builder, MetaAdapterFactory.getContainmentLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes")))) { if (ListSequence.fromList( SLinkOperations.getChildren( root, MetaAdapterFactory.getContainmentLink( 0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes"))) .select( new ISelector<SNode, SConcept>() { public SConcept select(SNode it) { return SNodeOperations.getConcept(it); } }) .contains(SNodeOperations.getConcept(myMode))) { if (MapSequence.fromMap(duplicatingDeclarations).get(root) == null) { MapSequence.fromMap(duplicatingDeclarations) .put(root, ListSequence.fromList(new ArrayList<SNode>())); } ListSequence.fromList(MapSequence.fromMap(duplicatingDeclarations).get(root)) .addElement(myMode); } } } } } if (SetSequence.fromSet(MapSequence.fromMap(duplicatingDeclarations).keySet()).isNotEmpty()) { for (SNode duplicatingDecl : SetSequence.fromSet(MapSequence.fromMap(duplicatingDeclarations).keySet())) { { MessageTarget errorTarget = new NodeMessageTarget(); IErrorReporter _reporter_2309309498 = typeCheckingContext.reportTypeError( builder, "Conflicting modes. Data flow builder" + ((ListSequence.fromList( MapSequence.fromMap(duplicatingDeclarations).get(duplicatingDecl)) .isEmpty() ? "" : " with modes (" + ListSequence.fromList( MapSequence.fromMap(duplicatingDeclarations) .get(duplicatingDecl)) .select( new ISelector<SNode, String>() { public String select(SNode it) { return SNodeOperations.getConcept(it).getName(); } }) .reduceLeft( new ILeftCombinator<String, String>() { public String combine(String a, String b) { return a + " , " + b; } }) + ")")) + " was defined in: " + INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke( duplicatingDecl), "r:00000000-0000-4000-0000-011c8959037a(jetbrains.mps.lang.dataFlow.typesystem)", "6246554009626560906", null, errorTarget); } } } }
public static String getExpressionPresentation(@Nullable SNode expression) { if (expression == null) { return "????"; } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, "jetbrains.mps.baseLanguage.structure.ParenthesizedExpression"))) { return "(" + getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, "jetbrains.mps.baseLanguage.structure.ParenthesizedExpression")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, 0xfb4ed32b80L, "expression"))) + ")"; } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6fea7de6103549b1L, "jetbrains.mps.baseLanguage.structure.UnaryMinus"))) { return "-" + getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6fea7de6103549b1L, "jetbrains.mps.baseLanguage.structure.UnaryMinus")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x120a4c1f269L, 0x120a4c433a6L, "expression"))); } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbcf6bd10dL, "jetbrains.mps.baseLanguage.structure.NotExpression"))) { return "!(" + getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbcf6bd10dL, "jetbrains.mps.baseLanguage.structure.NotExpression")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbcf6bd10dL, 0xfbcf6c30a4L, "expression"))) + ")"; } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getInterfaceConcept( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, "jetbrains.mps.lang.core.structure.INamedConcept"))) { return SPropertyOperations.getString( SNodeOperations.cast( expression, MetaAdapterFactory.getInterfaceConcept( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, "jetbrains.mps.lang.core.structure.INamedConcept")), MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, "jetbrains.mps.baseLanguage.structure.DotExpression"))) { return getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, "jetbrains.mps.baseLanguage.structure.DotExpression")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, 0x116b46a4416L, "operand"))) + "." + getOperationPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, "jetbrains.mps.baseLanguage.structure.DotExpression")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, 0x116b46b36c4L, "operation"))); } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation"))) { return getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11cL, "leftExpression"))) + SPropertyOperations.getString( SNodeOperations.getConceptDeclaration( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation"))), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")) + getExpressionPresentation( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11bL, "rightExpression"))); } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, "jetbrains.mps.baseLanguage.structure.StringLiteral"))) { return "\"" + SPropertyOperations.getString( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, "jetbrains.mps.baseLanguage.structure.StringLiteral")), MetaAdapterFactory.getProperty( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value")) + "\""; } if (SNodeOperations.isInstanceOf( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10ab8473cc5L, "jetbrains.mps.baseLanguage.structure.GenericNewExpression"))) { return "new " + BaseConcept_BehaviorDescriptor.getPresentation_idhEwIMiw.invoke( SLinkOperations.getTarget( SNodeOperations.cast( expression, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10ab8473cc5L, "jetbrains.mps.baseLanguage.structure.GenericNewExpression")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10ab8473cc5L, 0x10ab847b486L, "creator"))); } if (Expression_BehaviorDescriptor.constant_id1653mnvAgr2.invoke( SNodeOperations.asSConcept(SNodeOperations.getConcept(expression)))) { return Expression_BehaviorDescriptor.getCompileTimeConstantValue_idi1LP2xI.invoke( expression, SNodeOperations.getModel(expression).getModule()) + ""; } return BaseConcept_BehaviorDescriptor.getPresentation_idhEwIMiw.invoke(expression); }
public void applyRule( final SNode func, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) { // function is expected to return value of any type final SNode expectedRetType = (SConceptOperations.isExactly( SNodeOperations.asSConcept( SNodeOperations.getConcept( ConceptFunction__BehaviorDescriptor.getExpectedReturnType_idhEwIGRD.invoke( func))), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x110dae5f4a3L, "jetbrains.mps.baseLanguage.structure.WildCardType")) ? null : ConceptFunction__BehaviorDescriptor.getExpectedReturnType_idhEwIGRD.invoke(func)); boolean noReturnExpected = ((expectedRetType == null) || TypeChecker.getInstance() .getSubtypingManager() .isSubtype(expectedRetType, _quotation_createNode_bbraw4_b0a0a0c0b())); if (!(noReturnExpected)) { final SNode LCS_typevar_1186052624152 = typeCheckingContext.createNewRuntimeTypesVariable(); Iterable<SNode> returnStatements = RulesFunctions_BaseLanguage.collectReturnStatements( SLinkOperations.getTarget( func, MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body"))); // should return subtypes of the 'expected type' // if 'expected type' is null - should still return some value (of any type) for (SNode returnStatement : Sequence.fromIterable(returnStatements)) { if ((SLinkOperations.getTarget( returnStatement, MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7feL, 0xf8cc6bf96cL, "expression")) == null)) { { MessageTarget errorTarget = new NodeMessageTarget(); IErrorReporter _reporter_2309309498 = typeCheckingContext.reportTypeError( returnStatement, "should return value", "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053304501", null, errorTarget); } } else { { SNode _nodeToCheck_1029348928467 = SLinkOperations.getTarget( returnStatement, MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7feL, 0xf8cc6bf96cL, "expression")); EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053304511", 0, null); typeCheckingContext.createGreaterThanInequality( (SNode) typeCheckingContext.getRepresentative(LCS_typevar_1186052624152), (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053304515", true), false, true, _info_12389875345); } if ((expectedRetType != null)) { if (!(typeCheckingContext.isSingleTypeComputation())) { { SNode _nodeToCheck_1029348928467 = SLinkOperations.getTarget( returnStatement, MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7feL, 0xf8cc6bf96cL, "expression")); EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "7630810368327770735", 0, null); typeCheckingContext.createLessThanInequality( (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "7410236346363166597", true), (SNode) expectedRetType, true, true, _info_12389875345); } } } } } // last expression statement can serve as return statement SNode lastStatement = IMethodLike__BehaviorDescriptor.getLastStatement_idi2fhS7A.invoke(func); if (SNodeOperations.isInstanceOf( lastStatement, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L, "jetbrains.mps.baseLanguage.structure.ExpressionStatement"))) { final SNode expression = SLinkOperations.getTarget( SNodeOperations.cast( lastStatement, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L, "jetbrains.mps.baseLanguage.structure.ExpressionStatement")), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L, 0xf8cc56b214L, "expression")); { SNode _nodeToCheck_1029348928467 = expression; EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053063874", 0, null); typeCheckingContext.createGreaterThanInequality( (SNode) typeCheckingContext.getRepresentative(LCS_typevar_1186052624152), (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053084979", true), false, true, _info_12389875345); } if ((expectedRetType != null)) { if (!(typeCheckingContext.isSingleTypeComputation())) { { SNode _nodeToCheck_1029348928467 = expression; EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "7630810368327770756", 0, null); typeCheckingContext.createLessThanInequality( (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "7410236346363168757", true), (SNode) expectedRetType, true, true, _info_12389875345); } } } } { SNode _nodeToCheck_1029348928467 = func; EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053174208", 0, null); typeCheckingContext.createEquation( (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053169643", true), (SNode) typeCheckingContext.getRepresentative(LCS_typevar_1186052624152), _info_12389875345); } if ((expectedRetType != null)) { if (!(typeCheckingContext.isSingleTypeComputation())) { { SNode _nodeToCheck_1029348928467 = func; EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "1186053540847", 0, null); typeCheckingContext.createLessThanInequality( (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)", "7410236346363168929", true), (SNode) expectedRetType, true, true, _info_12389875345); } } } } }