line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::ForbiddenStructureMark; |
2
|
3
|
|
|
3
|
|
23
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
89
|
|
3
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
79
|
|
4
|
3
|
|
|
3
|
|
1172
|
use Lingua::YaTeA::AnnotationMark; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::AnnotationMark); |
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
12
|
|
|
12
|
1
|
34
|
my ($class,$form) = @_; |
13
|
12
|
|
|
|
|
37
|
my ($id,$action,$split_after,$type) = $class->parse($form); |
14
|
12
|
|
|
|
|
75
|
my $this = $class->SUPER::new($form,$id,$type); |
15
|
12
|
|
|
|
|
27
|
bless ($this,$class); |
16
|
12
|
|
|
|
|
28
|
$this->{ACTION} = $action; |
17
|
12
|
|
|
|
|
25
|
$this->{SPLIT_AFTER} = $split_after; |
18
|
12
|
|
|
|
|
29
|
return $this; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub parse |
22
|
|
|
|
|
|
|
{ |
23
|
12
|
|
|
12
|
1
|
30
|
my ($class,$form) = @_; |
24
|
12
|
|
|
|
|
44
|
my $id; |
25
|
|
|
|
|
|
|
my $action; |
26
|
12
|
|
|
|
|
0
|
my $split_after; |
27
|
12
|
|
|
|
|
0
|
my $type; |
28
|
|
|
|
|
|
|
|
29
|
12
|
100
|
|
|
|
58
|
if ($form =~ /^\/) |
30
|
|
|
|
|
|
|
{ # opening forbidden structure mark |
31
|
6
|
|
|
|
|
16
|
$type = "opener"; |
32
|
6
|
|
|
|
|
21
|
$id = $1; |
33
|
6
|
|
|
|
|
15
|
$action = $2; |
34
|
6
|
100
|
|
|
|
22
|
if ($action eq "split") |
35
|
|
|
|
|
|
|
{ # if splitting instructions are provided |
36
|
2
|
|
|
|
|
11
|
$split_after = $4; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else |
40
|
|
|
|
|
|
|
{ # closing forbidden structure mark |
41
|
6
|
50
|
|
|
|
51
|
if($form =~ /^\<\/FORBIDDEN ID=([0-9]+) ACTION=([a-z]+)( SPLIT_AFTER=([0-9]+))?\>/) |
42
|
|
|
|
|
|
|
{ |
43
|
6
|
|
|
|
|
15
|
$type = "closer"; |
44
|
6
|
|
|
|
|
21
|
$id = $1; |
45
|
6
|
|
|
|
|
12
|
$action = $2; |
46
|
6
|
100
|
|
|
|
23
|
if ($action eq "split") |
47
|
|
|
|
|
|
|
{ # if splitting instructions are provided |
48
|
2
|
|
|
|
|
8
|
$split_after = $4; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else{ |
52
|
0
|
|
|
|
|
0
|
die "Invalid line: " .$form . "\n"; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
12
|
|
|
|
|
327
|
return ($id,$action,$split_after,$type); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub isOpener |
59
|
|
|
|
|
|
|
{ |
60
|
12
|
|
|
12
|
1
|
25
|
my ($this) = @_; |
61
|
12
|
100
|
|
|
|
47
|
if($this->{TYPE} eq "opener") |
62
|
|
|
|
|
|
|
{ |
63
|
6
|
|
|
|
|
23
|
return 1 |
64
|
|
|
|
|
|
|
} |
65
|
6
|
|
|
|
|
16
|
return 0; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub isCloser |
69
|
|
|
|
|
|
|
{ |
70
|
6
|
|
|
6
|
1
|
25
|
my ($this) = @_; |
71
|
6
|
50
|
|
|
|
30
|
if($this->{TYPE} eq "closer") |
72
|
|
|
|
|
|
|
{ |
73
|
6
|
|
|
|
|
27
|
return 1 |
74
|
|
|
|
|
|
|
} |
75
|
0
|
|
|
|
|
0
|
return 0; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub getAction |
79
|
|
|
|
|
|
|
{ |
80
|
12
|
|
|
12
|
1
|
26
|
my ($this) = @_; |
81
|
|
|
|
|
|
|
return $this->{ACTION} |
82
|
12
|
|
|
|
|
44
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub getSplitAfter |
86
|
|
|
|
|
|
|
{ |
87
|
2
|
|
|
2
|
1
|
6
|
my ($this) = @_; |
88
|
|
|
|
|
|
|
return $this->{SPLIT_AFTER} |
89
|
2
|
|
|
|
|
8
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub isActionSplit |
93
|
|
|
|
|
|
|
{ |
94
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
95
|
0
|
0
|
|
|
|
|
if($this->getAction eq "split") |
96
|
|
|
|
|
|
|
{ |
97
|
0
|
|
|
|
|
|
return 1 |
98
|
|
|
|
|
|
|
} |
99
|
0
|
|
|
|
|
|
return 0; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub isActionDelete |
103
|
|
|
|
|
|
|
{ |
104
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
105
|
0
|
0
|
|
|
|
|
if($this->getAction eq "delete") |
106
|
|
|
|
|
|
|
{ |
107
|
0
|
|
|
|
|
|
return 1 |
108
|
|
|
|
|
|
|
} |
109
|
0
|
|
|
|
|
|
return 0; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
__END__ |