Next Higher-Order Parsing 28 

ラベル付きブロックLabeled blocks

        constraints { ... }
        define square extends rectangle { ... }
        sub labeled_block {
          my ($header, $item, $separator) = @_;
          $separator = lookfor(";") unless defined $separator;
          conc($header, 
               lookfor("{"), 
               list_of($item, $separator),
               lookfor("}"));
        }
        $constraint_block = 
          labeled_block(L("CONSTRAINTS"), $constraint);
     
        $definition = 
          labeled_block($Definition_header, $declaration);

Next Copyright © 2007 M. J. Dominus