package jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.runtime.MapConfigBase; import jetbrains.mps.generator.runtime.TemplateMappingConfiguration; import java.util.Collection; import jetbrains.mps.generator.runtime.TemplateRootMappingRule; import jetbrains.mps.generator.runtime.TemplateWeavingRule; import jetbrains.mps.generator.runtime.TemplateDropRootRule; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.runtime.TemplateModel; import jetbrains.mps.smodel.SNodePointer; import jetbrains.mps.generator.runtime.TemplateUtil; import jetbrains.mps.generator.runtime.MapRootRuleBase; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.generator.runtime.TemplateContext; import jetbrains.mps.generator.runtime.GenerationException; import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment; import jetbrains.mps.generator.runtime.DropRootRuleBase; import jetbrains.mps.generator.runtime.WeaveRuleBase; import jetbrains.mps.generator.template.WeavingMappingRuleContext; import java.util.List; import java.util.ArrayList; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import jetbrains.mps.generator.runtime.NodeWeaveFacility; import jetbrains.mps.generator.impl.WeaveContextImpl; @Generated public class Mapping_main extends MapConfigBase implements TemplateMappingConfiguration { private final Collection<TemplateRootMappingRule> rootRules; private final Collection<TemplateWeavingRule> weavings; private final Collection<TemplateDropRootRule> dropRules; public Mapping_main(@NotNull TemplateModel model) { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008486850"), "main", model, false); rootRules = TemplateUtil.<TemplateRootMappingRule>asCollection(new Mapping_main.RootMappingRule0()); weavings = TemplateUtil.<TemplateWeavingRule>asCollection(new Mapping_main.WeavingRule0(), new Mapping_main.WeavingRule1(), new Mapping_main.WeavingRule2(), new Mapping_main.WeavingRule3()); dropRules = TemplateUtil.<TemplateDropRootRule>asCollection(new Mapping_main.DropRootRule0()); } @Override public Collection<TemplateRootMappingRule> getRootRules() { return rootRules; } @Override public Collection<TemplateWeavingRule> getWeavingRules() { return weavings; } @Override public Collection<TemplateDropRootRule> getDropRules() { return dropRules; } public class RootMappingRule0 extends MapRootRuleBase implements TemplateRootMappingRule { public RootMappingRule0() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008486853"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c64caccL, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.RootConcept"), false, true); } @Override public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); Collection<SNode> result = new Template_map_RootConcept().apply(environment, context); environment.registerLabel(context.getInput(), result, "map_RootConcept"); return result; } } public class DropRootRule0 extends DropRootRuleBase implements TemplateDropRootRule { public DropRootRule0() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008531363"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c64caccL, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.RootConcept")); } } public class WeavingRule0 extends WeaveRuleBase implements TemplateWeavingRule { public WeavingRule0() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008490337"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c64f39cL, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.ChildConceptWeave"), false); } @NotNull @Override public SNode getContextNode(TemplateExecutionEnvironment environment, TemplateContext context) { return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_6186432342008490339(new WeavingMappingRuleContext(context, getRuleNode())); } @Override public boolean apply(final TemplateExecutionEnvironment environment, final TemplateContext context, final SNode outputContextNode) throws GenerationException { final List<SNode> tlist1 = new ArrayList<SNode>(); Iterable<SNode> weaveEachList1 = QueriesGenerated.sourceNodesQuery_6186432342008490342(new SourceSubstituteMacroNodesContext(context, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008490341"))); for (SNode itnode : weaveEachList1) { if (itnode == null) { continue; } TemplateContext innerContext = context.subContext(itnode); NodeWeaveFacility.WeaveContext weaveContext = new WeaveContextImpl(outputContextNode, innerContext, WeavingRule0.this); Collection<SNode> innerResult = environment.prepareWeave(weaveContext, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008490341")).weaveTemplate(new Template_weave_ChildConceptWeave()); if (innerResult != null) { tlist1.addAll(innerResult); } } return tlist1 != null && !(tlist1.isEmpty()); } } public class WeavingRule1 extends WeaveRuleBase implements TemplateWeavingRule { public WeavingRule1() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008522527"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c64caccL, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.RootConcept"), false); } @NotNull @Override public SNode getContextNode(TemplateExecutionEnvironment environment, TemplateContext context) { return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_6186432342008522529(new WeavingMappingRuleContext(context, getRuleNode())); } @Override public boolean apply(final TemplateExecutionEnvironment environment, final TemplateContext context, final SNode outputContextNode) throws GenerationException { final List<SNode> tlist1 = new ArrayList<SNode>(); Iterable<SNode> weaveEachList1 = QueriesGenerated.sourceNodesQuery_6186432342008522532(new SourceSubstituteMacroNodesContext(context, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008522531"))); for (SNode itnode : weaveEachList1) { if (itnode == null) { continue; } TemplateContext innerContext = context.subContext(itnode); NodeWeaveFacility.WeaveContext weaveContext = new WeaveContextImpl(outputContextNode, innerContext, WeavingRule1.this); Collection<SNode> innerResult = environment.prepareWeave(weaveContext, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008522531")).weaveTemplate(new Template_weave_ChildConceptWeave()); if (innerResult != null) { tlist1.addAll(innerResult); } } return tlist1 != null && !(tlist1.isEmpty()); } } public class WeavingRule2 extends WeaveRuleBase implements TemplateWeavingRule { public WeavingRule2() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533375"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c681159L, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.ChildConceptWeaveMany"), false); } @NotNull @Override public SNode getContextNode(TemplateExecutionEnvironment environment, TemplateContext context) { return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_6186432342008533384(new WeavingMappingRuleContext(context, getRuleNode())); } @Override public boolean apply(final TemplateExecutionEnvironment environment, final TemplateContext context, final SNode outputContextNode) throws GenerationException { final List<SNode> tlist1 = new ArrayList<SNode>(); Iterable<SNode> weaveEachList1 = QueriesGenerated.sourceNodesQuery_6186432342008533377(new SourceSubstituteMacroNodesContext(context, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533376"))); for (SNode itnode : weaveEachList1) { if (itnode == null) { continue; } TemplateContext innerContext = context.subContext(itnode); NodeWeaveFacility.WeaveContext weaveContext = new WeaveContextImpl(outputContextNode, innerContext, WeavingRule2.this); Collection<SNode> innerResult = environment.prepareWeave(weaveContext, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533376")).weaveTemplate(new Template_weave_ChildConceptWeaveMany()); if (innerResult != null) { tlist1.addAll(innerResult); } } return tlist1 != null && !(tlist1.isEmpty()); } } public class WeavingRule3 extends WeaveRuleBase implements TemplateWeavingRule { public WeavingRule3() { super(new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533360"), MetaAdapterFactory.getConcept(0xce517356fc9a4e78L, 0x86066e7a36ff0671L, 0x55da9f701c64caccL, "jetbrains.mps.traceInfo.testWeavingGenerated.data.structure.RootConcept"), false); } @NotNull @Override public SNode getContextNode(TemplateExecutionEnvironment environment, TemplateContext context) { return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_6186432342008533368(new WeavingMappingRuleContext(context, getRuleNode())); } @Override public boolean apply(final TemplateExecutionEnvironment environment, final TemplateContext context, final SNode outputContextNode) throws GenerationException { final List<SNode> tlist1 = new ArrayList<SNode>(); Iterable<SNode> weaveEachList1 = QueriesGenerated.sourceNodesQuery_6186432342008533362(new SourceSubstituteMacroNodesContext(context, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533361"))); for (SNode itnode : weaveEachList1) { if (itnode == null) { continue; } TemplateContext innerContext = context.subContext(itnode); NodeWeaveFacility.WeaveContext weaveContext = new WeaveContextImpl(outputContextNode, innerContext, WeavingRule3.this); Collection<SNode> innerResult = environment.prepareWeave(weaveContext, new SNodePointer("r:592e27b6-d258-4bf2-9e32-25019862e1f1(jetbrains.mps.traceInfo.testWeavingGenerated.data.generator.template.main@generator)", "6186432342008533361")).weaveTemplate(new Template_weave_ChildConceptWeaveMany()); if (innerResult != null) { tlist1.addAll(innerResult); } } return tlist1 != null && !(tlist1.isEmpty()); } } }