package jetbrains.mps.debugger.java.evaluation.generator.template.generator.template.main;
/*Generated by MPS */
import jetbrains.mps.generator.runtime.Generated;
import jetbrains.mps.generator.impl.query.QueryProviderBase;
import jetbrains.mps.generator.template.PropertyMacroContext;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import java.util.Map;
import jetbrains.mps.generator.impl.query.SourceNodeQuery;
import java.util.HashMap;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.generator.impl.query.QueryKey;
import jetbrains.mps.generator.impl.query.QueryKeyImpl;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.generator.impl.GenerationFailureException;
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;
@Generated
public class QueriesGenerated extends QueryProviderBase {
public QueriesGenerated() {
super(1);
}
public static Object propertyMacro_GetPropertyValue_138767106958845441(final PropertyMacroContext _context) {
return ("EvaluatorInstance");
}
public static Object propertyMacro_GetPropertyValue_138767106958624542(final PropertyMacroContext _context) {
return ("EvaluatorInstance");
}
public static SNode sourceNodeQuery_6293005617706016074(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7da4580f9d754603L, 0x816251a896d78375L, 0x53c5060c6b18d925L, 0x10093bb8b0669700L, "evaluatedStatements"));
}
public static SNode sourceNodeQuery_3409752288362167508(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7da4580f9d754603L, 0x816251a896d78375L, 0xbbe5b47d7cc5fa1L, 0xbbe5b47d7cc6080L, "code"));
}
public static Iterable<SNode> sourceNodesQuery_1496492112286760828(final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x7da4580f9d754603L, 0x816251a896d78375L, 0x53c5060c6b18d925L, 0x53c5060c6b19c797L, "variables"));
}
private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>();
{
int i = 0;
snqMethods.put("6293005617706016074", new QueriesGenerated.SNQ(i++));
snqMethods.put("3409752288362167508", 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_6293005617706016074(ctx);
case 1:
return QueriesGenerated.sourceNodeQuery_3409752288362167508(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("1496492112286760828", 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_1496492112286760828(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("138767106958845440", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "map_EvaluatorConcept"));
pvqMethods.put("138767106958624541", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "map_Evaluator"));
}
@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_138767106958845441(ctx);
case 1:
return QueriesGenerated.propertyMacro_GetPropertyValue_138767106958624542(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
}