From 3f033cae582db136e298e95ff475507a929adf1a Mon Sep 17 00:00:00 2001 From: Nils Fuhrmann Date: Mon, 20 Nov 2000 12:49:48 +0000 Subject: [PATCH] Added new functionality for localization of configuration --- transex3/source/cfglex.l | 198 ++++++++++++++++++++++++ transex3/source/cfgmerge.cxx | 284 +++++++++++++++++++++++++++++++++++ transex3/source/makefile.mk | 14 +- 3 files changed, 493 insertions(+), 3 deletions(-) create mode 100644 transex3/source/cfglex.l create mode 100644 transex3/source/cfgmerge.cxx diff --git a/transex3/source/cfglex.l b/transex3/source/cfglex.l new file mode 100644 index 000000000000..3b01bf1ef33b --- /dev/null +++ b/transex3/source/cfglex.l @@ -0,0 +1,198 @@ +%{ +/* + * lexer for parsing cfg source files + * + */ + + +/* enlarge token buffer to tokenize whole strings */ +#undef YYLMAX +#define YYLMAX 64000 + +/* to enable debug output define LEXDEBUG */ +#define LEXDEBUG 1 +#ifdef LEXDEBUG +#define OUTPUT fprintf +#else +#define OUTPUT(Par1,Par2); +#endif + +/* table of possible token ids */ +#include "tokens.h" +#include +#include + +/* external functions (C++ code, declared as extren "C" */ +extern WorkOnTokenSet( int, char* ); +extern InitCfgExport( char * ); +extern EndCfgExport(); +extern GetError(); +extern SetError(); +extern char *GetOutputFile( int argc, char* argv[]); +extern FILE *GetCfgFile(); + +/* forwards */ +void YYWarning(); + +int bText=0; +%} + +%p 24000 +%e 1200 +%n 500 + +%% + +\<.*\/\> { + bText = 0; + WorkOnTokenSet( ANYTOKEN, yytext ); +} + +\<[^\>]*"package-id="\".*\"[^\<]*\> { + bText = 0; + WorkOnTokenSet( CFG_TAG, yytext ); +} + +\<[^\>]*"xml:lang="\".*\"[^\<]*\> { + bText = 1; + WorkOnTokenSet( CFG_TEXT_START, yytext ); +} + +\<[^\>]*"="\".*\"[^\<]*\> { + bText = 0; + WorkOnTokenSet( CFG_TAG, yytext ); +} + +"