fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / oox / source / token / parsexsd.pl
blob5a4d595f24c942e8f2a408c9433acaa1fc8648b0
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 $ARGV = shift @ARGV;
20 my %tokens;
22 my @files = glob("$ARGV/*.rnc");
24 open( TOKEN, ">tokens.txt" ) || die "can't write token file";
26 foreach( @files )
28 print( "parsing $_\n" );
29 open ( XSD, $_ ) || die "can't open token file: $!";
30 while( <XSD> )
32 chomp($_);
33 if( /element (\S*:)?(\S*)/ )
35 $tokens{$2} = 1;
36 print(".");
38 elsif( /attribute (\S*:)?(\S*)/ )
40 $tokens{$2} = 1;
41 print(".");
43 elsif( /list\s*\{/ )
45 while( <XSD> )
47 chomp($_);
48 last if( /^\s*\}/ );
49 if( /"(\S*?)\"/ )
51 $tokens{$1} = 1;
52 print(".");
57 close ( XSD );
59 print("\n" );
62 foreach( sort(keys(%tokens)) )
64 print TOKEN "$_\n";
66 close( TOKEN );