[antlr-interest] Can subrules be set to 'n-to-m'?

Bryan Ewbank ewbank at gmail.com
Thu Mar 24 11:07:25 PST 2005


Only way of which I'm aware is a counter in the loop, and a following
semantic restriction:

rule
{ int c = 0; }
:
     ( subrule { c++; } )*
     {
          if (c < N || c > M)
          {
             diediedie(...)
          }
     }
;


On Thu, 24 Mar 2005 11:37:19 -0700, Jamie Ferguson <jferguson at aptas.com> wrote:
>  Is there a way to restriction a subrule so it occurs from n to m times?


More information about the antlr-interest mailing list