def self.inherited(base)
node_name = base.name.gsub(/.*::(.*?)Node$/, '\\1').downcase
base.instance_eval "# @return [Symbol] The name that is used for this node when visiting.\ndef node_name\n:\#{node_name}\nend\n\n# @return [Symbol] The method that is used on the visitor to visit nodes of this type.\ndef visit_method\n:visit_\#{node_name}\nend\n\n# @return [Symbol] The method name that determines if the parent is invalid.\ndef invalid_child_method_name\n:\"invalid_\#{node_name}_child?\"\nend\n\n# @return [Symbol] The method name that determines if the node is an invalid parent.\ndef invalid_parent_method_name\n:\"invalid_\#{node_name}_parent?\"\nend\n"
end