package jetbrains.mps.lang.behavior.generator.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.IfMacroContext; import jetbrains.mps.generator.runtime.TemplateUtil; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.generator.runtime.NodeWeaveFacility; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.language.SConcept; import org.jetbrains.mps.openapi.language.SContainmentLink; @Generated public class Template_reduce_LocalBehaviorMethodCallWithCast extends TemplateDeclarationBase { public Template_reduce_LocalBehaviorMethodCallWithCast() { } public SNodeReference getTemplateNode() { return new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4598718932037121729"); } protected Collection<SNode> applyPart0(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); Collection<SNode> tlist1 = null; if (QueriesGenerated.ifMacro_Condition_4598718932037160741(new IfMacroContext(context, ifMacroRef_6pcqdy_b0a0c0e))) { final SNode tnode2 = environment.createOutputNode(myConcepts[0]); try { TemplateContext context1 = context.subContext(); { final SNode tnode3 = environment.createOutputNode(myConcepts[1]); try { TemplateContext context2 = context1.subContext(); { Collection<SNode> tlist4 = null; tlist4 = new Template_reduce_LocalBehaviorMethodCall().apply(environment, context2); for (SNode child5 : TemplateUtil.asNotNull(tlist4)) { tnode3.addChild(myAggregationLinks[0], child5); } // TODO validate child } { Collection<SNode> tlist6 = null; final SNode copySrcInput6 = QueriesGenerated.sourceNodeQuery_4598718932037179911(new SourceSubstituteMacroNodeContext(context2, copySrcMacro_6pcqdy_b0a0c0c0b0b0b0c0e)); tlist6 = environment.copyNodes(TemplateUtil.singletonList(copySrcInput6), copySrcMacro_6pcqdy_b0a0c0c0b0b0b0c0e, "tpl/r:229ce18d-2bb0-4d5b-a7cd-cec65841e459/4598718932037174208", context2); for (SNode child7 : TemplateUtil.asNotNull(tlist6)) { tnode3.addChild(myAggregationLinks[1], child7); } // TODO validate child } } finally { } tnode2.addChild(myAggregationLinks[2], tnode3); // TODO validate child } } finally { } tlist1 = TemplateUtil.singletonList(tnode2); } else { Collection<SNode> tlist8 = null; tlist8 = new Template_reduce_LocalBehaviorMethodCall().apply(environment, context); tlist1 = tlist8; } 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L, 0xf8cc56b214L, "expression"), nodeToWeave); } return tlistpart0; } @Override protected SConcept[] initConcepts() { SConcept[] rv = new SConcept[2]; rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfb4ed32b7fL, "ParenthesizedExpression"); rv[1] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf940dabe4aL, "CastExpression"); return rv; } @Override protected SContainmentLink[] initAggregationLinks() { SContainmentLink[] rv = new SContainmentLink[3]; rv[0] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf940dabe4aL, 0xf940dabe4cL, "expression"); rv[1] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf940dabe4aL, 0xf940dabe4bL, "type"); rv[2] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfb4ed32b7fL, 0xfb4ed32b80L, "expression"); return rv; } private static SNodePointer copySrcMacro_6pcqdy_b0a0c0c0b0b0b0c0e = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4598718932037176834"); private static SNodePointer ifMacroRef_6pcqdy_b0a0c0e = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4598718932037160739"); }