Quick Start on ANTLR4 in Rust — Part3 (This article)
In the previous article, we implemented a parser with internal state variables. However, if a grammar is huge, it is practically impossible to manage a huge number of state variables. Alternatively, a visitor-like approach can be used.
In an exit method of the root rule in the Listener, we can grab the current context and its children and call custom parser methods: