blob: 87875f9a1acfddc0f5c86850490036bdbe69c870 (
plain) (
blame)
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
|
#! /usr/bin/perl
use strict;
my $state = 0;
my $def;
my $params;
while (<>) {
if (/^\tpublic\s+(.*)/) {
$def = "public $1";
$state = 1;
$params = 0;
} elsif ($state == 1 and /(\w+)\s*\(/) {
$def .= " $1 LESSPARAMS((";
$state = 2;
} elsif ($state == 2) {
if (/^{/) {
$def .= 'VOID_PARAM' if not $params;
print "$def));\n";
$state = 0;
} elsif (/^\s*([^;]*)/) {
$def .= ', ' if substr($def,-1) ne '(';
$def .= $1;
$params = 1;
}
}
}
|