File: demo_codeblock.pl

package info (click to toggle)
libparse-recdescent-perl 1.967015%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 764 kB
  • sloc: perl: 6,797; makefile: 13; ansic: 9
file content (22 lines) | stat: -rwxr-xr-x 287 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/perl -w

use Parse::RecDescent;

$RD_TRACE=1;
my $parse = Parse::RecDescent->new(do{local$/;<DATA>});


while (<>) {
	use Data::Dumper 'Dumper';
	print Dumper [
		$parse->line($_)
	];
}

__DATA__

line: block | call*

block: <perl_codeblock>

call: "foo" <perl_codeblock ()>