/[suikacvs]/messaging/manakai/bin/daf.pl
Suika

Diff of /messaging/manakai/bin/daf.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19 by wakaba, Sun Nov 5 10:57:29 2006 UTC revision 1.23 by wakaba, Sun Dec 31 09:11:52 2006 UTC
# Line 31  GetOptions ( Line 31  GetOptions (
31      my $i = [split /\s+/, shift, 3];      my $i = [split /\s+/, shift, 3];
32      $i->[3] = 'perl-pm';      $i->[3] = 'perl-pm';
33      push @{$Opt{create_module}}, $i;      push @{$Opt{create_module}}, $i;
34      push @target_modules, [$i->[0], $i->[2]];      push @target_modules, $i->[0];
35    },    },
36    'create-perl-test=s' => sub {    'create-perl-test=s' => sub {
37      shift;      shift;
38      my $i = [split /\s+/, shift, 3];      my $i = [split /\s+/, shift, 3];
39      $i->[3] = 'perl-t';      $i->[3] = 'perl-t';
40      push @{$Opt{create_module}}, $i;      push @{$Opt{create_module}}, $i;
41      push @target_modules, [$i->[0], $i->[2]];      push @target_modules, $i->[0];
42    },    },
43    'debug' => \$Opt{debug},    'debug' => \$Opt{debug},
44    'dis-file-suffix=s' => \$Opt{dis_suffix},    'dis-file-suffix=s' => \$Opt{dis_suffix},
# Line 50  GetOptions ( Line 50  GetOptions (
50    'load-module=s' => sub {    'load-module=s' => sub {
51      shift;      shift;
52      my $i = [split /\s+/, shift, 2];      my $i = [split /\s+/, shift, 2];
53      push @target_modules, [$i->[0], $i->[1]];      push @target_modules, $i->[0];
54    },    },
55    'mod-file-suffix=s' => \$Opt{mod_suffix},    'mod-file-suffix=s' => \$Opt{mod_suffix},
56    'search-path|I=s' => sub {    'search-path|I=s' => sub {
# Line 128  sub verbose_msg_ ($) { Line 128  sub verbose_msg_ ($) {
128    print STDERR $s if $Opt{verbose};    print STDERR $s if $Opt{verbose};
129  }  }
130    
131    sub daf_open_source_dis_document ($);
132    sub daf_open_current_module_index ($$);
133    sub daf_convert_dis_document_to_dnl_document ();
134    sub daf_get_referring_module_uri_list ($);
135    sub dac_search_file_path_stem ($$$);
136    sub daf_get_module_index_file_name ($);
137    sub daf_check_undefined ();
138    
139  ## ---- The MAIN Program  ## ---- The MAIN Program
140    
141  my $start_time;  my $start_time;
# Line 149  for (@{$Opt{create_module}}) { Line 157  for (@{$Opt{create_module}}) {
157    }    }
158  }  }
159    
160  our $impl = $Message::DOM::ImplementationRegistry->get_implementation;  our $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation;
161    
162  ## --- Loading and Updating the Database  ## --- Loading and Updating the Database
163    
# Line 172  my $ResourceCount = 0; Line 180  my $ResourceCount = 0;
180  $db->pl_update_module (\@target_modules,  $db->pl_update_module (\@target_modules,
181  get_module_index_file_name => sub {  get_module_index_file_name => sub {
182    shift; # $db    shift; # $db
183    daf_get_module_index_file_name (@_);    daf_get_module_index_file_name (shift);
184  },  },
185  get_module_source_document_from_uri => sub {  get_module_source_document_from_uri => sub {
186    my ($db, $module_uri, $module_for) = @_;    my ($db, $module_uri, $module_for) = @_;
# Line 188  get_module_source_document_from_uri => s Line 196  get_module_source_document_from_uri => s
196    }    }
197    return $ModuleSourceDNLDocument{$module_uri};    return $ModuleSourceDNLDocument{$module_uri};
198  },  },
199  get_module_source_document_from_resource => sub ($$$$$$) {  get_module_source_document_from_resource => sub ($$$$$) {
200    my ($self, $db, $uri, $ns, $ln, $for) = @_;    my ($self, $db, $uri, $ns, $ln) = @_;
201    status_msg '';    status_msg '';
202    status_msg qq<Loading module "$ln" for <$for>...>;    status_msg qq<Loading module "$ln"...>;
203    $ResourceCount = 0;    $ResourceCount = 0;
204    
205    my $module_uri = $ns.$ln;    my $module_uri = $ns.$ln;
# Line 291  exit $HasError if $HasError; Line 299  exit $HasError if $HasError;
299  ## --- Creating Files  ## --- Creating Files
300    
301  for (@{$Opt{create_module}}) {  for (@{$Opt{create_module}}) {
302    my ($mod_uri, $out_file_path, $mod_for, $out_type) = @$_;    my ($mod_uri, $out_file_path, undef, $out_type) = @$_;
303    
304    if ($out_type eq 'perl-pm') {    if ($out_type eq 'perl-pm') {
305      daf_perl_pm ($mod_uri, $out_file_path, $mod_for);      daf_perl_pm ($mod_uri, $out_file_path);
306    } elsif ($out_type eq 'perl-t') {    } elsif ($out_type eq 'perl-t') {
307      daf_perl_t ($mod_uri, $out_file_path, $mod_for);      daf_perl_t ($mod_uri, $out_file_path);
308    } elsif ($out_type eq 'dtd-modules') {    } elsif ($out_type eq 'dtd-modules') {
309      daf_dtd_modules ($mod_uri, $out_file_path, $mod_for);      daf_dtd_modules ($mod_uri, $out_file_path);
310    } elsif ($out_type eq 'dtd-driver') {    } elsif ($out_type eq 'dtd-driver') {
311      daf_dtd_driver ($mod_uri, $out_file_path, $mod_for);      daf_dtd_driver ($mod_uri, $out_file_path);
312    }    }
313  }  }
314    
# Line 464  sub dac_search_file_path_stem ($$$) { Line 472  sub dac_search_file_path_stem ($$$) {
472    return undef;    return undef;
473  } # dac_search_file_path_stem;  } # dac_search_file_path_stem;
474    
475  sub daf_get_module_index_file_name ($$) {  sub daf_get_module_index_file_name ($) {
476    my ($module_uri) = @_;    my ($module_uri) = @_;
477    my $ns = $module_uri;    my $ns = $module_uri;
478    $ns =~ s/(\w+)\z//;    $ns =~ s/(\w+)\z//;

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.23

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24