private boolean isApplicableToNode(final SNode node, final EditorContext editorContext) { return SNodeOperations.getConceptDeclaration(node) == SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral") || SNodeOperations.getConceptDeclaration(node) == SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.closures.structure.UnrestrictedClosureLiteral"); }
public static String virtual_getPresentation_1213877396640(SNode thisNode) { if (SNodeOperations.isInstanceOf( thisNode, MetaAdapterFactory.getInterfaceConcept( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, "jetbrains.mps.lang.core.structure.INamedConcept"))) { String name = SPropertyOperations.getString( SNodeOperations.cast( thisNode, MetaAdapterFactory.getInterfaceConcept( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, "jetbrains.mps.lang.core.structure.INamedConcept")), MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); if (name != null) { return name; } return "<no name>[" + SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(thisNode), MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")) + "]"; } // -- String smartRefPresentation = ReferenceConceptUtil.getPresentation(thisNode); if (smartRefPresentation != null) { return smartRefPresentation; } // -- String conceptAlias = SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(thisNode), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")); if (conceptAlias != null) { return conceptAlias; } // -- return SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(thisNode), MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); }
@Override public void addMethod(SNode method) { if (SNodeOperations.getConceptDeclaration(this.getContainerMethod()) == SNodeOperations.getConceptDeclaration(method)) { SNodeOperations.insertNextSiblingChild(this.getContainerMethod(), method); } else { super.addMethod(method); } }
public void execute(SNode node) { if ((boolean) Expression__BehaviorDescriptor.singleValue_id1o8Ht9sES3u.invoke( SNodeOperations.asSConcept( SNodeOperations.getConceptDeclaration( SLinkOperations.getTarget( ((SNode) RemoveUnnecessaryParentheses_QuickFix.this .getField("bottomLineParens")[0]), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, 0xfb4ed32b80L, "expression")))))) { SNodeOperations.replaceWithAnother( node, SLinkOperations.getTarget( ((SNode) RemoveUnnecessaryParentheses_QuickFix.this.getField("bottomLineParens")[0]), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, 0xfb4ed32b80L, "expression"))); } SNodeOperations.replaceWithAnother( node, ((SNode) RemoveUnnecessaryParentheses_QuickFix.this.getField("bottomLineParens")[0])); }
public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) { try { NodeHighlightManager highlightManager = ((EditorComponent) MapSequence.fromMap(_params).get("editorComponent")) .getHighlightManager(); EditorMessageOwner messageOwner = ((EditorComponent) MapSequence.fromMap(_params).get("editorComponent")) .getHighlightMessagesOwner(); Set<SNode> usages = FindUsagesManager.getInstance() .findUsages( Collections.singleton( SNodeOperations.getConceptDeclaration( ((SNode) MapSequence.fromMap(_params).get("node")))), SearchType.INSTANCES, new ModelsOnlyScope( ((SModelDescriptor) MapSequence.fromMap(_params).get("model"))), null); for (SNode ref : SetSequence.fromSet(usages)) { if (ref.getContainingRoot() == ((EditorComponent) MapSequence.fromMap(_params).get("editorComponent")) .getRootCell() .getSNode() .getContainingRoot()) { highlightManager.mark(ref, HighlightConstants.INSTANCES_COLOR, "usage", messageOwner); } } highlightManager.repaintAndRebuildEditorMessages(); } catch (Throwable t) { if (log.isErrorEnabled()) { log.error("User's action execute method failed. Action:" + "HighlightInstances", t); } } }
public static boolean baseMappingRule_Condition_1201386765715( final IOperationContext operationContext, final BaseMappingRuleContext _context) { return SConceptOperations.isExactly( SNodeOperations.getConceptDeclaration( SLinkOperations.getTarget(_context.getNode(), "operation", true)), "jetbrains.mps.baseLanguage.structure.PropertyReference"); }
public static boolean baseMappingRule_Condition_1566704013439143567( final IOperationContext operationContext, final BaseMappingRuleContext _context) { if (!(SNodeOperations.getConceptDeclaration(SNodeOperations.getParent(_context.getNode())) == SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.structure.StatementList"))) { return false; } SNode methodLike = SNodeOperations.getAncestor( SNodeOperations.getParent(_context.getNode()), "jetbrains.mps.baseLanguage.structure.IMethodLike", false, false); if (!(BehaviorReflection.invokeVirtual( (Class<SNode>) ((Class) Object.class), methodLike, "virtual_getLastStatement_1239354409446", new Object[] {}) == _context.getNode())) { return false; } if (!(LastStatementUtil.canMakeReturnStatement(_context.getNode()))) { return false; } return true; }
public void execute(final SNode node, final EditorContext editorContext) { EditorCell selectedCell = editorContext.getSelectedCell(); if (!(selectedCell.isReferenceCell())) { return; } SNode contextNode = SNodeOperations.cast( selectedCell.getSNode(), "jetbrains.mps.lang.core.structure.BaseConcept"); if (contextNode == null) { return; } String role = selectedCell.getRole(); if (SNodeOperations.isInstanceOf( contextNode, "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation")) { SNode attributedNode = SNodeOperations.cast( SNodeOperations.getParent(contextNode), "jetbrains.mps.lang.core.structure.BaseConcept"); assert attributedNode != null; AttributeOperations.setAttribute( attributedNode, new IAttributeDescriptor.LinkAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"), role), null); return; } if (AttributeOperations.getAttribute( contextNode, new IAttributeDescriptor.LinkAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"), role)) != null) { AttributeOperations.setAttribute( contextNode, new IAttributeDescriptor.LinkAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"), role), null); } else { SNode referenceAntiquotation = SNodeFactoryOperations.setNewAttribute( contextNode, new IAttributeDescriptor.LinkAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"), role), "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"); if (selectedCell.isSingleNodeCell()) { SPropertyOperations.set( referenceAntiquotation, "label", SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(contextNode), "name")); } } }
public boolean canWrap(@NotNull SNode node) { if (eq_kl7j79_a0a0b2( SNodeOperations.getConceptDeclaration(node), SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.structure.ClassConcept"))) { if (SPropertyOperations.getBoolean( SNodeOperations.cast(node, "jetbrains.mps.baseLanguage.structure.ClassConcept"), "abstractClass")) { return false; } SNode ancestor = SNodeOperations.cast(node, "jetbrains.mps.baseLanguage.structure.Classifier"); if (!(BehaviorReflection.invokeVirtual( Boolean.TYPE, ancestor, "virtual_checkLoops_3980490811621705344", new Object[] {}))) { return false; } while (ancestor != null && SNodeOperations.isInstanceOf( ancestor, "jetbrains.mps.baseLanguage.structure.ClassConcept") && !(BehaviorReflection.invokeVirtual( String.class, ancestor, "virtual_getFqName_1213877404258", new Object[] {}) .equals(TestCase.class.getCanonicalName()))) { ancestor = check_kl7j79_a0a0d0a0b2( SLinkOperations.getTarget( SNodeOperations.cast( ancestor, "jetbrains.mps.baseLanguage.structure.ClassConcept"), "superclass", true)); } return ancestor != null; } return false; }
public void applyRule( final SNode nodeToCheck, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) { if ((SLinkOperations.getTarget(nodeToCheck, "attributeType", true) != null) && (SLinkOperations.getTarget(nodeToCheck, "default", true) != null)) { { SNode _nodeToCheck_1029348928467 = SLinkOperations.getTarget(nodeToCheck, "default", true); EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:eac20369-5993-49cc-a9ac-fbeb7a91d81f(jetbrains.mps.build.generictasks.typesystem)", "353793545802854687", 0, null); typeCheckingContext.createGreaterThanInequality( (SNode) typeCheckingContext.typeOf( _nodeToCheck_1029348928467, "r:eac20369-5993-49cc-a9ac-fbeb7a91d81f(jetbrains.mps.build.generictasks.typesystem)", "353793545802854693", true), (SNode) SLinkOperations.getTarget(nodeToCheck, "attributeType", true), false, true, _info_12389875345); } if ((SLinkOperations.getTarget(nodeToCheck, "enum", true) != null)) { { SNode _nodeToCheck_1029348928467 = nodeToCheck; EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:eac20369-5993-49cc-a9ac-fbeb7a91d81f(jetbrains.mps.build.generictasks.typesystem)", "353793545802854699", 0, null); typeCheckingContext.createLessThanInequality( (SNode) BehaviorReflection.invokeVirtualStatic( (Class<SNode>) ((Class) Object.class), SConceptRepository.getInstance() .getConcept( NameUtil.nodeFQName( SNodeOperations.getConceptDeclaration( SLinkOperations.getTarget(nodeToCheck, "enum", true)))), "virtual_getExpectedAttributeType_6575219246653626201", new Object[] {}), (SNode) SLinkOperations.getTarget(nodeToCheck, "attributeType", true), false, true, _info_12389875345); } } } }
public boolean isApplicable(SNode node) { return SModelUtil_new.isAssignableConcept( BehaviorReflection.invokeVirtual( String.class, SNodeOperations.getConceptDeclaration(node), "virtual_getFqName_1213877404258", new Object[] {}), getApplicableConceptFqName()); }
public String getDescription(final SNode node, final EditorContext editorContext) { String type = (SNodeOperations.getConceptDeclaration(node) == SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral") ? "Unrestricted" : "Restricted"); return "Convert to " + type + " Closure Literal"; }
/*package*/ static String getPresentation_idhEwIMiw(@NotNull SNode __thisNode__) { return SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")); }
public static SNode findLinkDeclaration(SReference reference) { if (reference == null) { return null; } return ((SNode) SModelSearchUtil.findLinkDeclaration( jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations.getConceptDeclaration( ((SNode) reference.getSourceNode())), reference.getRole())); }
public boolean canWrap(@NotNull SNode node) { if (eq_kl7j79_a0a0b4( SNodeOperations.getConceptDeclaration(node), SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.structure.ClassConcept"))) { return JUnit4TestWrapper.isJUnit4TestCase( SNodeOperations.cast(node, "jetbrains.mps.baseLanguage.structure.ClassConcept")); } return false; }
public void processInequation( final SNode subtype, final SNode supertype, final EquationInfo equationInfo, final TypeCheckingContext typeCheckingContext, IsApplicable2Status status, final boolean inequalityIsWeak, final boolean inequalityIsLessThan) { if (!(SConceptOperations.isSubConceptOf( SNodeOperations.getConceptDeclaration(subtype), NameUtil.nodeFQName(SNodeOperations.getConceptDeclaration(supertype))))) { MessageTarget errorTarget = new NodeMessageTarget(); IErrorReporter _reporter_2309309498 = typeCheckingContext.reportTypeError( equationInfo.getNodeWithError(), "Incompatible types", "r:00000000-0000-4000-0000-011c8959032b(jetbrains.mps.baseLanguage.collections.typesystem)", "1240153585729", null, errorTarget); HUtil.addAdditionalRuleIdsFromInfo(_reporter_2309309498, equationInfo); } { SNode _nodeToCheck_1029348928467 = equationInfo.getNodeWithError(); EquationInfo _info_12389875345 = new EquationInfo( _nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c8959032b(jetbrains.mps.baseLanguage.collections.typesystem)", "1237470147423", 0, null); _info_12389875345.getOuterRulesIdFromInfo(equationInfo); typeCheckingContext.createLessThanInequality( (SNode) SLinkOperations.getTarget(subtype, "elementType", true), (SNode) SLinkOperations.getTarget(supertype, "elementType", true), false, true, inequalityIsLessThan, _info_12389875345); } }
public boolean isApplicableCustom(SNode subtype, SNode supertype, IsApplicable2Status status) { return SConceptOperations.isSubConceptOf( SNodeOperations.getConceptDeclaration(subtype), NameUtil.nodeFQName(SNodeOperations.getConceptDeclaration(supertype))) && !(ListSequence.fromList(SNodeOperations.getChildren(supertype)) .any( new IWhereFilter<SNode>() { public boolean accept(SNode ch) { return SNodeOperations.isInstanceOf( ch, "jetbrains.mps.baseLanguage.structure.TypeVariableReference"); } })) && ListSequence.fromList(SNodeOperations.getChildren(subtype)) .any( new IWhereFilter<SNode>() { public boolean accept(SNode ch) { return SNodeOperations.isInstanceOf( ch, "jetbrains.mps.baseLanguage.structure.TypeVariableReference"); } }); }
public List<INodeSubstituteAction> createActions() { if (myLinkDeclaration == null) { return Collections.emptyList(); } EditorComponent editor = (EditorComponent) mySubstituteInfo.getEditorContext().getEditorComponent(); EditorCell referenceCell = editor.findNodeCellWithRole( mySourceNode, BehaviorReflection.invokeNonVirtual( String.class, myLinkDeclaration, "jetbrains.mps.lang.structure.structure.LinkDeclaration", "call_getGenuineRole_1213877254542", new Object[] {})); if (referenceCell != null && referenceCell.getContainingBigCell().getFirstLeaf() == referenceCell && ReferenceConceptUtil.getCharacteristicReference( SNodeOperations.getConceptDeclaration(mySourceNode)) == myLinkDeclaration && SNodeOperations.getParent(mySourceNode) != null && ListSequence.fromList(SNodeOperations.getChildren(mySourceNode)).isEmpty()) { SNode parent = SNodeOperations.getParent(mySourceNode); String role = SNodeOperations.getContainingLinkRole(mySourceNode); SNode roleLink = ((SNode) SModelSearchUtil.findLinkDeclaration( SNodeOperations.getConceptDeclaration(parent), role)); return ModelActions.createChildSubstituteActions( parent, mySourceNode, SLinkOperations.getTarget(roleLink, "target", false), new DefaultChildNodeSetter(roleLink), mySubstituteInfo.getOperationContext()); } return ModelActions.createReferentSubstituteActions( mySourceNode, myCurrentReferent, myLinkDeclaration, mySubstituteInfo.getOperationContext()); }
/*package*/ static List<String> getVariableSuffixes_idhEwIzNo(@NotNull SNode __thisNode__) { return ListSequence.fromListAndArray( new ArrayList<String>(), SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")) .substring(0, 1)); }
/*package*/ static void appendName_id1bWeed$ownT( @NotNull SNode __thisNode__, SNode parent, StringBuilder sb) { if (SNodeOperations.isInstanceOf( parent, MetaAdapterFactory.getConcept( 0x798100da4f0a421aL, 0xb99171f8c50ce5d2L, 0x668c6cfbafac4c85L, "jetbrains.mps.build.structure.BuildLayout_Node"))) { sb.append("/"); } sb.append( (SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")) != null ? SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")) : SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")))); }
public boolean checkInequation( final SNode subtype, final SNode supertype, final EquationInfo equationInfo, IsApplicable2Status status, final boolean inequalityIsWeak, final boolean inequalityIsLessThan) { boolean result_14532009 = true; if (!(SConceptOperations.isSubConceptOf( SNodeOperations.getConceptDeclaration(subtype), NameUtil.nodeFQName(SNodeOperations.getConceptDeclaration(supertype))))) { result_14532009 = false; } result_14532009 = result_14532009 && TypeChecker.getInstance() .getSubtypingManager() .isSubtype( (SNode) SLinkOperations.getTarget(subtype, "elementType", true), (SNode) SLinkOperations.getTarget(supertype, "elementType", true), true); return result_14532009; }
public static void addNodeAtLink(SNode container, SNode node) { if (SNodeOperations.isInstanceOf(container, "jetbrains.mps.baseLanguage.structure.Classifier") && SNodeOperations.isInstanceOf( node, "jetbrains.mps.baseLanguage.structure.ClassifierMember")) { MemberInsertingUtils.insertClassifierMemberInBestPlace( SNodeOperations.cast(container, "jetbrains.mps.baseLanguage.structure.Classifier"), SNodeOperations.cast(node, "jetbrains.mps.baseLanguage.structure.ClassifierMember")); } else { SNode concept = SNodeOperations.getConceptDeclaration(node); for (SNode link : ListSequence.fromList( BehaviorReflection.invokeNonVirtual( (Class<List<SNode>>) ((Class) Object.class), SNodeOperations.getConceptDeclaration(container), "jetbrains.mps.lang.structure.structure.AbstractConceptDeclaration", "call_getLinkDeclarations_1213877394480", new Object[] {}))) { if (SLinkOperations.getTarget(link, "target", false) == concept) { container.addChild(SPropertyOperations.getString(link, "role"), node); } } } }
public boolean isApplicableToNode(final SNode node, final EditorContext editorContext) { final EditorCell editorCell = editorContext.getSelectedCell(); if (editorCell == null) { return false; } if (editorCell.getLinkDeclaration() != SLinkOperations.findLinkDeclaration( "jetbrains.mps.lang.generator.structure.Weaving_MappingRule", "ruleConsequence")) { return false; } return SLinkOperations.getTarget(node, "ruleConsequence", true) == null || SConceptOperations.isExactly( SNodeOperations.getConceptDeclaration( SLinkOperations.getTarget(node, "ruleConsequence", true)), "jetbrains.mps.lang.generator.structure.RuleConsequence"); }
private static boolean renderingCondition_j36akn_a0( SNode node, EditorContext editorContext, IScope scope) { boolean condition = SNodeOperations.getConceptDeclaration(SLinkOperations.getTarget(node, "type", true)) != SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.structure.Type"); if (SNodeOperations.isInstanceOf( SLinkOperations.getTarget(node, "type", true), "jetbrains.mps.baseLanguage.structure.Type")) { return condition && !(BehaviorReflection.invokeVirtual( Boolean.TYPE, SLinkOperations.getTarget(node, "type", true), "virtual_hasMissingParameters_3508583411997314206", new Object[] {})); } else { return condition; } }
public ModelLinkMap build() { // build map based on already loaded model for (SNode node : myModel.nodes()) { addRoleLocation(ptr(node.getRoleLink()), node); addTypeLocation(ptr(SNodeOperations.getConceptDeclaration(node)), node); for (String prop : SetSequence.fromSet(node.getPropertyNames())) { addNameLocation(ptr(node.getPropertyDeclaration(prop)), node, prop); } for (SReference ref : Sequence.fromIterable(SNodeOperations.getReferences(node))) { addRoleLocation(ptr(SLinkOperations.findLinkDeclaration(ref)), ref); if ((SReference) ref instanceof StaticReference) { addTargetLocation( ptr(SLinkOperations.getTargetNode(ref)), (StaticReference) (SReference) ref); } else { addDynamicReference(ref.getTargetSModelReference(), (DynamicReference) (SReference) ref); } } } return this; }
/*package*/ static String classifierName_id3ZSHU3pg$b_(@NotNull SNode __thisNode__) { return NameUtil.toValidCamelIdentifier( SPropertyOperations.getString( __thisNode__, MetaAdapterFactory.getProperty( 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"))) + "_" + SPropertyOperations.getString( SNodeOperations.getConceptDeclaration(__thisNode__), MetaAdapterFactory.getProperty( 0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, 0x46ab0ad5826c74caL, "conceptAlias")); }
public static SNode virtual_getExpectedReturnType_1213877374441(SNode thisNode) { SNode referenceMacro = SNodeOperations.getAncestor( thisNode, "jetbrains.mps.lang.generator.structure.ReferenceMacro", false, false); SNode attributedNode = SNodeOperations.getParent(referenceMacro); String linkRole = AttributeOperations.getLinkRole(referenceMacro); ConceptAndSuperConceptsScope linkSearchScope = new ConceptAndSuperConceptsScope(SNodeOperations.getConceptDeclaration(attributedNode)); SNode link = SNodeOperations.cast( linkSearchScope.getMostSpecificLinkDeclarationByRole(linkRole), "jetbrains.mps.lang.structure.structure.LinkDeclaration"); SNode targetConcept = SLinkOperations.getTarget(link, "target", false); SNode expectedNodeType = _quotation_createNode_mxwyp3_a0g0a(targetConcept); // reference may be resolved dynamically? if (SConceptOperations.isSubConceptOf( targetConcept, "jetbrains.mps.lang.core.structure.IResolveInfo")) { return _quotation_createNode_mxwyp3_a0a8a0(targetConcept); } return expectedNodeType; }
public void execute(final SNode node, final EditorContext editorContext) { SNode cl = (SNodeOperations.getConceptDeclaration(node) == SConceptOperations.findConceptDeclaration( "jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral") ? SNodeFactoryOperations.createNewNode( "jetbrains.mps.baseLanguage.closures.structure.UnrestrictedClosureLiteral", null) : SNodeFactoryOperations.createNewNode( "jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral", null)); SNodeOperations.replaceWithAnother(node, cl); List<SNode> params = SLinkOperations.getTargets(node, "parameter", true); for (SNode p : params) { ListSequence.fromList(SLinkOperations.getTargets(cl, "parameter", true)) .addElement(SNodeOperations.detachNode(p)); } SLinkOperations.setTarget( cl, "body", SNodeOperations.detachNode(SLinkOperations.getTarget(node, "body", true)), true); }
public static boolean static_canBeAChild( SNode node, SNode parentNode, SNode link, SNode childConcept, final IOperationContext operationContext) { SNode dtype = BehaviorReflection.invokeVirtual( (Class<SNode>) ((Class) Object.class), SNodeOperations.as( SNodeOperations.getParent(parentNode), "jetbrains.mps.baseLanguage.structure.TypeDerivable"), "virtual_deriveType_1213877435747", new Object[] { SNodeOperations.as(parentNode, "jetbrains.mps.baseLanguage.structure.Expression") }); return (dtype == null) || SConceptOperations.isSuperConceptOf( SNodeOperations.getConceptDeclaration(dtype), "jetbrains.mps.baseLanguage.collections.structure.MapType"); }
public static List<SNode> virtual_getMethodsToImplement_5418393554803775106(SNode thisNode) { List<SNode> methods = new ArrayList<SNode>(); ClassifierAndSuperClassifiersScope scope = new ClassifierAndSuperClassifiersScope(thisNode, IClassifiersSearchScope.INSTANCE_METHOD); // todo do not show already implemented methods for (SNode method : ((List<SNode>) scope.getNodes())) { boolean isOverridden = false; List<SNode> overridenMethods = scope.getOverriddenMethods(method); for (SNode overridingMethod : overridenMethods) { isOverridden = isOverridden || (SNodeOperations.isInstanceOf( overridingMethod, "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration") && SPropertyOperations.getBoolean( SNodeOperations.getConceptDeclaration( SNodeOperations.cast( overridingMethod, "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration")), "abstract")); } if (isOverridden) { continue; } SNode container = SNodeOperations.getAncestor( method, "jetbrains.mps.baseLanguage.structure.Classifier", false, false); if (container == thisNode || container == null) { continue; } if (SNodeOperations.isInstanceOf(container, "jetbrains.mps.baseLanguage.structure.Interface") || SPropertyOperations.getBoolean(method, "isAbstract")) { ListSequence.fromList(methods).addElement(method); } } return methods; }