package jetbrains.mps.lang.smodel.generator.baseLanguage.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.runtime.TemplateDeclarationBase; import org.jetbrains.mps.openapi.model.SNodeReference; import jetbrains.mps.smodel.SNodePointer; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.runtime.TemplateContext; import jetbrains.mps.generator.runtime.GenerationException; import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment; import jetbrains.mps.smodel.SReference; import org.jetbrains.mps.openapi.persistence.PersistenceFacade; import java.util.Collection; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.generator.runtime.TemplateUtil; import java.util.Collections; import jetbrains.mps.generator.runtime.NodeWeaveFacility; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.language.SConcept; import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.language.SContainmentLink; @Generated public class Template_reduce_GetChildrenAndChildAttributesOperation extends TemplateDeclarationBase { public Template_reduce_GetChildrenAndChildAttributesOperation() { } public SNodeReference getTemplateNode() { return new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4862225818734494682"); } protected SNode applyPart0(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); final SNode tnode1 = environment.createOutputNode(myConcepts[0]); try { tnode1.setReference(myAssociationLinks[0], SReference.create(myAssociationLinks[0], tnode1, PersistenceFacade.getInstance().createModelReference("r:c3548bac-30eb-4a2a-937c-0111d5697309(jetbrains.mps.lang.smodel.generator.smodelAdapter)"), PersistenceFacade.getInstance().createNodeId("8452361719892525251"))); tnode1.setReference(myAssociationLinks[1], SReference.create(myAssociationLinks[1], tnode1, PersistenceFacade.getInstance().createModelReference("r:c3548bac-30eb-4a2a-937c-0111d5697309(jetbrains.mps.lang.smodel.generator.smodelAdapter)"), PersistenceFacade.getInstance().createNodeId("6407023681582958584"))); TemplateContext context1 = context.subContext(); { Collection<SNode> tlist2 = null; final SNode copySrcInput2 = QueriesGenerated.sourceNodeQuery_4862225818734498431(new SourceSubstituteMacroNodeContext(context1, copySrcMacro_hvlio5_b0a0c0d0c0e)); tlist2 = environment.copyNodes(TemplateUtil.singletonList(copySrcInput2), copySrcMacro_hvlio5_b0a0c0d0c0e, "tpl/r:00000000-0000-4000-0000-011c89590303/4862225818734498429", context1); for (SNode child3 : TemplateUtil.asNotNull(tlist2)) { tnode1.addChild(myAggregationLinks[0], child3); } // TODO validate child } { Collection<SNode> tlist4 = null; { final SNode switchInput4 = QueriesGenerated.sourceNodeQuery_4862225818734498439(new SourceSubstituteMacroNodeContext(context1, switchMacroRef_hvlio5_b0a0a0a1a4a2a4)); if (switchInput4 == null) { tlist4 = Collections.emptyList(); } else { TemplateContext switchContext4; switchContext4 = context1.subContext(null, switchInput4); tlist4 = environment.trySwitch(templateSwitchNode_hvlio5_a0a0c0a1a1a4a2a4, switchContext4); if (tlist4 == null) { final SNode tnode5 = environment.createOutputNode(myConcepts[1]); try { } finally { } if (tnode5 != null) { tlist4 = TemplateUtil.singletonList(tnode5); } } } } for (SNode child6 : TemplateUtil.asNotNull(tlist4)) { tnode1.addChild(myAggregationLinks[0], child6); } // TODO validate child } } finally { } return tnode1; } @Override public Collection<SNode> apply(@NotNull TemplateExecutionEnvironment environment, @NotNull TemplateContext context) throws GenerationException { return TemplateUtil.singletonList(applyPart0(context)); } @Override public Collection<SNode> weave(@NotNull NodeWeaveFacility.WeaveContext weaveContext, @NotNull NodeWeaveFacility weaveSupport) throws GenerationException { final TemplateContext templateContext = weaveSupport.getTemplateContext(); SNode tnodepart0 = applyPart0(templateContext); weaveSupport.weaveNode(MetaAdapterFactory.getContainmentLink(0xb401a68083254110L, 0x8fd384331ff25befL, 0xfe43cb41d0L, 0xfe43de823bL, "contentNode"), tnodepart0); return TemplateUtil.singletonList(tnodepart0); } @Override protected SConcept[] initConcepts() { SConcept[] rv = new SConcept[2]; rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfbbebabf09L, "StaticMethodCall"); rv[1] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf940cd6167L, "NullLiteral"); return rv; } @Override protected SReferenceLink[] initAssociationLinks() { SReferenceLink[] rv = new SReferenceLink[2]; rv[0] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"); rv[1] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"); return rv; } @Override protected SContainmentLink[] initAggregationLinks() { SContainmentLink[] rv = new SContainmentLink[1]; rv[0] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"); return rv; } private static SNodePointer copySrcMacro_hvlio5_b0a0c0d0c0e = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4862225818734498430"); private static SNodePointer switchMacroRef_hvlio5_b0a0a0a1a4a2a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4862225818734498438"); private static SNodePointer templateSwitchNode_hvlio5_a0a0c0a1a1a4a2a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "3902354333653082203"); }