line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::ForbiddenStructureAny; |
2
|
5
|
|
|
5
|
|
1859
|
use Lingua::YaTeA::ForbiddenStructure; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
49
|
|
3
|
5
|
|
|
5
|
|
108
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
72
|
|
4
|
5
|
|
|
5
|
|
19
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
2245
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::ForbiddenStructure); |
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
172
|
|
|
172
|
1
|
242
|
my ($class,$infos_a) = @_; |
12
|
172
|
|
|
|
|
294
|
my ($form,$reg_exp) = $class->parse($infos_a->[0]); |
13
|
172
|
|
|
|
|
410
|
my $this = $class->SUPER::new($form); |
14
|
172
|
|
|
|
|
225
|
bless ($this,$class); |
15
|
172
|
|
|
|
|
261
|
$this->{ACTION} = $infos_a->[2]; |
16
|
172
|
|
|
|
|
247
|
$this->{SPLIT_AFTER} = $this->setSplitAfter($infos_a); |
17
|
172
|
|
|
|
|
274
|
$this->{REG_EXP} = $reg_exp; |
18
|
172
|
|
|
|
|
308
|
return $this; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# TODO |
23
|
|
|
|
|
|
|
sub setSplitAfter |
24
|
|
|
|
|
|
|
{ |
25
|
172
|
|
|
172
|
1
|
243
|
my ($this,$infos_a) = @_; |
26
|
172
|
100
|
|
|
|
316
|
if ($this->{ACTION} eq "split") |
27
|
|
|
|
|
|
|
{ |
28
|
56
|
|
|
|
|
128
|
return $infos_a->[3] - 1; |
29
|
|
|
|
|
|
|
} |
30
|
116
|
|
|
|
|
223
|
return ""; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub parse |
34
|
|
|
|
|
|
|
{ |
35
|
172
|
|
|
172
|
1
|
236
|
my ($class,$string) = @_; |
36
|
172
|
|
|
|
|
308
|
my @elements = split / /, $string; |
37
|
172
|
|
|
|
|
205
|
my $element; |
38
|
172
|
|
|
|
|
214
|
my $forbidden_tag = "\(\\n\\<\\/\?\(FORBIDDEN\|FRONTIER\)\[\^\>\]\+\>\)\*"; |
39
|
172
|
|
|
|
|
191
|
my $reg_exp = ""; |
40
|
172
|
|
|
|
|
185
|
my $form; |
41
|
|
|
|
|
|
|
|
42
|
172
|
|
|
|
|
226
|
foreach $element (@elements){ |
43
|
292
|
|
|
|
|
725
|
$element =~ /^([^\\]+)\\(.+)$/; |
44
|
292
|
50
|
|
|
|
617
|
if(!defined $2) |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
|
|
|
0
|
warn "FS error:" . $string. "\n"; |
47
|
|
|
|
|
|
|
} |
48
|
292
|
100
|
|
|
|
466
|
if ($2 eq "IF"){ |
49
|
104
|
|
|
|
|
285
|
$reg_exp .= $forbidden_tag . "\?\\n" . quotemeta($1)."\\t\[\^\\t\]\+\\t\[\^\\t\]\+" . $forbidden_tag; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else{ |
52
|
188
|
100
|
|
|
|
280
|
if ($2 eq "POS"){ |
53
|
96
|
|
|
|
|
231
|
$reg_exp .= $forbidden_tag . "\?\\n\[\^\\t\]\+\\t" . quotemeta($1)."\\t\[\^\\t\]\+". $forbidden_tag; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
else{ |
56
|
92
|
50
|
|
|
|
152
|
if ($2 eq "LF"){ |
57
|
92
|
|
|
|
|
229
|
$reg_exp .= $forbidden_tag . "\?\\n\[\^\\t\]\+\\t\[\^\\t\]\+\\t".quotemeta($1). $forbidden_tag; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
292
|
|
|
|
|
508
|
$form .= $1 . " "; |
62
|
|
|
|
|
|
|
} |
63
|
172
|
|
|
|
|
206
|
$reg_exp .= "\\n"; |
64
|
172
|
|
|
|
|
417
|
$form =~ s/ $//; |
65
|
172
|
|
|
|
|
460
|
return ($form,$reg_exp); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub getAction |
69
|
|
|
|
|
|
|
{ |
70
|
860
|
|
|
860
|
1
|
1299
|
my ($this) = @_; |
71
|
860
|
|
|
|
|
1823
|
return $this->{ACTION}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub getRegExp |
75
|
|
|
|
|
|
|
{ |
76
|
860
|
|
|
860
|
1
|
1113
|
my ($this) = @_; |
77
|
860
|
|
|
|
|
1428
|
return $this->{REG_EXP}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub getSplitAfter |
81
|
|
|
|
|
|
|
{ |
82
|
280
|
|
|
280
|
1
|
346
|
my ($this) = @_; |
83
|
280
|
|
|
|
|
452
|
return $this->{SPLIT_AFTER}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |