6 open ( TOKENS
, $ARGV0 ) || die "can't open $ARGV0 file: $!";
13 $_ =~ /^[a-zA-Z0-9-_]+$/ or die "invalid character in token '$_'";
20 open ( HXX
, ">$ARGV1" ) or die "can't open $ARGV1 file: $!";
21 open ( WORDS
, ">$ARGV2" ) or die "can't open $ARGV2 file: $!";
22 open ( GPERF
, ">$ARGV3" ) or die "can't open $ARGV3 file: $!";
24 print ( HXX
"#ifndef OOX_TOKENS_HXX\n" );
25 print ( HXX
"#define OOX_TOKENS_HXX\n\n" );
26 print ( HXX
"#include <com/sun/star/xml/sax/FastToken.hpp>\n" );
28 print ( WORDS
"static const sal_Char* xmltokenwordlist[] = {\n" );
30 print ( GPERF
"%language=C++\n" );
31 print ( GPERF
"%global-table\n" );
32 print ( GPERF
"%null-strings\n" );
33 print ( GPERF
"%struct-type\n" );
34 print ( GPERF
"struct xmltoken {\n" );
35 print ( GPERF
" const sal_Char *name;\n" );
36 print ( GPERF
" sal_Int32 nToken;\n" );
37 print ( GPERF
"};\n" );
38 print ( GPERF
"%%\n" );
41 foreach( sort( keys( %tokens ) ) )
43 print ( HXX
"const sal_Int32 $tokens{$_} = $i;\n" );
44 print ( WORDS
" \"$_\",\n" );
45 print ( GPERF
"$_,$tokens{$_}\n" );
49 print ( HXX
"const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
50 print ( HXX
"const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;\n\n" );
51 print ( HXX
"const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;\n\n" );
52 print ( HXX
"#endif\n" );
54 print ( WORDS
" \"\"\n" );
55 print ( WORDS
"};\n" );
57 print ( GPERF
"%%\n" );