/* Visitor Pattern Warmup Assignment This warmup assignment allows you to review/practice using the parameterized visitor pattern. See the online calculator for example. Rewrite the truth table program using the visitor pattern: */ interface exp { public R accept(expvisitor v); } interface expvisitor { public T visit(conste e); public T visit(vare e); public T visit(ande e); public T visit(ore e); public T visit(impe e); public T visit(note e); } /* Rewrite the evaluation procedure as an expvisitor. The hashtable representing the current truth assignment can now become an instance variable of the visitor object instead of being passed around as a parameter to eval: */ class evaluator implements expvisitor { Hashtable Env; public evaluator(Hashtable h) { Env=h; } // ... }