package jetbrains.mps.lang.quotation.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 jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SContainmentLink;

public class NodeBuilder_Replace {
  public static class NodeFactory_9079830899493053022 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      {
        final SNode sampleBuilderNode = sampleNode;
        if (SNodeOperations.isInstanceOf(sampleBuilderNode, CONCEPTS.NodeBuilderNode$Sn)) {
          SLinkOperations.setTarget(newNode, LINKS.concept$xoA0, SLinkOperations.getTarget(sampleBuilderNode, LINKS.concept$xoA0));
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.values$JgAV)).addSequence(ListSequence.fromList(SLinkOperations.getChildren(sampleBuilderNode, LINKS.values$JgAV)));
        }
      }
    }
  }
  public static class NodeFactory_410791833645398110 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      {
        final SNode sampleBuilderNode = sampleNode;
        if (SNodeOperations.isInstanceOf(sampleBuilderNode, CONCEPTS.NodeBuilderNode$Sn)) {
          ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.nodes$MvP4)).addElement(sampleBuilderNode);
        }
      }
    }
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept NodeBuilderNode$Sn = MetaAdapterFactory.getConcept(0x3a13115c633c4c5cL, 0xbbcc75c4219e9555L, 0x4bb51009d20a4aa0L, "jetbrains.mps.lang.quotation.structure.NodeBuilderNode");
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink concept$xoA0 = MetaAdapterFactory.getReferenceLink(0x3a13115c633c4c5cL, 0xbbcc75c4219e9555L, 0x4bb51009d20a4aa0L, 0x4bb51009d20b02b1L, "concept");
    /*package*/ static final SContainmentLink values$JgAV = MetaAdapterFactory.getContainmentLink(0x3a13115c633c4c5cL, 0xbbcc75c4219e9555L, 0x4bb51009d20a4aa0L, 0x4bb51009d20b033bL, "values");
    /*package*/ static final SContainmentLink nodes$MvP4 = MetaAdapterFactory.getContainmentLink(0x3a13115c633c4c5cL, 0xbbcc75c4219e9555L, 0x718e3f4cb7a2df32L, 0x718e3f4cb7a2df33L, "nodes");
  }
}
