How to embed actions within every match of a one-or-more ( rule+ ) or zero-or-more ( rule* ) rule in ANTLR?

Yeah, well, the particular task is very simple if you know the solution. But when you are just getting started with ANTLR it is not that obvious what kind of things you can do within a grammar, and what you can not. I looked around the web for a while, but it was difficult for me to find a solution, so I will share it here.

Continue reading