Visitor interface and traversal code.