[antlr-interest] Has anyone done a UTF-16 C++ implementation?

Ric Klaren ric.klaren at gmail.com
Fri Jan 6 00:19:25 PST 2006


Hi,

To start with best wishes for the new year.

On 1/5/06, Randy Hammon <younglv at yahoo.com> wrote:
> However, we are converting our C++ application to
> utf-16 and will need antlr to support this. I perused
> the old archive and saw reference to the utf-8
> implementation.
>
> Has anyone created a utf-16 c++ version?

If you work from the unicode example provided with 2.7.5/6 it should
be pretty trivial to construct an utf-16 version. The approach in the
example is reported to work. Some tweaking may be necessary for how
you store the UTF16 strings after they're lexed. The example decodes
UTF8 and then reencodes them as UTF8 into std::string, you probably
want to do something different there.

Cheers,

Ric


More information about the antlr-interest mailing list