/**
 * Default listener for interpreter events.
 */
package edu.kit.iti.formal.pse.worthwhile.interpreter;

import edu.kit.iti.formal.pse.worthwhile.model.ast.Assertion;
import edu.kit.iti.formal.pse.worthwhile.model.ast.Expression;
import edu.kit.iti.formal.pse.worthwhile.model.ast.Statement;

public abstract class AbstractExecutionEventListener {
	/**
	 * Called every time a Statement has been executed by the Interpreter
	 * 
	 * @param statement
	 *                the Statement that was executed
	 */

	public void statementExecuted(Statement statement) {
		return;
	}

	/**
	 * Called every time a Statement will be executed
	 * 
	 * @param statement
	 *                the Statement that will be executed
	 */
	public void statementWillExecute(Statement statement) {
		return;
	}

	/**
	 * Called after the execution of a Statement failed
	 * 
	 * @param statement
	 *                the Statement that failed to execute
	 * @param error
	 *                an InterpreterError object that describes the error
	 */
	public void executionFailed(Statement statement, InterpreterError error) {
		throw new RuntimeException("Failed to execute " + statement.toString() + "; Got error "
		                + error.toString());
	}

	/**
	 * Called after the start of the execution of a <code>Program</code>
	 */
	public void executionStarted() {
		return;
	}

	/**
	 * Called after the successful completion of execution of a <code>Program</code>
	 */
	public void executionCompleted() {
		return;
	}

	/**
	 * Called after the execution of an assertion that was not valid
	 * 
	 * @param assertion
	 *                the invalid assertion
	 */
	public void assertionFailed(Assertion assertion) {
		throw new RuntimeException(assertion.toString() + " is invalid.");
	}

	/**
	 * Called after the execution of an assertion that was valid
	 * 
	 * @param assertion
	 *                the valid assertion
	 */
	public void assertionSucceeded(Assertion assertion) {
		return;
	}

	/**
	 * Called after the evaluation of a <code>Expression</code>
	 * 
	 * @param expression
	 *                the expression that was evaluated
	 */
	public void expressionEvaluated(Expression expression) {
		return;
	}
}
@@ -534,16 +534,22 @@
 xecuted(
+final 
 Statemen
@@ -559,34 +559,24 @@
 tatement) %7B%0A
-%09%09return;%0A
 %09%7D%0A%0A%09/**%0A%09 *
@@ -743,16 +743,22 @@
 Execute(
+final 
 Statemen
@@ -768,34 +768,24 @@
 tatement) %7B%0A
-%09%09return;%0A
 %09%7D%0A%0A%09/**%0A%09 *
@@ -1038,16 +1038,22 @@
 nFailed(
+final 
 Statemen
@@ -1064,16 +1064,22 @@
 atement,
+ final
  Interpr
@@ -1340,34 +1340,24 @@
 Started() %7B%0A
-%09%09return;%0A
 %09%7D%0A%0A%09/**%0A%09 *
@@ -1472,34 +1472,24 @@
 mpleted() %7B%0A
-%09%09return;%0A
 %09%7D%0A%0A%09/**%0A%09 *
@@ -1652,16 +1652,22 @@
 nFailed(
+final 
 Assertio
@@ -1923,16 +1923,22 @@
 cceeded(
+final 
 Assertio
@@ -1952,26 +1952,16 @@
 tion) %7B%0A
-%09%09return;%0A
 %09%7D%0A%0A%09/**
@@ -2140,16 +2140,22 @@
 aluated(
+final 
 Expressi
@@ -2175,18 +2175,8 @@
 ) %7B%0A
-%09%09return;%0A
 %09%7D%0A%7D

Fix AbstractExecutionEventListener checkstyle errors