22 |
|
bless $self, $class; |
23 |
|
$self->{file}=shift; |
24 |
|
$self->{Arch}=1; |
25 |
< |
push @{$self->{ARCHBLOCK}}, $Arch; |
25 |
> |
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
26 |
|
$self->init($self->{file}); |
27 |
|
return $self; |
28 |
|
} |
60 |
|
|
61 |
|
my $switch=ActiveDoc::SimpleDoc->new(); |
62 |
|
$switch->filetoparse($file); |
63 |
+ |
$switch->newparse("doc"); |
64 |
+ |
$switch->addtag("doc","Doc", \&Doc_start,$self,"",$self,"",$self); |
65 |
|
$switch->newparse("ordering"); |
66 |
+ |
$switch->addtag("ordering","Architecture", |
67 |
+ |
\&Arch_Start,$self, |
68 |
+ |
"", $self, |
69 |
+ |
\&Arch_End, $self); |
70 |
+ |
$switch->grouptag("Architecture","ordering"); |
71 |
|
$switch->addtag("ordering","require", |
72 |
|
\&require_start,$self, |
73 |
|
"", $self, |
74 |
|
"", $self); |
75 |
|
$self->{switch}=$switch; |
76 |
|
@{$self->{tools}}=(); |
77 |
< |
$self->{switch}->parse("ordering"); |
77 |
> |
|
78 |
> |
$self->{switch}->parse("doc"); |
79 |
> |
# -- for backwards compatability only parse if we have a docversion |
80 |
> |
# defined |
81 |
> |
if ( defined $self->{docversion} ) { |
82 |
> |
$self->{switch}->parse("ordering"); |
83 |
> |
} |
84 |
|
} |
85 |
|
|
86 |
|
sub download { |
95 |
|
} |
96 |
|
|
97 |
|
# ---- Tag routines |
98 |
+ |
|
99 |
+ |
sub Doc_start { |
100 |
+ |
my $self=shift; |
101 |
+ |
my $name=shift; |
102 |
+ |
my $hashref=shift; |
103 |
+ |
|
104 |
+ |
$self->{switch}->checktag( $name, $hashref, 'type'); |
105 |
+ |
$self->{switch}->checktag( $name, $hashref, 'version'); |
106 |
+ |
|
107 |
+ |
$self->{docversion}=$$hashref{'version'}; |
108 |
+ |
} |
109 |
+ |
|
110 |
|
sub require_start { |
111 |
|
my $self=shift; |
112 |
|
my $name=shift; |
121 |
|
$self->{url}{$$hashref{'name'}}=$$hashref{'file'}; |
122 |
|
} |
123 |
|
} |
124 |
+ |
|
125 |
+ |
sub Arch_Start { |
126 |
+ |
my $self=shift; |
127 |
+ |
my $name=shift; |
128 |
+ |
my $hashref=shift; |
129 |
+ |
|
130 |
+ |
$self->{switch}->checktag($name, $hashref,'name'); |
131 |
+ |
( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1) |
132 |
+ |
: ($self->{Arch}=0); |
133 |
+ |
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
134 |
+ |
} |
135 |
+ |
|
136 |
+ |
sub Arch_End { |
137 |
+ |
my $self=shift; |
138 |
+ |
my $name=shift; |
139 |
+ |
|
140 |
+ |
pop @{$self->{ARCHBLOCK}}; |
141 |
+ |
$self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}]; |
142 |
+ |
} |
143 |
+ |
|