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 org.jetbrains.mps.openapi.model.SNodeAccessUtil; import jetbrains.mps.generator.runtime.TemplateUtil; import jetbrains.mps.generator.template.PropertyMacroContext; import java.util.Collection; 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.SProperty; import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.language.SContainmentLink; @Generated public class Template_reduce_Property2Id extends TemplateDeclarationBase { public Template_reduce_Property2Id() { } public SNodeReference getTemplateNode() { return new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2196823097110102159"); } 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("6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.adapter.ids(MPS.Core/)"), PersistenceFacade.getInstance().createNodeId("~MetaIdFactory"))); tnode1.setReference(myAssociationLinks[1], SReference.create(myAssociationLinks[1], tnode1, PersistenceFacade.getInstance().createModelReference("6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.adapter.ids(MPS.Core/)"), PersistenceFacade.getInstance().createNodeId("~MetaIdFactory.propId(long,long,long,long):jetbrains.mps.smodel.adapter.ids.SPropertyId"))); TemplateContext context1 = context.subContext(); { final SNode tnode2 = environment.createOutputNode(myConcepts[1]); try { SNodeAccessUtil.setProperty(tnode2, myProperties[0], TemplateUtil.asString(QueriesGenerated.propertyMacro_GetPropertyValue_2196823097110114471(new PropertyMacroContext(context1, "0l", propertyMacro_aw6s9u_c0a0c0a0b0d0c0e)))); } finally { } tnode1.addChild(myAggregationLinks[0], tnode2); // TODO validate child } { final SNode tnode3 = environment.createOutputNode(myConcepts[1]); try { SNodeAccessUtil.setProperty(tnode3, myProperties[0], TemplateUtil.asString(QueriesGenerated.propertyMacro_GetPropertyValue_2196823097110114490(new PropertyMacroContext(context1, "0l", propertyMacro_aw6s9u_c0a0c0a0b0e0c0e)))); } finally { } tnode1.addChild(myAggregationLinks[0], tnode3); // TODO validate child } { final SNode tnode4 = environment.createOutputNode(myConcepts[1]); try { SNodeAccessUtil.setProperty(tnode4, myProperties[0], TemplateUtil.asString(QueriesGenerated.propertyMacro_GetPropertyValue_2196823097110114509(new PropertyMacroContext(context1, "0l", propertyMacro_aw6s9u_c0a0c0a0b0f0c0e)))); } finally { } tnode1.addChild(myAggregationLinks[0], tnode4); // TODO validate child } { final SNode tnode5 = environment.createOutputNode(myConcepts[1]); try { SNodeAccessUtil.setProperty(tnode5, myProperties[0], TemplateUtil.asString(QueriesGenerated.propertyMacro_GetPropertyValue_2196823097110114524(new PropertyMacroContext(context1, "0l", propertyMacro_aw6s9u_c0a0c0a0b0g0c0e)))); } finally { } tnode1.addChild(myAggregationLinks[0], tnode5); // 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"), 0x3b418722717710b4L, "LongLiteral"); return rv; } @Override protected SProperty[] initProperties() { SProperty[] rv = new SProperty[1]; rv[0] = MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"); return rv; } @Override protected SReferenceLink[] initAssociationLinks() { SReferenceLink[] rv = new SReferenceLink[2]; rv[0] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"); rv[1] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"); 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 propertyMacro_aw6s9u_c0a0c0a0b0d0c0e = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2196823097110114470"); private static SNodePointer propertyMacro_aw6s9u_c0a0c0a0b0e0c0e = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2196823097110114489"); private static SNodePointer propertyMacro_aw6s9u_c0a0c0a0b0f0c0e = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2196823097110114508"); private static SNodePointer propertyMacro_aw6s9u_c0a0c0a0b0g0c0e = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2196823097110114523"); }