package jetbrains.mps.baseLanguage.regexp.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 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;

public class regexps_node_factories {
  public static class NodeFactory_6799940379546646404 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.UnaryRegexp$Nw)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$$Nis, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.UnaryRegexp$Nw), LINKS.regexp$$Nis));
      }
    }
  }
  public static class NodeFactory_8786899561263173301 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.LookRegexp$cd)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$a3MD, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.LookRegexp$cd), LINKS.regexp$a3MD));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.ParensRegexp$KC)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$a3MD, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.ParensRegexp$KC), LINKS.expr$EXG0));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.MatchParensRegexp$Ea)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$a3MD, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.MatchParensRegexp$Ea), LINKS.regexp$G7fG));
      }
    }
  }
  public static class NodeFactory_6799940379547316574 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.LookRegexp$cd)) {
        SLinkOperations.setTarget(newNode, LINKS.expr$EXG0, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.LookRegexp$cd), LINKS.regexp$a3MD));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.MatchParensRegexp$Ea)) {
        SLinkOperations.setTarget(newNode, LINKS.expr$EXG0, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.MatchParensRegexp$Ea), LINKS.regexp$G7fG));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Regexp$aA)) {
        SLinkOperations.setTarget(newNode, LINKS.expr$EXG0, SNodeOperations.cast(sampleNode, CONCEPTS.Regexp$aA));
      }
    }
  }
  public static class NodeFactory_3050481019131578337 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.LookRegexp$cd)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$G7fG, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.LookRegexp$cd), LINKS.regexp$a3MD));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.ParensRegexp$KC)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$G7fG, SLinkOperations.getTarget(SNodeOperations.cast(sampleNode, CONCEPTS.ParensRegexp$KC), LINKS.expr$EXG0));
      } else if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Regexp$aA)) {
        SLinkOperations.setTarget(newNode, LINKS.regexp$G7fG, SNodeOperations.cast(sampleNode, CONCEPTS.Regexp$aA));
      }
    }
  }
  public static class NodeFactory_1353467374625228627 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.Regexp$aA)) {
        SLinkOperations.setTarget(newNode, LINKS.left$41WX, SNodeOperations.cast(sampleNode, CONCEPTS.Regexp$aA));
      }
    }
  }
  public static class NodeFactory_4759120547780396753 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      if (SNodeOperations.isInstanceOf(sampleNode, CONCEPTS.SymbolClassRegexp$IA)) {
        ListSequence.fromList(SLinkOperations.getChildren(newNode, LINKS.part$$2oq)).addSequence(ListSequence.fromList(SLinkOperations.getChildren(SNodeOperations.cast(sampleNode, CONCEPTS.SymbolClassRegexp$IA), LINKS.part$$2oq)));
      }
    }
  }
  public static class NodeFactory_7048923897762413188 implements NodeFactory {
    public void setup(SNode newNode, SNode sampleNode, SNode enclosingNode, int index, SModel model) {
      SLinkOperations.setTarget(newNode, LINKS.regexp$uW0J, SNodeFactoryOperations.createNewNode(CONCEPTS.InlineRegexpExpression$Am, null));
    }
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept UnaryRegexp$Nw = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11174c678adL, "jetbrains.mps.baseLanguage.regexp.structure.UnaryRegexp");
    /*package*/ static final SConcept LookRegexp$cd = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1118de32185L, "jetbrains.mps.baseLanguage.regexp.structure.LookRegexp");
    /*package*/ static final SConcept ParensRegexp$KC = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x111752101b0L, "jetbrains.mps.baseLanguage.regexp.structure.ParensRegexp");
    /*package*/ static final SConcept MatchParensRegexp$Ea = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x111797946c7L, "jetbrains.mps.baseLanguage.regexp.structure.MatchParensRegexp");
    /*package*/ static final SConcept Regexp$aA = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11174a06efdL, "jetbrains.mps.baseLanguage.regexp.structure.Regexp");
    /*package*/ static final SConcept SymbolClassRegexp$IA = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11178e2916aL, "jetbrains.mps.baseLanguage.regexp.structure.SymbolClassRegexp");
    /*package*/ static final SConcept InlineRegexpExpression$Am = MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1117648961dL, "jetbrains.mps.baseLanguage.regexp.structure.InlineRegexpExpression");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink regexp$$Nis = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11174c678adL, 0x11174c6961aL, "regexp");
    /*package*/ static final SContainmentLink regexp$a3MD = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1118de32185L, 0x1118de377b8L, "regexp");
    /*package*/ static final SContainmentLink expr$EXG0 = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x111752101b0L, 0x1117521177bL, "expr");
    /*package*/ static final SContainmentLink regexp$G7fG = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x111797946c7L, 0x111797ac579L, "regexp");
    /*package*/ static final SContainmentLink left$41WX = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11174c56bf9L, 0x11174c59241L, "left");
    /*package*/ static final SContainmentLink part$$2oq = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x11178e2916aL, 0x11179171739L, "part");
    /*package*/ static final SContainmentLink regexp$uW0J = MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1117ecbc07aL, 0x1117ecc427cL, "regexp");
  }
}
