package jetbrains.mps.samples.fincalculator.generator.template.main;

/*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.samples.fincalculator.behavior.Selector__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.typechecking.TypecheckingFacade;
import java.util.Objects;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SEnumOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.generator.template.PropertyMacroContext;
import jetbrains.mps.samples.fincalculator.generator.util.Helper;
import jetbrains.mps.generator.template.ReferenceMacroContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.generator.template.IfMacroContext;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import jetbrains.mps.generator.template.MappingScriptContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations;
import jetbrains.mps.smodel.action.SNodeFactoryOperations;
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.ScriptCodeBlock;
import jetbrains.mps.generator.impl.query.SourceNodeQuery;
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.smodel.builder.SNodeBuilder;
import org.jetbrains.mps.openapi.language.SConcept;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SContainmentLink;

@Generated
public class QueriesGenerated extends QueryProviderBase {
  public QueriesGenerated() {
    super(1);
  }
  public static boolean rule_Condition_0_0(final BaseMappingRuleContext _context) {
    return (boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode());
  }
  public static boolean rule_Condition_0_1(final BaseMappingRuleContext _context) {
    return !((boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode()));
  }
  public static boolean rule_Condition_9_0(final BaseMappingRuleContext _context) {
    return (boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode());
  }
  public static boolean rule_Condition_9_1(final BaseMappingRuleContext _context) {
    return !((boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode()));
  }
  public static boolean rule_Condition_15_0(final BaseMappingRuleContext _context) {
    return SNodeOperations.isInstanceOf(TypecheckingFacade.getFromContext().getTypeOf(_context.getNode()), CONCEPTS.PrimitiveType$sR);
  }
  public static boolean rule_Condition_15_1(final BaseMappingRuleContext _context) {
    return !(SNodeOperations.isInstanceOf(TypecheckingFacade.getFromContext().getTypeOf(_context.getNode()), CONCEPTS.PrimitiveType$sR));
  }
  public static boolean rule_Condition_15_2(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_15_3(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean rule_Condition_15_4(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static boolean rule_Condition_15_5(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_15_6(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical")));
  }
  public static boolean rule_Condition_15_7(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_16_0(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_16_1(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean rule_Condition_16_2(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static boolean rule_Condition_16_3(final BaseMappingRuleContext _context) {
    return (boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode());
  }
  public static boolean rule_Condition_16_4(final BaseMappingRuleContext _context) {
    return !((boolean) Selector__BehaviorDescriptor.isSmall_id49kBZ1LyWM8.invoke(_context.getNode()));
  }
  public static boolean rule_Condition_17_0(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_17_1(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean rule_Condition_17_2(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static boolean rule_Condition_18_0(final BaseMappingRuleContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean rule_Condition_18_1(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean rule_Condition_18_2(final BaseMappingRuleContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static Object propertyMacro_GetValue_1_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_1_1(final PropertyMacroContext _context) {
    return _context.createUniqueName((SNodeOperations.isInstanceOf(_context.getNode(), CONCEPTS.InputField$41) ? "inputField" : "outputField"), SNodeOperations.getContainingRoot(_context.getNode()));
  }
  public static Object propertyMacro_GetValue_1_2(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_1_3(final PropertyMacroContext _context) {
    return _context.createUniqueName("checkbox", SNodeOperations.getContainingRoot(_context.getNode()));
  }
  public static Object propertyMacro_GetValue_1_4(final PropertyMacroContext _context) {
    return _context.createUniqueName("table", SNodeOperations.getContainingRoot(_context.getNode()));
  }
  public static Object propertyMacro_GetValue_1_5(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_2_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_2_1(final PropertyMacroContext _context) {
    return Helper.stringForKind(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P));
  }
  public static Object propertyMacro_GetValue_4_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.default_value$9ckJ);
  }
  public static Object propertyMacro_GetValue_7_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.default_value$9ckJ);
  }
  public static Object propertyMacro_GetValue_8_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_8_1(final PropertyMacroContext _context) {
    return Helper.stringForKind(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P));
  }
  public static Object propertyMacro_GetValue_10_0(final PropertyMacroContext _context) {
    return _context.createUniqueName("group", SNodeOperations.getContainingRoot(_context.getNode()));
  }
  public static Object propertyMacro_GetValue_11_0(final PropertyMacroContext _context) {
    return _context.createUniqueName("selector", SNodeOperations.getContainingRoot(_context.getNode()));
  }
  public static Object propertyMacro_GetValue_13_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_1(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_2(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_13_3(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_4(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_5(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_13_6(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_7(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_13_8(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_13_9(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_14_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_14_1(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_14_2(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_14_3(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_14_4(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_14_5(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.value$mosh);
  }
  public static Object propertyMacro_GetValue_14_6(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object propertyMacro_GetValue_14_7(final PropertyMacroContext _context) {
    return Helper.stringForKind(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB));
  }
  public static Object propertyMacro_GetValue_15_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_1(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_2(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_3(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_4(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_5(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_6(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_7(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_8(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_15_9(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL).replaceAll(" ", "_");
  }
  public static Object propertyMacro_GetValue_20_0(final PropertyMacroContext _context) {
    return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
  }
  public static Object referenceMacro_GetReferent_0_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.target$fs2f), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_0_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.field$pMHA), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_0_2(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.target$22yf), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_0_3(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.target$Djhf), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_0_4(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.target$WJl$), "Methods");
  }
  public static Object referenceMacro_GetReferent_2_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_2_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_4_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_7_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_8_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_8_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_12_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_13_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.as(SNodeOperations.getParent(_context.getNode()), CONCEPTS.Selector$ej), "Commands");
  }
  public static Object referenceMacro_GetReferent_14_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_16_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_16_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_16_2(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_16_3(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_16_4(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_16_5(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_16_6(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_16_7(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_16_8(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_17_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_17_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_17_2(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_17_3(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_17_4(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_17_5(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_18_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_18_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_18_2(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_18_3(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_18_4(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_18_5(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_18_6(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_18_7(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_19_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_19_1(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_19_2(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_19_3(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_19_4(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "FieldValues");
  }
  public static Object referenceMacro_GetReferent_20_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static Object referenceMacro_GetReferent_21_0(final ReferenceMacroContext _context) {
    return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "Commands");
  }
  public static boolean ifMacro_Condition_6_0(final IfMacroContext _context) {
    return SNodeOperations.isInstanceOf(ListSequence.fromList(SNodeOperations.getNextSiblings(_context.getNode(), false)).where((it) -> !(SNodeOperations.isInstanceOf(it, CONCEPTS.Calculation$J0))).first(), CONCEPTS.EmptyLine$CT);
  }
  public static boolean ifMacro_Condition_13_0(final IfMacroContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(SNodeOperations.as(SNodeOperations.getParent(_context.getNode()), CONCEPTS.Selector$ej), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(SNodeOperations.as(SNodeOperations.getParent(_context.getNode()), CONCEPTS.Selector$ej), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean ifMacro_Condition_13_1(final IfMacroContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(SNodeOperations.as(SNodeOperations.getParent(_context.getNode()), CONCEPTS.Selector$ej), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean ifMacro_Condition_13_2(final IfMacroContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(SNodeOperations.as(SNodeOperations.getParent(_context.getNode()), CONCEPTS.Selector$ej), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static boolean ifMacro_Condition_14_0(final IfMacroContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"))) && !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual")));
  }
  public static boolean ifMacro_Condition_14_1(final IfMacroContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static boolean ifMacro_Condition_14_2(final IfMacroContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$DveB), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061ccL, "textual"));
  }
  public static boolean ifMacro_Condition_19_0(final IfMacroContext _context) {
    return !(Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical")));
  }
  public static boolean ifMacro_Condition_19_1(final IfMacroContext _context) {
    return Objects.equals(SPropertyOperations.getEnum(_context.getNode(), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x20e1c9c3baa061c7L, "logical"));
  }
  public static SNode sourceNodeQuery_15_0(final SourceSubstituteMacroNodeContext _context) {
    return TypecheckingFacade.getFromContext().getTypeOf(_context.getNode());
  }
  public static SNode sourceNodeQuery_15_1(final SourceSubstituteMacroNodeContext _context) {
    return TypecheckingFacade.getFromContext().getTypeOf(_context.getNode());
  }
  public static SNode sourceNodeQuery_15_2(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.returnType$78p2);
  }
  public static SNode sourceNodeQuery_16_0(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.initializer$EDCJ);
  }
  public static SNode sourceNodeQuery_19_0(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.expression$ddms);
  }
  public static SNode sourceNodeQuery_21_0(final SourceSubstituteMacroNodeContext _context) {
    return SLinkOperations.getTarget(_context.getNode(), LINKS.dataSource$1D5f);
  }
  public static Iterable<SNode> sourceNodesQuery_1_0(final SourceSubstituteMacroNodesContext _context) {
    return SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR), CONCEPTS.Field$_5);
  }
  public static Iterable<SNode> sourceNodesQuery_1_1(final SourceSubstituteMacroNodesContext _context) {
    return SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR), CONCEPTS.Logical$HP);
  }
  public static Iterable<SNode> sourceNodesQuery_1_2(final SourceSubstituteMacroNodesContext _context) {
    return SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR), CONCEPTS.Selector$ej);
  }
  public static Iterable<SNode> sourceNodesQuery_1_3(final SourceSubstituteMacroNodesContext _context) {
    return SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR), CONCEPTS.OutputTable$LY);
  }
  public static Iterable<SNode> sourceNodesQuery_1_4(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR);
  }
  public static Iterable<SNode> sourceNodesQuery_1_5(final SourceSubstituteMacroNodesContext _context) {
    return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR)).where((it) -> !(SNodeOperations.isInstanceOf(it, CONCEPTS.Calculation$J0)));
  }
  public static Iterable<SNode> sourceNodesQuery_1_6(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR);
  }
  public static Iterable<SNode> sourceNodesQuery_1_7(final SourceSubstituteMacroNodesContext _context) {
    return SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.commands$LtFR), CONCEPTS.OutputField$hD);
  }
  public static Iterable<SNode> sourceNodesQuery_13_0(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.options$pszS);
  }
  public static Iterable<SNode> sourceNodesQuery_14_0(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.options$pszS);
  }
  public static Iterable<SNode> sourceNodesQuery_14_1(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.options$pszS);
  }
  public static Iterable<SNode> sourceNodesQuery_14_2(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(_context.getNode(), LINKS.options$pszS);
  }
  public static Iterable<SNode> sourceNodesQuery_15_0(final SourceSubstituteMacroNodesContext _context) {
    return SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), LINKS.body$xrvH), LINKS.statement$53DE);
  }
  public static void mappingScript_CodeBlock_5(final MappingScriptContext _context) {
    ListSequence.fromList(SModelOperations.nodes(_context.getModel(), CONCEPTS.FieldReference$gP)).where((ref) -> Objects.equals(SPropertyOperations.getEnum(SLinkOperations.getTarget(ref, LINKS.field$pMHA), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x1d111c815ee9dbb7L, "percent")) && !(Objects.equals(SPropertyOperations.getEnum(SNodeOperations.getNodeAncestor(ref, CONCEPTS.OutputField$hD, false, false), PROPS.value_kind$cL8P), SEnumOperations.getMember(MetaAdapterFactory.getEnumeration(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ee9dbb5L, "jetbrains.mps.samples.fincalculator.structure.ValueKind"), 0x1d111c815ee9dbb7L, "percent")))).visitAll((ref) -> {
      SNode div = SNodeFactoryOperations.replaceWithNewChild(ref, CONCEPTS.DivExpression$En);
      SLinkOperations.setTarget(div, LINKS.leftExpression$sEj, ref);
      SLinkOperations.setTarget(div, LINKS.rightExpression$nvX, createIntegerConstant_x583g4_a0c0a0a0a931());
    });
  }
  private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>();
  {
    int i = 0;
    rrcMethods.put("4779620959591347858", new RRC(i++));
    rrcMethods.put("4779620959591791849", new RRC(i++));
    rrcMethods.put("4779620959591194712", new RRC(i++));
    rrcMethods.put("4779620959591224583", new RRC(i++));
    rrcMethods.put("5982026979499254894", new RRC(i++));
    rrcMethods.put("5982026979499277864", new RRC(i++));
    rrcMethods.put("2369396721461348680", new RRC(i++));
    rrcMethods.put("2369396721461360424", new RRC(i++));
    rrcMethods.put("2369396721461361652", new RRC(i++));
    rrcMethods.put("2369396721461373548", new RRC(i++));
    rrcMethods.put("2369396721461373583", new RRC(i++));
    rrcMethods.put("2369396721461373610", new RRC(i++));
    rrcMethods.put("2369396721461631274", new RRC(i++));
    rrcMethods.put("2369396721461631309", new RRC(i++));
    rrcMethods.put("2369396721461631336", new RRC(i++));
    rrcMethods.put("2369396721461703259", new RRC(i++));
    rrcMethods.put("2369396721461703324", new RRC(i++));
    rrcMethods.put("2369396721462696743", new RRC(i++));
    rrcMethods.put("2369396721462696809", new RRC(i++));
    rrcMethods.put("2369396721462696867", new RRC(i++));
    rrcMethods.put("2369396721462660353", new RRC(i++));
    rrcMethods.put("2369396721462660418", new RRC(i++));
    rrcMethods.put("2369396721462660468", new RRC(i++));
  }
  @Override
  @NotNull
  public ReductionRuleCondition getReductionRuleCondition(@NotNull QueryKey identity) {
    ReductionRuleCondition query = identity.forTemplateNode(rrcMethods);
    return (query != null ? query : super.getReductionRuleCondition(identity));
  }
  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.rule_Condition_0_0(ctx);
        case 1:
          return QueriesGenerated.rule_Condition_0_1(ctx);
        case 2:
          return QueriesGenerated.rule_Condition_9_0(ctx);
        case 3:
          return QueriesGenerated.rule_Condition_9_1(ctx);
        case 4:
          return QueriesGenerated.rule_Condition_15_0(ctx);
        case 5:
          return QueriesGenerated.rule_Condition_15_1(ctx);
        case 6:
          return QueriesGenerated.rule_Condition_15_2(ctx);
        case 7:
          return QueriesGenerated.rule_Condition_15_3(ctx);
        case 8:
          return QueriesGenerated.rule_Condition_15_4(ctx);
        case 9:
          return QueriesGenerated.rule_Condition_15_5(ctx);
        case 10:
          return QueriesGenerated.rule_Condition_15_6(ctx);
        case 11:
          return QueriesGenerated.rule_Condition_15_7(ctx);
        case 12:
          return QueriesGenerated.rule_Condition_16_0(ctx);
        case 13:
          return QueriesGenerated.rule_Condition_16_1(ctx);
        case 14:
          return QueriesGenerated.rule_Condition_16_2(ctx);
        case 15:
          return QueriesGenerated.rule_Condition_16_3(ctx);
        case 16:
          return QueriesGenerated.rule_Condition_16_4(ctx);
        case 17:
          return QueriesGenerated.rule_Condition_17_0(ctx);
        case 18:
          return QueriesGenerated.rule_Condition_17_1(ctx);
        case 19:
          return QueriesGenerated.rule_Condition_17_2(ctx);
        case 20:
          return QueriesGenerated.rule_Condition_18_0(ctx);
        case 21:
          return QueriesGenerated.rule_Condition_18_1(ctx);
        case 22:
          return QueriesGenerated.rule_Condition_18_2(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, ScriptCodeBlock> mscbMethods = new HashMap<String, ScriptCodeBlock>();
  {
    int i = 0;
    mscbMethods.put("2094486643673747900", new SCB(i++));
  }
  @Override
  @NotNull
  public ScriptCodeBlock getScriptCodeBlock(@NotNull QueryKey identity) {
    ScriptCodeBlock query = identity.forTemplateNode(mscbMethods);
    return (query != null ? query : super.getScriptCodeBlock(identity));
  }
  private static class SCB implements ScriptCodeBlock {
    private final int methodKey;
    public SCB(int methodKey) {
      this.methodKey = methodKey;
    }
    @Override
    public void invoke(MappingScriptContext ctx) throws GenerationFailureException {
      switch (methodKey) {
        case 0:
          QueriesGenerated.mappingScript_CodeBlock_5(ctx);
          return;
        default:
          throw new GenerationFailureException(String.format("There's no code block with method index %d ", methodKey));
      }
    }
  }
  private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>();
  {
    int i = 0;
    snqMethods.put("5982026979499264529", new SNQ(i++));
    snqMethods.put("5982026979499277870", new SNQ(i++));
    snqMethods.put("2369396721463292834", new SNQ(i++));
    snqMethods.put("5982026979499415196", new SNQ(i++));
    snqMethods.put("2369396721463503528", new SNQ(i++));
    snqMethods.put("5982026979500487469", 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_15_0(ctx);
        case 1:
          return QueriesGenerated.sourceNodeQuery_15_1(ctx);
        case 2:
          return QueriesGenerated.sourceNodeQuery_15_2(ctx);
        case 3:
          return QueriesGenerated.sourceNodeQuery_16_0(ctx);
        case 4:
          return QueriesGenerated.sourceNodeQuery_19_0(ctx);
        case 5:
          return QueriesGenerated.sourceNodeQuery_21_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("1241363965966", new SNsQ(i++));
    snsqMethods.put("1241364033293", new SNsQ(i++));
    snsqMethods.put("4779620959591180572", new SNsQ(i++));
    snsqMethods.put("5982026979500020929", new SNsQ(i++));
    snsqMethods.put("2369396721461271822", new SNsQ(i++));
    snsqMethods.put("2094486643673094576", new SNsQ(i++));
    snsqMethods.put("2369396721461557515", new SNsQ(i++));
    snsqMethods.put("2369396721463549636", new SNsQ(i++));
    snsqMethods.put("4779620959591434810", new SNsQ(i++));
    snsqMethods.put("4779620959591827596", new SNsQ(i++));
    snsqMethods.put("2369396721462116894", new SNsQ(i++));
    snsqMethods.put("2369396721462133817", new SNsQ(i++));
    snsqMethods.put("2369396721463292823", 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_1_0(ctx));
        case 1:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_1(ctx));
        case 2:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_2(ctx));
        case 3:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_3(ctx));
        case 4:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_4(ctx));
        case 5:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_5(ctx));
        case 6:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_6(ctx));
        case 7:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1_7(ctx));
        case 8:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_13_0(ctx));
        case 9:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_14_0(ctx));
        case 10:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_14_1(ctx));
        case 11:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_14_2(ctx));
        case 12:
          return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_15_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, PropertyValueQuery> pvqMethods = new HashMap<String, PropertyValueQuery>();
  {
    int i = 0;
    pvqMethods.put("1241363259553", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "CalculatorImpl"));
    pvqMethods.put("1241364001133", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "field"));
    pvqMethods.put("4779620959591002207", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("1241364033299", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "checkbox"));
    pvqMethods.put("5982026979500046483", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "table"));
    pvqMethods.put("1241363912193", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Calculator"));
    pvqMethods.put("5982026979501346237", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Title"));
    pvqMethods.put("5982026979501354642", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "$"));
    pvqMethods.put("2094486643673129231", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2094486643674856240", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5982026979501566952", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Output"));
    pvqMethods.put("5982026979501574594", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "$"));
    pvqMethods.put("4779620959591294341", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "group"));
    pvqMethods.put("4779620959591292212", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "selector"));
    pvqMethods.put("4779620959591441329", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5087448708487578438", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5087448708487576568", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462311381", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462311391", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462550221", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462326859", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462326869", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462326878", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5982026979501625478", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Selector"));
    pvqMethods.put("4779620959592356558", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("4779620959593752098", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462116857", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462178743", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462133780", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("2369396721462133789", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5982026979501783434", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Selector"));
    pvqMethods.put("5982026979501808398", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), ""));
    pvqMethods.put("5982026979499256532", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value"));
    pvqMethods.put("5982026979499277876", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value"));
    pvqMethods.put("2369396721461337413", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_b"));
    pvqMethods.put("2369396721461348823", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_i"));
    pvqMethods.put("2369396721461364296", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_b"));
    pvqMethods.put("2369396721461361658", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_s"));
    pvqMethods.put("2369396721461373554", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_i"));
    pvqMethods.put("2369396721461373589", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_b"));
    pvqMethods.put("2369396721461373616", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "value_s"));
    pvqMethods.put("2369396721463292841", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "method"));
    pvqMethods.put("5982026979501286959", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "Table"));
  }
  @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_1_0(ctx);
        case 1:
          return QueriesGenerated.propertyMacro_GetValue_1_1(ctx);
        case 2:
          return QueriesGenerated.propertyMacro_GetValue_1_2(ctx);
        case 3:
          return QueriesGenerated.propertyMacro_GetValue_1_3(ctx);
        case 4:
          return QueriesGenerated.propertyMacro_GetValue_1_4(ctx);
        case 5:
          return QueriesGenerated.propertyMacro_GetValue_1_5(ctx);
        case 6:
          return QueriesGenerated.propertyMacro_GetValue_2_0(ctx);
        case 7:
          return QueriesGenerated.propertyMacro_GetValue_2_1(ctx);
        case 8:
          return QueriesGenerated.propertyMacro_GetValue_4_0(ctx);
        case 9:
          return QueriesGenerated.propertyMacro_GetValue_7_0(ctx);
        case 10:
          return QueriesGenerated.propertyMacro_GetValue_8_0(ctx);
        case 11:
          return QueriesGenerated.propertyMacro_GetValue_8_1(ctx);
        case 12:
          return QueriesGenerated.propertyMacro_GetValue_10_0(ctx);
        case 13:
          return QueriesGenerated.propertyMacro_GetValue_11_0(ctx);
        case 14:
          return QueriesGenerated.propertyMacro_GetValue_13_0(ctx);
        case 15:
          return QueriesGenerated.propertyMacro_GetValue_13_1(ctx);
        case 16:
          return QueriesGenerated.propertyMacro_GetValue_13_2(ctx);
        case 17:
          return QueriesGenerated.propertyMacro_GetValue_13_3(ctx);
        case 18:
          return QueriesGenerated.propertyMacro_GetValue_13_4(ctx);
        case 19:
          return QueriesGenerated.propertyMacro_GetValue_13_5(ctx);
        case 20:
          return QueriesGenerated.propertyMacro_GetValue_13_6(ctx);
        case 21:
          return QueriesGenerated.propertyMacro_GetValue_13_7(ctx);
        case 22:
          return QueriesGenerated.propertyMacro_GetValue_13_8(ctx);
        case 23:
          return QueriesGenerated.propertyMacro_GetValue_13_9(ctx);
        case 24:
          return QueriesGenerated.propertyMacro_GetValue_14_0(ctx);
        case 25:
          return QueriesGenerated.propertyMacro_GetValue_14_1(ctx);
        case 26:
          return QueriesGenerated.propertyMacro_GetValue_14_2(ctx);
        case 27:
          return QueriesGenerated.propertyMacro_GetValue_14_3(ctx);
        case 28:
          return QueriesGenerated.propertyMacro_GetValue_14_4(ctx);
        case 29:
          return QueriesGenerated.propertyMacro_GetValue_14_5(ctx);
        case 30:
          return QueriesGenerated.propertyMacro_GetValue_14_6(ctx);
        case 31:
          return QueriesGenerated.propertyMacro_GetValue_14_7(ctx);
        case 32:
          return QueriesGenerated.propertyMacro_GetValue_15_0(ctx);
        case 33:
          return QueriesGenerated.propertyMacro_GetValue_15_1(ctx);
        case 34:
          return QueriesGenerated.propertyMacro_GetValue_15_2(ctx);
        case 35:
          return QueriesGenerated.propertyMacro_GetValue_15_3(ctx);
        case 36:
          return QueriesGenerated.propertyMacro_GetValue_15_4(ctx);
        case 37:
          return QueriesGenerated.propertyMacro_GetValue_15_5(ctx);
        case 38:
          return QueriesGenerated.propertyMacro_GetValue_15_6(ctx);
        case 39:
          return QueriesGenerated.propertyMacro_GetValue_15_7(ctx);
        case 40:
          return QueriesGenerated.propertyMacro_GetValue_15_8(ctx);
        case 41:
          return QueriesGenerated.propertyMacro_GetValue_15_9(ctx);
        case 42:
          return QueriesGenerated.propertyMacro_GetValue_20_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("2094486643674755906", new IfMC(i++));
    imcMethods.put("2369396721462392904", new IfMC(i++));
    imcMethods.put("2369396721462510857", new IfMC(i++));
    imcMethods.put("2369396721462561342", new IfMC(i++));
    imcMethods.put("2369396721461985165", new IfMC(i++));
    imcMethods.put("2369396721462116874", new IfMC(i++));
    imcMethods.put("2369396721462133797", new IfMC(i++));
    imcMethods.put("2369396721463503567", new IfMC(i++));
    imcMethods.put("2369396721463503605", 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_6_0(ctx);
        case 1:
          return QueriesGenerated.ifMacro_Condition_13_0(ctx);
        case 2:
          return QueriesGenerated.ifMacro_Condition_13_1(ctx);
        case 3:
          return QueriesGenerated.ifMacro_Condition_13_2(ctx);
        case 4:
          return QueriesGenerated.ifMacro_Condition_14_0(ctx);
        case 5:
          return QueriesGenerated.ifMacro_Condition_14_1(ctx);
        case 6:
          return QueriesGenerated.ifMacro_Condition_14_2(ctx);
        case 7:
          return QueriesGenerated.ifMacro_Condition_19_0(ctx);
        case 8:
          return QueriesGenerated.ifMacro_Condition_19_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("5982026979499299232", new RTQ(0, "i"));
    rtqMethods.put("313932908986203994", new RTQ(1, "i"));
    rtqMethods.put("4779620959593549493", new RTQ(2, "b"));
    rtqMethods.put("4779620959593553576", new RTQ(3, "s"));
    rtqMethods.put("2369396721458074624", new RTQ(4, "foo"));
    rtqMethods.put("5982026979501352313", new RTQ(5, "field"));
    rtqMethods.put("2094486643673046956", new RTQ(6, "field"));
    rtqMethods.put("2094486643673112543", new RTQ(7, "inputField"));
    rtqMethods.put("2094486643674831693", new RTQ(8, "inputField"));
    rtqMethods.put("5982026979501569637", new RTQ(9, "field"));
    rtqMethods.put("4779620959591088502", new RTQ(10, "field"));
    rtqMethods.put("4779620959594142563", new RTQ(11, "checkbox"));
    rtqMethods.put("4779620959591567402", new RTQ(12, "group"));
    rtqMethods.put("4779620959592007680", new RTQ(13, "selector"));
    rtqMethods.put("5982026979499412931", new RTQ(14, "field"));
    rtqMethods.put("2369396721461626086", new RTQ(15, "checkbox"));
    rtqMethods.put("2369396721461624503", new RTQ(16, "field"));
    rtqMethods.put("2369396721461679968", new RTQ(17, "textField"));
    rtqMethods.put("2369396721461677378", new RTQ(18, "field"));
    rtqMethods.put("2369396721461685682", new RTQ(19, "field"));
    rtqMethods.put("2369396721461685672", new RTQ(20, "textField"));
    rtqMethods.put("2369396721461696532", new RTQ(21, "field"));
    rtqMethods.put("2369396721461696543", new RTQ(22, "textField"));
    rtqMethods.put("2369396721462745348", new RTQ(23, "selector"));
    rtqMethods.put("2369396721462745393", new RTQ(24, "field"));
    rtqMethods.put("2369396721462714877", new RTQ(25, "selector"));
    rtqMethods.put("2369396721462730337", new RTQ(26, "field"));
    rtqMethods.put("2369396721462753636", new RTQ(27, "selector"));
    rtqMethods.put("2369396721462753681", new RTQ(28, "field"));
    rtqMethods.put("2369396721462683774", new RTQ(29, "field"));
    rtqMethods.put("2369396721462678587", new RTQ(30, "selector"));
    rtqMethods.put("2369396721462690627", new RTQ(31, "field"));
    rtqMethods.put("2369396721462690645", new RTQ(32, "selector"));
    rtqMethods.put("2369396721462660496", new RTQ(33, "field"));
    rtqMethods.put("2369396721462660506", new RTQ(34, "textField"));
    rtqMethods.put("2369396721462692588", new RTQ(35, "field"));
    rtqMethods.put("2369396721462692606", new RTQ(36, "selector"));
    rtqMethods.put("2369396721463534399", new RTQ(37, "value"));
    rtqMethods.put("2369396721463503546", new RTQ(38, "field"));
    rtqMethods.put("2369396721463538642", new RTQ(39, "value"));
    rtqMethods.put("2369396721463503581", new RTQ(40, "field"));
    rtqMethods.put("2369396721463540868", new RTQ(41, "value"));
    rtqMethods.put("5982026979500558110", new RTQ(42, "table"));
    rtqMethods.put("5982026979500209859", new RTQ(43, "table"));
  }
  @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_0_1(ctx);
        case 2:
          return QueriesGenerated.referenceMacro_GetReferent_0_2(ctx);
        case 3:
          return QueriesGenerated.referenceMacro_GetReferent_0_3(ctx);
        case 4:
          return QueriesGenerated.referenceMacro_GetReferent_0_4(ctx);
        case 5:
          return QueriesGenerated.referenceMacro_GetReferent_2_0(ctx);
        case 6:
          return QueriesGenerated.referenceMacro_GetReferent_2_1(ctx);
        case 7:
          return QueriesGenerated.referenceMacro_GetReferent_4_0(ctx);
        case 8:
          return QueriesGenerated.referenceMacro_GetReferent_7_0(ctx);
        case 9:
          return QueriesGenerated.referenceMacro_GetReferent_8_0(ctx);
        case 10:
          return QueriesGenerated.referenceMacro_GetReferent_8_1(ctx);
        case 11:
          return QueriesGenerated.referenceMacro_GetReferent_12_0(ctx);
        case 12:
          return QueriesGenerated.referenceMacro_GetReferent_13_0(ctx);
        case 13:
          return QueriesGenerated.referenceMacro_GetReferent_14_0(ctx);
        case 14:
          return QueriesGenerated.referenceMacro_GetReferent_16_0(ctx);
        case 15:
          return QueriesGenerated.referenceMacro_GetReferent_16_1(ctx);
        case 16:
          return QueriesGenerated.referenceMacro_GetReferent_16_2(ctx);
        case 17:
          return QueriesGenerated.referenceMacro_GetReferent_16_3(ctx);
        case 18:
          return QueriesGenerated.referenceMacro_GetReferent_16_4(ctx);
        case 19:
          return QueriesGenerated.referenceMacro_GetReferent_16_5(ctx);
        case 20:
          return QueriesGenerated.referenceMacro_GetReferent_16_6(ctx);
        case 21:
          return QueriesGenerated.referenceMacro_GetReferent_16_7(ctx);
        case 22:
          return QueriesGenerated.referenceMacro_GetReferent_16_8(ctx);
        case 23:
          return QueriesGenerated.referenceMacro_GetReferent_17_0(ctx);
        case 24:
          return QueriesGenerated.referenceMacro_GetReferent_17_1(ctx);
        case 25:
          return QueriesGenerated.referenceMacro_GetReferent_17_2(ctx);
        case 26:
          return QueriesGenerated.referenceMacro_GetReferent_17_3(ctx);
        case 27:
          return QueriesGenerated.referenceMacro_GetReferent_17_4(ctx);
        case 28:
          return QueriesGenerated.referenceMacro_GetReferent_17_5(ctx);
        case 29:
          return QueriesGenerated.referenceMacro_GetReferent_18_0(ctx);
        case 30:
          return QueriesGenerated.referenceMacro_GetReferent_18_1(ctx);
        case 31:
          return QueriesGenerated.referenceMacro_GetReferent_18_2(ctx);
        case 32:
          return QueriesGenerated.referenceMacro_GetReferent_18_3(ctx);
        case 33:
          return QueriesGenerated.referenceMacro_GetReferent_18_4(ctx);
        case 34:
          return QueriesGenerated.referenceMacro_GetReferent_18_5(ctx);
        case 35:
          return QueriesGenerated.referenceMacro_GetReferent_18_6(ctx);
        case 36:
          return QueriesGenerated.referenceMacro_GetReferent_18_7(ctx);
        case 37:
          return QueriesGenerated.referenceMacro_GetReferent_19_0(ctx);
        case 38:
          return QueriesGenerated.referenceMacro_GetReferent_19_1(ctx);
        case 39:
          return QueriesGenerated.referenceMacro_GetReferent_19_2(ctx);
        case 40:
          return QueriesGenerated.referenceMacro_GetReferent_19_3(ctx);
        case 41:
          return QueriesGenerated.referenceMacro_GetReferent_19_4(ctx);
        case 42:
          return QueriesGenerated.referenceMacro_GetReferent_20_0(ctx);
        case 43:
          return QueriesGenerated.referenceMacro_GetReferent_21_0(ctx);
        default:
          throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
      }
    }
  }
  private static SNode createIntegerConstant_x583g4_a0c0a0a0a931() {
    SNodeBuilder n0 = new SNodeBuilder().init(CONCEPTS.IntegerConstant$Na);
    n0.setProperty(PROPS.value$jgCM, "" + (100));
    return n0.getResult();
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept PrimitiveType$sR = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10f0ad8bde4L, "jetbrains.mps.baseLanguage.structure.PrimitiveType");
    /*package*/ static final SConcept InputField$41 = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12106fa3191L, "jetbrains.mps.samples.fincalculator.structure.InputField");
    /*package*/ static final SConcept Selector$ej = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716bc68cL, "jetbrains.mps.samples.fincalculator.structure.Selector");
    /*package*/ static final SConcept Calculation$J0 = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x20e1c9c3ba743f75L, "jetbrains.mps.samples.fincalculator.structure.Calculation");
    /*package*/ static final SConcept EmptyLine$CT = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ef16d4fL, "jetbrains.mps.samples.fincalculator.structure.EmptyLine");
    /*package*/ static final SConcept Field$_5 = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ef3602cL, "jetbrains.mps.samples.fincalculator.structure.Field");
    /*package*/ static final SConcept Logical$HP = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff071696974L, "jetbrains.mps.samples.fincalculator.structure.Logical");
    /*package*/ static final SConcept OutputTable$LY = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x53046dd7fde2f4acL, "jetbrains.mps.samples.fincalculator.structure.OutputTable");
    /*package*/ static final SConcept OutputField$hD = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12106fd5a98L, "jetbrains.mps.samples.fincalculator.structure.OutputField");
    /*package*/ static final SConcept FieldReference$gP = MetaAdapterFactory.getConcept(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12107017046L, "jetbrains.mps.samples.fincalculator.structure.FieldReference");
    /*package*/ static final SConcept DivExpression$En = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xff2bbc13daL, "jetbrains.mps.baseLanguage.structure.DivExpression");
    /*package*/ static final SConcept IntegerConstant$Na = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, "jetbrains.mps.baseLanguage.structure.IntegerConstant");
  }

  private static final class PROPS {
    /*package*/ static final SProperty value_kind$cL8P = MetaAdapterFactory.getProperty(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815ef3602cL, 0x1d111c815ee9dbb3L, "value_kind");
    /*package*/ static final SProperty value_kind$DveB = MetaAdapterFactory.getProperty(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716bc68cL, 0x469a3fa55a6675a8L, "value_kind");
    /*package*/ static final SProperty name$MnvL = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name");
    /*package*/ static final SProperty default_value$9ckJ = MetaAdapterFactory.getProperty(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x1d111c815eee89eeL, 0x1d111c815eee89efL, "default_value");
    /*package*/ static final SProperty value$mosh = MetaAdapterFactory.getProperty(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716bc68fL, 0x42549ff0716bc692L, "value");
    /*package*/ static final SProperty value$jgCM = MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value");
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink target$fs2f = MetaAdapterFactory.getReferenceLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x53046dd7fdd834adL, 0x53046dd7fdd834aeL, "target");
    /*package*/ static final SReferenceLink field$pMHA = MetaAdapterFactory.getReferenceLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12107017046L, 0x1210701c618L, "field");
    /*package*/ static final SReferenceLink target$22yf = MetaAdapterFactory.getReferenceLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716969a8L, 0x42549ff0716969a9L, "target");
    /*package*/ static final SReferenceLink target$Djhf = MetaAdapterFactory.getReferenceLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716bc718L, 0x42549ff0716bc719L, "target");
    /*package*/ static final SReferenceLink target$WJl$ = MetaAdapterFactory.getReferenceLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x20e1c9c3ba7966a7L, 0x20e1c9c3ba7966a8L, "target");
    /*package*/ static final SContainmentLink returnType$78p2 = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x20e1c9c3ba743f75L, 0x20e1c9c3ba783088L, "returnType");
    /*package*/ static final SContainmentLink initializer$EDCJ = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x53046dd7fdd5e3b3L, 0x53046dd7fdd5e3b4L, "initializer");
    /*package*/ static final SContainmentLink expression$ddms = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12106fd5a98L, 0x1210700deeeL, "expression");
    /*package*/ static final SContainmentLink dataSource$1D5f = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x53046dd7fde2f4acL, 0x53046dd7fde2f4adL, "dataSource");
    /*package*/ static final SContainmentLink commands$LtFR = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x12106f96410L, 0x1d111c815ef22eb0L, "commands");
    /*package*/ static final SContainmentLink options$pszS = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x42549ff0716bc68cL, 0x42549ff0716bc6cdL, "options");
    /*package*/ static final SContainmentLink body$xrvH = MetaAdapterFactory.getContainmentLink(0x26b3d6d5b99a4ed6L, 0x83bed2ea6f3627c2L, 0x20e1c9c3ba743f75L, 0x20e1c9c3ba75c867L, "body");
    /*package*/ static final SContainmentLink statement$53DE = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement");
    /*package*/ static final SContainmentLink leftExpression$sEj = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11cL, "leftExpression");
    /*package*/ static final SContainmentLink rightExpression$nvX = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11bL, "rightExpression");
  }
}
