source: osm/applications/editors/josm/i18n/convwms.pl@ 26319

Last change on this file since 26319 was 25613, checked in by stoecker, 14 years ago

fix wms and validator

File size: 891 bytes
RevLine 
[12334]1#! /usr/bin/perl -w
2
3# Written by Dirk Stöcker <openstreetmap@dstoecker.de>
4# Public domain, no rights reserved.
5
6use strict;
[25613]7use LWP::Simple;
[12334]8
9my $item;
10my $comment = 0;
11
12# This is a simple conversion and in no way a complete XML parser
13# but it works with a default Perl installation
14
[13392]15# Print a header to write valid Java code. No line break,
16# so that the input and output line numbers will match.
17print "class trans_wms { void tr(String s){} void f() {";
18
[25613]19my @lines;
20if($ARGV[0] && $ARGV[0] =~ /^http:\/\//)
[12334]21{
[25613]22 @lines = split("\r?\n", get($ARGV[0]));
23}
24else
25{
26 @lines = <>;
27}
28
29for my $line (@lines)
30{
31 $line =~ s/\r//g;
[12334]32 chomp($line);
33 if($line =~ /^#(.*)$/)
34 {
[23091]35 print "/* $1 */\n";
[12334]36 }
37 elsif($line =~ /^$/)
38 {
39 print "\n";
40 }
41 elsif($line =~ /^(.*?);(.*?);(.*)$/)
42 {
[23091]43 print "/* $3 */ tr(\"$2\");\n";
[12334]44 }
45 else
46 {
47 print "/* $line */\n";
48 }
49}
[13392]50
51print "}}\n";
Note: See TracBrowser for help on using the repository browser.