diff options
author | Mariusz PluciĆski <mplucinski@mplucinski.com> | 2014-06-24 19:21:43 +0200 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2014-11-30 19:22:43 -0500 |
commit | 227e731b7686d79902c31756e11e7104070f4c2b (patch) | |
tree | c417e60a930cb21a3c7dbb2616b80e10ddc7fb89 /src/FlexLexer.h | |
parent | 4d6089fc838072d6a057257254107fdf84ff690f (diff) | |
download | flex-git-unicode.tar.gz |
Make charset support working with C++ scanners toounicode
Diffstat (limited to 'src/FlexLexer.h')
-rw-r--r-- | src/FlexLexer.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/FlexLexer.h b/src/FlexLexer.h index ccda8ae..a9aa4f2 100644 --- a/src/FlexLexer.h +++ b/src/FlexLexer.h @@ -96,8 +96,16 @@ public: int debug() const { return yy_flex_debug; } void set_debug( int flag ) { yy_flex_debug = flag; } +#ifdef YY_CHARSET + void set_charset(char *charset); + char* get_charset(); +#endif + protected: YY_CHAR* yytext; +#ifdef YY_CHARSET + char *yycharset; +#endif int yyleng; int yylineno; // only maintained if you use %option yylineno int yy_flex_debug; // only has effect with -d or "%option debug" @@ -158,6 +166,15 @@ protected: yy_state_type yy_try_NUL_trans( yy_state_type current_state ); int yy_get_next_buffer(); +#ifdef YY_CHARSET + size_t yycharset_convert(char* source, size_t source_bytes, YY_CHAR* target, + size_t target_length, size_t* converted_bytes); + virtual size_t yycharset_handler(char *charset, + char *source, size_t source_bytes, + YY_CHAR *target, size_t target_length, + size_t *converted_bytes); +#endif + FLEX_STD istream* yyin; // input source for default LexerInput FLEX_STD ostream* yyout; // output sink for default LexerOutput |