Search in sources :

Example 1 with TypeSystemExtension

use of org.abs_models.frontend.typechecker.ext.TypeSystemExtension in project abstools by abstools.

the class LocationTypeInferenceExtension method finished.

@Override
public void finished() {
    ConstraintSolver solver = new ConstraintSolver(constraints, debug);
    results = solver.solve();
    if (debug) {
        for (Map.Entry<LocationTypeVar, LocationType> e : results.entrySet()) {
            System.out.println("" + e.getKey() + " := " + e.getValue());
        }
    }
    if (!errors.containsErrors()) {
        SemanticConditionList sel = new SemanticConditionList();
        List<TypeSystemExtension> exts = model.getTypeExt().getTypeSystemExtensionList();
        model.getTypeExt().clearTypeSystemExtensions();
        LocationTypeExtension lte = new LocationTypeExtension(model, results);
        lte.setDefaultType(defaultType);
        model.getTypeExt().register(lte);
        model.typeCheck(sel);
        errors.addAll(sel);
        model.getTypeExt().clearTypeSystemExtensions();
        model.getTypeExt().registerAll(exts);
    }
}
Also used : SemanticConditionList(org.abs_models.frontend.analyser.SemanticConditionList) Map(java.util.Map) DefaultTypeSystemExtension(org.abs_models.frontend.typechecker.ext.DefaultTypeSystemExtension) TypeSystemExtension(org.abs_models.frontend.typechecker.ext.TypeSystemExtension)

Aggregations

Map (java.util.Map)1 SemanticConditionList (org.abs_models.frontend.analyser.SemanticConditionList)1 DefaultTypeSystemExtension (org.abs_models.frontend.typechecker.ext.DefaultTypeSystemExtension)1 TypeSystemExtension (org.abs_models.frontend.typechecker.ext.TypeSystemExtension)1