line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Treex::PML::Schema::Attribute; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
38
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
157
|
|
4
|
6
|
|
|
6
|
|
23
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
143
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
25
|
use vars qw($VERSION); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
256
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
6
|
|
|
6
|
|
150
|
$VERSION='2.24'; # version template |
9
|
|
|
|
|
|
|
} |
10
|
6
|
|
|
6
|
|
30
|
no warnings 'uninitialized'; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
212
|
|
11
|
6
|
|
|
6
|
|
34
|
use Carp; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
316
|
|
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
|
37
|
use Treex::PML::Schema::Constants; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
563
|
|
14
|
6
|
|
|
6
|
|
35
|
use base qw( Treex::PML::Schema::Decl ); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
1490
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Treex::PML::Schema::Attribute - implements declaration of an attribute |
19
|
|
|
|
|
|
|
of a container. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 INHERITANCE |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This class inherits from L. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
See the super-class for the complete list. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over 3 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item $decl->get_decl_type () |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Returns the constant PML_ATTRIBUTE_DECL. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item $decl->get_decl_type_str () |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Returns the string 'attribute'. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item $decl->get_name () |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Return name of the attribute. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item $decl->is_required () |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Return 1 if the attribute is required, 0 otherwise. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item $decl->is_attribute () |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Return 1 (for compatibility with C). |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item $decl->get_parent_container () |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Return the container declaration the attribute belongs to. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item $decl->get_parent_struct () |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Alias for C for compatibility with |
58
|
|
|
|
|
|
|
C. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=back |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
1
|
0
|
sub is_atomic { undef } |
66
|
329
|
|
|
329
|
1
|
582
|
sub get_decl_type { return PML_ATTRIBUTE_DECL; } |
67
|
0
|
|
|
0
|
1
|
0
|
sub get_decl_type_str { return 'attribute'; } |
68
|
229
|
|
|
229
|
1
|
718
|
sub get_name { return $_[0]->{-name}; } |
69
|
55
|
|
|
55
|
1
|
197
|
sub is_required { return $_[0]->{required}; } |
70
|
0
|
|
|
0
|
1
|
|
sub is_attribute { return 1; } |
71
|
|
|
|
|
|
|
*get_parent_container = \&Treex::PML::Schema::Decl::get_parent_decl; |
72
|
|
|
|
|
|
|
*get_parent_struct = \&Treex::PML::Schema::Decl::get_parent_decl; # compatibility with members |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub validate_object { |
75
|
0
|
|
|
0
|
1
|
|
shift->get_content_decl->validate_object(@_); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
__END__ |