private DmdlAnalyzer parse(DmdlSourceRepository source) throws IOException {
assert source != null;
boolean green = true;
DmdlParser parser = new DmdlParser();
DmdlAnalyzer analyzer = new DmdlAnalyzer(
ServiceLoader.load(TypeDriver.class, serviceClassLoader),
ServiceLoader.load(AttributeDriver.class, serviceClassLoader));
int count = 0;
Cursor cursor = source.createCursor();
try {
while (cursor.next()) {
URI name = cursor.getIdentifier();
LOG.info(Messages.getString("AnalyzeTask.monitorParseStarting"), name); //$NON-NLS-1$
Reader resource = cursor.openResource();
try {
AstScript script = parser.parse(resource, name);
for (AstModelDefinition<?> model : script.models) {
LOG.debug(Messages.getString("AnalyzeTask.monitorFoundModel"), model.name); //$NON-NLS-1$
analyzer.addModel(model);
count++;
}
} catch (DmdlSyntaxException e) {
LOG.error(MessageFormat.format(
Messages.getString("AnalyzeTask.monitorParseFailed"), //$NON-NLS-1$