package jetbrains.mps.lang.behavior.generator.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.ReductionRuleBase; import jetbrains.mps.generator.runtime.TemplateRuleWithCondition; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.runtime.GenerationException; import jetbrains.mps.generator.template.ReductionRuleQueryContext; import jetbrains.mps.smodel.SReference; import org.jetbrains.mps.openapi.persistence.PersistenceFacade; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import java.util.Collections; @Generated public class Switch_switch_Parameter extends TemplateSwitchBase implements TemplateSwitchMapping { private final Iterable<TemplateReductionRule> rules; public Switch_switch_Parameter() { rules = TemplateUtil.<TemplateReductionRule>asIterable(new Switch_switch_Parameter.ReductionRule0(), new Switch_switch_Parameter.ReductionRule1()); } public SNodeReference getSwitchNode() { return new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4698411099515185335"); } 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) { return null; } public void processNull(TemplateExecutionEnvironment environment, SNodeReference templateSwitch, TemplateContext context) { } public final class ReductionRule0 extends ReductionRuleBase implements TemplateRuleWithCondition { public ReductionRule0() { super(new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4698411099515185370"), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e94L, "jetbrains.mps.baseLanguage.structure.ParameterDeclaration"), true); } @Override public boolean isApplicable(@NotNull TemplateContext context) throws GenerationException { return QueriesGenerated.baseMappingRule_Condition_4698411099515225497(new ReductionRuleQueryContext(context, getRuleNode())); } @Override public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); final SNode tnode1 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfbbebabf09L, "StaticMethodCall")); try { tnode1.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"), tnode1, PersistenceFacade.getInstance().createModelReference("d936855b-48da-4812-a8a0-2bfddd633ac4/java:jetbrains.mps.core.aspects.behaviour(jetbrains.mps.lang.behavior.runtime/)"), PersistenceFacade.getInstance().createNodeId("~SMethodBuilder.createVarArgPrm(java.lang.Class,java.lang.String):jetbrains.mps.core.aspects.behaviour.api.SParameter"))); tnode1.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"), tnode1, PersistenceFacade.getInstance().createModelReference("d936855b-48da-4812-a8a0-2bfddd633ac4/java:jetbrains.mps.core.aspects.behaviour(jetbrains.mps.lang.behavior.runtime/)"), PersistenceFacade.getInstance().createNodeId("~SMethodBuilder"))); TemplateContext context1 = context.subContext(); { Collection<SNode> tlist2 = null; { final SNode switchInput2 = QueriesGenerated.sourceNodeQuery_4698411099515235207(new SourceSubstituteMacroNodeContext(context1, switchMacroRef_vnjhlw_b0a0a0a1a3a2a2h)); if (switchInput2 == null) { tlist2 = Collections.emptyList(); } else { TemplateContext switchContext2; switchContext2 = context1.subContext(null, switchInput2); tlist2 = environment.trySwitch(templateSwitchNode_vnjhlw_a0a0c0a1a1a3a2a2h, switchContext2); if (tlist2 == null) { final SNode tnode3 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x103fb730c14L, "ClassifierClassExpression")); try { tnode3.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x103fb730c14L, 0x103fb73a43eL, "classifier"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x103fb730c14L, 0x103fb73a43eL, "classifier"), tnode3, PersistenceFacade.getInstance().createModelReference("6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)"), PersistenceFacade.getInstance().createNodeId("~Object"))); } finally { } if (tnode3 != null) { tlist2 = TemplateUtil.singletonList(tnode3); } } } } for (SNode child4 : TemplateUtil.asNotNull(tlist2)) { tnode1.addChild(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), child4); } // TODO validate child } { final SNode tnode5 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf93d565d10L, "StringLiteral")); try { } finally { } tnode1.addChild(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), tnode5); // TODO validate child } } finally { } return TemplateUtil.singletonList(tnode1); } } public final class ReductionRule1 extends ReductionRuleBase { public ReductionRule1() { super(new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4698411099515238862"), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e94L, "jetbrains.mps.baseLanguage.structure.ParameterDeclaration"), true); } @Override public Collection<SNode> apply(@NotNull final TemplateContext context) throws GenerationException { final TemplateExecutionEnvironment environment = context.getEnvironment(); final SNode tnode1 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xfbbebabf09L, "StaticMethodCall")); try { tnode1.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration"), tnode1, PersistenceFacade.getInstance().createModelReference("d936855b-48da-4812-a8a0-2bfddd633ac4/java:jetbrains.mps.core.aspects.behaviour(jetbrains.mps.lang.behavior.runtime/)"), PersistenceFacade.getInstance().createNodeId("~SMethodBuilder.createJavaParameter(java.lang.Class,java.lang.String):jetbrains.mps.core.aspects.behaviour.api.SParameter"))); tnode1.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L, 0x10a7588b546L, "classConcept"), tnode1, PersistenceFacade.getInstance().createModelReference("d936855b-48da-4812-a8a0-2bfddd633ac4/java:jetbrains.mps.core.aspects.behaviour(jetbrains.mps.lang.behavior.runtime/)"), PersistenceFacade.getInstance().createNodeId("~SMethodBuilder"))); TemplateContext context1 = context.subContext(); { Collection<SNode> tlist2 = null; { final SNode switchInput2 = QueriesGenerated.sourceNodeQuery_7830995205626232436(new SourceSubstituteMacroNodeContext(context1, switchMacroRef_vnjhlw_b0a0a0a1a3a2a1i)); if (switchInput2 == null) { tlist2 = Collections.emptyList(); } else { TemplateContext switchContext2; switchContext2 = context1.subContext(null, switchInput2); tlist2 = environment.trySwitch(templateSwitchNode_vnjhlw_a0a0c0a1a1a3a2a1i, switchContext2); if (tlist2 == null) { final SNode tnode3 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x103fb730c14L, "ClassifierClassExpression")); try { tnode3.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x103fb730c14L, 0x103fb73a43eL, "classifier"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x103fb730c14L, 0x103fb73a43eL, "classifier"), tnode3, PersistenceFacade.getInstance().createModelReference("6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)"), PersistenceFacade.getInstance().createNodeId("~Object"))); } finally { } if (tnode3 != null) { tlist2 = TemplateUtil.singletonList(tnode3); } } } } for (SNode child4 : TemplateUtil.asNotNull(tlist2)) { tnode1.addChild(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), child4); } // TODO validate child } { final SNode tnode5 = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0xf93d565d10L, "StringLiteral")); try { } finally { } tnode1.addChild(MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), tnode5); // TODO validate child } } finally { } return TemplateUtil.singletonList(tnode1); } } private static SNodePointer switchMacroRef_vnjhlw_b0a0a0a1a3a2a2h = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "4698411099515193570"); private static SNodePointer templateSwitchNode_vnjhlw_a0a0c0a1a1a3a2a2h = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "2356949341616134045"); private static SNodePointer switchMacroRef_vnjhlw_b0a0a0a1a3a2a1i = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "7830995205626232435"); private static SNodePointer templateSwitchNode_vnjhlw_a0a0c0a1a1a3a2a1i = new SNodePointer("r:229ce18d-2bb0-4d5b-a7cd-cec65841e459(jetbrains.mps.lang.behavior.generator.template.main@generator)", "2356949341616134045"); }