org.snapscript.compile.validate.ExecutableValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.compile.validate;
import java.util.List;
import org.snapscript.core.Context;
import org.snapscript.core.Module;
import org.snapscript.core.ModuleRegistry;
import org.snapscript.core.ProgramValidator;
import org.snapscript.core.TypeExtractor;
import org.snapscript.core.convert.ConstraintMatcher;
public class ExecutableValidator implements ProgramValidator {
private final ModuleValidator validator;
public ExecutableValidator(ConstraintMatcher matcher, TypeExtractor extractor) {
this.validator = new ModuleValidator(matcher, extractor);
}
@Override
public void validate(Context context) throws Exception {
ModuleRegistry registry = context.getRegistry();
List modules = registry.getModules();
for(Module module : modules) {
validator.validate(module);
}
}
}