make BaseTraversal and ConstBaseTraversal template classes
We have an upcoming need to rewrite parts of the AST (overwrite one AST node with another). This would be easier done if we could return a new Node from a visitation function. To achieve this we need a tweakable return type as part of the visitor base classes. Note that we cannot make the intermediate children of BaseTraversal and ConstBaseTraversal (e.g. Traversal) also template classes, because there is no straightforward way to construct a value to return when the template type is instantiated as non-void. We could play some tricks with template specialisation but it seemed easier to just leave them as concrete classes.
parent
0f038262
Please register or sign in to comment