26 |
|
my $class=shift; |
27 |
|
$self={}; |
28 |
|
bless $self, $class; |
29 |
+ |
$self->{cache}=shift; |
30 |
+ |
$self->{mydoctype}="BuildSystem::ToolDoc"; |
31 |
+ |
$self->{mydocversion}="1.0"; |
32 |
|
$self->init(); |
33 |
|
return $self; |
34 |
|
} |
103 |
|
$self->{tool}->version($version); |
104 |
|
$self->{switch}->filetoparse($file); |
105 |
|
$self->{toolfound}=1; |
106 |
+ |
# -- check the type of document - can we parse it? |
107 |
+ |
my($doctype,$docversion)=$self->{switch}->doctype(); |
108 |
+ |
if ( ($doctype ne $self->{mydoctype}) || |
109 |
+ |
($self->{mydocversion} ne $docversion) ) { |
110 |
+ |
$self->error("Unable to Parse Document of type $doctype $docversion". |
111 |
+ |
"\n(Only ".$self->{mydoctype}." ". $self->{mydocversion}.")"); |
112 |
+ |
} |
113 |
|
$self->{switch}->parse("setup"); |
114 |
|
return $self->{toolfound}; |
115 |
|
} |