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_ILinkQualifier_toSLink extends TemplateSwitchBase implements TemplateSwitchMapping {
private final Iterable<TemplateReductionRule> rules;
public Switch_switch_ILinkQualifier_toSLink() {
rules = TemplateUtil.<TemplateReductionRule>asIterable(new Switch_switch_ILinkQualifier_toSLink.ReductionRule0(), new Switch_switch_ILinkQualifier_toSLink.ReductionRule1());
}
public SNodeReference getSwitchNode() {
return new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2855392971717573960");
}
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_3td2ki_a = new DismissTopMappingRuleException(DismissTopMappingRuleException.MessageType.error, "Unsupported ILinkQualifier found. Reference to LinkDeclaration cannot be generated.");
ex_3td2ki_a.setTemplateContext(context);
ex_3td2ki_a.setTemplateModelLocation(new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2855392971717573983"));
throw ex_3td2ki_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)", "2855392971717573961"), 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_2855392971717573965(new SourceSubstituteMacroNodeContext(context, copySrcMacro_3v20rx_b0a0d0b7));
tlist1 = environment.copyNodes(TemplateUtil.singletonList(copySrcInput1), copySrcMacro_3v20rx_b0a0d0b7, "tpl/r:00000000-0000-4000-0000-011c89590303/2855392971717573963", context);
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)", "2855392971717573971"), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x26b292a5afc7ccacL, "jetbrains.mps.lang.smodel.structure.LinkQualifier"), 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_2855392971717573975(new SourceSubstituteMacroNodeContext(context, includeMacro_3v20rx_b0a0a0a2a1i));
TemplateContext context1 = context.subContext(null, callInputNode1);
if (callInputNode1 != null) {
try {
tlist1 = new Template_reduce_LinkDeclaration_SLink().apply(environment, context1);
} finally {
}
}
} finally {
}
return tlist1;
}
}
private static SNodePointer copySrcMacro_3v20rx_b0a0d0b7 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2855392971717573964");
private static SNodePointer includeMacro_3v20rx_b0a0a0a2a1i = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2855392971717573974");
}