Hierarchical Visitor Pattern and State Management

I am trying to find a good way to manage state with the hierarchical visitor pattern and ANTLRs autogenerated base visitor class. While the example below is something silly I made up, I believe it …