Is there any possibility of templated visitors in AntlrCpp similar to Java implementation?
I've a BaseExpression
class that I want to return from my visitors but for the sub-rules, I'd like to return ScalarExpression/VectorExpression
that derive from BaseExpression
. Now, I've to check the type of Any
everytime I need to do something specific related to scalar
or vector
rules. Having a template would eliminate the need for Any
and we can directly access the right type of object returned from each visitor method.
问问题
231 次