package jetbrains.mps.lang.dataFlow.generator.baseLanguage.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.impl.query.QueryProviderBase; import jetbrains.mps.generator.template.CreateRootRuleContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModuleOperations; 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 org.jetbrains.mps.openapi.model.SModel; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.lang.core.behavior.INamedConcept__BehaviorDescriptor; import jetbrains.mps.generator.template.ReferenceMacroContext; import jetbrains.mps.internal.collections.runtime.Sequence; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations; import jetbrains.mps.generator.template.IfMacroContext; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.baseLanguage.behavior.IOperation__BehaviorDescriptor; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import jetbrains.mps.internal.collections.runtime.ISelector; import jetbrains.mps.internal.collections.runtime.IWhereFilter; import jetbrains.mps.generator.template.TemplateVarContext; 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.CreateRootCondition; 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.SourceNodesQuery; import java.util.Collection; import jetbrains.mps.util.IterableUtil; 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.ReferenceTargetQuery; import jetbrains.mps.generator.impl.query.VariableValueQuery; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static boolean createRootRule_Condition_1832482093173674464(final CreateRootRuleContext _context) { // see MPS-24613 return SModuleOperations.isAspect(_context.getOriginalInputModel(), "dataFlow"); } public static boolean baseMappingRule_Condition_8756503640281003227(final BaseMappingRuleContext _context) { return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, 0x116b46b36c4L, "operation")), MetaAdapterFactory.getConcept(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x194dbbd57c9dbb65L, "jetbrains.mps.lang.dataFlow.structure.BaseInstructionOperation")); } public static boolean baseMappingRule_Condition_1570228009929814973(final BaseMappingRuleContext _context) { // see MPS-24613 return SModuleOperations.isAspect(((SModel) _context.getVariable("model")), "dataFlow"); } public static Object propertyMacro_GetPropertyValue_1206456427297(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_1815980786158776239(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159175721(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159157450(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159121502(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159130424(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159145524(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159187547(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159191586(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1815980786159196460(final PropertyMacroContext _context) { return _context.getOriginalCopiedInputNode(_context.getNode()).getReference().toString(); } public static Object propertyMacro_GetPropertyValue_1207063014986(final PropertyMacroContext _context) { return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x1190a8b1526L, 0x1190a8b2ed8L, "label")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_1207063142468(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_6676818848694468475(final PropertyMacroContext _context) { return (String) INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_8324812022359558848(final PropertyMacroContext _context) { return SNodeOperations.getConcept(_context.getNode()).getQualifiedName(); } public static Object referenceMacro_GetReferent_6673335989323240696(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(Sequence.fromIterable(((Iterable<SNode>) _context.getVariable("var:rules"))).first(), "ruleClass"); } public static Object referenceMacro_GetReferent_6673335989323248699(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "ruleClass"); } public static Object referenceMacro_GetReferent_4860312625245627457(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(Sequence.fromIterable(((Iterable<SNode>) _context.getVariable("var:dataFlowBuilders"))).first(), "dataFlowBuilderClass"); } public static Object referenceMacro_GetReferent_4860312625245632383(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "dataFlowBuilderClass"); } public static Object referenceMacro_GetReferent_4860312625245430330(final ReferenceMacroContext _context) { return _context.getNode(); } public static Object referenceMacro_GetReferent_8100708479158807976(final ReferenceMacroContext _context) { // TODO genContext.get output .DataFlowAspectDescriptorClass for model model; return SModelOperations.getModelName(((SModel) _context.getVariable("model"))) + ".DataFlowAspectDescriptorImpl"; } public static boolean ifMacro_Condition_735072980478764555(final IfMacroContext _context) { return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes"))).isNotEmpty(); } public static boolean ifMacro_Condition_2979128091426922176(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5a42658L, 0x1160a375bea5106L, "position")) != null; } public static boolean ifMacro_Condition_2979128091426921167(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5a42658L, 0x1160a375bea5106L, "position")) != null; } public static boolean ifMacro_Condition_6676818848694486245(final IfMacroContext _context) { return Sequence.fromIterable(((Iterable<SNode>) _context.getVariable("var:rules"))).count() == 1; } public static boolean ifMacro_Condition_4860312625245355792(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x97a52717898f4598L, 0x8150573d9fd03868L, 0x5faaa6bbd57b6c8L, "jetbrains.mps.lang.dataFlow.analyzers.structure.Rule"))).isNotEmpty(); } public static boolean ifMacro_Condition_4860312625245474202(final IfMacroContext _context) { return Sequence.fromIterable(((Iterable<SNode>) _context.getVariable("var:dataFlowBuilders"))).count() == 1; } public static boolean ifMacro_Condition_8164880117399493597(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, "jetbrains.mps.lang.dataFlow.structure.DataFlowBuilderDeclaration"))).isNotEmpty(); } public static SNode sourceNodeQuery_8756503640281024578(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L, 0x116b46b36c4L, "operation")); } public static SNode sourceNodeQuery_1206456672226(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e59865a7L, "builderBlock")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1215195642591(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e643e7efL, 0x118e6444eb9L, "codeFor")); } public static SNode sourceNodeQuery_2979128091426922173(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5a42658L, 0x1160a375bea5106L, "position")); } public static SNode sourceNodeQuery_1206457204137(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5bc8a99L, 0x118e5bcba84L, "jumpTo")); } public static SNode sourceNodeQuery_2979128091426921164(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5a42658L, 0x1160a375bea5106L, "position")); } public static SNode sourceNodeQuery_1206457232122(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5bc8a99L, 0x118e5bcba84L, "jumpTo")); } public static SNode sourceNodeQuery_1206457018606(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5b40208L, 0x118e5b41f27L, "variable")); } public static SNode sourceNodeQuery_1206457029675(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5b40208L, 0x118e5b41f27L, "variable")); } public static SNode sourceNodeQuery_1230548357391(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5afd8deL, 0x11e7d9f7c3bL, "value")); } public static SNode sourceNodeQuery_1206457136740(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5b86667L, 0x118e5b89bc2L, "relativeTo")); } public static SNode sourceNodeQuery_1206457164922(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e5b86667L, 0x118e5b89bc2L, "relativeTo")); } public static SNode sourceNodeQuery_1206535717257(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118eb0b6674L, 0x118eb0b872cL, "emitStatement")); } public static SNode sourceNodeQuery_1206957434165(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x119043714f5L, 0x11904378e28L, "tryPart")); } public static SNode sourceNodeQuery_1206957448491(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x119043714f5L, 0x1190437aab4L, "finallyPart")); } public static SNode sourceNodeQuery_3063987229946254704(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x75c73261efe5e666L, 0x75c73261efe5e689L, "instruction")); } public static SNode sourceNodeQuery_3063987229946254740(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x75c73261efe5e666L, 0x75c73261efe5e689L, "instruction")); } public static SNode sourceNodeQuery_2959643274329985279(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x2912c3e08c4f3324L, 0x2912c3e08c4f3325L, "expression")); } public static SNode sourceNodeQuery_8756503640280628683(final SourceSubstituteMacroNodeContext _context) { return (SNode) IOperation__BehaviorDescriptor.getOperand_idhEwIP$m.invoke(_context.getNode()); } public static SNode sourceNodeQuery_7180022869589056777(final SourceSubstituteMacroNodeContext _context) { return (SNode) IOperation__BehaviorDescriptor.getOperand_idhEwIP$m.invoke(_context.getNode()); } public static SNode sourceNodeQuery_7180022869589078151(final SourceSubstituteMacroNodeContext _context) { return (SNode) IOperation__BehaviorDescriptor.getOperand_idhEwIP$m.invoke(_context.getNode()); } public static SNode sourceNodeQuery_554709999453585561(final SourceSubstituteMacroNodeContext _context) { return (SNode) IOperation__BehaviorDescriptor.getOperand_idhEwIP$m.invoke(_context.getNode()); } public static Iterable<SNode> sourceNodesQuery_8324812022359514372(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x6e8db6877fd04efbL, "modes")); } public static Iterable<SNode> sourceNodesQuery_6676818848694486262(final SourceSubstituteMacroNodesContext _context) { return ((Iterable<SNode>) _context.getVariable("var:rules")); } public static Iterable<SNode> sourceNodesQuery_6676818848693807797(final SourceSubstituteMacroNodesContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x97a52717898f4598L, 0x8150573d9fd03868L, 0x5faaa6bbd57b6c8L, "jetbrains.mps.lang.dataFlow.analyzers.structure.Rule"))).select(new ISelector<SNode, SNode>() { public SNode select(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x97a52717898f4598L, 0x8150573d9fd03868L, 0x5faaa6bbd57b6c8L, 0x3952cf7bd76e6440L, "analyzer")); } }).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return (it != null); } }).distinct().sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Iterable<SNode> sourceNodesQuery_2955426575105724546(final SourceSubstituteMacroNodesContext _context) { return ((Iterable<SNode>) _context.getVariable("var:dataFlowBuilders")); } public static Iterable<SNode> sourceNodesQuery_4860312625245371214(final SourceSubstituteMacroNodesContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, "jetbrains.mps.lang.dataFlow.structure.DataFlowBuilderDeclaration"))).select(new ISelector<SNode, SNode>() { public SNode select(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e58d76a0L, "conceptDeclaration")); } }).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return (it != null); } }).distinct().sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Object insertMacro_varValue_6676818848694489085(final TemplateVarContext _context) { return ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x97a52717898f4598L, 0x8150573d9fd03868L, 0x5faaa6bbd57b6c8L, "jetbrains.mps.lang.dataFlow.analyzers.structure.Rule"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x97a52717898f4598L, 0x8150573d9fd03868L, 0x5faaa6bbd57b6c8L, 0x3952cf7bd76e6440L, "analyzer")) == _context.getNode(); } }).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Object insertMacro_varValue_4860312625245470054(final TemplateVarContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, "jetbrains.mps.lang.dataFlow.structure.DataFlowBuilderDeclaration"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x7fa12e9cb9494976L, 0xb4fa19accbc320b4L, 0x118e58cd635L, 0x118e58d76a0L, "conceptDeclaration")) == _context.getNode(); } }).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>(); { int i = 0; rrcMethods.put("8756503640281001459", new QueriesGenerated.RRC(i++)); rrcMethods.put("1570228009929814969", 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_8756503640281003227(ctx); case 1: return QueriesGenerated.baseMappingRule_Condition_1570228009929814973(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, CreateRootCondition> crcMethods = new HashMap<String, CreateRootCondition>(); { int i = 0; crcMethods.put("1832482093173671714", new QueriesGenerated.CRC(i++)); } @Override @NotNull public CreateRootCondition getCreateRootRuleCondition(@NotNull QueryKey identity) { String id = identity.getTemplateNode().getNodeId().toString(); if (!(crcMethods.containsKey(id))) { return super.getCreateRootRuleCondition(identity); } return crcMethods.get(id); } private static class CRC implements CreateRootCondition { private final int methodKey; public CRC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull CreateRootRuleContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.createRootRule_Condition_1832482093173674464(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("8756503640281024578", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206456672226", new QueriesGenerated.SNQ(i++)); snqMethods.put("1215195642591", new QueriesGenerated.SNQ(i++)); snqMethods.put("2979128091426922173", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457204137", new QueriesGenerated.SNQ(i++)); snqMethods.put("2979128091426921164", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457232122", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457018606", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457029675", new QueriesGenerated.SNQ(i++)); snqMethods.put("1230548357391", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457136740", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206457164922", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206535717257", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206957434165", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206957448491", new QueriesGenerated.SNQ(i++)); snqMethods.put("3063987229946254704", new QueriesGenerated.SNQ(i++)); snqMethods.put("3063987229946254740", new QueriesGenerated.SNQ(i++)); snqMethods.put("2959643274329985279", new QueriesGenerated.SNQ(i++)); snqMethods.put("8756503640280628683", new QueriesGenerated.SNQ(i++)); snqMethods.put("7180022869589056777", new QueriesGenerated.SNQ(i++)); snqMethods.put("7180022869589078151", new QueriesGenerated.SNQ(i++)); snqMethods.put("554709999453585561", 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_8756503640281024578(ctx); case 1: return QueriesGenerated.sourceNodeQuery_1206456672226(ctx); case 2: return QueriesGenerated.sourceNodeQuery_1215195642591(ctx); case 3: return QueriesGenerated.sourceNodeQuery_2979128091426922173(ctx); case 4: return QueriesGenerated.sourceNodeQuery_1206457204137(ctx); case 5: return QueriesGenerated.sourceNodeQuery_2979128091426921164(ctx); case 6: return QueriesGenerated.sourceNodeQuery_1206457232122(ctx); case 7: return QueriesGenerated.sourceNodeQuery_1206457018606(ctx); case 8: return QueriesGenerated.sourceNodeQuery_1206457029675(ctx); case 9: return QueriesGenerated.sourceNodeQuery_1230548357391(ctx); case 10: return QueriesGenerated.sourceNodeQuery_1206457136740(ctx); case 11: return QueriesGenerated.sourceNodeQuery_1206457164922(ctx); case 12: return QueriesGenerated.sourceNodeQuery_1206535717257(ctx); case 13: return QueriesGenerated.sourceNodeQuery_1206957434165(ctx); case 14: return QueriesGenerated.sourceNodeQuery_1206957448491(ctx); case 15: return QueriesGenerated.sourceNodeQuery_3063987229946254704(ctx); case 16: return QueriesGenerated.sourceNodeQuery_3063987229946254740(ctx); case 17: return QueriesGenerated.sourceNodeQuery_2959643274329985279(ctx); case 18: return QueriesGenerated.sourceNodeQuery_8756503640280628683(ctx); case 19: return QueriesGenerated.sourceNodeQuery_7180022869589056777(ctx); case 20: return QueriesGenerated.sourceNodeQuery_7180022869589078151(ctx); case 21: return QueriesGenerated.sourceNodeQuery_554709999453585561(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, SourceNodesQuery> snsqMethods = new HashMap<String, SourceNodesQuery>(); { int i = 0; snsqMethods.put("8324812022359514372", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("6676818848694486262", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("6676818848693807797", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("2955426575105724546", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("4860312625245371214", new QueriesGenerated.SNsQ(i++)); } @NotNull @Override public SourceNodesQuery getSourceNodesQuery(@NotNull QueryKey identity) { final String id = ((QueryKeyImpl) identity).getQueryNodeId().toString(); if (!(snsqMethods.containsKey(id))) { return super.getSourceNodesQuery(identity); } return snsqMethods.get(id); } private static class SNsQ implements SourceNodesQuery { private final int methodKey; public SNsQ(int methodKey) { this.methodKey = methodKey; } @NotNull public Collection<SNode> evaluate(@NotNull SourceSubstituteMacroNodesContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_8324812022359514372(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_6676818848694486262(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_6676818848693807797(ctx)); case 3: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_2955426575105724546(ctx)); case 4: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_4860312625245371214(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("1206456427296", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "ConceptName_DataFlow")); pvqMethods.put("1815980786158776238", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159175720", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159157449", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159121501", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159130423", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159145523", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159187546", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159191585", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1815980786159196459", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1207063014985", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "labelName")); pvqMethods.put("1207063142467", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "labelName")); pvqMethods.put("6676818848694468474", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("8324812022359558847", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); } @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_1206456427297(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786158776239(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159175721(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159157450(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159121502(ctx); case 5: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159130424(ctx); case 6: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159145524(ctx); case 7: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159187547(ctx); case 8: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159191586(ctx); case 9: return QueriesGenerated.propertyMacro_GetPropertyValue_1815980786159196460(ctx); case 10: return QueriesGenerated.propertyMacro_GetPropertyValue_1207063014986(ctx); case 11: return QueriesGenerated.propertyMacro_GetPropertyValue_1207063142468(ctx); case 12: return QueriesGenerated.propertyMacro_GetPropertyValue_6676818848694468475(ctx); case 13: return QueriesGenerated.propertyMacro_GetPropertyValue_8324812022359558848(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("735072980478764553", new QueriesGenerated.IfMC(i++)); imcMethods.put("2979128091426922175", new QueriesGenerated.IfMC(i++)); imcMethods.put("2979128091426921166", new QueriesGenerated.IfMC(i++)); imcMethods.put("6676818848694486244", new QueriesGenerated.IfMC(i++)); imcMethods.put("4860312625245355790", new QueriesGenerated.IfMC(i++)); imcMethods.put("4860312625245474201", new QueriesGenerated.IfMC(i++)); imcMethods.put("8164880117399493595", 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_735072980478764555(ctx); case 1: return QueriesGenerated.ifMacro_Condition_2979128091426922176(ctx); case 2: return QueriesGenerated.ifMacro_Condition_2979128091426921167(ctx); case 3: return QueriesGenerated.ifMacro_Condition_6676818848694486245(ctx); case 4: return QueriesGenerated.ifMacro_Condition_4860312625245355792(ctx); case 5: return QueriesGenerated.ifMacro_Condition_4860312625245474202(ctx); case 6: return QueriesGenerated.ifMacro_Condition_8164880117399493597(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, ReferenceTargetQuery> rtqMethods = new HashMap<String, ReferenceTargetQuery>(); { rtqMethods.put("6673335989323240695", new QueriesGenerated.RTQ(0, "ConceptRule")); rtqMethods.put("6673335989323248698", new QueriesGenerated.RTQ(1, "ConceptRule")); rtqMethods.put("4860312625245627456", new QueriesGenerated.RTQ(2, "ConceptName_DataFlow")); rtqMethods.put("4860312625245632382", new QueriesGenerated.RTQ(3, "ConceptName_DataFlow")); rtqMethods.put("4860312625245430329", new QueriesGenerated.RTQ(4, "BaseConcept")); rtqMethods.put("8100708479158807975", new QueriesGenerated.RTQ(5, "DataFlowAspectDescriptorImpl")); } @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_6673335989323240696(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_6673335989323248699(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_4860312625245627457(ctx); case 3: return QueriesGenerated.referenceMacro_GetReferent_4860312625245632383(ctx); case 4: return QueriesGenerated.referenceMacro_GetReferent_4860312625245430330(ctx); case 5: return QueriesGenerated.referenceMacro_GetReferent_8100708479158807976(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, VariableValueQuery> vvqMethods = new HashMap<String, VariableValueQuery>(); { vvqMethods.put("6676818848694489083", new QueriesGenerated.VVQ(0)); vvqMethods.put("4860312625245470052", new QueriesGenerated.VVQ(1)); } @NotNull @Override public VariableValueQuery getVariableValueQuery(@NotNull QueryKey queryKey) { final String id = queryKey.getTemplateNode().getNodeId().toString(); if (!(vvqMethods.containsKey(id))) { return super.getVariableValueQuery(queryKey); } return vvqMethods.get(id); } private static class VVQ implements VariableValueQuery { private final int methodKey; /*package*/ VVQ(int methodKey) { this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull TemplateVarContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.insertMacro_varValue_6676818848694489085(ctx); case 1: return QueriesGenerated.insertMacro_varValue_4860312625245470054(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } }