line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Symbology::Convention::CQS; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
1577
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.2; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $template = { |
9
|
|
|
|
|
|
|
'Preferred' => { |
10
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p)$/, |
11
|
|
|
|
|
|
|
template => 'p' |
12
|
|
|
|
|
|
|
} , |
13
|
|
|
|
|
|
|
'Preferred Class' => { |
14
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p)([A-Z])$/, |
15
|
|
|
|
|
|
|
template => 'p=CLASS=', |
16
|
|
|
|
|
|
|
class => 3 |
17
|
|
|
|
|
|
|
} , |
18
|
|
|
|
|
|
|
'Class' => { |
19
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/([A-Z])$/ , |
20
|
|
|
|
|
|
|
template => '/=CLASS=', |
21
|
|
|
|
|
|
|
class => 2 |
22
|
|
|
|
|
|
|
} , |
23
|
|
|
|
|
|
|
'Preferred when distributed' => { |
24
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p\/WD)$/, |
25
|
|
|
|
|
|
|
template => 'p/WD' |
26
|
|
|
|
|
|
|
} , |
27
|
|
|
|
|
|
|
'When distributed' => { |
28
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(WD)$/, |
29
|
|
|
|
|
|
|
template => '/WD' |
30
|
|
|
|
|
|
|
} , |
31
|
|
|
|
|
|
|
'Warrants' => { |
32
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(WS)$/, |
33
|
|
|
|
|
|
|
template => '/WS' |
34
|
|
|
|
|
|
|
} , |
35
|
|
|
|
|
|
|
'Warrants Class' => { |
36
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(WS\/([A-Z]))$/, |
37
|
|
|
|
|
|
|
template => '/WS/=CLASS=', |
38
|
|
|
|
|
|
|
class => 3 |
39
|
|
|
|
|
|
|
} , |
40
|
|
|
|
|
|
|
'Called' => { |
41
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(CL)$/, |
42
|
|
|
|
|
|
|
template => '/CL' |
43
|
|
|
|
|
|
|
} , |
44
|
|
|
|
|
|
|
'Class Called' => { |
45
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/([A-Z])\/(CL)$/, |
46
|
|
|
|
|
|
|
template => '/=CLASS/CL', |
47
|
|
|
|
|
|
|
class => 2 |
48
|
|
|
|
|
|
|
} , |
49
|
|
|
|
|
|
|
'Preferred Called' => { |
50
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p\/CL)$/, |
51
|
|
|
|
|
|
|
template => 'p/CL' |
52
|
|
|
|
|
|
|
} , |
53
|
|
|
|
|
|
|
'Preferred Class Called' => { |
54
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p([A-Z])\/CL)$/, |
55
|
|
|
|
|
|
|
template => 'p=CLASS=/CL', |
56
|
|
|
|
|
|
|
class => 3 |
57
|
|
|
|
|
|
|
} , |
58
|
|
|
|
|
|
|
'Preferred Class When Issued' => { |
59
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p([A-Z])w)$/, |
60
|
|
|
|
|
|
|
template => 'p=CLASS=w', |
61
|
|
|
|
|
|
|
class => 3 |
62
|
|
|
|
|
|
|
} , |
63
|
|
|
|
|
|
|
'Emerging Company Marketplace' => { |
64
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(EC)$/, |
65
|
|
|
|
|
|
|
template => '/EC' |
66
|
|
|
|
|
|
|
} , |
67
|
|
|
|
|
|
|
'Partial Paid' => { |
68
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(PP)$/, |
69
|
|
|
|
|
|
|
template => '/PP' |
70
|
|
|
|
|
|
|
} , |
71
|
|
|
|
|
|
|
'Convertible' => { |
72
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(CV)$/, |
73
|
|
|
|
|
|
|
template => '/CV' |
74
|
|
|
|
|
|
|
} , |
75
|
|
|
|
|
|
|
'Convertible Called' => { |
76
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(CV\/CL)$/, |
77
|
|
|
|
|
|
|
template => '/CV/CL' |
78
|
|
|
|
|
|
|
} , |
79
|
|
|
|
|
|
|
'Class Convertible' => { |
80
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/([A-Z])\/(CV)$/, |
81
|
|
|
|
|
|
|
template => '/=CLASS=/CV', |
82
|
|
|
|
|
|
|
class => 2 |
83
|
|
|
|
|
|
|
} , |
84
|
|
|
|
|
|
|
'Preferred Class Convertible' => { |
85
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p([A-Z])\/CV)$/, |
86
|
|
|
|
|
|
|
template => 'p=CLASS=/CV', |
87
|
|
|
|
|
|
|
class => 3 |
88
|
|
|
|
|
|
|
} , |
89
|
|
|
|
|
|
|
'Preferred Class When Distributed' => { |
90
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(p([A-Z])\/WD)$/, |
91
|
|
|
|
|
|
|
template => 'p=CLASS=/WD', |
92
|
|
|
|
|
|
|
class => 3 |
93
|
|
|
|
|
|
|
} , |
94
|
|
|
|
|
|
|
'Rights' => { |
95
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(r)$/, |
96
|
|
|
|
|
|
|
template => 'r' |
97
|
|
|
|
|
|
|
} , |
98
|
|
|
|
|
|
|
'Units' => { |
99
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(U)$/, |
100
|
|
|
|
|
|
|
template => '/U' |
101
|
|
|
|
|
|
|
} , |
102
|
|
|
|
|
|
|
'When Issued' => { |
103
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(w)$/, |
104
|
|
|
|
|
|
|
template => 'w' |
105
|
|
|
|
|
|
|
} , |
106
|
|
|
|
|
|
|
'Rights When Issued' => { |
107
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(rw)$/, |
108
|
|
|
|
|
|
|
template => 'rw' |
109
|
|
|
|
|
|
|
} , |
110
|
|
|
|
|
|
|
'Preferred When Issued' => { |
111
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)(pw)$/, |
112
|
|
|
|
|
|
|
template => 'pw' |
113
|
|
|
|
|
|
|
} , |
114
|
|
|
|
|
|
|
'Class When Issued' => { |
115
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/([A-Z])(w)$/, |
116
|
|
|
|
|
|
|
template => '/=CLASS=w', |
117
|
|
|
|
|
|
|
class => 2 |
118
|
|
|
|
|
|
|
} , |
119
|
|
|
|
|
|
|
'Warrant When Issued' => { |
120
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(WSw)$/, |
121
|
|
|
|
|
|
|
template => '/WSw' |
122
|
|
|
|
|
|
|
} , |
123
|
|
|
|
|
|
|
'TEST Symbol' => { |
124
|
|
|
|
|
|
|
pattern => qr/^([A-Z]+)\/(TEST)$/, |
125
|
|
|
|
|
|
|
template => '/TEST' |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
}; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub check { |
130
|
11
|
|
|
11
|
0
|
18
|
my ($self, $symbol) = @_; |
131
|
|
|
|
|
|
|
|
132
|
11
|
|
|
|
|
14
|
for my $type (keys %{$template}){ |
|
11
|
|
|
|
|
77
|
|
133
|
213
|
100
|
|
|
|
1008
|
if (my @matches = $symbol =~ m/$template->{$type}{pattern}/){ |
134
|
8
|
100
|
|
|
|
30
|
my @class = splice(@matches,$template->{$type}{class}-1,1) |
135
|
|
|
|
|
|
|
if defined $template->{$type}{class}; |
136
|
|
|
|
|
|
|
|
137
|
8
|
|
|
|
|
9
|
my $returnObj; |
138
|
8
|
|
|
|
|
18
|
$returnObj->{type} = $type; |
139
|
8
|
|
|
|
|
17
|
$returnObj->{symbol} = shift @matches; |
140
|
8
|
100
|
|
|
|
21
|
$returnObj->{class} = shift @class if defined $class[0]; |
141
|
8
|
50
|
|
|
|
22
|
$returnObj->{suffix} = shift @matches if defined $matches[0]; |
142
|
|
|
|
|
|
|
|
143
|
8
|
|
|
|
|
31
|
return $returnObj; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
} |
146
|
3
|
|
|
|
|
57
|
return undef; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub convert { |
150
|
3
|
|
|
3
|
0
|
6
|
my ($self, $obj) = @_; |
151
|
|
|
|
|
|
|
|
152
|
3
|
|
|
|
|
9
|
my $outline = $template->{$obj->{type}}{template}; |
153
|
|
|
|
|
|
|
|
154
|
3
|
50
|
|
|
|
12
|
return -1 unless defined $outline; |
155
|
|
|
|
|
|
|
|
156
|
3
|
50
|
|
|
|
9
|
$outline =~ s/=CLASS=/$obj->{class}/ |
157
|
|
|
|
|
|
|
if defined $obj->{class}; |
158
|
|
|
|
|
|
|
|
159
|
3
|
|
|
|
|
14
|
return $obj->{symbol}.$outline; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
1; |