Counting repeated tokens in ANTLR4

In your visitPrint method you get a PrintContext with a member ID(). This returns an array and you can simply use context.ID().length to get the ID count (note: no parameter).

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top