package jetbrains.mps.baseLanguage.math.generator.template.operations; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.impl.query.QueryProviderBase; import jetbrains.mps.generator.template.BaseMappingRuleContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.typesystem.inference.TypeChecker; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.generator.template.ReferenceMacroContext; import jetbrains.mps.generator.template.IfMacroContext; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.baseLanguage.behavior.Type__BehaviorDescriptor; import java.util.Map; import jetbrains.mps.generator.impl.query.ReductionRuleCondition; import java.util.HashMap; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.impl.query.QueryKey; import jetbrains.mps.generator.template.ReductionRuleQueryContext; import jetbrains.mps.generator.impl.GenerationFailureException; import jetbrains.mps.generator.impl.query.SourceNodeQuery; import jetbrains.mps.generator.impl.query.QueryKeyImpl; import org.jetbrains.annotations.Nullable; import jetbrains.mps.generator.impl.query.PropertyValueQuery; import org.jetbrains.mps.openapi.language.SProperty; import jetbrains.mps.generator.impl.query.IfMacroCondition; import jetbrains.mps.generator.impl.query.InlineSwitchCaseCondition; import jetbrains.mps.generator.template.InlineSwitchCaseContext; import jetbrains.mps.generator.impl.query.ReferenceTargetQuery; import org.jetbrains.mps.openapi.persistence.PersistenceFacade; import jetbrains.mps.smodel.SModelUtil_new; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static boolean baseMappingRule_Condition_1237111605288(final BaseMappingRuleContext _context) { return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca6da8L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolIndex")); } public static boolean baseMappingRule_Condition_1237111638742(final BaseMappingRuleContext _context) { return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fea765cf0L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolFromToIndex")); } public static boolean baseMappingRule_Condition_1237112518374(final BaseMappingRuleContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cd41a5L, "precondition")) != null; } public static boolean baseMappingRule_Condition_1418611629041289492(final BaseMappingRuleContext _context) { return TypeChecker.getInstance().getSubtypingManager().isSubtype(TypeChecker.getInstance().getTypeOf(_context.getNode()), _quotation_createNode_x583g4_b0a0a4()); } public static boolean baseMappingRule_Condition_1418611629041290683(final BaseMappingRuleContext _context) { return TypeChecker.getInstance().getSubtypingManager().isSubtype(TypeChecker.getInstance().getTypeOf(_context.getNode()), _quotation_createNode_x583g4_b0a0a5()); } public static Object propertyMacro_GetPropertyValue_1237191873565(final PropertyMacroContext _context) { return _context.createUniqueName("r", null); } public static Object propertyMacro_GetPropertyValue_1237111778085(final PropertyMacroContext _context) { return _context.createUniqueName(SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), null); } public static Object propertyMacro_GetPropertyValue_1237125700945(final PropertyMacroContext _context) { return _context.createUniqueName(SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), null); } public static Object propertyMacro_GetPropertyValue_1237111769945(final PropertyMacroContext _context) { return _context.createUniqueName("i", null); } public static Object propertyMacro_GetPropertyValue_1237123277207(final PropertyMacroContext _context) { return _context.createUniqueName("v", null); } public static Object referenceMacro_GetReferent_1237125777321(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(_context.getNode(), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fea765cf0L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolFromToIndex")), "TmpLocalVar"); } public static Object referenceMacro_GetReferent_1237112085618(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fea765cf0L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolFromToIndex")), "TmpLocalVar"); } public static Object referenceMacro_GetReferent_1237112162700(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fea765cf0L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolFromToIndex")), "TmpLocalVar"); } public static Object referenceMacro_GetReferent_1237113243060(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "ForeachVar"); } public static Object referenceMacro_GetReferent_1237113245188(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "LocalVar"); } public static Object referenceMacro_GetReferent_1237113438439(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "ResultVar"); } public static Object referenceMacro_GetReferent_1237117141434(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "InvokedExpression"); } public static Object referenceMacro_GetReferent_1237117144781(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "InvokedExpression"); } public static Object referenceMacro_GetReferent_1237117195572(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "InvokedExpression"); } public static Object referenceMacro_GetReferent_1237117198279(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "InvokedExpression"); } public static boolean ifMacro_Condition_1237117033967(final IfMacroContext _context) { return SNodeOperations.isInstanceOf(_context.getNode(), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0e16047L, "jetbrains.mps.baseLanguage.math.structure.BigMaxExpression")); } public static SNode sourceNodeQuery_1237191873553(final SourceSubstituteMacroNodeContext _context) { return (SNode) Type__BehaviorDescriptor.getBoxedType_idhEwIzNC.invoke(SNodeOperations.cast(TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression"))), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL, "jetbrains.mps.baseLanguage.structure.Type"))); } public static SNode sourceNodeQuery_1237191873573(final SourceSubstituteMacroNodeContext _context) { return _context.getNode(); } public static SNode sourceNodeQuery_1237116414162(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0d91491L, 0x11fe0d95bdfL, "indexRef")); } public static SNode sourceNodeQuery_3415580819641879969(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x12008f4e805L, 0x1200914977fL, "numerator")); } public static SNode sourceNodeQuery_3415580819641882218(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x12008f4e805L, 0x12009149b1aL, "denominator")); } public static SNode sourceNodeQuery_1237112255041(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")); } public static SNode sourceNodeQuery_1237111816463(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")), MetaAdapterFactory.getConcept(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca6da8L, "jetbrains.mps.baseLanguage.math.structure.MathSymbolIndex")), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca6da8L, 0x11fe0ccecc0L, "iterable")); } public static SNode sourceNodeQuery_1237125715824(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")); } public static SNode sourceNodeQuery_1237112127021(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae7f6L, "var")); } public static SNode sourceNodeQuery_3415580819641901421(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11feacc8f16L, "upperBound")); } public static SNode sourceNodeQuery_1237112602212(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cd41a5L, "precondition")); } public static SNode sourceNodeQuery_1418611629041289482(final SourceSubstituteMacroNodeContext _context) { return TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression"))); } public static SNode sourceNodeQuery_1418611629041290673(final SourceSubstituteMacroNodeContext _context) { return TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression"))); } public static SNode sourceNodeQuery_1237123277187(final SourceSubstituteMacroNodeContext _context) { return (SNode) Type__BehaviorDescriptor.getBoxedType_idhEwIzNC.invoke(SNodeOperations.cast(TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression"))), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL, "jetbrains.mps.baseLanguage.structure.Type"))); } public static SNode sourceNodeQuery_1237123277200(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression")); } public static SNode sourceNodeQuery_1237192405705(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression")); } public static SNode sourceNodeQuery_1237192427720(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x11fe0ca1899L, 0x11fe0cae874L, "expression")); } private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>(); { int i = 0; rrcMethods.put("1237111519843", new QueriesGenerated.RRC(i++)); rrcMethods.put("1237111520720", new QueriesGenerated.RRC(i++)); } @Override @NotNull public ReductionRuleCondition getReductionRuleCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(rrcMethods.containsKey(id))) { return super.getReductionRuleCondition(identity); } return rrcMethods.get(id); } private static class RRC implements ReductionRuleCondition { private final int methodKey; public RRC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(ReductionRuleQueryContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.baseMappingRule_Condition_1237111605288(ctx); case 1: return QueriesGenerated.baseMappingRule_Condition_1237111638742(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>(); { int i = 0; snqMethods.put("1237191873553", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237191873573", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237116414162", new QueriesGenerated.SNQ(i++)); snqMethods.put("3415580819641879969", new QueriesGenerated.SNQ(i++)); snqMethods.put("3415580819641882218", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237112255041", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237111816463", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237125715824", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237112127021", new QueriesGenerated.SNQ(i++)); snqMethods.put("3415580819641901421", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237112602212", new QueriesGenerated.SNQ(i++)); snqMethods.put("1418611629041289482", new QueriesGenerated.SNQ(i++)); snqMethods.put("1418611629041290673", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237123277187", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237123277200", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237192405705", new QueriesGenerated.SNQ(i++)); snqMethods.put("1237192427720", new QueriesGenerated.SNQ(i++)); } @NotNull @Override public SourceNodeQuery getSourceNodeQuery(@NotNull QueryKey identity) { final String id = ((QueryKeyImpl) identity).getQueryNodeId().toString(); if (!(snqMethods.containsKey(id))) { return super.getSourceNodeQuery(identity); } return snqMethods.get(id); } private static class SNQ implements SourceNodeQuery { private final int methodKey; public SNQ(int methodKey) { this.methodKey = methodKey; } @Nullable public SNode evaluate(@NotNull SourceSubstituteMacroNodeContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.sourceNodeQuery_1237191873553(ctx); case 1: return QueriesGenerated.sourceNodeQuery_1237191873573(ctx); case 2: return QueriesGenerated.sourceNodeQuery_1237116414162(ctx); case 3: return QueriesGenerated.sourceNodeQuery_3415580819641879969(ctx); case 4: return QueriesGenerated.sourceNodeQuery_3415580819641882218(ctx); case 5: return QueriesGenerated.sourceNodeQuery_1237112255041(ctx); case 6: return QueriesGenerated.sourceNodeQuery_1237111816463(ctx); case 7: return QueriesGenerated.sourceNodeQuery_1237125715824(ctx); case 8: return QueriesGenerated.sourceNodeQuery_1237112127021(ctx); case 9: return QueriesGenerated.sourceNodeQuery_3415580819641901421(ctx); case 10: return QueriesGenerated.sourceNodeQuery_1237112602212(ctx); case 11: return QueriesGenerated.sourceNodeQuery_1418611629041289482(ctx); case 12: return QueriesGenerated.sourceNodeQuery_1418611629041290673(ctx); case 13: return QueriesGenerated.sourceNodeQuery_1237123277187(ctx); case 14: return QueriesGenerated.sourceNodeQuery_1237123277200(ctx); case 15: return QueriesGenerated.sourceNodeQuery_1237192405705(ctx); case 16: return QueriesGenerated.sourceNodeQuery_1237192427720(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, PropertyValueQuery> pvqMethods = new HashMap<String, PropertyValueQuery>(); { int i = 0; pvqMethods.put("1237191873564", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "result")); pvqMethods.put("1237111778084", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "p")); pvqMethods.put("1237125700944", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "j")); pvqMethods.put("1237111769944", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "i")); pvqMethods.put("1237123277206", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "e")); } @NotNull @Override public PropertyValueQuery getPropertyValueQuery(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(pvqMethods.containsKey(id))) { return super.getPropertyValueQuery(identity); } return pvqMethods.get(id); } private static class PVQ extends PropertyValueQuery.Base { private final int methodKey; /*package*/ PVQ(int methodKey, SProperty property, String templateValue) { super(property, templateValue); this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.propertyMacro_GetPropertyValue_1237191873565(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_1237111778085(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_1237125700945(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_1237111769945(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_1237123277207(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, IfMacroCondition> imcMethods = new HashMap<String, IfMacroCondition>(); { int i = 0; imcMethods.put("1237117033966", new QueriesGenerated.IfMC(i++)); } @NotNull @Override public IfMacroCondition getIfMacroCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(imcMethods.containsKey(id))) { return super.getIfMacroCondition(identity); } return imcMethods.get(id); } private static class IfMC implements IfMacroCondition { private final int methodKey; public IfMC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull IfMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.ifMacro_Condition_1237117033967(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for if macro %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, InlineSwitchCaseCondition> isccMethods = new HashMap<String, InlineSwitchCaseCondition>(); { int i = 0; isccMethods.put("1237112518373", new QueriesGenerated.ISCC(i++)); isccMethods.put("1418611629041289491", new QueriesGenerated.ISCC(i++)); isccMethods.put("1418611629041290682", new QueriesGenerated.ISCC(i++)); } @NotNull @Override public InlineSwitchCaseCondition getInlineSwitchCaseCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(isccMethods.containsKey(id))) { return super.getInlineSwitchCaseCondition(identity); } return isccMethods.get(id); } private static class ISCC implements InlineSwitchCaseCondition { private final int methodKey; public ISCC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull InlineSwitchCaseContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.baseMappingRule_Condition_1237112518374(ctx); case 1: return QueriesGenerated.baseMappingRule_Condition_1418611629041289492(ctx); case 2: return QueriesGenerated.baseMappingRule_Condition_1418611629041290683(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for inline switch's case %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, ReferenceTargetQuery> rtqMethods = new HashMap<String, ReferenceTargetQuery>(); { rtqMethods.put("1237125777320", new QueriesGenerated.RTQ(0, "i")); rtqMethods.put("1237112085617", new QueriesGenerated.RTQ(1, "i")); rtqMethods.put("1237112162699", new QueriesGenerated.RTQ(2, "i")); rtqMethods.put("1237113243059", new QueriesGenerated.RTQ(3, null)); rtqMethods.put("1237113245187", new QueriesGenerated.RTQ(4, null)); rtqMethods.put("1237113438438", new QueriesGenerated.RTQ(5, null)); rtqMethods.put("1237117141433", new QueriesGenerated.RTQ(6, "p")); rtqMethods.put("1237117144780", new QueriesGenerated.RTQ(7, "p")); rtqMethods.put("1237117195571", new QueriesGenerated.RTQ(8, "p")); rtqMethods.put("1237117198278", new QueriesGenerated.RTQ(9, "p")); } @NotNull @Override public ReferenceTargetQuery getReferenceTargetQuery(@NotNull QueryKey queryKey) { final String id = queryKey.getTemplateNode().getNodeId().toString(); if (!(rtqMethods.containsKey(id))) { return super.getReferenceTargetQuery(queryKey); } return rtqMethods.get(id); } private static class RTQ extends ReferenceTargetQuery.Base { private final int methodKey; /*package*/ RTQ(int methodKey, String templateValue) { super(templateValue); this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull ReferenceMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.referenceMacro_GetReferent_1237125777321(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_1237112085618(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_1237112162700(ctx); case 3: return QueriesGenerated.referenceMacro_GetReferent_1237113243060(ctx); case 4: return QueriesGenerated.referenceMacro_GetReferent_1237113245188(ctx); case 5: return QueriesGenerated.referenceMacro_GetReferent_1237113438439(ctx); case 6: return QueriesGenerated.referenceMacro_GetReferent_1237117141434(ctx); case 7: return QueriesGenerated.referenceMacro_GetReferent_1237117144781(ctx); case 8: return QueriesGenerated.referenceMacro_GetReferent_1237117195572(ctx); case 9: return QueriesGenerated.referenceMacro_GetReferent_1237117198279(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private static SNode _quotation_createNode_x583g4_b0a0a4() { PersistenceFacade facade = PersistenceFacade.getInstance(); SNode quotedNode_1 = null; SNode quotedNode_2 = null; quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, "jetbrains.mps.baseLanguage.math"), 0x42d5783a6267f776L, "MatrixType"), null, null, false); quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, "jetbrains.mps.baseLanguage.math"), 0x120096f8e4cL, "BigComplexType"), null, null, false); quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x42d5783a6267f776L, 0x42d5783a62684653L, "elementType"), quotedNode_2); return quotedNode_1; } private static SNode _quotation_createNode_x583g4_b0a0a5() { PersistenceFacade facade = PersistenceFacade.getInstance(); SNode quotedNode_1 = null; SNode quotedNode_2 = null; quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, "jetbrains.mps.baseLanguage.math"), 0x42d5783a6267f776L, "MatrixType"), null, null, false); quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, "jetbrains.mps.baseLanguage.math"), 0x120096f8e4cL, "BigComplexType"), null, null, false); quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x3304fc6e7c6b401eL, 0xa016b944934bb21fL, 0x42d5783a6267f776L, 0x42d5783a62684653L, "elementType"), quotedNode_2); return quotedNode_1; } }