Common
- Use wchar_t instead of char.
- Set your locale if default C locale is not enough to express your language.
- Use std::wstring instead of std::string.
- Use std::wiostream family instead of std::iostream
Of course, you can use std::basic_string<...> and std::basic_stream<...> family directly, or use typedef.
Lex
- Use boost::spirit::lex::token_def<std::wstring, wchar_t> instead of token_def<>.
- Write regular expressions in wide characters.
- Use boost::spirit::lex::lexertl::token<wchar_t const*> instead of token<char const*>.
Qi
- Use boost::spirit::qi::symbols<wchar_t,std::wstring instead of symbols<char,std::string>
- Write grammar rules in wide characters.
- Use std::wstring::iterator instead of std::string::iterator
- As skipper also requires wide character version, replace skipper parameter of phrase_parse().
Note
- As the argument of boost::spirit::qi::rule<...>::name() is not depends on character set, it is only single byte characters.
No comments:
Post a Comment