check_TheMainConcept_propertyIsTrue_NonTypesystemRule.java

package languageUnderTest.typesystem;

/*Generated by MPS */

import jetbrains.mps.lang.typesystem.runtime.AbstractNonTypesystemRule_Runtime;
import jetbrains.mps.lang.typesystem.runtime.NonTypesystemRule_Runtime;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.typesystem.inference.TypeCheckingContext;
import jetbrains.mps.lang.typesystem.runtime.IsApplicableStatus;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.errors.messageTargets.MessageTarget;
import jetbrains.mps.errors.messageTargets.PropertyMessageTarget;
import jetbrains.mps.errors.IErrorReporter;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import org.jetbrains.mps.openapi.language.SProperty;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SConcept;

public class check_TheMainConcept_propertyIsTrue_NonTypesystemRule extends AbstractNonTypesystemRule_Runtime implements NonTypesystemRule_Runtime {
  public check_TheMainConcept_propertyIsTrue_NonTypesystemRule() {
  }
  public void applyRule(final SNode theMainConcept, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) {
    if (!(SPropertyOperations.getBoolean(theMainConcept, PROPS.mustBeTrue$4aqZ))) {
      {
        final MessageTarget errorTarget = new PropertyMessageTarget(PROPS.mustBeTrue$4aqZ);
        IErrorReporter _reporter_2309309498 = typeCheckingContext.reportTypeError(theMainConcept, "Property must be true", "r:ca08c356-e20f-4373-a12a-9533c1700002(languageUnderTest.typesystem)", "1810720063340967919", null, errorTarget);
      }
    }
  }
  public SAbstractConcept getApplicableConcept() {
    return CONCEPTS.TheMainConcept$lp;
  }
  public IsApplicableStatus isApplicableAndPattern(SNode argument) {
    return new IsApplicableStatus(argument.getConcept().isSubConceptOf(getApplicableConcept()), null);
  }
  public boolean overrides() {
    return false;
  }

  private static final class PROPS {
    /*package*/ static final SProperty mustBeTrue$4aqZ = MetaAdapterFactory.getProperty(0x9de5c73504b24046L, 0xb62685d969c564d9L, 0x1920f84dd31aeb4dL, 0x1920f84dd31aeb50L, "mustBeTrue");
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept TheMainConcept$lp = MetaAdapterFactory.getConcept(0x9de5c73504b24046L, 0xb62685d969c564d9L, 0x1920f84dd31aeb4dL, "languageUnderTest.structure.TheMainConcept");
  }
}