Boost logo

Boost :

Subject: Re: [boost] Scalpel: a Spirit&Wave-powered C++ source code analysis library
From: Doug Gregor (doug.gregor_at_[hidden])
Date: 2010-09-07 10:40:08


On Tue, Sep 7, 2010 at 7:16 AM, Thomas Klimpel
<Thomas.Klimpel_at_[hidden]> wrote:
> Doug Gregor wrote:
>> Dave Abrahams wrote:
>> > Now it's my turn to be a little skeptical.  I can't imagine a
>> > compiler would ever try to do error recovery by throwing out
>> > all the information from
>> > #include files you had already processed.
>>
>> Heck no! But in the absence of information (e.g., an #include couldn't
>> be found, or an identifier is horribly mis-typed), such approaches
>> could drastically improve recovery.
>
> >From my naive user point of view, there is a "preprocessing" step, a "compilation" step and a "linking" step. As a compiler user, I would prefer that the compiler doesn't start the "compilation" step in case the "preprocessing" step failed (e.g., an #include couldn't be found). Similar, I would prefer that the compiler doesn't start the "link" step in case the "compilation" step failed.

The right answer often depends on how you're using the parser. As a
compiler, Clang stops parsing after a missing #include, because
there's rarely any point in continuing the parse. When performing
syntax highlighting or code completion, you want results even though
the source is never actually going to compile.

  - Doug


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