package bool;

import java.util.List;

public class ExplicitVisitor implements Visitor< String, List<String>> {

	@Override
	public String var(Var var, List<String> notused) {
		return var.name;
	}

	@Override
	public String and(And and, List<String> notused) {
		return "(" + explicit(and.left) + " && " + explicit(and.right) + ")";
	}

	@Override
	public String or(Or or, List<String> notused) {
		return "(" + explicit(or.left) + " || " + explicit(or.right) + ")";
	}

	@Override
	public String not(Not not, List<String> notused) {
		return "!(" + explicit(not.operand) + ")"; 
	}
	
	private String explicit (Expr expr) {
	    return expr.describeTo(this, null);
	}

}

@@ -539,17 +539,16 @@
 eturn %22!
-(
 %22 + expl
@@ -564,22 +564,16 @@
 operand)
- + %22)%22
 ; %0A%09%7D%0A%09%0A

don't need brackets for the not. ref #32