Commit a6919087 authored by Sarah Grebing's avatar Sarah Grebing

interim

parent a559e78e
...@@ -14,5 +14,8 @@ public class RigidRuleCommandHandler implements CommandHandler<KeyData> { ...@@ -14,5 +14,8 @@ public class RigidRuleCommandHandler implements CommandHandler<KeyData> {
@Override @Override
public void evaluate(Interpreter<KeyData> interpreter, CallStatement call, VariableAssignment params) { public void evaluate(Interpreter<KeyData> interpreter, CallStatement call, VariableAssignment params) {
// Evaluator evaluator = new Evaluator(g.getAssignments(), g);
// evaluator.setMatcher(interpreter.getMatcherApi());
//taclet.getExecutor().apply(env.getLoadedProof().root(), env.getServices());
} }
} }
package edu.kit.iti.formal.psdbg.interpreter; package edu.kit.iti.formal.psdbg.interpreter;
import edu.kit.iti.formal.psdbg.interpreter.data.GoalNode; import edu.kit.iti.formal.psdbg.interpreter.data.GoalNode;
import edu.kit.iti.formal.psdbg.parser.ast.*;
import edu.kit.iti.formal.psdbg.parser.data.Value;
import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment; import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor; import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import edu.kit.iti.formal.psdbg.parser.ast.Operator; import edu.kit.iti.formal.psdbg.parser.ast.*;
import edu.kit.iti.formal.psdbg.parser.data.Value;
import edu.kit.iti.formal.psdbg.parser.types.SimpleType; import edu.kit.iti.formal.psdbg.parser.types.SimpleType;
import edu.kit.iti.formal.psdbg.parser.types.TermType; import edu.kit.iti.formal.psdbg.parser.types.TermType;
import edu.kit.iti.formal.psdbg.parser.types.TypeFacade; import edu.kit.iti.formal.psdbg.parser.types.TypeFacade;
...@@ -67,6 +66,7 @@ public class Evaluator<T> extends DefaultASTVisitor<Value> implements ScopeObser ...@@ -67,6 +66,7 @@ public class Evaluator<T> extends DefaultASTVisitor<Value> implements ScopeObser
*/ */
@Override @Override
public Value visit(MatchExpression match) { public Value visit(MatchExpression match) {
enterScope(match);
if (match.getSignature() != null && !match.getSignature().isEmpty()) { if (match.getSignature() != null && !match.getSignature().isEmpty()) {
throw new IllegalStateException("not supported"); throw new IllegalStateException("not supported");
} }
...@@ -81,7 +81,7 @@ public class Evaluator<T> extends DefaultASTVisitor<Value> implements ScopeObser ...@@ -81,7 +81,7 @@ public class Evaluator<T> extends DefaultASTVisitor<Value> implements ScopeObser
} }
} }
exitScope(match);
return va != null && va.size() > 0 ? Value.TRUE : Value.FALSE; return va != null && va.size() > 0 ? Value.TRUE : Value.FALSE;
} }
......
...@@ -266,10 +266,12 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -266,10 +266,12 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
@Override @Override
public Object visit(SimpleCaseStatement simpleCaseStatement) { public Object visit(SimpleCaseStatement simpleCaseStatement) {
Expression matchExpression = simpleCaseStatement.getGuard(); Expression matchExpression = simpleCaseStatement.getGuard();
State<T> currentStateToMatch = peekState(); State<T> currentStateToMatch = peekState();
GoalNode<T> selectedGoal = currentStateToMatch.getSelectedGoalNode(); GoalNode<T> selectedGoal = currentStateToMatch.getSelectedGoalNode();
VariableAssignment va = evaluateMatchInGoal(matchExpression, selectedGoal); VariableAssignment va = evaluateMatchInGoal(matchExpression, selectedGoal);
if (va != null) { if (va != null) {
enterScope(simpleCaseStatement); enterScope(simpleCaseStatement);
executeBody(simpleCaseStatement.getBody(), selectedGoal, va); executeBody(simpleCaseStatement.getBody(), selectedGoal, va);
......
...@@ -71,16 +71,19 @@ public class StateGraphWrapper<T> { ...@@ -71,16 +71,19 @@ public class StateGraphWrapper<T> {
private ControlFlowVisitor cfgVisitor; private ControlFlowVisitor cfgVisitor;
private EntryListener entryListener = new EntryListener(); private EntryListener entryListener = new EntryListener();
private ExitListener exitListener = new ExitListener(); private ExitListener exitListener = new ExitListener();
private ProofScript mainScript; private ProofScript mainScript;
/** /**
* Creates a new state graph and adds the root node with the root state * Creates a new state graph and adds the root node with the root state
* * @param inter
* @param inter
* @param mainScript * @param mainScript
* @param cfgVisitor * @param cfgVisitor
*
*/ */
public StateGraphWrapper(Interpreter<T> inter, ProofScript mainScript, ControlFlowVisitor cfgVisitor) { public StateGraphWrapper(Interpreter<T> inter, ProofScript mainScript, ControlFlowVisitor cfgVisitor) {
stateGraph = ValueGraphBuilder.directed().build(); stateGraph = ValueGraphBuilder.directed().build();
...@@ -106,17 +109,11 @@ public class StateGraphWrapper<T> { ...@@ -106,17 +109,11 @@ public class StateGraphWrapper<T> {
return lastNode; return lastNode;
} }
public void setUpGraph() {
//create empty graph
stateGraph = ValueGraphBuilder.directed().build();
}
//careful TODO look for right edges //careful TODO look for right edges
//TODO handle endpoint of graph //TODO handle endpoint of graph
public PTreeNode<T> getStepOver(PTreeNode statePointer) { public PTreeNode<T> getStepOver(PTreeNode statePointer) {
if (statePointer == null) { if (statePointer == null) {
LOGGER.info("Stepover requested for null, therefore returning root"); LOGGER.info("Stepover requested for null, therefore returning root");
return this.rootProperty().get(); return this.rootProperty().get();
...@@ -126,6 +123,7 @@ public class StateGraphWrapper<T> { ...@@ -126,6 +123,7 @@ public class StateGraphWrapper<T> {
Set<PTreeNode<T>> successors = this.stateGraph.successors(statePointer); Set<PTreeNode<T>> successors = this.stateGraph.successors(statePointer);
//if there are no successors they have to be computed therefore return null, to trigger the proof tree controller //if there are no successors they have to be computed therefore return null, to trigger the proof tree controller
if (successors.isEmpty()) { if (successors.isEmpty()) {
return null; return null;
} else { } else {
//if there are successors we want those which are connetced with State-Flow //if there are successors we want those which are connetced with State-Flow
...@@ -227,19 +225,13 @@ public class StateGraphWrapper<T> { ...@@ -227,19 +225,13 @@ public class StateGraphWrapper<T> {
private Void createNewNode(ASTNode node, boolean isCasesStmt) { private Void createNewNode(ASTNode node, boolean isCasesStmt) {
LOGGER.info("Creating Node for State graph with statement {}@{}", node.getNodeName(), node.getStartPosition()); LOGGER.info("Creating Node for State graph with statement {}@{}", node.getNodeName(), node.getStartPosition());
//save old pointer of last node //save old pointer of last node
//State<T> lastState = lastNode.getState();
State<T> lastState; State<T> lastState;
// if(lastNode.getExtendedState().getStateAfterStmt() != null) {
// lastState = lastNode.getExtendedState().getStateAfterStmt().copy();
// }else{
lastState = currentInterpreter.getCurrentState().copy(); lastState = currentInterpreter.getCurrentState().copy();
// }
//create a new ProofTreeNode in graph with ast node as parameter //create a new ProofTreeNode in graph with ast node as parameter
PTreeNode<T> newStateNode = new PTreeNode<>(node); PTreeNode<T> newStateNode = new PTreeNode<>(node);
newStateNode.setContext(lastNode.getContext()); newStateNode.setContext(lastNode.getContext());
//get the state before executing ast node to save it to the extended state //get the state before executing ast node to save it to the extended state
//State<T> currentState = currentInterpreter.getCurrentState().copy();
InterpreterExtendedState<T> extState; InterpreterExtendedState<T> extState;
if (isCasesStmt) { if (isCasesStmt) {
...@@ -284,12 +276,12 @@ public class StateGraphWrapper<T> { ...@@ -284,12 +276,12 @@ public class StateGraphWrapper<T> {
} }
private void fireNodeAdded(NodeAddedEvent nodeAddedEvent) { private void fireNodeAdded(NodeAddedEvent nodeAddedEvent) {
counter++; //counter++;
System.out.println("XXXXXXXXXX counter = " + counter); //System.out.println("XXXXXXXXXX counter = " + counter);
changeListeners.forEach(list -> Platform.runLater(() -> { changeListeners.forEach(list -> Platform.runLater(() -> {
list.graphChanged(nodeAddedEvent); list.graphChanged(nodeAddedEvent);
//TODO //TODO
LOGGER.info("New StateGraphChange \n%%%%%%" + this.asdot() + "\n%%%%%%%"); // LOGGER.info("New StateGraphChange \n%%%%%%" + this.asdot() + "\n%%%%%%%");
})); }));
} }
...@@ -309,11 +301,8 @@ public class StateGraphWrapper<T> { ...@@ -309,11 +301,8 @@ public class StateGraphWrapper<T> {
this.root.set(root); this.root.set(root);
} }
private void fireStateAdded(StateAddedEvent stateAddedEvent) { private Void addState(ASTNode node) {
changeListeners.forEach(list -> Platform.runLater(() -> { return addState(node, true);
list.graphChanged(stateAddedEvent);
LOGGER.debug("New StateGraphChange " + this.asdot());
}));
} }
public void addChangeListener(GraphChangedListener listener) { public void addChangeListener(GraphChangedListener listener) {
...@@ -385,7 +374,7 @@ public class StateGraphWrapper<T> { ...@@ -385,7 +374,7 @@ public class StateGraphWrapper<T> {
return sb.toString(); return sb.toString();
} }
private Void addState(ASTNode node) { private Void addState(ASTNode node, boolean fireStateAdded) {
LOGGER.info("Adding a new state for statement {}@{}", node.getNodeName(), node.getStartPosition()); LOGGER.info("Adding a new state for statement {}@{}", node.getNodeName(), node.getStartPosition());
//get node from addedNodes Map //get node from addedNodes Map
PTreeNode<T> newStateNode = addedNodes.get(node); PTreeNode<T> newStateNode = addedNodes.get(node);
...@@ -405,11 +394,20 @@ public class StateGraphWrapper<T> { ...@@ -405,11 +394,20 @@ public class StateGraphWrapper<T> {
newStateNode.getContext().pop(); newStateNode.getContext().pop();
} }
} }
fireStateAdded(new StateAddedEvent(newStateNode, currentState, newStateNode.getExtendedState())); if (fireStateAdded) {
fireStateAdded(new StateAddedEvent(newStateNode, currentState, newStateNode.getExtendedState()));
}
LOGGER.debug("Extended state for {} updated with {} \n", node.getStartPosition(), newStateNode.getExtendedState().toString()); LOGGER.debug("Extended state for {} updated with {} \n", node.getStartPosition(), newStateNode.getExtendedState().toString());
return null; return null;
} }
private void fireStateAdded(StateAddedEvent stateAddedEvent) {
changeListeners.forEach(list -> Platform.runLater(() -> {
list.graphChanged(stateAddedEvent);
// LOGGER.debug("New StateGraphChange " + this.asdot());
}));
}
private class EntryListener extends DefaultASTVisitor<Void> { private class EntryListener extends DefaultASTVisitor<Void> {
@Override @Override
public Void visit(ProofScript proofScript) { public Void visit(ProofScript proofScript) {
...@@ -460,6 +458,11 @@ public class StateGraphWrapper<T> { ...@@ -460,6 +458,11 @@ public class StateGraphWrapper<T> {
return createNewNode(repeatStatement); return createNewNode(repeatStatement);
} }
@Override
public Void visit(MatchExpression matchExpression) {
return createNewNode(matchExpression);
}
@Override @Override
public Void visit(TryCase tryCase) { public Void visit(TryCase tryCase) {
return createNewNode(tryCase); return createNewNode(tryCase);
...@@ -488,14 +491,19 @@ public class StateGraphWrapper<T> { ...@@ -488,14 +491,19 @@ public class StateGraphWrapper<T> {
return addState(assignment); return addState(assignment);
} }
/* @Override @Override
public Void visit(ProofScript proofScript) {
return addState(proofScript, false);
}
@Override
public Void visit(CasesStatement casesStatement) { public Void visit(CasesStatement casesStatement) {
return addState(casesStatement); return addState(casesStatement, false);
} }
*/
/*@Override /*@Override
public Void visit(CaseStatement caseStatement) { public Void visit(CaseStatement caseStatement) {
return addState(caseStatement); return addState(caseStatement, false);
}*/ }*/
@Override @Override
...@@ -529,20 +537,17 @@ public class StateGraphWrapper<T> { ...@@ -529,20 +537,17 @@ public class StateGraphWrapper<T> {
return addState(tryCase); return addState(tryCase);
} }
/* @Override @Override
public Void visit(SimpleCaseStatement simpleCaseStatement) { public Void visit(SimpleCaseStatement simpleCaseStatement) {
return addState(simpleCaseStatement); return addState(simpleCaseStatement, false);
}*/ }
@Override @Override
public Void visit(ClosesCase closesCase) { public Void visit(ClosesCase closesCase) {
return addState(closesCase); return addState(closesCase);
} }
/* @Override
public Void visit(ProofScript proofScript) {
return addState(proofScript);
}*/
} }
} }
...@@ -22,6 +22,9 @@ public class InterpretingService extends Service<State<KeyData>> { ...@@ -22,6 +22,9 @@ public class InterpretingService extends Service<State<KeyData>> {
* The interpreter (with the appropriate KeY state) that is used to traverse and execute the script * The interpreter (with the appropriate KeY state) that is used to traverse and execute the script
*/ */
private final SimpleObjectProperty<Interpreter<KeyData>> interpreter = new SimpleObjectProperty<>(); private final SimpleObjectProperty<Interpreter<KeyData>> interpreter = new SimpleObjectProperty<>();
/**
* Statusbar for indication of progress
*/
private DebuggerStatusBar statusBar; private DebuggerStatusBar statusBar;
/** /**
...@@ -99,6 +102,7 @@ public class InterpretingService extends Service<State<KeyData>> { ...@@ -99,6 +102,7 @@ public class InterpretingService extends Service<State<KeyData>> {
protected edu.kit.iti.formal.psdbg.interpreter.data.State<KeyData> call() throws Exception { protected edu.kit.iti.formal.psdbg.interpreter.data.State<KeyData> call() throws Exception {
if (statusBar != null) { if (statusBar != null) {
statusBar.indicateProgress(); statusBar.indicateProgress();
statusBar.publishMessage("Interpreting " + ast.getName());
} }
i.interpret(ast); i.interpret(ast);
return i.peekState(); return i.peekState();
......
...@@ -172,6 +172,7 @@ public class DebuggerMain implements Initializable { ...@@ -172,6 +172,7 @@ public class DebuggerMain implements Initializable {
private void marriageProofTreeControllerWithActiveInspectionView() { private void marriageProofTreeControllerWithActiveInspectionView() {
InspectionModel imodel = getInspectionViewsController().getActiveInspectionViewTab().getModel(); InspectionModel imodel = getInspectionViewsController().getActiveInspectionViewTab().getModel();
//set all listeners //set all listeners
proofTreeController.currentGoalsProperty().addListener((o, old, fresh) -> { proofTreeController.currentGoalsProperty().addListener((o, old, fresh) -> {
if (fresh != null) { if (fresh != null) {
...@@ -495,24 +496,11 @@ public class DebuggerMain implements Initializable { ...@@ -495,24 +496,11 @@ public class DebuggerMain implements Initializable {
openKeyFile(keyFile); openKeyFile(keyFile);
} }
//endregion
//region Santa's Little Helper
public void openJavaFile() { public void openJavaFile() {
loadJavaFile(); loadJavaFile();
showCodeDock(null); showCodeDock(null);
} }
//endregion
//region Santa's Little Helper
@FXML @FXML
protected void loadJavaFile() { protected void loadJavaFile() {
File javaFile = openFileChooserOpenDialog("Select Java File", "Java Files", "java"); File javaFile = openFileChooserOpenDialog("Select Java File", "Java Files", "java");
......
...@@ -101,6 +101,20 @@ public class ProofTreeController { ...@@ -101,6 +101,20 @@ public class ProofTreeController {
*/ */
private SimpleObjectProperty<ProofScript> mainScript = new SimpleObjectProperty<>(); private SimpleObjectProperty<ProofScript> mainScript = new SimpleObjectProperty<>();
/*public State getBlockerState() {
return blockerState.get();
}
public SimpleObjectProperty<State> blockerStateProperty() {
return blockerState;
}
public void setBlockerState(State blockerState) {
this.blockerState.set(blockerState);
}
*/
// private SimpleObjectProperty<State> blockerState = new SimpleObjectProperty<>();
/** /**
* Add a change listener for the stategraph, whenever a new node is added it receives an event * Add a change listener for the stategraph, whenever a new node is added it receives an event
*/ */
...@@ -111,7 +125,7 @@ public class ProofTreeController { ...@@ -111,7 +125,7 @@ public class ProofTreeController {
if (added.getState() != null) { if (added.getState() != null) {
LOGGER.info("Graph changed with the following PTreeNode: {} and the statepointer points to {}", nodeAddedEvent.getAddedNode(), statePointer); LOGGER.info("Graph changed with the following PTreeNode: {} and the statepointer points to {}", nodeAddedEvent.getAddedNode(), statePointer);
nextComputedNode.setValue(nodeAddedEvent.getAddedNode()); nextComputedNode.setValue(nodeAddedEvent.getAddedNode());
Events.fire(new Events.NewNodeExecuted(nodeAddedEvent.getAddedNode().getScriptstmt())); // Events.fire(new Events.NewNodeExecuted(nodeAddedEvent.getAddedNode().getScriptstmt()));
} }
} }
...@@ -121,7 +135,8 @@ public class ProofTreeController { ...@@ -121,7 +135,8 @@ public class ProofTreeController {
PTreeNode changedNode = stateAddedEvent.getChangedNode(); PTreeNode changedNode = stateAddedEvent.getChangedNode();
LOGGER.info("Graph changed by adding a state to PTreeNode: {} and the statepointer points to {}", stateAddedEvent, statePointer); LOGGER.info("Graph changed by adding a state to PTreeNode: {} and the statepointer points to {}", stateAddedEvent, statePointer);
nextComputedNode.set(changedNode); nextComputedNode.set(changedNode);
Events.fire(new Events.NewNodeExecuted(changedNode.getScriptstmt())); //Events.fire(new Events.NewNodeExecuted(changedNode.getScriptstmt()));
} }
}; };
...@@ -138,34 +153,45 @@ public class ProofTreeController { ...@@ -138,34 +153,45 @@ public class ProofTreeController {
return mainScript; return mainScript;
} }
/** /**
* Create a new ProofTreeController * Create a new ProofTreeController
* and bind properties * and bind properties
*/ */
public ProofTreeController() { public ProofTreeController() {
blocker.currentStateProperty().addListener((observable, oldValue, newValue) -> {
/* blocker.currentStateProperty().addListener((observable, oldValue, newValue) -> {
//setNewState(newValue);
setBlockerState(newValue);
LOGGER.info("The state in the Puppetmaster changed to " + newValue.toString()); LOGGER.info("The state in the Puppetmaster changed to " + newValue.toString());
}); });*/
//add listener to nextcomputed node, that is updated whenever a new node is added to the stategraph //add listener to nextcomputed node, that is updated whenever a new node is added to the stategraph
nextComputedNode.addListener((observable, oldValue, newValue) -> { nextComputedNode.addListener((observable, oldValue, newValue) -> {
//update statepointer //update statepointer
if (newValue != null) { if (newValue != null) {
LOGGER.info("New node {} was computed and the statepointer was set to {}", newValue.getScriptstmt(), newValue); LOGGER.info("New node {} was computed and the statepointer was set to {}", newValue.getScriptstmt(), newValue);
this.statePointer = newValue; this.statePointer = newValue;
//setNewState(blocker.currentStateProperty().get());
setNewState(newValue.getState()); setNewState(newValue.getState());
} }
}); });
} }
/** /**
* Sets the properties that may notify GUI about statechanges with new state values * Sets the properties that may notify GUI about statechanges with new state values
* * CurrentGoalsProperty and SelectedGoal are both listened by InspectionViewModel
* @param state * @param state
*/ */
private void setNewState(State<KeyData> state) { private void setNewState(State<KeyData> state) {
LOGGER.info("Setting new State " + state.toString()); LOGGER.info("Setting new State " + state.toString());
//Statepointer null wenn anfangszustand? //Statepointer null wenn anfangszustand?
if (statePointer != null && state != null) { if (statePointer != null && state != null) {
...@@ -191,6 +217,7 @@ public class ProofTreeController { ...@@ -191,6 +217,7 @@ public class ProofTreeController {
throw new RuntimeException("The state pointer was null when setting new state"); throw new RuntimeException("The state pointer was null when setting new state");
} }
} }
//TODO handle endpoint //TODO handle endpoint
...@@ -223,7 +250,11 @@ public class ProofTreeController { ...@@ -223,7 +250,11 @@ public class ProofTreeController {
} }
//get next node //get next node
PTreeNode<KeyData> nextNode = stateGraphWrapper.getStepOver(currentPointer); PTreeNode<KeyData> nextNode = stateGraphWrapper.getStepOver(currentPointer);
//if nextnode is null ask interpreter to execute next statement and compute next state //if nextnode is null ask interpreter to execute next statement and compute next state
if (nextNode != null) {
setCurrentHighlightNode(nextNode.getScriptstmt());
}
if (nextNode != null && nextNode.getExtendedState().getStateAfterStmt() != null) { if (nextNode != null && nextNode.getExtendedState().getStateAfterStmt() != null) {
PTreeNode<KeyData> lastNode = this.statePointer; PTreeNode<KeyData> lastNode = this.statePointer;
...@@ -297,17 +328,20 @@ public class ProofTreeController { ...@@ -297,17 +328,20 @@ public class ProofTreeController {
blocker.deinstall(); blocker.deinstall();
blocker.install(currentInterpreter); blocker.install(currentInterpreter);
statusBar.setText("Starting in debug mode for script " + mainScript.getName()); statusBar.setText("Starting to interpret script " + mainScript.getName());
statusBar.indicateProgress(); statusBar.indicateProgress();
setCurrentHighlightNode(mainScript.get()); setCurrentHighlightNode(mainScript.get());
//build CFG //build CFG
buildControlFlowGraph(mainScript.get()); buildControlFlowGraph(mainScript.get());
//build StateGraph statusBar.publishMessage("Controlflow graph ws build");
this.stateGraphWrapper = new StateGraphWrapper<>(currentInterpreter, mainScript.get(), this.controlFlowGraphVisitor);
//build StateGraph
this.stateGraphWrapper = new StateGraphWrapper(currentInterpreter, mainScript.get(), this.controlFlowGraphVisitor);
this.stateGraphWrapper.install(currentInterpreter); this.stateGraphWrapper.install(currentInterpreter);
this.stateGraphWrapper.addChangeListener(graphChangedListener); this.stateGraphWrapper.addChangeListener(graphChangedListener);
statusBar.publishMessage("Stategraph was set up");
statusBar.stopProgress(); statusBar.stopProgress();
//create interpreter service and start //create interpreter service and start
...@@ -322,6 +356,7 @@ public class ProofTreeController { ...@@ -322,6 +356,7 @@ public class ProofTreeController {
interpreterService.start(); interpreterService.start();
interpreterService.setOnSucceeded(event -> { interpreterService.setOnSucceeded(event -> {
statusBar.setText("Executed until end of script."); statusBar.setText("Executed until end of script.");
System.out.println("Number of Goals " + currentGoals.get().size());
//TODO is this the right position?? //TODO is this the right position??
if (currentGoals.isEmpty()) { if (currentGoals.isEmpty()) {
...@@ -344,7 +379,7 @@ public class ProofTreeController { ...@@ -344,7 +379,7 @@ public class ProofTreeController {
this.controlFlowGraphVisitor = new ControlFlowVisitor(currentInterpreter.getFunctionLookup()); this.controlFlowGraphVisitor = new ControlFlowVisitor(currentInterpreter.getFunctionLookup());
mainScript.accept(controlFlowGraphVisitor); mainScript.accept(controlFlowGraphVisitor);
this.setMainScript(mainScript); this.setMainScript(mainScript);
System.out.println("CFG\n" + controlFlowGraphVisitor.asdot()); LOGGER.debug("CFG\n" + controlFlowGraphVisitor.asdot());
} }
......
...@@ -3,7 +3,6 @@ package edu.kit.iti.formal.psdbg.gui.controller; ...@@ -3,7 +3,6 @@ package edu.kit.iti.formal.psdbg.gui.controller;
import edu.kit.iti.formal.psdbg.interpreter.HistoryListener; import edu.kit.iti.formal.psdbg.interpreter.HistoryListener;
import edu.kit.iti.formal.psdbg.interpreter.Interpreter; import edu.kit.iti.formal.psdbg.interpreter.Interpreter;
import edu.kit.iti.formal.psdbg.interpreter.KeyInterpreter; import edu.kit.iti.formal.psdbg.interpreter.KeyInterpreter;
import edu.kit.iti.formal.psdbg.interpreter.data.GoalNode;
import edu.kit.iti.formal.psdbg.interpreter.data.KeyData; import edu.kit.iti.formal.psdbg.interpreter.data.KeyData;
import edu.kit.iti.formal.psdbg.interpreter.data.State; import edu.kit.iti.formal.psdbg.interpreter.data.State;
import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor; import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor;
...@@ -13,7 +12,6 @@ import javafx.application.Platform; ...@@ -13,7 +12,6 @@ import javafx.application.Platform;
import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleObjectProperty;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
...@@ -30,8 +28,8 @@ public class PuppetMaster { ...@@ -30,8 +28,8 @@ public class PuppetMaster {
/** /**
* Properties that are changed, when new states are added using the blocker * Properties that are changed, when new states are added using the blocker
*/ */
private final SimpleObjectProperty<List<GoalNode<KeyData>>> currentGoals = new SimpleObjectProperty<>(); //private final SimpleObjectProperty<List<GoalNode<KeyData>>> currentGoals = new SimpleObjectProperty<>();
private final SimpleObjectProperty<GoalNode<KeyData>> currentSelectedGoal = new SimpleObjectProperty<>(); //private final SimpleObjectProperty<GoalNode<KeyData>> currentSelectedGoal = new SimpleObjectProperty<>();
private final SimpleObjectProperty<State<KeyData>> currentState = new SimpleObjectProperty<>(); private final SimpleObjectProperty<State<KeyData>> currentState = new SimpleObjectProperty<>();
...@@ -46,6 +44,8 @@ public class PuppetMaster { ...@@ -46,6 +44,8 @@ public class PuppetMaster {