Paul said:
Sure. The main factors, by far, that has led to the lack of more
sophisticated development environments (in C++) is templates (or more
specifically,
second-phase lookup) and (in C and C++) context-dependent parsing.
I don't know what you mean by 'context-dependent parsing'. The only context
dependency I can think of in C and C++ that is signally different from that
of other languages is the CPP.
For a
tool to do an analysis that is anywhere near complete, it has to do a
nearly complete parse of the language, *and* it has to be able to deal
with intermediate stages of construct completion (i.e. as you type in an
IDE; it can't just bail like a
compiler can).
That's just not true. IDE tools can, and do, fail to parse a given block of
code until the code can be completely evaluated. Sometimes they can pickup
once the block is completed, sometimes they need to be manually refreshed,
and sometimes they need to have the compiler run on the code in question.
The preprocessor is almost insignificant in comparison.
This paper was called to my attention by the person who wrote much of the
code responsible for parsing C++ to provide syntax checking, code
completion and other facilities in the most popular IDE used on Linux. It
was part of his response to my question: 'Is the #include evil'?
https://netfiles.uiuc.edu/garrido/www/papers/ASE_paper.pdf
Abstract
Refactoring, an important technique for increasing
flexibility of the source code, can be applied with much
ease and efficiency by using automated tools. There is
currently a lack of refactoring tools for C with full
support for preprocessor directives because directives
complicate refactorings in many ways.
This paper describes refactoring of C programs in the
presence of conditional compilation directives and how
we propose to support them in a refactoring tool.