Visitor Pattern
interface VisitorInterface {
boolean visit(UnaryExpression node);
boolean visit(BinaryExpression node);
}
What would happen if we add the following?
class TernaryExpression extends Expression {
@Override
void accept(VisitorInterface visitor) {
visitor.visit(this);
}
}