package jetbrains.mps.lang.smodel.generator.baseLanguage.template.main;
/*Generated by MPS */
import jetbrains.mps.generator.runtime.Generated;
import jetbrains.mps.generator.runtime.TemplateDeclarationBase;
import org.jetbrains.mps.openapi.model.SNodeReference;
import jetbrains.mps.smodel.SNodePointer;
import java.util.Collection;
import org.jetbrains.mps.openapi.model.SNode;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.generator.runtime.TemplateContext;
import jetbrains.mps.generator.runtime.GenerationException;
import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.generator.runtime.TemplateSwitchMapping;
import java.util.Collections;
import jetbrains.mps.generator.runtime.TemplateUtil;
import jetbrains.mps.generator.runtime.NodeWeaveFacility;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SConcept;
@Generated
public class Template_reduce_LanguageRefExpression extends TemplateDeclarationBase {
public Template_reduce_LanguageRefExpression() {
}
public SNodeReference getTemplateNode() {
return new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "4497478346159792589");
}
protected Collection<SNode> applyPart0(@NotNull final TemplateContext context) throws GenerationException {
final TemplateExecutionEnvironment environment = context.getEnvironment();
Collection<SNode> tlist1 = null;
{
final SNode switchInput1 = QueriesGenerated.sourceNodeQuery_2944629966652339675(new SourceSubstituteMacroNodeContext(context, switchMacroRef_lwhn3j_b0a0a0a2a4));
if (switchInput1 == null) {
{
TemplateSwitchMapping switch1 = environment.getGenerator().getSwitch(templateSwitchNode_lwhn3j_a0a0c0a1a2a4);
if (switch1 != null) {
switch1.processNull(environment, templateSwitchNode_lwhn3j_a0a0c0a1a2a4, context);
}
}
tlist1 = Collections.emptyList();
} else {
TemplateContext switchContext1;
switchContext1 = context.subContext(null, switchInput1);
tlist1 = environment.trySwitch(templateSwitchNode_lwhn3j_a0a0c0a1a2a4, switchContext1);
if (tlist1 == null) {
final SNode tnode2 = environment.createOutputNode(myConcepts[0]);
try {
} finally {
}
if (tnode2 != null) {
tlist1 = TemplateUtil.singletonList(tnode2);
}
}
}
}
return tlist1;
}
@Override
public Collection<SNode> apply(@NotNull TemplateExecutionEnvironment environment, @NotNull TemplateContext context) throws GenerationException {
return applyPart0(context);
}
@Override
public Collection<SNode> weave(@NotNull NodeWeaveFacility.WeaveContext weaveContext, @NotNull NodeWeaveFacility weaveSupport) throws GenerationException {
final TemplateContext templateContext = weaveSupport.getTemplateContext();
Collection<SNode> tlistpart0 = applyPart0(templateContext);
for (SNode nodeToWeave : TemplateUtil.asNotNull(tlistpart0)) {
weaveSupport.weaveNode(MetaAdapterFactory.getContainmentLink(0xb401a68083254110L, 0x8fd384331ff25befL, 0xfe43cb41d0L, 0xfe43de823bL, "contentNode"), nodeToWeave);
}
return tlistpart0;
}
@Override
protected SConcept[] initConcepts() {
SConcept[] rv = new SConcept[1];
rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, "jetbrains.mps.lang.core"), 0x10802efe25aL, "BaseConcept");
return rv;
}
private static SNodePointer switchMacroRef_lwhn3j_b0a0a0a2a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2944629966652339671");
private static SNodePointer templateSwitchNode_lwhn3j_a0a0c0a1a2a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590303(jetbrains.mps.lang.smodel.generator.baseLanguage.template.main@generator)", "2944629966652298601");
}