/usr/share/doc/libparse-recdescent-perl/examples/demo_quicklist.pl is in libparse-recdescent-perl 1.967009+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | #!/usr/bin/perl -w
use Parse::RecDescent;
#$RD_TRACE=1;
#$RD_HINT=1;
my $parser = Parse::RecDescent->new(<<'EOG') or die;
list1N_c: term(s /,/)
list1N_s: term(s /\/+/)
list0N_c: term(s? /,/)
list0N_s: term(s? /\/+/)
list01_c: term(? /,/)
list01_s: term(? /\/+/)
list2_c: term(2 /,/)
list2_s: term(2 /\/+/)
list02_c: term(0..2 /,/)
list02_s: term(0..2 /\/+/)
list2N_c: term(2.. /,/)
list2N_s: term(2.. /\/+/)
list13_c: term(..3 /,/)
list13_s: term(..3 /\/+/)
term: 't'
EOG
while (<DATA>)
{
print;
print "\tlist1N_c:\t", @{$parser->list1N_c($_)||['undef']}, "\n";
print "\tlist1N_s:\t", @{$parser->list1N_s($_)||['undef']}, "\n";
print "\tlist0N_c:\t", @{$parser->list0N_c($_)||['undef']}, "\n";
print "\tlist0N_s:\t", @{$parser->list0N_s($_)||['undef']}, "\n";
print "\tlist01_c:\t", @{$parser->list01_c($_)||['undef']}, "\n";
print "\tlist01_s:\t", @{$parser->list01_s($_)||['undef']}, "\n";
print "\tlist2_c:\t", @{$parser->list2_c($_)||['undef']}, "\n";
print "\tlist2_s:\t", @{$parser->list2_s($_)||['undef']}, "\n";
print "\tlist02_c:\t", @{$parser->list02_c($_)||['undef']}, "\n";
print "\tlist02_s:\t", @{$parser->list02_s($_)||['undef']}, "\n";
print "\tlist2N_c:\t", @{$parser->list2N_c($_)||['undef']}, "\n";
print "\tlist2N_s:\t", @{$parser->list2N_s($_)||['undef']}, "\n";
print "\tlist13_c:\t", @{$parser->list13_c($_)||['undef']}, "\n";
print "\tlist13_s:\t", @{$parser->list13_s($_)||['undef']}, "\n";
print "-----\n";
}
__DATA__
t
t,t
t,t,t
t,t,t,t
t
t/t
t/t//t
t/t///t/t
|