package jetbrains.mps.lang.smodel.generator.baseLanguage.template.main;
/*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 jetbrains.mps.generator.impl.DismissTopMappingRuleException;
import jetbrains.mps.generator.runtime.ReductionRuleBase;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
@Generated
public class Switch_switch_toLinkRoleSLinkExp extends TemplateSwitchBase implements TemplateSwitchMapping {
private final Iterable<TemplateReductionRule> rules;
public Switch_switch_toLinkRoleSLinkExp() {
rules = TemplateUtil.<TemplateReductionRule>asIterable(new Switch_switch_toLinkRoleSLinkExp.ReductionRule0(), new Switch_switch_toLinkRoleSLinkExp.ReductionRule1(), new Switch_switch_toLinkRoleSLinkExp.ReductionRule2(), new Switch_switch_toLinkRoleSLinkExp.ReductionRule3());
}
public SNodeReference getSwitchNode() {
return new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205432344145");
}
public SNodeReference getModifiesSwitch() {
return null;
}
public Iterable<TemplateReductionRule> getReductionRules() {
return rules;
}
public Collection<SNode> applyDefault(final TemplateExecutionEnvironment environment, SNodeReference templateSwitch, String mappingLabel, final TemplateContext context) throws GenerationException {
DismissTopMappingRuleException ex_htg03n_a = new DismissTopMappingRuleException(DismissTopMappingRuleException.MessageType.error, "couldn't generate role string expression");
ex_htg03n_a.setTemplateContext(context);
ex_htg03n_a.setTemplateModelLocation(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205432503129"));
throw ex_htg03n_a;
}
public void processNull(TemplateExecutionEnvironment environment, SNodeReference templateSwitch, TemplateContext context) {
}
public final class ReductionRule0 extends ReductionRuleBase {
public ReductionRule0() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205436019441"), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f96ea2caL, "jetbrains.mps.lang.smodel.structure.SLinkAccess"), false);
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
try {
SNode callInputNode1 = QueriesGenerated.sourceNodeQuery_4585658144694415266(new SourceSubstituteMacroNodeContext(context, includeMacro_gqxre5_b0a0a0a2a1h));
TemplateContext context1 = context.subContext(null, callInputNode1);
if (callInputNode1 != null) {
try {
tlist1 = new Template_reduce_LinkDeclaration_SLink().apply(environment, context1);
} finally {
}
}
} finally {
}
return tlist1;
}
}
public final class ReductionRule1 extends ReductionRuleBase {
public ReductionRule1() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205436136616"), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f970c119L, "jetbrains.mps.lang.smodel.structure.SLinkListAccess"), false);
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
try {
SNode callInputNode1 = QueriesGenerated.sourceNodeQuery_4585658144694417717(new SourceSubstituteMacroNodeContext(context, includeMacro_gqxre5_b0a0a0a2a1i));
TemplateContext context1 = context.subContext(null, callInputNode1);
if (callInputNode1 != null) {
try {
tlist1 = new Template_reduce_LinkDeclaration_SLink().apply(environment, context1);
} finally {
}
}
} finally {
}
return tlist1;
}
}
public final class ReductionRule2 extends ReductionRuleBase {
public ReductionRule2() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205435484806"), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11886c4bac0L, "jetbrains.mps.lang.smodel.structure.LinkRefQualifier"), false);
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
try {
SNode callInputNode1 = QueriesGenerated.sourceNodeQuery_4585658144694420578(new SourceSubstituteMacroNodeContext(context, includeMacro_gqxre5_b0a0a0a2a1j));
TemplateContext context1 = context.subContext(null, callInputNode1);
if (callInputNode1 != null) {
try {
tlist1 = new Template_reduce_LinkDeclaration_SLink().apply(environment, context1);
} finally {
}
}
} finally {
}
return tlist1;
}
}
public final class ReductionRule3 extends ReductionRuleBase {
public ReductionRule3() {
super(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205435538666"), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11885c0d945L, "jetbrains.mps.lang.smodel.structure.PoundExpression"), false);
}
@Override
public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
final SNode copySrcInput1 = QueriesGenerated.sourceNodeQuery_1205435568235(new SourceSubstituteMacroNodeContext(context, copySrcMacro_gqxre5_b0a0d0b01));
tlist1 = environment.copyNodes(TemplateUtil.singletonList(copySrcInput1), copySrcMacro_gqxre5_b0a0d0b01, "tpl/r:00000000-0000-4000-0000-011c89590303/1205435561388", context);
return tlist1;
}
}
private static SNodePointer includeMacro_gqxre5_b0a0a0a2a1h = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4585658144694415257");
private static SNodePointer includeMacro_gqxre5_b0a0a0a2a1i = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4585658144694417716");
private static SNodePointer includeMacro_gqxre5_b0a0a0a2a1j = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4585658144694420577");
private static SNodePointer copySrcMacro_gqxre5_b0a0d0b01 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "1205435568234");
}