Next Higher-Order Parsing 26 

省略できる項目Optional items

     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