Menu

Flex localisation problem

2015-07-12
2015-07-22
  • Alexey Pavlenko

    Alexey Pavlenko - 2015-07-12

    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
    • Alex Zhondin

      Alex Zhondin - 2015-07-20

      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

Log in to post a comment.