package jetbrains.mps.lang.structure.constraints; /*Generated by MPS */ import jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.smodel.runtime.ReferenceScopeProvider; import jetbrains.mps.smodel.runtime.base.BaseScopeProvider; import org.jetbrains.mps.openapi.model.SNodeReference; import jetbrains.mps.scope.Scope; import jetbrains.mps.smodel.IOperationContext; import jetbrains.mps.smodel.runtime.ReferenceConstraintsContext; import jetbrains.mps.smodel.runtime.ConstraintFunction; import jetbrains.mps.smodel.runtime.ConstraintContext_CanBeRoot; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import jetbrains.mps.smodel.runtime.CheckingNodeContext; import org.jetbrains.mps.openapi.model.SModel; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModuleOperations; import jetbrains.mps.smodel.SModelStereotype; import jetbrains.mps.smodel.SNodePointer; public class InterfaceConceptDeclaration_Constraints extends BaseConstraintsDescriptor { public InterfaceConceptDeclaration_Constraints() { super(MetaAdapterFactory.getConcept(0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103556dcafL, "jetbrains.mps.lang.structure.structure.InterfaceConceptDeclaration")); } @Override public boolean hasOwnDefaultScopeProvider() { return true; } @Override public ReferenceScopeProvider getDefaultScopeProvider() { return new BaseScopeProvider() { @Override public SNodeReference getSearchScopeValidatorNode() { return breakingNode_vsd8pt_a0a0a0a0a3; } @Override public Scope createScope(final IOperationContext operationContext, final ReferenceConstraintsContext _context) { return Scopes.forConcepts(_context.getContextNode(), MetaAdapterFactory.getConcept(0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103556dcafL, "jetbrains.mps.lang.structure.structure.InterfaceConceptDeclaration")); } }; } @Override public ConstraintFunction<ConstraintContext_CanBeRoot, Boolean> calculateCanBeRootConstraint() { return new ConstraintFunction<ConstraintContext_CanBeRoot, Boolean>() { @NotNull public Boolean invoke(@NotNull ConstraintContext_CanBeRoot context, @Nullable CheckingNodeContext checkingNodeContext) { boolean result = staticCanBeARoot(context.getModel()); if (!(result) && checkingNodeContext != null) { checkingNodeContext.setBreakingNode(canBeRootBreakingPoint); } return result; } }; } private static boolean staticCanBeARoot(SModel model) { return SModuleOperations.isAspect(model, "structure") || SModelStereotype.isGeneratorModel(model); } private static SNodePointer breakingNode_vsd8pt_a0a0a0a0a3 = new SNodePointer("r:00000000-0000-4000-0000-011c8959028c(jetbrains.mps.lang.structure.constraints)", "6836281137582805227"); private static SNodePointer canBeRootBreakingPoint = new SNodePointer("r:00000000-0000-4000-0000-011c8959028c(jetbrains.mps.lang.structure.constraints)", "1227087672328"); }