use of com.dat3m.ui.editor.Editor in project Dat3M by hernanponcedeleon.
the class Dat3M method runTest.
private void runTest() {
UiOptions options = optionsPane.getOptions();
testResult = null;
try {
Editor programEditor = editorsPane.getEditor(EditorCode.PROGRAM);
Program program = new ProgramParser().parse(programEditor.getEditorPane().getText(), programEditor.getLoadedFormat());
try {
Wmm targetModel = new ParserCat().parse(editorsPane.getEditor(EditorCode.TARGET_MM).getEditorPane().getText());
testResult = new ReachabilityResult(program, targetModel, options);
} catch (Exception e) {
String msg = e.getMessage() == null ? "Memory model cannot be parsed" : e.getMessage();
showError(msg, "Target memory model error");
}
} catch (Exception e) {
String msg = e.getMessage() == null ? "Program cannot be parsed" : e.getMessage();
Throwable cause = e.getCause();
if (cause instanceof InputMismatchException) {
Token token = ((InputMismatchException) cause).getOffendingToken();
msg = "Problem with \"" + token.getText() + "\" at line " + token.getLine();
}
showError(msg, "Program error");
}
}
Aggregations