Search in sources :

Example 1 with UiOptions

use of com.dat3m.ui.utils.UiOptions 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");
    }
}
Also used : ReachabilityResult(com.dat3m.ui.result.ReachabilityResult) Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Wmm(com.dat3m.dartagnan.wmm.Wmm) UiOptions(com.dat3m.ui.utils.UiOptions) Token(org.antlr.v4.runtime.Token) ParserCat(com.dat3m.dartagnan.parsers.cat.ParserCat) Editor(com.dat3m.ui.editor.Editor) InputMismatchException(org.antlr.v4.runtime.InputMismatchException) InputMismatchException(org.antlr.v4.runtime.InputMismatchException)

Example 2 with UiOptions

use of com.dat3m.ui.utils.UiOptions in project Dat3M by hernanponcedeleon.

the class OptionsPane method getOptions.

public UiOptions getOptions() {
    int bound = Integer.parseInt(boundField.getText());
    int timeout = Integer.parseInt(timeoutField.getText());
    Arch target = (Arch) targetPane.getSelectedItem();
    Method method = (Method) methodPane.getSelectedItem();
    Solvers solver = (Solvers) solverPane.getSelectedItem();
    return new UiOptions(target, method, bound, solver, timeout);
}
Also used : Solvers(org.sosy_lab.java_smt.SolverContextFactory.Solvers) Arch(com.dat3m.dartagnan.configuration.Arch) UiOptions(com.dat3m.ui.utils.UiOptions) Method(com.dat3m.dartagnan.configuration.Method)

Aggregations

UiOptions (com.dat3m.ui.utils.UiOptions)2 Arch (com.dat3m.dartagnan.configuration.Arch)1 Method (com.dat3m.dartagnan.configuration.Method)1 ParserCat (com.dat3m.dartagnan.parsers.cat.ParserCat)1 ProgramParser (com.dat3m.dartagnan.parsers.program.ProgramParser)1 Program (com.dat3m.dartagnan.program.Program)1 Wmm (com.dat3m.dartagnan.wmm.Wmm)1 Editor (com.dat3m.ui.editor.Editor)1 ReachabilityResult (com.dat3m.ui.result.ReachabilityResult)1 InputMismatchException (org.antlr.v4.runtime.InputMismatchException)1 Token (org.antlr.v4.runtime.Token)1 Solvers (org.sosy_lab.java_smt.SolverContextFactory.Solvers)1