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