use of abs.frontend.analyser.SemanticCondition in project abstools by abstools.
the class FrontendTest method assertTypeErrors.
protected void assertTypeErrors(String absCode, ErrorMessage expected) {
SemanticCondition e = assertTypeErrors(absCode, EXPECT_TYPE_ERROR, WITH_STD_LIB);
assertEquals(expected, e.msg);
}
use of abs.frontend.analyser.SemanticCondition in project abstools by abstools.
the class FrontendTest method assertWarnings.
protected void assertWarnings(String absCode, ErrorMessage expected) {
SemanticCondition e = assertTypeErrors(absCode, EXPECT_WARNING, WITH_STD_LIB);
assertEquals(expected, e.msg);
}
use of abs.frontend.analyser.SemanticCondition in project abstools by abstools.
the class ABSUnitTestCaseTranslator method validateOutput.
private void validateOutput(Model model, String product) {
Model copy = model.treeCopyNoTransform();
if (product != null) {
try {
copy.flattenForProduct(product);
} catch (Exception e) {
throw new IllegalStateException("Cannot select product " + product, e);
}
}
SemanticConditionList typeerrors = copy.typeCheck();
for (SemanticCondition se : typeerrors) {
System.err.println(se.getHelpMessage());
}
}
use of abs.frontend.analyser.SemanticCondition in project abstools by abstools.
the class TypeCheckerException method getMessage.
private static String getMessage(SemanticConditionList typeErrors) {
StringBuffer result = new StringBuffer("Project contains parse errors: ");
for (SemanticCondition error : typeErrors) {
// TODO: newline doesn't work ):
result.append('\n');
result.append(error.getFileName());
result.append(':');
result.append(error.getLine());
result.append(':');
result.append(error.getColumn());
result.append(' ');
result.append(error.getMessage());
}
return result.toString();
}
use of abs.frontend.analyser.SemanticCondition in project abstools by abstools.
the class Main method typeCheckProductLine.
private void typeCheckProductLine(Model m) {
// int n = m.getFeatureModelConfigurations().size();
int n = m.getProductList().getNumChild();
if (n == 0)
return;
if (verbose) {
System.out.println("Typechecking Software Product Line (" + n + " products)...");
}
SemanticConditionList errors = m.typeCheckPL();
for (SemanticCondition err : errors) {
System.err.println(err.getHelpMessage());
}
}
Aggregations