package jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_reduceOneToMany; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.runtime.TemplateSwitchBase; import jetbrains.mps.generator.runtime.TemplateSwitchMapping; import jetbrains.mps.generator.runtime.TemplateReductionRule; import jetbrains.mps.generator.runtime.TemplateUtil; import org.jetbrains.mps.openapi.model.SNodeReference; import jetbrains.mps.smodel.SNodePointer; import java.util.Collection; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment; import jetbrains.mps.generator.runtime.TemplateContext; import jetbrains.mps.generator.runtime.GenerationException; import java.util.Collections; import jetbrains.mps.generator.runtime.ReductionRuleBase; import jetbrains.mps.generator.runtime.TemplateRuleWithCondition; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.template.ReductionRuleQueryContext; @Generated public class Switch_betterSwitch extends TemplateSwitchBase implements TemplateSwitchMapping { private final Iterable<TemplateReductionRule> rules; public Switch_betterSwitch() { rules = TemplateUtil.<TemplateReductionRule>asIterable(new Switch_betterSwitch.ReductionRule0()); } public SNodeReference getSwitchNode() { return new SNodePointer("r:eca8e1c7-93fd-4ddf-9db6-91f9c2320691(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_reduceOneToMany@generator)", "8371596541809066874"); } public SNodeReference getModifiesSwitch() { return new SNodePointer("r:eca8e1c7-93fd-4ddf-9db6-91f9c2320691(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_reduceOneToMany@generator)", "1892993302480310366"); } public Iterable<TemplateReductionRule> getReductionRules() { return rules; } public Collection<SNode> applyDefault(final TemplateExecutionEnvironment environment, SNodeReference templateSwitch, String mappingLabel, final TemplateContext context) throws GenerationException { Collection<SNode> tlist1 = Collections.emptyList(); return tlist1; } public void processNull(TemplateExecutionEnvironment environment, SNodeReference templateSwitch, TemplateContext context) { environment.getLogger().info(templateSwitch, "Hmm, input is null"); } public final class ReductionRule0 extends ReductionRuleBase implements TemplateRuleWithCondition { public ReductionRule0() { super(new SNodePointer("r:eca8e1c7-93fd-4ddf-9db6-91f9c2320691(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_reduceOneToMany@generator)", "8371596541809066877"), MetaAdapterFactory.getConcept(0xab0ae915e3b54f35L, 0xb55ac655d649a03cL, 0x11645be5a7aL, "jetbrains.mps.transformation.test.inputLang.structure.InputNode_A"), false); } @Override public boolean isApplicable(@NotNull TemplateContext context) throws GenerationException { return QueriesGenerated.baseMappingRule_Condition_8371596541809066879(new ReductionRuleQueryContext(context, getRuleNode())); } @Override public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); Collection<SNode> tlist1 = new Template_reduce_InputNode_A().apply(environment, context); return tlist1; } } }