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;

/**
 * Default listener for {@link Interpreter} events.
 */
public abstract class AbstractExecutionEventListener {
	/**
	 * Signals that a {@link Statement} has been executed by the {@link Interpreter}.
	 * 
	 * @param statement
	 *                the <code>Statement</code> that was executed
	 */

	public void statementExecuted(final Statement statement) {
	}

	/**
	 * Signals that a {@link Statement} will be executed.
	 * 
	 * @param statement
	 *                the <code>Statement</code> that will be executed
	 */
	public void statementWillExecute(final Statement statement) {
	}

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

	/**
	 * Signals the start of the execution of a {@link edu.kit.iti.formal.pse.worthwhile.model.ast.Program}.
	 */
	public void executionStarted() {
	}

	/**
	 * Signals the successful completion of execution of a {@link edu.kit.iti.formal.pse.worthwhile.model.ast.Program}.
	 */
	public void executionCompleted() {
	}

	/**
	 * Signals the execution of an {@link Assertion} that was not valid.
	 * 
	 * @param assertion
	 *                the invalid <code>Assertion</code>
	 */
	public void assertionFailed(final Assertion assertion) {
		throw new RuntimeException(assertion.toString() + " is invalid.");
	}

	/**
	 * Signals the execution of an {@link Assertion} that was valid.
	 * 
	 * @param assertion
	 *                the valid <code>Assertion</code>
	 */
	public void assertionSucceeded(final Assertion assertion) {
	}

	/**
	 * Signals the evaluation of a {@link Expression}.
	 * 
	 * @param expression
	 *                the <code>Expression</code> that was evaluated
	 */
	public void expressionEvaluated(final Expression expression) {
	}
}
@@ -2362,9 +2362,499 @@
 n) %7B%0A%09%7D%0A
+%09%0A%09/**%0A%09 * Signals that the execution of a %7B@link Expression%7D failed.%0A%09 * %0A%09 * @param expression%0A%09 *                the %3Ccode%3EExpression%3C/code%3E that failed to execute%0A%09 * @param error%0A%09 *                an %7B@link InterpreterError%7D object that describes the error%0A%09 */%0A%09public void expressionFailed(final Expression expression, final InterpreterError error) %7B%0A%09%09throw new RuntimeException(%22Failed to execute %22 + expression.toString() + %22; Got error %22%0A                + error.toString());%0A%09%7D%0A
 %7D

Add executionFailed() method because of consistency reasons.