Commit 56cbeee4 authored by Matthew Fernandez's avatar Matthew Fernandez
Browse files

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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment