Implements AST visitor.