| Path : /proc/self/root/usr/share/doc/perl-Parse-RecDescent-1.967009/demo/ |
| Current File : //proc/self/root/usr/share/doc/perl-Parse-RecDescent-1.967009/demo/demo_autorule.pl |
#!/usr/bin/perl -ws
# use strict;
use Parse::RecDescent;
print 1 if Parse::RecDescent->new(<<'EOGRAMMAR')->file(join "", <DATA>);
<autorule: /\w+/ { print "Found $item[-1]\n" } >
file: defn(s)
defn: 'def' ident ':' block
block: '{' item(s) '}'
EOGRAMMAR
__DATA__
def ident : { item item item }