Boost logo

Boost :

From: Dan Nuffer (dan-boost_at_[hidden])
Date: 2005-02-10 01:10:02


Michiel Salters wrote:
>>-----Original Message-----
>>From: boost-bounces_at_[hidden]
>>[mailto:boost-bounces_at_[hidden]] On Behalf Of Doug Gregor
>>Sent: woensdag 9 februari 2005 17:23
>>To: boost_at_[hidden]
>>Subject: Re: [boost] Wave C++ Review Begins Today - February 7, 2005
>>
>
> ...
>
>>Even dereferencing *last could be a bug, if it is
>>past-the-end. For iterators referencing contiguous memory
>>(vectors and pointers only, as you've said), one would need to write
>>
>> scanner.last = scanner.first + std::distance(first, last);
>
>
> True, but that's an partial fix. For now, I've fixed that bug too
> in my vector<char> wrapper but it's becoming complex. I'm afraid
> someone will have to write re2cpp.
>

It is possible to use re2c generated code in a c++ context. However, to
explain the current situation, the original re2c c++ lexer was actually
written in pure C (thus the origin of the aq_* code), and it looks like
Hartmut has only changed the minimum necessary to integrate it with
Wave. Like he said, if it works, don't mess with it :-)

I originally wrote the re2c c++ scanner as a benchmarking tool to
compare performance of re2c/flex/SLex generated scanners. At the time
re2c won by about a factor of 2 IIRC. I did it in C because my #1 goal
was performance. I found it interesting that, using the exact same
source, if I compiled it as C instead of C++, it was about 10% faster.
But that was years ago with gcc 2.95.2, who knows how things would stand
today?

-- 
Dan Nuffer

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk