… | |
… | |
105 | $arch->{value} = $e->attr ("value"); |
105 | $arch->{value} = $e->attr ("value"); |
106 | } elsif ($arch->{type} =~ s/^bool_special$/bool/) { |
106 | } elsif ($arch->{type} =~ s/^bool_special$/bool/) { |
107 | $arch->{value} = [$e->attr ("false"), $e->attr ("true")]; |
107 | $arch->{value} = [$e->attr ("false"), $e->attr ("true")]; |
108 | } |
108 | } |
109 | |
109 | |
110 | $sect->{$e->attr ("arch") || $e->attr("arch_begin")} = $arch; |
110 | push @$sect, [$e->attr ("arch") || $e->attr("arch_begin"), $arch]; |
111 | } |
111 | } |
112 | |
112 | |
113 | sub parse_type { |
113 | sub parse_type { |
114 | my ($e, $type) = @_; |
114 | my ($e, $type) = @_; |
115 | |
115 | |
116 | my %main; |
116 | my %main; |
117 | |
117 | |
118 | for my $e (grep ref, @{$e->contents}) { |
118 | for my $e (grep ref, @{$e->contents}) { |
119 | if ($e->name eq "required") { |
119 | if ($e->name eq "required") { |
|
|
120 | # not used |
120 | for my $i (grep ref, @{$e->contents}) { |
121 | #for my $i (grep ref, @{$e->contents}) { |
121 | $type->{required}{$i->attr ("arch")} = $i->attr ("value"); |
122 | # $type->{required}{$i->attr ("arch")} = $i->attr ("value"); |
122 | } |
123 | #} |
123 | } elsif ($e->name eq "attribute") { |
124 | } elsif ($e->name eq "attribute") { |
124 | parse_attr $e, $type->{attr} ||= {}; |
125 | parse_attr $e, $type->{attr} ||= []; |
125 | } elsif ($e->name eq "ignore") { |
126 | } elsif ($e->name eq "ignore") { |
126 | for my $i (grep ref, @{$e->contents}) { |
127 | for my $i (grep ref, @{$e->contents}) { |
127 | if ($i->name eq "ignore_list") { |
128 | if ($i->name eq "ignore_list") { |
128 | push @{$type->{ignore}}, $ignore_list{$i->attr ("name")} ||= []; |
129 | push @{$type->{ignore}}, $ignore_list{$i->attr ("name")} ||= []; |
129 | } elsif ($i->name eq "attribute") { |
130 | } elsif ($i->name eq "attribute") { |
… | |
… | |
135 | } elsif ($e->name eq "use") { |
136 | } elsif ($e->name eq "use") { |
136 | $type->{use} = string $e; |
137 | $type->{use} = string $e; |
137 | } elsif ($e->name eq "description") { |
138 | } elsif ($e->name eq "description") { |
138 | $type->{desc} = string $e; |
139 | $type->{desc} = string $e; |
139 | } elsif ($e->name eq "section") { |
140 | } elsif ($e->name eq "section") { |
140 | my %attr; |
141 | my @attr; |
141 | for my $i (grep ref, @{$e->contents}) { |
142 | for my $i (grep ref, @{$e->contents}) { |
142 | parse_attr $i, \%attr; |
143 | parse_attr $i, \@attr; |
143 | } |
144 | } |
144 | push @{ $type->{section} }, [$e->attr ("name") => \%attr]; |
145 | push @{ $type->{section} }, [$e->attr ("name") => \@attr]; |
145 | } else { |
146 | } else { |
146 | warn "unknown types subelement ", $e->name; |
147 | warn "unknown types subelement ", $e->name; |
147 | } |
148 | } |
148 | } |
149 | } |
149 | |
150 | |
… | |
… | |
199 | |
200 | |
200 | for (grep ref, @{$spell->root->contents}) { |
201 | for (grep ref, @{$spell->root->contents}) { |
201 | $spell{$_->attr ("id")} = $_->attr ("name"); |
202 | $spell{$_->attr ("id")} = $_->attr ("name"); |
202 | } |
203 | } |
203 | |
204 | |
204 | dump_hash ["BITMASK", "LIST", "IGNORE_LIST", "DEFAULT_ATTR", "TYPE", "ATTR0", "ATTR", "TYPENAME", "SPELL"], |
205 | dump_hash ["BITMASK", "LIST", "IGNORE_LIST", "DEFAULT_ATTR", "TYPE", "ATTR", "TYPENAME", "SPELL"], |
205 | [\%bitmask, \%list, \%ignore_list, \%default_attr, \%type, \@attr0, \%attr, \%typename, \%spell]; |
206 | [\%bitmask, \%list, \%ignore_list, \%default_attr, \%type, \%attr, \%typename, \%spell]; |
206 | |
207 | |
207 | print <<EOF; |
208 | print <<EOF; |
208 | |
209 | |
209 | =head1 AUTHOR |
210 | =head1 AUTHOR |
210 | |
211 | |