package jetbrains.mps.lang.smodel.actions;

/*Generated by MPS */

import jetbrains.mps.openapi.actions.descriptor.NodeFactory;
import org.jetbrains.mps.openapi.model.SNode;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import java.util.List;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.smodel.action.SNodeFactoryOperations;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import org.jetbrains.mps.openapi.language.SReferenceLink;

public class SModelLang_factories {
  public static class NodeFactory_1171415364777 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.SNodeOperation$pA)) {
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
      // init default parms
      if (ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).isEmpty()) {
        SNodeFactoryOperations.addNewChild(newNode, LINKS.parameter$mzxB, CONCEPTS.OperationParm_Concept$WJ);
      }
    }
  }
  public static class NodeFactory_1207248813874 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.SNodeOperation$pA)) {
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
      // init default parms
      if (ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).isEmpty()) {
        SNodeFactoryOperations.addNewChild(newNode, LINKS.parameter$mzxB, CONCEPTS.OperationParm_Concept$WJ);
      }
    }
  }
  public static class NodeFactory_1203553726914 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Concept_IsSubConceptOfOperation$xI)) {
        SLinkOperations.setTarget(newNode, LINKS.conceptArgument$z1aa, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Concept_IsSubConceptOfOperation$xI), LINKS.conceptArgument$V98w));
      }
    }
  }
  public static class NodeFactory_1203553739270 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Concept_IsSuperConceptOfOperation$aG)) {
        SLinkOperations.setTarget(newNode, LINKS.conceptArgument$V98w, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Concept_IsSuperConceptOfOperation$aG), LINKS.conceptArgument$z1aa));
      }
    }
  }
  public static class NodeFactory_1205353787833 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.SequenceType$_s)) {
        SNode elementType = SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.SequenceType$_s), LINKS.elementType$KpjL);
        if (SNodeOperations.isInstanceOf(elementType, CONCEPTS.SNodeType$hR)) {
          SLinkOperations.setTarget(newNode, LINKS.elementConcept$hlru, SLinkOperations.getTarget(SNodeOperations.cast(elementType, CONCEPTS.SNodeType$hR), LINKS.concept$OMgE));
        }
      }
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.ListType$LR)) {
        SNode elementType = SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.ListType$LR), LINKS.elementType$ssn);
        if (SNodeOperations.isInstanceOf(elementType, CONCEPTS.SNodeType$hR)) {
          SLinkOperations.setTarget(newNode, LINKS.elementConcept$hlru, SLinkOperations.getTarget(SNodeOperations.cast(elementType, CONCEPTS.SNodeType$hR), LINKS.concept$OMgE));
        }
      }
    }
  }
  public static class NodeFactory_3602058458308809797 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.SNodeCreator$dS)) {
        SLinkOperations.setTarget(newNode, LINKS.createdType$3ZFy, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeCreator$dS), LINKS.createdType$3ZFy));
      }
    }
  }
  public static class NodeFactory_3341893916018829253 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Concept_NewInstance$S_)) {
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829316 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Model_CreateNewNodeOperation$s$)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$oQou, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Model_CreateNewNodeOperation$s$), LINKS.concept$oQou));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829413 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Node_InsertNewNextSiblingOperation$n7)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$87SQ, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Node_InsertNewNextSiblingOperation$n7), LINKS.concept$87SQ));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829507 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Node_InsertNewPrevSiblingOperation$Ae)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$LFQy, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Node_InsertNewPrevSiblingOperation$Ae), LINKS.concept$LFQy));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829548 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Node_ReplaceWithNewOperation$zd)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$hL6r, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Node_ReplaceWithNewOperation$zd), LINKS.concept$hL6r));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829589 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Link_SetNewChildOperation$J_)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$KLIK, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.Link_SetNewChildOperation$J_), LINKS.concept$KLIK));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }
  public static class NodeFactory_3341893916018829632 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.LinkList_AddNewChildOperation$cY)) {
        SLinkOperations.setTarget(newNode, LINKS.concept$79ZG, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.LinkList_AddNewChildOperation$cY), LINKS.concept$79ZG));
        List<SNode> parms = SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SNodeOperation$pA), LINKS.parameter$mzxB);
        for (SNode parm : ListSequence.fromList(parms)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.parameter$mzxB)).addElement(parm);
        }
      }
    }
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept SNodeOperation$pA = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1090ea2ebacL, "jetbrains.mps.lang.smodel.structure.SNodeOperation");
    /*package*/ static final SConcept OperationParm_Concept$WJ = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a61caab68L, "jetbrains.mps.lang.smodel.structure.OperationParm_Concept");
    /*package*/ static final SConcept Concept_IsSubConceptOfOperation$xI = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112bf601180L, "jetbrains.mps.lang.smodel.structure.Concept_IsSubConceptOfOperation");
    /*package*/ static final SConcept Concept_IsSuperConceptOfOperation$aG = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112bf289d94L, "jetbrains.mps.lang.smodel.structure.Concept_IsSuperConceptOfOperation");
    /*package*/ static final SConcept SequenceType$_s = MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType");
    /*package*/ static final SConcept SNodeType$hR = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType");
    /*package*/ static final SConcept ListType$LR = MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c25fb076aL, "jetbrains.mps.baseLanguage.collections.structure.ListType");
    /*package*/ static final SConcept SNodeCreator$dS = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112e36f7135L, "jetbrains.mps.lang.smodel.structure.SNodeCreator");
    /*package*/ static final SConcept Concept_NewInstance$S_ = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11331ad1f2aL, "jetbrains.mps.lang.smodel.structure.Concept_NewInstance");
    /*package*/ static final SConcept Model_CreateNewNodeOperation$s$ = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2e210544L, "jetbrains.mps.lang.smodel.structure.Model_CreateNewNodeOperation");
    /*package*/ static final SConcept Node_InsertNewNextSiblingOperation$n7 = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10964e26717L, "jetbrains.mps.lang.smodel.structure.Node_InsertNewNextSiblingOperation");
    /*package*/ static final SConcept Node_InsertNewPrevSiblingOperation$Ae = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2d494062L, "jetbrains.mps.lang.smodel.structure.Node_InsertNewPrevSiblingOperation");
    /*package*/ static final SConcept Node_ReplaceWithNewOperation$zd = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10965697d7aL, "jetbrains.mps.lang.smodel.structure.Node_ReplaceWithNewOperation");
    /*package*/ static final SConcept Link_SetNewChildOperation$J_ = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x109233dbca1L, "jetbrains.mps.lang.smodel.structure.Link_SetNewChildOperation");
    /*package*/ static final SConcept LinkList_AddNewChildOperation$cY = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1093caead54L, "jetbrains.mps.lang.smodel.structure.LinkList_AddNewChildOperation");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink parameter$mzxB = MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1090ea2ebacL, 0x10a61ef5a56L, "parameter");
    /*package*/ static final SContainmentLink conceptArgument$z1aa = MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112bf289d94L, 0x112bf2b9fc0L, "conceptArgument");
    /*package*/ static final SContainmentLink conceptArgument$V98w = MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112bf601180L, 0x112bf601181L, "conceptArgument");
    /*package*/ static final SContainmentLink elementType$KpjL = MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType");
    /*package*/ static final SReferenceLink elementConcept$hlru = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10aae26be32L, 0x10aae27c421L, "elementConcept");
    /*package*/ static final SReferenceLink concept$OMgE = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, 0x1090e46ca51L, "concept");
    /*package*/ static final SContainmentLink elementType$ssn = MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c25fb076aL, 0x10c25fe95c5L, "elementType");
    /*package*/ static final SContainmentLink createdType$3ZFy = MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x112e36f7135L, 0x112e36f7138L, "createdType");
    /*package*/ static final SReferenceLink concept$oQou = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2e210544L, 0x10a2e23ae30L, "concept");
    /*package*/ static final SReferenceLink concept$87SQ = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10964e26717L, 0x10964e34da0L, "concept");
    /*package*/ static final SReferenceLink concept$LFQy = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2d494062L, 0x10a2d494065L, "concept");
    /*package*/ static final SReferenceLink concept$hL6r = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10965697d7aL, 0x109656cb789L, "concept");
    /*package*/ static final SReferenceLink concept$KLIK = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x109233dbca1L, 0x109662671bcL, "concept");
    /*package*/ static final SReferenceLink concept$79ZG = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1093caead54L, 0x1096601f97fL, "concept");
  }
}
