package jetbrains.mps.samples.Kaja.generator.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.runtime.TemplateUtil; 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; @Generated public class Template_reduce_South extends TemplateDeclarationBase { public Template_reduce_South() { } public SNodeReference getTemplateNode() { return new SNodePointer("r:3ab3501c-2f4b-48e6-9b6c-e31ff8ef3185(jetbrains.mps.samples.Kaja.generator.template.main@generator)", "3308300503039683808"); } 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:f5e9b11f-5073-4786-8ed1-a9e42307c3f8(JavaKaja.runtime)"), PersistenceFacade.getInstance().createNodeId("3308300503039569143"))); tnode1.setReference(myAssociationLinks[1], SReference.create(myAssociationLinks[1], tnode1, PersistenceFacade.getInstance().createModelReference("r:f5e9b11f-5073-4786-8ed1-a9e42307c3f8(JavaKaja.runtime)"), PersistenceFacade.getInstance().createNodeId("3308300503039569134"))); } 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer"), tnodepart0); return TemplateUtil.singletonList(tnodepart0); } @Override protected SConcept[] initConcepts() { SConcept[] rv = new SConcept[1]; rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfc37588bc8L, "EnumConstantReference"); return rv; } @Override protected SReferenceLink[] initAssociationLinks() { SReferenceLink[] rv = new SReferenceLink[2]; rv[0] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfc37588bc8L, 0xfc37588bcaL, "enumConstantDeclaration"); rv[1] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfc37588bc8L, 0x10a758428feL, "enumClass"); return rv; } }