Commit 0f0c3f8c authored by Sarah Grebing's avatar Sarah Grebing

Delete Temp Files

parent e4dcaaf4
Pipeline #10706 failed with stage
in 2 minutes and 11 seconds
package edu.kit.formal.commands;
import edu.kit.formal.interpreter.State;
import java.util.ArrayList;
import java.util.List;
/**
* AbstractHandler for Chain of Respionsibility
*/
public abstract class CommandHandler {
protected List<CommandHandler> nextList = new ArrayList<>();
public void addNextCommandHandler(CommandHandler cmdHandler) {
this.nextList.add(cmdHandler);
}
public void handle(String commandName) {
for (int i = 0; i < nextList.size(); i++) {
CommandHandler cmdHandler = nextList.get(i);
cmdHandler.handle(commandName);
}
}
protected abstract State processCommand();
}
package edu.kit.formal.commands;
import edu.kit.formal.interpreter.State;
import edu.kit.formal.proofscriptparser.ast.ProofScript;
import java.util.HashMap;
/**
* Created by sarah on 5/17/17.
*/
public class LocalScriptCommandHandler extends CommandHandler {
HashMap<String, ProofScript> localScripts;
String requestedCommand;
public LocalScriptCommandHandler() {
localScripts = new HashMap<>();
}
@Override
public void handle(String commandName) {
if (localScripts.containsKey(commandName)) {
requestedCommand = commandName;
processCommand();
} else {
super.handle(commandName);
}
}
@Override
protected State processCommand() {
ProofScript command = localScripts.get(requestedCommand);
return null;
//execute
}
}
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