use of org.absmodels.abs.plugin.internal.NoModelException in project abstools by abstools.
the class AbsNature method typeCheckModel.
/**
* takes the properties from the project preference store for location type checking and location type precision. Typeckecks
* the current model in the current model builder.
* Note that your model must be sufficiently "complete" and not have any semantic errors .
* @param monitor
* @throws CoreException {@link IResource#deleteMarkers(String, boolean, int)} does not handle exceptions thrown by
* #createMarker(SemanticError) and #createMarker(TypecheckInternalException)
*/
void typeCheckModel(IProgressMonitor monitor) throws CoreException {
getProject().deleteMarkers(TYPECHECK_MARKER_TYPE, true, IResource.DEPTH_INFINITE);
getProject().deleteMarkers(LOCATION_TYPE_INFERENCE_MARKER_TYPE, true, IResource.DEPTH_INFINITE);
boolean dolocationtypecheck = getProjectPreferenceStore().getBoolean(LOCATION_TYPECHECK);
String defaultlocationtype = getProjectPreferenceStore().getString(DEFAULT_LOCATION_TYPE);
String defaultlocationtypeprecision = getProjectPreferenceStore().getString(LOCATION_TYPE_PRECISION);
boolean checkProducts = getProjectPreferenceStore().getBoolean(PRODUCT_TYPECHECK);
try {
addPackagesForTypeChecking();
final SemanticConditionList typeerrors = modelbuilder.typeCheckModel(monitor, dolocationtypecheck, defaultlocationtype, defaultlocationtypeprecision, checkProducts);
createMarkers(typeerrors);
if (dolocationtypecheck) {
createLocationTypeInferenceMarker();
}
} catch (NoModelException e) {
// ignore
return;
} catch (TypecheckInternalException e) {
/* Internal error caught. Log, and turn into an error marker */
Activator.logException(e);
createMarker(e);
return;
}
}
Aggregations