@@ -0,0 +1,1880 @@
+package edu.kit.iti.formal.pse.worthwhile.validation;%0A%0Aimport edu.kit.iti.formal.pse.worthwhile.model.ast.*;%0Aimport edu.kit.iti.formal.pse.worthwhile.model.ast.visitor.ASTNodeVisitor;%0A%0A/**%0A * TODO von wegen nur Functionsdeklarationsbl%C3%B6cke%0A *%0A */%0Apublic class ValidatorASTNodeVisitor extends ASTNodeVisitor %7B%0A%09/**%0A%09 * TODO%0A%09 */%0A%09private boolean validReturnFound = false;%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(ReturnStatement returnStatement) %7B%0A%09%09setValidReturnFound(true);%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(FunctionDeclaration functionDeclaration) %7B%0A%09%09functionDeclaration.getBody().accept(this);%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(Block block) %7B%0A%09%09for(Statement statement : block.getStatements()) %7B%0A%09%09%09statement.accept(this);%0A%09%09%7D%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(Conditional conditional) %7B%0A%09%09ValidatorASTNodeVisitor trueVisitor = new ValidatorASTNodeVisitor();%0A%09%09ValidatorASTNodeVisitor falseVisitor = new ValidatorASTNodeVisitor();%0A%09%09%0A%09%09if(conditional.getTrueBlock() != null && conditional.getFalseBlock() != null) %7B%0A%09%09%09conditional.getTrueBlock().accept(trueVisitor);%0A%09%09%09conditional.getFalseBlock().accept(falseVisitor);%0A%09%09%09if(trueVisitor.getValidReturnFound() && falseVisitor.getValidReturnFound()) %7B%0A%09%09%09%09setValidReturnFound(true);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(Assignment assignment) %7B%0A%09%09return;%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(VariableDeclaration variableDeclaration) %7B%0A%09%09return;%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(Loop loop) %7B%0A%09%09return;%0A%09%7D%0A%09%0A%09/**%0A%09 * TODO%0A%09 */%0A%09public void visit(Annotation annotation) %7B%0A%09%09return;%0A%09%7D%0A%0A%09/**%0A%09 * TODO%0A%09 * @return%0A%09 */%0A%09public boolean getValidReturnFound() %7B%0A%09        return validReturnFound;%0A        %7D%0A%0A%09/**%0A%09 * TODO%0A%09 * @param validReturnFound%0A%09 */%0A%09public void setValidReturnFound(boolean validReturnFound) %7B%0A%09        this.validReturnFound = validReturnFound;%0A        %7D%0A%7D%0A

Add class ValidatorASTNodeVisitor.