Currently, I would like to focus on using lexer for the first time using a simple ASCII character set, and then when the lexer is working, put the display support for different types of characters, such as UTF-16 and locale support.
And no, you should not mistakenly rely on ctype functions such as isdigit , isalpha and so on ...
Actually, perhaps at a later stage there is a Posix equivalent for the ctype type for wide characters wctype.h 'so that it can be in your interest to define a macro later ... so that you can transparently change the code to handle different sets of locales ...
#ifdef LEX_WIDECHARS
#include <wctype.h>
#define isdigit iswdigit
#else
#define isdigit
#endif
In this context something similar will be defined ...
Hope this helps, Regards, Tom.
source share