[antlr-interest] count number of times a rule is called

Gavin Lambert antlr at mirality.co.nz
Thu Nov 15 11:01:45 PST 2007


At 07:12 16/11/2007, atif azad wrote:
>I want to count the number fo times a rule is called for a 
>certain input file.
>Does any body has an idea how to do it in the simplest way.

Declare a variable in @members, then increment it in an action 
every time you reach the rule in question. 



More information about the antlr-interest mailing list