package jetbrains.mps.core.xml.sax.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 jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.util.NameUtil;
import jetbrains.mps.core.xml.sax.behavior.XMLSAXChildRule__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.generator.template.ReferenceMacroContext;
import jetbrains.mps.generator.template.IfMacroContext;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.project.SModuleOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import jetbrains.mps.internal.collections.runtime.Sequence;
import jetbrains.mps.generator.template.TemplateVarContext;
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 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 jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
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;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SConcept;

@Generated
public class QueriesGenerated extends QueryProviderBase {
  public QueriesGenerated() {
    super(1);
  }
  public static Object propertyMacro_GetValue_0_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "Handler";
  }
  public static Object propertyMacro_GetValue_0_1(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replace('-', '_') + "Handler";
  }
  public static Object propertyMacro_GetValue_0_2(final PropertyMacroContext _context) {
    return "my_" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "Param";
  }
  public static Object propertyMacro_GetValue_0_3(final PropertyMacroContext _context) {
    return "my_" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "Field";
  }
  public static Object propertyMacro_GetValue_0_4(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_0_5(final PropertyMacroContext _context) {
    return NameUtil.capitalize(SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL)) + "ElementHandler";
  }
  public static Object propertyMacro_GetValue_0_6(final PropertyMacroContext _context) {
    return "param" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_0_7(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_0_8(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_0_9(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_0_10(final PropertyMacroContext _context) {
    return (String) XMLSAXChildRule__BehaviorDescriptor.getTagName_id1XGsQcRHuf0.invoke(_context.getNode());
  }
  public static Object propertyMacro_GetValue_0_11(final PropertyMacroContext _context) {
    return (String) XMLSAXChildRule__BehaviorDescriptor.getTagName_id1XGsQcRHuf0.invoke(_context.getNode());
  }
  public static Object propertyMacro_GetValue_0_12(final PropertyMacroContext _context) {
    return "check" + ((isNotEmptyString(SPropertyOperations.getString(_context.getNode(), PROPS.tagName$zGNu)) ? SPropertyOperations.getString(_context.getNode(), PROPS.tagName$zGNu) : SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP), PROPS.name$MnvL))) + "_" + _context.getOriginalCopiedInputNode(SLinkOperations.getTarget(_context.getNode(), LINKS.condition$NUPO)).getNodeId();
  }
  public static Object propertyMacro_GetValue_0_13(final PropertyMacroContext _context) {
    return "handleChild_" + _context.getOriginalCopiedInputNode(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$zG$t)).getNodeId();
  }
  public static Object propertyMacro_GetValue_1_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), LINKS.attribute$zzQt), PROPS.name$MnvL);
  }
  public static Object referenceMacro_GetReferent_0_0(final ReferenceMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object referenceMacro_GetReferent_1_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.param$vMro), "xmlSaxNodeParam");
  }
  public static Object referenceMacro_GetReferent_1_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.declaration$zN_X), "fieldDecl");
  }
  public static Object referenceMacro_GetReferent_1_2(final ReferenceMacroContext _context) {
    return "myLocator";
  }
  public static boolean ifMacro_Condition_0_0(final IfMacroContext _context) {
    SModel model = _context.getOriginalInputModel();
    if (model == null) {
      return false;
    }
    return SModuleOperations.classesAvailableToMPS(model.getModule());
  }
  public static boolean ifMacro_Condition_0_1(final IfMacroContext _context) {
    return false;
  }
  public static boolean ifMacro_Condition_0_2(final IfMacroContext _context) {
    return ListSequence.fromList(SNodeOperations.getNodeDescendants(_context.getNode(), CONCEPTS.XMLSAXNodeRule$VS, false, new SAbstractConcept[]{})).any((it) -> (SLinkOperations.getTarget(it, LINKS.defaultChild$biG5) != null));
  }
  public static boolean ifMacro_Condition_0_3(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.globalText$AInQ) != null);
  }
  public static boolean ifMacro_Condition_0_4(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.globalText$AInQ) != null);
  }
  public static boolean ifMacro_Condition_0_5(final IfMacroContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.attrs$Aw1u)).any((it) -> SPropertyOperations.getBoolean(it, PROPS.isRequired$z$lt));
  }
  public static boolean ifMacro_Condition_0_6(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.creator$AwIx) != null) && (SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.creator$AwIx), LINKS.body$e68K) != null) && ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.creator$AwIx), LINKS.body$e68K), LINKS.statement$53DE)).isNotEmpty();
  }
  public static boolean ifMacro_Condition_0_7(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt) != null);
  }
  public static boolean ifMacro_Condition_0_8(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.handler$z$$u) != null) && (SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$z$$u), LINKS.body$e68K) != null) && ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$z$$u), LINKS.body$e68K), LINKS.statement$53DE)).isNotEmpty();
  }
  public static boolean ifMacro_Condition_0_9(final IfMacroContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.attrs$Aw1u)).any((it) -> (SLinkOperations.getTarget(it, LINKS.handler$z$$u) != null) && (SLinkOperations.getTarget(SLinkOperations.getTarget(it, LINKS.handler$z$$u), LINKS.body$e68K) != null) && ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(it, LINKS.handler$z$$u), LINKS.body$e68K), LINKS.statement$53DE)).isNotEmpty());
  }
  public static boolean ifMacro_Condition_0_10(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.condition$NUPO) != null);
  }
  public static boolean ifMacro_Condition_0_11(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.handler$zG$t) != null);
  }
  public static boolean ifMacro_Condition_0_12(final IfMacroContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP), LINKS.params$VQ7O)).isEmpty();
  }
  public static boolean ifMacro_Condition_0_13(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.defaultChild$biG5), LINKS.handler$rZ8u) != null);
  }
  public static boolean ifMacro_Condition_0_14(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.defaultChild$biG5) != null);
  }
  public static boolean ifMacro_Condition_0_15(final IfMacroContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.children$Awgv)).isNotEmpty() || (SLinkOperations.getTarget(_context.getNode(), LINKS.defaultChild$biG5) != null);
  }
  public static boolean ifMacro_Condition_0_16(final IfMacroContext _context) {
    return ListSequence.fromList(SNodeOperations.getNodeDescendants(_context.getNode(), CONCEPTS.XMLSAXHandler_resultObject$Mw, false, new SAbstractConcept[]{})).isNotEmpty() && (SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt) != null);
  }
  public static boolean ifMacro_Condition_0_17(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt) != null) && ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$zG$t), CONCEPTS.XMLSAXHandler_resultObject$Mw, false, new SAbstractConcept[]{})).isNotEmpty();
  }
  public static boolean ifMacro_Condition_0_18(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.text$Awvw) != null);
  }
  public static boolean ifMacro_Condition_0_19(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt) != null);
  }
  public static boolean ifMacro_Condition_0_20(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.validator$AwXy) != null);
  }
  public static boolean ifMacro_Condition_0_21(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.validator$AwXy) != null) && (SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.validator$AwXy), LINKS.body$e68K) != null) && ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.validator$AwXy), LINKS.body$e68K), LINKS.statement$53DE)).isNotEmpty();
  }
  public static boolean ifMacro_Condition_0_22(final IfMacroContext _context) {
    return ListSequence.fromList(SNodeOperations.getNodeDescendants(_context.getNode(), CONCEPTS.XMLSAXNodeRule$VS, false, new SAbstractConcept[]{})).any((it) -> (SLinkOperations.getTarget(it, LINKS.defaultChild$biG5) != null));
  }
  public static boolean ifMacro_Condition_1_0(final IfMacroContext _context) {
    return (SLinkOperations.getTarget(_context.getNode(), LINKS.result$z_yu) != null);
  }
  public static boolean ifMacro_Condition_1_1(final IfMacroContext _context) {
    SModel model = _context.getOriginalInputModel();
    if (model == null) {
      return false;
    }
    return SModuleOperations.classesAvailableToMPS(model.getModule());
  }
  public static SNode sourceNodeQuery_0_0(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_1(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_2(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$zMRt);
  }
  public static SNode sourceNodeQuery_0_3(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$zMRt);
  }
  public static SNode sourceNodeQuery_0_4(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$zMRt);
  }
  public static SNode sourceNodeQuery_0_5(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_6(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_7(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_8(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_9(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_10(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(_context.getNode(), LINKS.type$a1UY));
  }
  public static SNode sourceNodeQuery_0_11(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(_context.getNode(), LINKS.type$a1UY));
  }
  public static SNode sourceNodeQuery_0_12(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_13(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_14(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_15(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP);
  }
  public static SNode sourceNodeQuery_0_16(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP);
  }
  public static SNode sourceNodeQuery_0_17(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_18(final SourceSubstituteMacroNodeContext _context) {

    return SNodeOperations.copyNode(SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_19(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_20(final SourceSubstituteMacroNodeContext _context) {
    return SNodeOperations.copyNode(SLinkOperations.getTarget(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), CONCEPTS.XMLSAXNodeRule$VS), LINKS.type$AvMt));
  }
  public static SNode sourceNodeQuery_0_21(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_22(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.rule$zMcP), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_23(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_24(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_25(final SourceSubstituteMacroNodeContext _context) {
    return ((SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.text$Awvw), LINKS.handler$AQjX) != null) ? SLinkOperations.getTarget(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.text$Awvw), LINKS.handler$AQjX), LINKS.body$e68K) : null);
  }
  public static SNode sourceNodeQuery_0_26(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_0_27(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.type$AvMt);
  }
  public static SNode sourceNodeQuery_1_0(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.result$z_yu);
  }
  public static Iterable<SNode> sourceNodesQuery_0_0(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.nodes$AHTO)).where((it) -> ListSequence.fromList(SLinkOperations.getChildren(it, LINKS.params$VQ7O)).isEmpty());
  }
  public static Iterable<SNode> sourceNodesQuery_0_1(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.parameters$ACwt);
  }
  public static Iterable<SNode> sourceNodesQuery_0_2(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.fields$AI8P);
  }
  public static Iterable<SNode> sourceNodesQuery_0_3(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.parameters$ACwt);
  }
  public static Iterable<SNode> sourceNodesQuery_0_4(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.parameters$ACwt);
  }
  public static Iterable<SNode> sourceNodesQuery_0_5(final SourceSubstituteMacroNodesContext _context) {
    return Sequence.fromArray(new SNode[]{SLinkOperations.getTarget(_context.getNode(), LINKS.root$ACJu)});

  }
  public static Iterable<SNode> sourceNodesQuery_0_6(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.globalText$AInQ), LINKS.handler$AQjX), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_7(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.nodes$AHTO);
  }
  public static Iterable<SNode> sourceNodesQuery_0_8(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.params$VQ7O);
  }
  public static Iterable<SNode> sourceNodesQuery_0_9(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.params$VQ7O);
  }
  public static Iterable<SNode> sourceNodesQuery_0_10(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.attrs$Aw1u)).where((it) -> SPropertyOperations.getBoolean(it, PROPS.isRequired$z$lt));
  }
  public static Iterable<SNode> sourceNodesQuery_0_11(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.params$VQ7O);
  }
  public static Iterable<SNode> sourceNodesQuery_0_12(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.creator$AwIx), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_13(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$z$$u), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_14(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.attrs$Aw1u)).where((it) -> (SLinkOperations.getTarget(it, LINKS.handler$z$$u) != null) && (SLinkOperations.getTarget(SLinkOperations.getTarget(it, LINKS.handler$z$$u), LINKS.body$e68K) != null) && ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(it, LINKS.handler$z$$u), LINKS.body$e68K), LINKS.statement$53DE)).isNotEmpty());
  }
  public static Iterable<SNode> sourceNodesQuery_0_15(final SourceSubstituteMacroNodesContext _context) {
    return ((Iterable<SNode>) _context.getVariable("var:args"));
  }
  public static Iterable<SNode> sourceNodesQuery_0_16(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.children$Awgv);
  }
  public static Iterable<SNode> sourceNodesQuery_0_17(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.defaultChild$biG5), LINKS.handler$rZ8u), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_18(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.children$Awgv)).where((it) -> (SLinkOperations.getTarget(it, LINKS.condition$NUPO) != null));
  }
  public static Iterable<SNode> sourceNodesQuery_0_19(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.condition$NUPO), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_20(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.children$Awgv)).where((it) -> (SLinkOperations.getTarget(it, LINKS.handler$zG$t) != null));
  }
  public static Iterable<SNode> sourceNodesQuery_0_21(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.handler$zG$t), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Iterable<SNode> sourceNodesQuery_0_22(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.validator$AwXy), LINKS.body$e68K), LINKS.statement$53DE);
  }
  public static Object varMacro_Value_0_0(final TemplateVarContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.actualArgument$mGKO);
  }
  private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>();
  {
    int i = 0;
    snqMethods.put("2264311582634171618", new SNQ(i++));
    snqMethods.put("2264311582634171490", new SNQ(i++));
    snqMethods.put("2264311582634171502", new SNQ(i++));
    snqMethods.put("2264311582634171528", new SNQ(i++));
    snqMethods.put("2264311582634171585", new SNQ(i++));
    snqMethods.put("2264311582634172333", new SNQ(i++));
    snqMethods.put("2264311582634172456", new SNQ(i++));
    snqMethods.put("2264311582634172587", new SNQ(i++));
    snqMethods.put("2264311582634172655", new SNQ(i++));
    snqMethods.put("2264311582634172666", new SNQ(i++));
    snqMethods.put("980633948639147834", new SNQ(i++));
    snqMethods.put("980633948636769441", new SNQ(i++));
    snqMethods.put("2264311582634171758", new SNQ(i++));
    snqMethods.put("2264311582634171850", new SNQ(i++));
    snqMethods.put("2264311582634171859", new SNQ(i++));
    snqMethods.put("4720003541468792438", new SNQ(i++));
    snqMethods.put("2264311582634171953", new SNQ(i++));
    snqMethods.put("4720003541490414767", new SNQ(i++));
    snqMethods.put("4720003541490414776", new SNQ(i++));
    snqMethods.put("2264311582634172005", new SNQ(i++));
    snqMethods.put("2264311582634172014", new SNQ(i++));
    snqMethods.put("2264311582634172027", new SNQ(i++));
    snqMethods.put("2264311582634172038", new SNQ(i++));
    snqMethods.put("2264311582634172170", new SNQ(i++));
    snqMethods.put("2264311582634172179", new SNQ(i++));
    snqMethods.put("2264311582634172188", new SNQ(i++));
    snqMethods.put("2264311582634172227", new SNQ(i++));
    snqMethods.put("2264311582634172250", new SNQ(i++));
    snqMethods.put("2264311582634172794", new SNQ(i++));
  }
  @NotNull
  @Override
  public SourceNodeQuery getSourceNodeQuery(@NotNull QueryKey identity) {
    SourceNodeQuery query = identity.forFunctionNode(snqMethods);
    return (query != null ? query : super.getSourceNodeQuery(identity));
  }
  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_0_0(ctx);
        case 1:
          return QueriesGenerated.sourceNodeQuery_0_1(ctx);
        case 2:
          return QueriesGenerated.sourceNodeQuery_0_2(ctx);
        case 3:
          return QueriesGenerated.sourceNodeQuery_0_3(ctx);
        case 4:
          return QueriesGenerated.sourceNodeQuery_0_4(ctx);
        case 5:
          return QueriesGenerated.sourceNodeQuery_0_5(ctx);
        case 6:
          return QueriesGenerated.sourceNodeQuery_0_6(ctx);
        case 7:
          return QueriesGenerated.sourceNodeQuery_0_7(ctx);
        case 8:
          return QueriesGenerated.sourceNodeQuery_0_8(ctx);
        case 9:
          return QueriesGenerated.sourceNodeQuery_0_9(ctx);
        case 10:
          return QueriesGenerated.sourceNodeQuery_0_10(ctx);
        case 11:
          return QueriesGenerated.sourceNodeQuery_0_11(ctx);
        case 12:
          return QueriesGenerated.sourceNodeQuery_0_12(ctx);
        case 13:
          return QueriesGenerated.sourceNodeQuery_0_13(ctx);
        case 14:
          return QueriesGenerated.sourceNodeQuery_0_14(ctx);
        case 15:
          return QueriesGenerated.sourceNodeQuery_0_15(ctx);
        case 16:
          return QueriesGenerated.sourceNodeQuery_0_16(ctx);
        case 17:
          return QueriesGenerated.sourceNodeQuery_0_17(ctx);
        case 18:
          return QueriesGenerated.sourceNodeQuery_0_18(ctx);
        case 19:
          return QueriesGenerated.sourceNodeQuery_0_19(ctx);
        case 20:
          return QueriesGenerated.sourceNodeQuery_0_20(ctx);
        case 21:
          return QueriesGenerated.sourceNodeQuery_0_21(ctx);
        case 22:
          return QueriesGenerated.sourceNodeQuery_0_22(ctx);
        case 23:
          return QueriesGenerated.sourceNodeQuery_0_23(ctx);
        case 24:
          return QueriesGenerated.sourceNodeQuery_0_24(ctx);
        case 25:
          return QueriesGenerated.sourceNodeQuery_0_25(ctx);
        case 26:
          return QueriesGenerated.sourceNodeQuery_0_26(ctx);
        case 27:
          return QueriesGenerated.sourceNodeQuery_0_27(ctx);
        case 28:
          return QueriesGenerated.sourceNodeQuery_1_0(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("2264311582634171452", new SNsQ(i++));
    snsqMethods.put("2264311582634171509", new SNsQ(i++));
    snsqMethods.put("2264311582634171535", new SNsQ(i++));
    snsqMethods.put("2264311582634171576", new SNsQ(i++));
    snsqMethods.put("2264311582634171592", new SNsQ(i++));
    snsqMethods.put("2264311582634172520", new SNsQ(i++));
    snsqMethods.put("2264311582634172677", new SNsQ(i++));
    snsqMethods.put("2264311582634171738", new SNsQ(i++));
    snsqMethods.put("980633948638533676", new SNsQ(i++));
    snsqMethods.put("980633948640576286", new SNsQ(i++));
    snsqMethods.put("8660501075658399423", new SNsQ(i++));
    snsqMethods.put("980633948636480844", new SNsQ(i++));
    snsqMethods.put("980633948646559042", new SNsQ(i++));
    snsqMethods.put("2264311582634171897", new SNsQ(i++));
    snsqMethods.put("2264311582634171920", new SNsQ(i++));
    snsqMethods.put("4720003541465466965", new SNsQ(i++));
    snsqMethods.put("2264311582634171971", new SNsQ(i++));
    snsqMethods.put("7357835043236542262", new SNsQ(i++));
    snsqMethods.put("4720003541484077956", new SNsQ(i++));
    snsqMethods.put("4720003541474553163", new SNsQ(i++));
    snsqMethods.put("1910945748574897893", new SNsQ(i++));
    snsqMethods.put("2264311582634172103", new SNsQ(i++));
    snsqMethods.put("2264311582634172260", new SNsQ(i++));
  }
  @NotNull
  @Override
  public SourceNodesQuery getSourceNodesQuery(@NotNull QueryKey identity) {
    SourceNodesQuery query = identity.forFunctionNode(snsqMethods);
    return (query != null ? query : super.getSourceNodesQuery(identity));
  }
  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_0_0(ctx));
        case 1:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_1(ctx));
        case 2:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_2(ctx));
        case 3:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_3(ctx));
        case 4:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_4(ctx));
        case 5:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_5(ctx));
        case 6:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_6(ctx));
        case 7:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_7(ctx));
        case 8:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_8(ctx));
        case 9:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_9(ctx));
        case 10:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_10(ctx));
        case 11:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_11(ctx));
        case 12:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_12(ctx));
        case 13:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_13(ctx));
        case 14:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_14(ctx));
        case 15:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_15(ctx));
        case 16:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_16(ctx));
        case 17:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_17(ctx));
        case 18:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_18(ctx));
        case 19:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_19(ctx));
        case 20:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_20(ctx));
        case 21:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_21(ctx));
        case 22:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_0_22(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("2264311582634171606", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "Parser"));
    pvqMethods.put("2264311582634171458", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "handler"));
    pvqMethods.put("2264311582634171515", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "myField1"));
    pvqMethods.put("2264311582634171541", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "myField2"));
    pvqMethods.put("2264311582634171598", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "param"));
    pvqMethods.put("2264311582634171744", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "RuleElementHandler"));
    pvqMethods.put("980633948639434994", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "param"));
    pvqMethods.put("8660501075658399439", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("980633948637143462", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "param"));
    pvqMethods.put("2264311582634171910", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("4720003541480476185", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2264311582634171961", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("4720003541484956175", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "checkCondition"));
    pvqMethods.put("1910945748578763715", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "handleChild"));
    pvqMethods.put("2264311582634172717", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
  }
  @NotNull
  @Override
  public PropertyValueQuery getPropertyValueQuery(@NotNull QueryKey identity) {
    PropertyValueQuery query = identity.forTemplateNode(pvqMethods);
    return (query != null ? query : super.getPropertyValueQuery(identity));
  }
  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_GetValue_0_0(ctx);
        case 1:
          return QueriesGenerated.propertyMacro_GetValue_0_1(ctx);
        case 2:
          return QueriesGenerated.propertyMacro_GetValue_0_2(ctx);
        case 3:
          return QueriesGenerated.propertyMacro_GetValue_0_3(ctx);
        case 4:
          return QueriesGenerated.propertyMacro_GetValue_0_4(ctx);
        case 5:
          return QueriesGenerated.propertyMacro_GetValue_0_5(ctx);
        case 6:
          return QueriesGenerated.propertyMacro_GetValue_0_6(ctx);
        case 7:
          return QueriesGenerated.propertyMacro_GetValue_0_7(ctx);
        case 8:
          return QueriesGenerated.propertyMacro_GetValue_0_8(ctx);
        case 9:
          return QueriesGenerated.propertyMacro_GetValue_0_9(ctx);
        case 10:
          return QueriesGenerated.propertyMacro_GetValue_0_10(ctx);
        case 11:
          return QueriesGenerated.propertyMacro_GetValue_0_11(ctx);
        case 12:
          return QueriesGenerated.propertyMacro_GetValue_0_12(ctx);
        case 13:
          return QueriesGenerated.propertyMacro_GetValue_0_13(ctx);
        case 14:
          return QueriesGenerated.propertyMacro_GetValue_1_0(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("7113564998979659511", new IfMC(i++));
    imcMethods.put("980633948647704678", new IfMC(i++));
    imcMethods.put("4685929028540551511", new IfMC(i++));
    imcMethods.put("2264311582634172378", new IfMC(i++));
    imcMethods.put("2264311582634172689", new IfMC(i++));
    imcMethods.put("8660501075658985455", new IfMC(i++));
    imcMethods.put("2264311582634171766", new IfMC(i++));
    imcMethods.put("1910945748555012443", new IfMC(i++));
    imcMethods.put("2264311582634171869", new IfMC(i++));
    imcMethods.put("2264311582634171932", new IfMC(i++));
    imcMethods.put("4720003541479560431", new IfMC(i++));
    imcMethods.put("1910945748580310589", new IfMC(i++));
    imcMethods.put("4720003541464879057", new IfMC(i++));
    imcMethods.put("7357835043236426328", new IfMC(i++));
    imcMethods.put("6607027903926101424", new IfMC(i++));
    imcMethods.put("2264311582634171981", new IfMC(i++));
    imcMethods.put("4720003541493794872", new IfMC(i++));
    imcMethods.put("1910945748555598832", new IfMC(i++));
    imcMethods.put("2264311582634172156", new IfMC(i++));
    imcMethods.put("1910945748556190052", new IfMC(i++));
    imcMethods.put("2264311582634172234", new IfMC(i++));
    imcMethods.put("2264311582634172270", new IfMC(i++));
    imcMethods.put("4685929028540831222", new IfMC(i++));
    imcMethods.put("2264311582634172802", new IfMC(i++));
    imcMethods.put("7113564998979618878", new IfMC(i++));
  }
  @NotNull
  @Override
  public IfMacroCondition getIfMacroCondition(@NotNull QueryKey identity) {
    IfMacroCondition query = identity.forTemplateNode(imcMethods);
    return (query != null ? query : super.getIfMacroCondition(identity));
  }
  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_0_0(ctx);
        case 1:
          return QueriesGenerated.ifMacro_Condition_0_1(ctx);
        case 2:
          return QueriesGenerated.ifMacro_Condition_0_2(ctx);
        case 3:
          return QueriesGenerated.ifMacro_Condition_0_3(ctx);
        case 4:
          return QueriesGenerated.ifMacro_Condition_0_4(ctx);
        case 5:
          return QueriesGenerated.ifMacro_Condition_0_5(ctx);
        case 6:
          return QueriesGenerated.ifMacro_Condition_0_6(ctx);
        case 7:
          return QueriesGenerated.ifMacro_Condition_0_7(ctx);
        case 8:
          return QueriesGenerated.ifMacro_Condition_0_8(ctx);
        case 9:
          return QueriesGenerated.ifMacro_Condition_0_9(ctx);
        case 10:
          return QueriesGenerated.ifMacro_Condition_0_10(ctx);
        case 11:
          return QueriesGenerated.ifMacro_Condition_0_11(ctx);
        case 12:
          return QueriesGenerated.ifMacro_Condition_0_12(ctx);
        case 13:
          return QueriesGenerated.ifMacro_Condition_0_13(ctx);
        case 14:
          return QueriesGenerated.ifMacro_Condition_0_14(ctx);
        case 15:
          return QueriesGenerated.ifMacro_Condition_0_15(ctx);
        case 16:
          return QueriesGenerated.ifMacro_Condition_0_16(ctx);
        case 17:
          return QueriesGenerated.ifMacro_Condition_0_17(ctx);
        case 18:
          return QueriesGenerated.ifMacro_Condition_0_18(ctx);
        case 19:
          return QueriesGenerated.ifMacro_Condition_0_19(ctx);
        case 20:
          return QueriesGenerated.ifMacro_Condition_0_20(ctx);
        case 21:
          return QueriesGenerated.ifMacro_Condition_0_21(ctx);
        case 22:
          return QueriesGenerated.ifMacro_Condition_0_22(ctx);
        case 23:
          return QueriesGenerated.ifMacro_Condition_1_0(ctx);
        case 24:
          return QueriesGenerated.ifMacro_Condition_1_1(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("2264311582634171558", new RTQ(0, "param"));
    rtqMethods.put("4720003541458287980", new RTQ(1, "param"));
    rtqMethods.put("8660501075660349068", new RTQ(2, "aa"));
    rtqMethods.put("2264311582634172772", new RTQ(3, "myLocator"));
  }
  @NotNull
  @Override
  public ReferenceTargetQuery getReferenceTargetQuery(@NotNull QueryKey queryKey) {
    ReferenceTargetQuery query = queryKey.forTemplateNode(rtqMethods);
    return (query != null ? query : super.getReferenceTargetQuery(queryKey));
  }
  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_0_0(ctx);
        case 1:
          return QueriesGenerated.referenceMacro_GetReferent_1_0(ctx);
        case 2:
          return QueriesGenerated.referenceMacro_GetReferent_1_1(ctx);
        case 3:
          return QueriesGenerated.referenceMacro_GetReferent_1_2(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("2409421742521910647", new VVQ(0));
  }
  @NotNull
  @Override
  public VariableValueQuery getVariableValueQuery(@NotNull QueryKey queryKey) {
    VariableValueQuery query = queryKey.forTemplateNode(vvqMethods);
    return (query != null ? query : super.getVariableValueQuery(queryKey));
  }
  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.varMacro_Value_0_0(ctx);
        default:
          throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
      }
    }
  }
  private static boolean isNotEmptyString(String str) {
    return str != null && str.length() > 0;
  }

  private static final class PROPS {
    /*package*/ static final SProperty name$MnvL = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name");
    /*package*/ static final SProperty tagName$zGNu = MetaAdapterFactory.getProperty(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2d8L, 0x1f6c736337b5e2daL, "tagName");
    /*package*/ static final SProperty isRequired$z$lt = MetaAdapterFactory.getProperty(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2cbL, 0x1f6c736337b5e2ccL, "isRequired");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink condition$NUPO = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2d8L, 0x4180d2369beda765L, "condition");
    /*package*/ static final SReferenceLink rule$zMcP = MetaAdapterFactory.getReferenceLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2d8L, 0x1f6c736337b5e2dcL, "rule");
    /*package*/ static final SContainmentLink handler$zG$t = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2d8L, 0x1f6c736337b5e2d9L, "handler");
    /*package*/ static final SReferenceLink attribute$zzQt = MetaAdapterFactory.getReferenceLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2c9L, 0x1f6c736337b5e2caL, "attribute");
    /*package*/ static final SReferenceLink param$vMro = MetaAdapterFactory.getReferenceLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x4180d2369b1f16c6L, 0x4180d2369b1f17e0L, "param");
    /*package*/ static final SReferenceLink declaration$zN_X = MetaAdapterFactory.getReferenceLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2e0L, 0x1f6c736337b5e2e1L, "declaration");
    /*package*/ static final SContainmentLink defaultChild$biG5 = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x3afd69375a020705L, "defaultChild");
    /*package*/ static final SContainmentLink globalText$AInQ = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e301L, 0x1f6c736337b5e306L, "globalText");
    /*package*/ static final SContainmentLink attrs$Aw1u = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f4L, "attrs");
    /*package*/ static final SContainmentLink creator$AwIx = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f7L, "creator");
    /*package*/ static final SContainmentLink body$e68K = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body");
    /*package*/ static final SContainmentLink statement$53DE = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement");
    /*package*/ static final SContainmentLink type$AvMt = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f3L, "type");
    /*package*/ static final SContainmentLink handler$z$$u = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2cbL, 0x1f6c736337b5e2cdL, "handler");
    /*package*/ static final SContainmentLink params$VQ7O = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0xd9be961730be2e2L, "params");
    /*package*/ static final SContainmentLink handler$rZ8u = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x3afd693759ffa97fL, 0x3afd693759ffa981L, "handler");
    /*package*/ static final SContainmentLink children$Awgv = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f5L, "children");
    /*package*/ static final SContainmentLink text$Awvw = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f6L, "text");
    /*package*/ static final SContainmentLink validator$AwXy = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, 0x1f6c736337b5e2f8L, "validator");
    /*package*/ static final SContainmentLink result$z_yu = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2cfL, 0x1f6c736337b5e2d1L, "result");
    /*package*/ static final SReferenceLink root$ACJu = MetaAdapterFactory.getReferenceLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e301L, 0x1f6c736337b5e303L, "root");
    /*package*/ static final SContainmentLink type$zMRt = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2ddL, 0x1f6c736337b5e2deL, "type");
    /*package*/ static final SContainmentLink type$a1UY = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x450368d90ce15bc3L, 0x4ed4d318133c80ceL, "type");
    /*package*/ static final SContainmentLink handler$AQjX = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e310L, 0x1f6c736337b5e311L, "handler");
    /*package*/ static final SContainmentLink nodes$AHTO = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e301L, 0x1f6c736337b5e304L, "nodes");
    /*package*/ static final SContainmentLink parameters$ACwt = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e301L, 0x1f6c736337b5e302L, "parameters");
    /*package*/ static final SContainmentLink fields$AI8P = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e301L, 0x1f6c736337b5e305L, "fields");
    /*package*/ static final SContainmentLink actualArgument$mGKO = MetaAdapterFactory.getContainmentLink(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2d8L, 0xf8c78301aeL, "actualArgument");
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept XMLSAXNodeRule$VS = MetaAdapterFactory.getConcept(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2f2L, "jetbrains.mps.core.xml.sax.structure.XMLSAXNodeRule");
    /*package*/ static final SConcept XMLSAXHandler_resultObject$Mw = MetaAdapterFactory.getConcept(0xdcb5a83a19a844ffL, 0xa4cbfc7d324ecc63L, 0x1f6c736337b5e2eaL, "jetbrains.mps.core.xml.sax.structure.XMLSAXHandler_resultObject");
  }
}
