package jetbrains.mps.kotlin.dataFlow;

/*Generated by MPS */

import jetbrains.mps.lang.dataFlow.DataFlowBuilder;
import jetbrains.mps.lang.dataFlow.DataFlowBuilderContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SConcept;

public class ContinueExpression_DataFlow extends DataFlowBuilder {
  public void build(final DataFlowBuilderContext _context) {
    // TODO proper loop abstraction
    if ((SLinkOperations.getTarget(_context.getNode(), LINKS.targetLabel$iS7r) != null)) {
      _context.getBuilder().emitJump(_context.getBuilder().before(SLinkOperations.getTarget(_context.getNode(), LINKS.targetLabel$iS7r)), "r:08ab5e45-1c79-495b-9ba5-962c1dd58af6(jetbrains.mps.kotlin.dataFlow)/6374444830330706632");
    } else {
      SNode loopAncestor = SNodeOperations.getNodeAncestor(_context.getNode(), CONCEPTS.AbstractConditionalLoop$w2, false, false);
      if (loopAncestor != null) {
        _context.getBuilder().emitJump(_context.getBuilder().before(loopAncestor), "r:08ab5e45-1c79-495b-9ba5-962c1dd58af6(jetbrains.mps.kotlin.dataFlow)/1206465288371");
      } else {
        _context.getBuilder().emitNop("r:08ab5e45-1c79-495b-9ba5-962c1dd58af6(jetbrains.mps.kotlin.dataFlow)/1409563270992122147");
      }
    }
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink targetLabel$iS7r = MetaAdapterFactory.getReferenceLink(0x6b3888c1980244d8L, 0x8baff8e6c33ed689L, 0x11400bb790af2908L, 0x11400bb790af2909L, "targetLabel");
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept AbstractConditionalLoop$w2 = MetaAdapterFactory.getConcept(0x6b3888c1980244d8L, 0x8baff8e6c33ed689L, 0x47de42ea4e1d0294L, "jetbrains.mps.kotlin.structure.AbstractConditionalLoop");
  }
}
