package jetbrains.mps.transformation.test.outputLang.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 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 org.jetbrains.mps.openapi.model.SNodeAccessUtil; import jetbrains.mps.generator.impl.reference.RefResolver; import java.util.Collection; 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; import org.jetbrains.mps.openapi.language.SProperty; import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.language.SContainmentLink; @Generated public class Template_gen_static_method extends TemplateDeclarationBase { public Template_gen_static_method() { } public SNodeReference getTemplateNode() { return new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "3392060900980718989"); } protected SNode applyPart0(@NotNull final TemplateContext contextNoLabel) throws GenerationException { final TemplateExecutionEnvironment environment = contextNoLabel.getEnvironment(); final TemplateContext context = contextNoLabel.subContext("testlabel"); final SNode tnode1 = environment.createOutputNode(myConcepts[0]); try { environment.nodeCopied(context, tnode1, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724041"); SNodeAccessUtil.setProperty(tnode1, myProperties[0], "fact"); TemplateContext context1 = context.subContext(); { final SNode tnode2 = environment.createOutputNode(myConcepts[1]); try { } finally { } tnode1.addChild(myAggregationLinks[0], tnode2); // TODO validate child } { final SNode tnode3 = environment.createOutputNode(myConcepts[2]); try { TemplateContext context2 = context1.subContext(); { final SNode tnode4 = environment.createOutputNode(myConcepts[3]); try { TemplateContext context3 = context2.subContext(); { final SNode tnode5 = environment.createOutputNode(myConcepts[2]); try { TemplateContext context4 = context3.subContext(); { final SNode tnode6 = environment.createOutputNode(myConcepts[4]); try { TemplateContext context5 = context4.subContext(); { final SNode tnode7 = environment.createOutputNode(myConcepts[5]); try { SNodeAccessUtil.setProperty(tnode7, myProperties[1], "1"); } finally { } tnode6.addChild(myAggregationLinks[1], tnode7); // TODO validate child } } finally { } tnode5.addChild(myAggregationLinks[2], tnode6); // TODO validate child } } finally { } tnode4.addChild(myAggregationLinks[3], tnode5); // TODO validate child } { final SNode tnode8 = environment.createOutputNode(myConcepts[6]); try { TemplateContext context6 = context3.subContext(); { final SNode tnode9 = environment.createOutputNode(myConcepts[7]); try { environment.resolveInTemplateLater(tnode9, myAssociationLinks[0], templateNode_2hhfmn_c0a0a1a1a1a2a1a1a1a4a3a4, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724048", "e", context6); } finally { } tnode8.addChild(myAggregationLinks[4], tnode9); // TODO validate child } { final SNode tnode10 = environment.createOutputNode(myConcepts[5]); try { SNodeAccessUtil.setProperty(tnode10, myProperties[1], "0"); } finally { } tnode8.addChild(myAggregationLinks[5], tnode10); // TODO validate child } } finally { } tnode4.addChild(myAggregationLinks[6], tnode8); // TODO validate child } } finally { } tnode3.addChild(myAggregationLinks[2], tnode4); // TODO validate child } { final SNode tnode11 = environment.createOutputNode(myConcepts[4]); try { TemplateContext context7 = context2.subContext(); { final SNode tnode12 = environment.createOutputNode(myConcepts[8]); try { TemplateContext context8 = context7.subContext(); { final SNode tnode13 = environment.createOutputNode(myConcepts[7]); try { environment.resolveInTemplateLater(tnode13, myAssociationLinks[0], templateNode_2hhfmn_c0a0a1a1a1a1a1a2a1a4a3a4, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724048", "e", context8); } finally { } tnode12.addChild(myAggregationLinks[4], tnode13); // TODO validate child } { final SNode tnode14 = environment.createOutputNode(myConcepts[9]); try { environment.resolveInTemplateLater(tnode14, myAssociationLinks[1], templateNode_2hhfmn_c0a0a1a2a1a1a1a2a1a4a3a4, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724041", "fact", context8); TemplateContext context9 = context8.subContext(); { final SNode tnode15 = environment.createOutputNode(myConcepts[10]); try { TemplateContext context10 = context9.subContext(); { final SNode tnode16 = environment.createOutputNode(myConcepts[5]); try { SNodeAccessUtil.setProperty(tnode16, myProperties[1], "1"); } finally { } tnode15.addChild(myAggregationLinks[5], tnode16); // TODO validate child } { final SNode tnode17 = environment.createOutputNode(myConcepts[7]); try { environment.resolveInTemplateLater(tnode17, myAssociationLinks[0], templateNode_2hhfmn_c0a0a1a2a1a2a1a2a1a1a1a2a1a4a3a4, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724048", "e", context10); } finally { } tnode15.addChild(myAggregationLinks[4], tnode17); // TODO validate child } } finally { } tnode14.addChild(myAggregationLinks[7], tnode15); // TODO validate child } } finally { } tnode12.addChild(myAggregationLinks[5], tnode14); // TODO validate child } } finally { } tnode11.addChild(myAggregationLinks[1], tnode12); // TODO validate child } } finally { } tnode3.addChild(myAggregationLinks[2], tnode11); // TODO validate child } } finally { } tnode1.addChild(myAggregationLinks[8], tnode3); // TODO validate child } { final SNode tnode18 = environment.createOutputNode(myConcepts[11]); try { } finally { } tnode1.addChild(myAggregationLinks[9], tnode18); // TODO validate child } { final SNode tnode19 = environment.createOutputNode(myConcepts[12]); try { environment.nodeCopied(context1, tnode19, "tpl/r:00000000-0000-4000-0000-011c89590606/3392060900980724048"); SNodeAccessUtil.setProperty(tnode19, myProperties[0], "e"); TemplateContext context11 = context1.subContext(); { final SNode tnode20 = environment.createOutputNode(myConcepts[11]); try { } finally { } tnode19.addChild(myAggregationLinks[10], tnode20); // TODO validate child } } finally { } tnode1.addChild(myAggregationLinks[11], tnode19); // TODO validate child } } finally { } environment.registerLabel(contextNoLabel.getInput(), tnode1, "testlabel"); return tnode1; } protected SNode applyPart1(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); final SNode tnode1 = environment.createOutputNode(myConcepts[0]); try { SNodeAccessUtil.setProperty(tnode1, myProperties[0], "worker"); TemplateContext context1 = context.subContext(); { final SNode tnode2 = environment.createOutputNode(myConcepts[13]); try { } finally { } tnode1.addChild(myAggregationLinks[9], tnode2); // TODO validate child } { final SNode tnode3 = environment.createOutputNode(myConcepts[1]); try { } finally { } tnode1.addChild(myAggregationLinks[0], tnode3); // TODO validate child } { final SNode tnode4 = environment.createOutputNode(myConcepts[2]); try { TemplateContext context2 = context1.subContext(); { final SNode tnode5 = environment.createOutputNode(myConcepts[14]); try { TemplateContext context3 = context2.subContext(); { final SNode tnode6 = environment.createOutputNode(myConcepts[9]); try { environment.resolve(new RefResolver(tnode6, myAssociationLinks[1], context3, new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "5955416080080987362"), "fact") { @Override public Object resolve() { return QueriesGenerated.referenceMacro_GetReferent_5955416080080987363(createQueryContext()); } }); TemplateContext context4 = context3.subContext(); { final SNode tnode7 = environment.createOutputNode(myConcepts[5]); try { SNodeAccessUtil.setProperty(tnode7, myProperties[1], "3"); } finally { } tnode6.addChild(myAggregationLinks[7], tnode7); // TODO validate child } } finally { } tnode5.addChild(myAggregationLinks[12], tnode6); // TODO validate child } } finally { } tnode4.addChild(myAggregationLinks[2], tnode5); // TODO validate child } } finally { } tnode1.addChild(myAggregationLinks[8], tnode4); // TODO validate child } } finally { } return tnode1; } @Override public Collection<SNode> apply(@NotNull TemplateExecutionEnvironment environment, @NotNull TemplateContext context) throws GenerationException { return TemplateUtil.asList(applyPart0(context), applyPart1(context)); } @Override public Collection<SNode> weave(@NotNull NodeWeaveFacility.WeaveContext weaveContext, @NotNull NodeWeaveFacility weaveSupport) throws GenerationException { final TemplateContext templateContext = weaveSupport.getTemplateContext(); SNode tnodepart0 = applyPart0(templateContext); weaveSupport.weaveNode(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"), tnodepart0); SNode tnodepart1 = applyPart1(templateContext); weaveSupport.weaveNode(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"), tnodepart1); return TemplateUtil.asList(tnodepart0, tnodepart1); } @Override protected SConcept[] initConcepts() { SConcept[] rv = new SConcept[15]; rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfbbebabf0aL, "StaticMethodDeclaration"); rv[1] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x10af9581ff1L, "PublicVisibility"); rv[2] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc56b200L, "StatementList"); rv[3] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc56b217L, "IfStatement"); rv[4] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc67c7feL, "ReturnStatement"); rv[5] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc59b314L, "IntegerConstant"); rv[6] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc56b210L, "EqualsExpression"); rv[7] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8c77f1e98L, "VariableReference"); rv[8] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfe476b758fL, "MulExpression"); rv[9] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x6c6b6a1e379f9404L, "LocalMethodCall"); rv[10] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc67c7f5L, "MinusExpression"); rv[11] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf940d22479L, "IntegerType"); rv[12] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8c77f1e94L, "ParameterDeclaration"); rv[13] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc6bf96dL, "VoidType"); rv[14] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf8cc56b213L, "ExpressionStatement"); return rv; } @Override protected SProperty[] initProperties() { SProperty[] rv = new SProperty[2]; rv[0] = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"); rv[1] = MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"); return rv; } @Override protected SReferenceLink[] initAssociationLinks() { SReferenceLink[] rv = new SReferenceLink[2]; rv[0] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration"); rv[1] = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"); return rv; } @Override protected SContainmentLink[] initAggregationLinks() { SContainmentLink[] rv = new SContainmentLink[13]; rv[0] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"); rv[1] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7feL, 0xf8cc6bf96cL, "expression"); rv[2] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement"); rv[3] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b217L, 0xf8cc56b219L, "ifTrue"); rv[4] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11cL, "leftExpression"); rv[5] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11bL, "rightExpression"); rv[6] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b217L, 0xf8cc56b218L, "condition"); rv[7] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"); rv[8] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body"); rv[9] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1fdL, "returnType"); rv[10] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x450368d90ce15bc3L, 0x4ed4d318133c80ceL, "type"); rv[11] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"); rv[12] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L, 0xf8cc56b214L, "expression"); return rv; } private static SNodePointer templateNode_2hhfmn_c0a0a1a1a1a2a1a1a1a4a3a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "3021153905150327964"); private static SNodePointer templateNode_2hhfmn_c0a0a1a1a1a1a1a2a1a4a3a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "3021153905151613299"); private static SNodePointer templateNode_2hhfmn_c0a0a1a2a1a1a1a2a1a4a3a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "4923130412071517799"); private static SNodePointer templateNode_2hhfmn_c0a0a1a2a1a2a1a2a1a1a1a2a1a4a3a4 = new SNodePointer("r:00000000-0000-4000-0000-011c89590606(jetbrains.mps.transformation.test.outputLang.generator.baseLanguage.template.main@generator)", "3021153905151738388"); }