my $grammar = q{ list: item: word list | word word: /\w+/ }; #### my $grammar = q{ list: '(' item(s) ')' item: list | word word: /[^()]*/ };