Hi Everyone!
According to the Flex manual, "the character classes are sensitive to the locale in which flex is executed, and the resulting scanner will not be sensitive to the runtime locale". Systeminfo shows that the system locale is "ru;Russian", nevertheless [:alpha:] doesn't match cyrillic letters. Furthermore, if "%option case-insensitive" is specified, the generated scanner still distinguishes upper- from lowercase ones. What should I do?
Regards,
Alexey Pavlenko
Last edit: Alexey Pavlenko 2015-07-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried to use [:alpha:] expression in flex file. But I did discover any "isalpha" invocation in generated output source files. That seems [:isalpha:] expanded to symbols table during the lexer source code generation and didn't depend on locale.
I think you have to use symbols ranges instead of [:alpha:] expression (like [a-zA-z]).
Regards,
Alex
Last edit: Alex Zhondin 2015-07-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Everyone!
According to the Flex manual, "the character classes are sensitive to the locale in which flex is executed, and the resulting scanner will not be sensitive to the runtime locale". Systeminfo shows that the system locale is "ru;Russian", nevertheless [:alpha:] doesn't match cyrillic letters. Furthermore, if "%option case-insensitive" is specified, the generated scanner still distinguishes upper- from lowercase ones. What should I do?
Regards,
Alexey Pavlenko
Last edit: Alexey Pavlenko 2015-07-12
Hi Alexey,
I've tried to use [:alpha:] expression in flex file. But I did discover any "isalpha" invocation in generated output source files. That seems [:isalpha:] expanded to symbols table during the lexer source code generation and didn't depend on locale.
I think you have to use symbols ranges instead of [:alpha:] expression (like [a-zA-z]).
Regards,
Alex
Last edit: Alex Zhondin 2015-07-22