/** ** \file ast/non-object-visitor.hh ** \brief Provide aborting visits for object-related nodes. */ #pragma once #include namespace ast { /** GenNonObjectVisitor provides aborting visit methods for object-related nodes. This class is meant to factor the code visiting object-related nodes in visitors bound to process AST \em without objects. ast::GenNonObjectVisitor inherits virtually from ast::GenVisitor to allow diamond inheritance, notably for a ``compatibility'' purpose with ast::GenDefaultVisitor. For instance, type::TypeChecker, a visitor that checks the types of an AST without objects, inherits from ast::DefaultVisitor to factor default (``empty'') traversal implementations, and from ast::NonObjectVisitor to get an aborting behavior for object-related nodes. \verbatim /ast::Visitor/ ^ (virtual) | (virtual) ,--------------+--------------. | | | | /ast::DefaultVisitor/ /ast::NonObjectVisitor/ ^ ^ | | `--------------+--------------' | | type::TypeChecker \endverbatim */ template