package jetbrains.mps.lang.plugin.generator.baseLanguage.template.commands;
/*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.SLinkOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations;
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;
@Generated
public class QueriesGenerated extends QueryProviderBase {
public QueriesGenerated() {
super(1);
}
public static boolean baseMappingRule_Condition_1423104411234610091(final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo")) != null);
}
public static boolean baseMappingRule_Condition_1423104411234573858(final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo")) != null);
}
public static boolean baseMappingRule_Condition_1423104411234586843(final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo")) != null);
}
public static boolean baseMappingRule_Condition_1423104411234595397(final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo")) != null);
}
public static boolean baseMappingRule_Condition_1423104411234624245(final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo")) != null);
}
public static SNode sourceNodeQuery_1423104411234616366(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_1423104411234616376(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1423104411234585072(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_1423104411234583776(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1423104411234592825(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_1423104411234592835(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1423104411234601358(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_1423104411234601368(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1423104411234630710(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_1423104411234630720(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1225441503888(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1225441503908(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_8319207097755373177(final SourceSubstituteMacroNodeContext _context) {
return ((SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20eL, 0x7c8b08a50a3ea20fL, "project")) != null) ? SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20eL, 0x7c8b08a50a3ea20fL, "project")) : SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf940cd6167L, "jetbrains.mps.baseLanguage.structure.NullLiteral")));
}
public static SNode sourceNodeQuery_1225441503928(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1225441503948(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_1225441503968(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
public static SNode sourceNodeQuery_3353862535916068541(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x13bfe1ec0ded851eL, "repo"));
}
public static SNode sourceNodeQuery_3353862535916067219(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x63650c5916c8498aL, 0x99c8005c7ee9515dL, 0x7c8b08a50a3ea20aL, 0x7c8b08a50a3ea20bL, "commandClosureLiteral"));
}
private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>();
{
int i = 0;
rrcMethods.put("1423104411234609062", new QueriesGenerated.RRC(i++));
rrcMethods.put("1225441503868", new QueriesGenerated.RRC(i++));
rrcMethods.put("1423104411234586229", new QueriesGenerated.RRC(i++));
rrcMethods.put("1423104411234594569", new QueriesGenerated.RRC(i++));
rrcMethods.put("1423104411234623000", 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_1423104411234610091(ctx);
case 1:
return QueriesGenerated.baseMappingRule_Condition_1423104411234573858(ctx);
case 2:
return QueriesGenerated.baseMappingRule_Condition_1423104411234586843(ctx);
case 3:
return QueriesGenerated.baseMappingRule_Condition_1423104411234595397(ctx);
case 4:
return QueriesGenerated.baseMappingRule_Condition_1423104411234624245(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("1423104411234616366", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234616376", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234585072", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234583776", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234592825", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234592835", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234601358", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234601368", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234630710", new QueriesGenerated.SNQ(i++));
snqMethods.put("1423104411234630720", new QueriesGenerated.SNQ(i++));
snqMethods.put("1225441503888", new QueriesGenerated.SNQ(i++));
snqMethods.put("1225441503908", new QueriesGenerated.SNQ(i++));
snqMethods.put("8319207097755373177", new QueriesGenerated.SNQ(i++));
snqMethods.put("1225441503928", new QueriesGenerated.SNQ(i++));
snqMethods.put("1225441503948", new QueriesGenerated.SNQ(i++));
snqMethods.put("1225441503968", new QueriesGenerated.SNQ(i++));
snqMethods.put("3353862535916068541", new QueriesGenerated.SNQ(i++));
snqMethods.put("3353862535916067219", 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_1423104411234616366(ctx);
case 1:
return QueriesGenerated.sourceNodeQuery_1423104411234616376(ctx);
case 2:
return QueriesGenerated.sourceNodeQuery_1423104411234585072(ctx);
case 3:
return QueriesGenerated.sourceNodeQuery_1423104411234583776(ctx);
case 4:
return QueriesGenerated.sourceNodeQuery_1423104411234592825(ctx);
case 5:
return QueriesGenerated.sourceNodeQuery_1423104411234592835(ctx);
case 6:
return QueriesGenerated.sourceNodeQuery_1423104411234601358(ctx);
case 7:
return QueriesGenerated.sourceNodeQuery_1423104411234601368(ctx);
case 8:
return QueriesGenerated.sourceNodeQuery_1423104411234630710(ctx);
case 9:
return QueriesGenerated.sourceNodeQuery_1423104411234630720(ctx);
case 10:
return QueriesGenerated.sourceNodeQuery_1225441503888(ctx);
case 11:
return QueriesGenerated.sourceNodeQuery_1225441503908(ctx);
case 12:
return QueriesGenerated.sourceNodeQuery_8319207097755373177(ctx);
case 13:
return QueriesGenerated.sourceNodeQuery_1225441503928(ctx);
case 14:
return QueriesGenerated.sourceNodeQuery_1225441503948(ctx);
case 15:
return QueriesGenerated.sourceNodeQuery_1225441503968(ctx);
case 16:
return QueriesGenerated.sourceNodeQuery_3353862535916068541(ctx);
case 17:
return QueriesGenerated.sourceNodeQuery_3353862535916067219(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
}