Commit d8cc45e9 authored by Sarah Grebing's avatar Sarah Grebing

minor bug fix

parent 3722b8cb
......@@ -232,6 +232,7 @@ public class DebuggerMainWindowController implements Initializable {
});
pc.executeScript(this.debugMode.get());
model.currentSelectedGoalNodeProperty().bind(pc.currentSelectedGoalProperty());
model.currentGoalNodesProperty().bind(pc.currentGoalsProperty());
pc.startHighlightPositionPropertyProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.getLineNumber() > -1) {
......
......@@ -39,11 +39,14 @@ public class PuppetMaster {
private Visitor<Void> exitListener = new ExitListener();
public PuppetMaster() {
}
public PuppetMaster(Interpreter<KeyData> inter) {
install(puppet);
}
public SimpleObjectProperty<List<GoalNode<KeyData>>> currentGoalsProperty() {
return currentGoals;
}
public HistoryListener getHistoryLogger() {
return historyLogger;
}
......
......@@ -38,6 +38,7 @@ public class InterpretingService extends Service<State<KeyData>> {
@Override
protected void succeeded() {
System.out.println("Finished executing");
updateView();
}
......
......@@ -36,6 +36,9 @@ public class MacroCommandHandler implements CommandHandler {
CallStatement call,
VariableAssignment params) {
//ProofMacro m = macros.get(call.getCommand());
macros.forEach((k, v) -> {
System.out.println(k);
});
Parameters p = new Parameters();
p.put(new Variable("#2"), new StringLiteral(call.getCommand()));
CallStatement macroCall = new CallStatement("macro", p);
......
......@@ -8,6 +8,7 @@ import edu.kit.formal.interpreter.data.KeyData;
import edu.kit.formal.interpreter.data.State;
import edu.kit.formal.proofscriptparser.ast.Position;
import edu.kit.formal.proofscriptparser.ast.ProofScript;
import javafx.application.Platform;
import javafx.beans.property.ListProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.SimpleListProperty;
......@@ -102,7 +103,11 @@ public class ProofTreeController {
//get state from blocker, who communicates with interpreter
this.currentSelectedGoal.bindBidirectional(blocker.currentSelectedGoalProperty());
blocker.currentGoalsProperty().addListener((observable, oldValue, newValue) -> {
Platform.runLater(() -> {
this.setCurrentGoals(newValue);
});
});
//add listener to nextcomputed node, that is updated whenever a new node is added to the stategraph
nextComputedNode.addListener((observable, oldValue, newValue) -> {
//update statepointer
......
......@@ -5,6 +5,7 @@ import com.google.common.graph.MutableValueGraph;
import com.google.common.graph.ValueGraphBuilder;
import edu.kit.formal.interpreter.Interpreter;
import edu.kit.formal.interpreter.NodeAddedEvent;
import edu.kit.formal.interpreter.data.GoalNode;
import edu.kit.formal.interpreter.data.KeyData;
import edu.kit.formal.interpreter.data.State;
import edu.kit.formal.interpreter.exceptions.StateGraphException;
......@@ -274,6 +275,20 @@ public class StateGraphWrapper {
}
public PTreeNode getNode(List<GoalNode<KeyData>> newValue) {
Iterator<Map.Entry<ASTNode, PTreeNode>> iterator = addedNodes.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<ASTNode, PTreeNode> next = iterator.next();
PTreeNode value = next.getValue();
if (value.getState().getGoals().equals(newValue)) {
return value;
}
}
return null;
}
private class EntryListener extends DefaultASTVisitor<Void> {
@Override
public Void visit(ProofScript proofScript) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment