package jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts;
/*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.TemplateReductionRule;
import jetbrains.mps.generator.runtime.TemplateCreateRootRule;
import jetbrains.mps.generator.runtime.TemplateRootMappingRule;
import jetbrains.mps.generator.runtime.TemplateMappingScript;
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.ReductionRuleBase;
import jetbrains.mps.generator.runtime.TemplateRuleWithCondition;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.generator.runtime.TemplateContext;
import jetbrains.mps.generator.runtime.GenerationException;
import jetbrains.mps.generator.template.ReductionRuleQueryContext;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment;
import jetbrains.mps.generator.template.BaseMappingRuleContext;
import org.jetbrains.mps.openapi.model.SNodeAccessUtil;
import java.util.Collections;
import jetbrains.mps.generator.runtime.MapRootRuleBase;
import jetbrains.mps.generator.template.MapRootRuleContext;
import jetbrains.mps.generator.runtime.CreateRootRuleBase;
import jetbrains.mps.generator.template.CreateRootRuleContext;
import jetbrains.mps.generator.impl.DefaultTemplateContext;
@Generated
public class Mapping_main extends MapConfigBase implements TemplateMappingConfiguration {
private final Collection<TemplateReductionRule> rules;
private final Collection<TemplateCreateRootRule> createRules;
private final Collection<TemplateRootMappingRule> rootRules;
private final Collection<TemplateMappingScript> preScripts;
private final Collection<TemplateMappingScript> postScripts;
public Mapping_main(@NotNull TemplateModel model) {
super(new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195164863269"), "main", model, false);
rules = TemplateUtil.<TemplateReductionRule>asCollection(new Mapping_main.ReductionRule0(), new Mapping_main.ReductionRule1());
createRules = TemplateUtil.<TemplateCreateRootRule>asCollection(new Mapping_main.CreateRootRule0());
rootRules = TemplateUtil.<TemplateRootMappingRule>asCollection(new Mapping_main.RootMappingRule0());
preScripts = TemplateUtil.<TemplateMappingScript>asCollection(new Script_test_preMappingScript());
postScripts = TemplateUtil.<TemplateMappingScript>asCollection(new Script_test_postMappingScript());
}
@Override
public Collection<TemplateReductionRule> getReductionRules() {
return rules;
}
@Override
public Collection<TemplateCreateRootRule> getCreateRules() {
return createRules;
}
@Override
public Collection<TemplateRootMappingRule> getRootRules() {
return rootRules;
}
@Override
public Collection<TemplateMappingScript> getPostScripts() {
return postScripts;
}
@Override
public Collection<TemplateMappingScript> getPreScripts() {
return preScripts;
}
public final class ReductionRule0 extends ReductionRuleBase implements TemplateRuleWithCondition {
public ReductionRule0() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195170730024"), MetaAdapterFactory.getConcept(0xab0ae915e3b54f35L, 0xb55ac655d649a03cL, 0x11645be5a7aL, "jetbrains.mps.transformation.test.inputLang.structure.InputNode_A"), true);
}
@Override
public boolean isApplicable(@NotNull TemplateContext context) throws GenerationException {
return QueriesGenerated.baseMappingRule_Condition_1202780919451(new ReductionRuleQueryContext(context, getRuleNode()));
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
if (QueriesGenerated.baseMappingRule_Condition_1195172400866(new BaseMappingRuleContext(context, rule_ief6mt_b0a0c0c11))) {
final SNode tnode2 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x157a9668bf58417bL, 0x893e53d86388dc56L, "jetbrains.mps.transformation.test.outputLang"), 0x1164564a526L, "OutputNode"));
try {
SNodeAccessUtil.setProperty(tnode2, MetaAdapterFactory.getProperty(0x157a9668bf58417bL, 0x893e53d86388dc56L, 0x1164564a526L, 0x11645b5a797L, "text"), "<input option : 1>");
} finally {
}
tlist1 = TemplateUtil.singletonList(tnode2);
} else {
final SNode tnode3 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x157a9668bf58417bL, 0x893e53d86388dc56L, "jetbrains.mps.transformation.test.outputLang"), 0x1164564a526L, "OutputNode"));
try {
SNodeAccessUtil.setProperty(tnode3, MetaAdapterFactory.getProperty(0x157a9668bf58417bL, 0x893e53d86388dc56L, 0x1164564a526L, 0x11645b5a797L, "text"), "<input option : default>");
} finally {
}
tlist1 = TemplateUtil.singletonList(tnode3);
}
return tlist1;
}
}
public final class ReductionRule1 extends ReductionRuleBase implements TemplateRuleWithCondition {
public ReductionRule1() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1202780884290"), 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_1202780894871(new ReductionRuleQueryContext(context, getRuleNode()));
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = Collections.emptyList();
return tlist1;
}
}
public class RootMappingRule0 extends MapRootRuleBase implements TemplateRootMappingRule {
public RootMappingRule0() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195168895642"), MetaAdapterFactory.getConcept(0xab0ae915e3b54f35L, 0xb55ac655d649a03cL, 0x11645953ab3L, "jetbrains.mps.transformation.test.inputLang.structure.InputRoot"), false, false);
}
@Override
public boolean isApplicable(@NotNull TemplateContext context) throws GenerationException {
return QueriesGenerated.baseMappingRule_Condition_1202243113773(new MapRootRuleContext(context, getRuleNode()));
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> result = new Template_OutputRoot_by_MappingRule().apply(environment, context);
return result;
}
}
public class CreateRootRule0 extends CreateRootRuleBase implements TemplateCreateRootRule {
public CreateRootRule0() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195165196524"));
}
@Override
public boolean isApplicable(@NotNull TemplateContext context) throws GenerationException {
return QueriesGenerated.createRootRule_Condition_1202245164352(new CreateRootRuleContext(context, getRuleNode()));
}
public Collection<SNode> apply(TemplateExecutionEnvironment environment) throws GenerationException {
Collection<SNode> result = new Template_OutputRoot_By_RootRule().apply(environment, new DefaultTemplateContext(environment, null, null));
return result;
}
}
private static SNodePointer rule_ief6mt_b0a0c0c11 = new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195170730024");
}