package jetbrains.mps.lang.smodel.typesystem;

/*Generated by MPS */

import jetbrains.mps.lang.typesystem.runtime. AbstractInferenceRule_Runtime;
import jetbrains.mps.lang.typesystem.runtime. InferenceRule_Runtime;
import org.jetbrains.mps.openapi.model. SNode;
import jetbrains.mps.typesystem.inference. TypeCheckingContext;
import jetbrains.mps.lang.typesystem.runtime. IsApplicableStatus;
import jetbrains.mps.typesystem.inference. EquationInfo;
import org.jetbrains.mps.openapi.language. SAbstractConcept;
import org.jetbrains.mps.openapi.persistence. PersistenceFacade;
import jetbrains.mps.smodel.builder. SNodeBuilder;
import jetbrains.mps.smodel.adapter.structure. MetaAdapterFactory;
import jetbrains.mps.smodel. SReference;
import org.jetbrains.mps.openapi.language. SConcept;

public class typeof_LinkRefExpression_InferenceRule extends AbstractInferenceRule_Runtime implements InferenceRule_Runtime {
  public typeof_LinkRefExpression_InferenceRule() {
  }
  public void applyRule(final SNode expr, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) {
    {
      SNode _nodeToCheck_1029348928467 = expr;
      EquationInfo _info_12389875345 = new EquationInfo(_nodeToCheck_1029348928467, null, "r:00000000-0000-4000-0000-011c895902fe(jetbrains.mps.lang.smodel.typesystem)", "1226359792159", 0, null);
      typeCheckingContext.createEquation((SNode) typeCheckingContext.typeOf(_nodeToCheck_1029348928467, "r:00000000-0000-4000-0000-011c895902fe(jetbrains.mps.lang.smodel.typesystem)", "1226359772983", true), (SNode) _quotation_createNode_ndr3vg_a1a0c0a0b(), _info_12389875345);
    }
  }
  public SAbstractConcept getApplicableConcept() {
    return CONCEPTS.LinkRefExpression$nK;
  }
  public IsApplicableStatus isApplicableAndPattern(SNode argument) {
    return new IsApplicableStatus(argument.getConcept().isSubConceptOf(getApplicableConcept()), null);
  }
  public boolean overrides() {
    return false;
  }
  private static SNode _quotation_createNode_ndr3vg_a1a0c0a0b() {
    PersistenceFacade facade = PersistenceFacade.getInstance();
    SNode quotedNode_1 = null;
    quotedNode_1 = new SNodeBuilder(null, null).init(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, "jetbrains.mps.lang.smodel"), 0x108f968b3caL, "SNodeType")).getResult();
    quotedNode_1.setReference(MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, 0x1090e46ca51L, "concept"), SReference.create(MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, 0x1090e46ca51L, "concept"), quotedNode_1, facade.createModelReference("r:00000000-0000-4000-0000-011c89590292(jetbrains.mps.lang.structure.structure)"), facade.createNodeId("1071489288298")));
    return quotedNode_1;
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept LinkRefExpression$nK = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11d88b27d15L, "jetbrains.mps.lang.smodel.structure. LinkRefExpression");
  }
}
