line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::ForbiddenStructureMark; |
2
|
3
|
|
|
3
|
|
25
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
90
|
|
3
|
3
|
|
|
3
|
|
56
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
1201
|
use Lingua::YaTeA::AnnotationMark; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
42
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::AnnotationMark); |
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
12
|
|
|
12
|
1
|
30
|
my ($class,$form) = @_; |
13
|
12
|
|
|
|
|
38
|
my ($id,$action,$split_after,$type) = $class->parse($form); |
14
|
12
|
|
|
|
|
68
|
my $this = $class->SUPER::new($form,$id,$type); |
15
|
12
|
|
|
|
|
20
|
bless ($this,$class); |
16
|
12
|
|
|
|
|
28
|
$this->{ACTION} = $action; |
17
|
12
|
|
|
|
|
138
|
$this->{SPLIT_AFTER} = $split_after; |
18
|
12
|
|
|
|
|
42
|
return $this; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub parse |
22
|
|
|
|
|
|
|
{ |
23
|
12
|
|
|
12
|
1
|
27
|
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
|
|
|
|
55
|
if ($form =~ /^\/) |
30
|
|
|
|
|
|
|
{ # opening forbidden structure mark |
31
|
6
|
|
|
|
|
13
|
$type = "opener"; |
32
|
6
|
|
|
|
|
20
|
$id = $1; |
33
|
6
|
|
|
|
|
20
|
$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
|
|
|
|
48
|
if($form =~ /^\<\/FORBIDDEN ID=([0-9]+) ACTION=([a-z]+)( SPLIT_AFTER=([0-9]+))?\>/) |
42
|
|
|
|
|
|
|
{ |
43
|
6
|
|
|
|
|
17
|
$type = "closer"; |
44
|
6
|
|
|
|
|
17
|
$id = $1; |
45
|
6
|
|
|
|
|
15
|
$action = $2; |
46
|
6
|
100
|
|
|
|
20
|
if ($action eq "split") |
47
|
|
|
|
|
|
|
{ # if splitting instructions are provided |
48
|
2
|
|
|
|
|
7
|
$split_after = $4; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else{ |
52
|
0
|
|
|
|
|
0
|
die "Invalid line: " .$form . "\n"; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
12
|
|
|
|
|
249
|
return ($id,$action,$split_after,$type); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub isOpener |
59
|
|
|
|
|
|
|
{ |
60
|
12
|
|
|
12
|
1
|
27
|
my ($this) = @_; |
61
|
12
|
100
|
|
|
|
38
|
if($this->{TYPE} eq "opener") |
62
|
|
|
|
|
|
|
{ |
63
|
6
|
|
|
|
|
26
|
return 1 |
64
|
|
|
|
|
|
|
} |
65
|
6
|
|
|
|
|
18
|
return 0; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub isCloser |
69
|
|
|
|
|
|
|
{ |
70
|
6
|
|
|
6
|
1
|
41
|
my ($this) = @_; |
71
|
6
|
50
|
|
|
|
23
|
if($this->{TYPE} eq "closer") |
72
|
|
|
|
|
|
|
{ |
73
|
6
|
|
|
|
|
21
|
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
|
|
|
|
|
60
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub getSplitAfter |
86
|
|
|
|
|
|
|
{ |
87
|
2
|
|
|
2
|
1
|
9
|
my ($this) = @_; |
88
|
|
|
|
|
|
|
return $this->{SPLIT_AFTER} |
89
|
2
|
|
|
|
|
19
|
} |
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__ |