use of org.finos.legend.pure.m3.compiler.validation.Validator in project legend-pure by finos.
the class Validator method validateM3.
public static void validateM3(Iterable<? extends CoreInstance> newInstancesConsolidated, ValidationType validationType, ParserLibrary parserLibrary, InlineDSLLibrary inlineDSLLibrary, Iterable<? extends MatchRunner> additionalValidators, CodeStorage codeStorage, ModelRepository modelRepository, Context context, ProcessorSupport processorSupport) throws PureCompilationException {
// Post Process
Matcher matcher = new Matcher(modelRepository, context, processorSupport);
for (Parser parser : parserLibrary.getParsers()) {
for (MatchRunner parserValidator : parser.getValidators()) {
matcher.addMatchIfTypeIsKnown(parserValidator);
}
}
for (InlineDSL dsl : inlineDSLLibrary.getInlineDSLs()) {
for (MatchRunner dslValidator : dsl.getValidators()) {
matcher.addMatchIfTypeIsKnown(dslValidator);
}
}
for (MatchRunner validator : additionalValidators) {
matcher.addMatchIfTypeIsKnown(validator);
}
ValidatorState validatorState = new ValidatorState(validationType, codeStorage, processorSupport);
for (CoreInstance instance : newInstancesConsolidated) {
validate(instance, validatorState, matcher, processorSupport);
}
}
Aggregations