line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::Ogmios::Annotations::Token; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
70
|
use Lingua::Ogmios::Annotations::Element; |
|
16
|
|
|
|
|
24
|
|
|
16
|
|
|
|
|
400
|
|
4
|
16
|
|
|
16
|
|
65
|
use strict; |
|
16
|
|
|
|
|
19
|
|
|
16
|
|
|
|
|
420
|
|
5
|
16
|
|
|
16
|
|
59
|
use warnings; |
|
16
|
|
|
|
|
19
|
|
|
16
|
|
|
|
|
9557
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Lingua::Ogmios::Annotations::Element); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
0
|
|
|
0
|
0
|
|
my ($class, $fields) = @_; |
12
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'content'}) { |
13
|
0
|
|
|
|
|
|
die("content is not defined"); |
14
|
|
|
|
|
|
|
} |
15
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'id'}) { |
16
|
0
|
|
|
|
|
|
$fields->{'id'} = -1; |
17
|
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
|
my $token = $class->SUPER::new({ |
19
|
|
|
|
|
|
|
'id' => $fields->{'id'}, |
20
|
|
|
|
|
|
|
# 'form' => $fields->{'content'}, |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'type'}) { |
26
|
0
|
|
|
|
|
|
die("type is not defined"); |
27
|
|
|
|
|
|
|
} |
28
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'from'}) { |
29
|
0
|
|
|
|
|
|
die("from is not defined"); |
30
|
|
|
|
|
|
|
} |
31
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'to'}) { |
32
|
0
|
|
|
|
|
|
die("to is not defined"); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
bless ($token,$class); |
36
|
0
|
|
|
|
|
|
$token->setContent($fields->{'content'}); |
37
|
0
|
|
|
|
|
|
$token->setType($fields->{'type'}); |
38
|
0
|
|
|
|
|
|
$token->setFrom($fields->{'from'}); |
39
|
0
|
|
|
|
|
|
$token->setTo($fields->{'to'}); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $token; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub getContent { |
45
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# return($self->getForm); |
48
|
0
|
|
|
|
|
|
return($self->{'content'}); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub setContent { |
52
|
0
|
|
|
0
|
0
|
|
my ($self, $content) = @_; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# $self->setForm($content); |
55
|
0
|
|
|
|
|
|
$self->{'content'}=$content; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub setType { |
59
|
0
|
|
|
0
|
0
|
|
my ($self, $type) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
$self->{'type'} = $type; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub setFrom { |
65
|
0
|
|
|
0
|
0
|
|
my ($self, $from) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$self->{'from'} = $from; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub setTo { |
72
|
0
|
|
|
0
|
0
|
|
my ($self, $to) = @_; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
$self->{'to'} = $to; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub getType { |
78
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
return($self->{'type'}); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub isType { |
84
|
0
|
|
|
0
|
0
|
|
my ($self, $type) = @_; |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
return($self->getType eq $type); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub isSep { |
90
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
return($self->isType('sep')); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub isSymb { |
96
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
return($self->isType('symb')); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub isAlpha { |
102
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
return($self->isType('alpha')); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub isNum { |
108
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return($self->isType('num')); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub getFrom { |
114
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
return($self->{'from'}); |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub getTo { |
121
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
return($self->{'to'}); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub printXML { |
128
|
0
|
|
|
0
|
0
|
|
my ($self, $order) = @_; |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
print $self->XMLout($order); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub XMLout { |
134
|
0
|
|
|
0
|
0
|
|
my ($self, $order) = @_; |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
return($self->SUPER::XMLout("token", $order)); |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# sub before { |
140
|
|
|
|
|
|
|
# my ($self, $token2) = @_; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# return($self-> |
143
|
|
|
|
|
|
|
# } |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub getElementFormList { |
146
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# warn $self->getContent . "\n"; |
149
|
|
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
return($self->getContent); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
1; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
__END__ |