Next Higher-Order Parsing 28 

Optional items

     term → factor ("*" term | nothing)
     term → factor optional("*" term)
        sub optional {
          my $p = shift;
          return alt($p, $nothing);
        }
     $term = $Factor - (L("*") - $Term | $nothing);
     $term = $Factor - optional(L("*") - $Term);

Next Copyright © 2007 M. J. Dominus