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 ); +} + +"