Using a real parser generator to parse numbers (and dates)

Stephan Bergmann sbergman at redhat.com
Wed Feb 29 06:10:24 PST 2012


On 02/29/2012 02:57 PM, Stephan Bergmann wrote:
> On 02/29/2012 11:49 AM, Lionel Elie Mamane wrote:
>> 2) I add a const_iterator interface to rtl::OUString. Instead of
>> coding it manually to use iterateCodePoints, I again reuse the
>> power of boost. But I have in my git history a manually-coded
>> version based on iterateCodePoints if for some reason it is
>> desirable (I don't think it is).
>>
>> That's also more generally a more "C++ natural" interface to
>> OUStrings, so we can use it throughout our codebase instead of
>> iterateCodePoints.
>>
>> I don't define an iterator interface, as this could be *extremely*
>> slow: writing one character in the middle of a string is O(n)
>> (linear in the length of the string) when replacing a
>> surrogates-encoded codepoint by a non-surrogate encoded one and
>> vice-versa.
> [...]
>> 5) I've stuck the LibreOffice<->Spirit integration in
>> svl/source/numbers/spirit/, but possibly we could move it to a more
>> general location (sal/rtl?) so that it can be reused in other parts
>> of LibreOffice.
>
> Note that the stable sal interface historically stays clear of boost,
> because of differences in the various boost versions available in the
> various environments. Also, the SDK does not include any boost headers,
> so client code that does not even itself make use of boost could stop to
> compile.

(Also, is boost::u16_to_u32_iterator from 
boost/regex/pending/unicode_iterator.hpp supposed to be a stable interface?)

Stephan


More information about the LibreOffice mailing list