New parser branch (Was: Dumping the source DOM?)
roberto.raggi at trolltech.com
Wed Jul 13 18:05:53 UTC 2005
On Wednesday 13 July 2005 13:26, Vladimir Prus wrote:
> Maybe you meant the opposite? That IDE should access invalid C++ code? If I
> have a valid C++ program, I'd expect IDE to parse it without problems.
the point is what is a valid source code for you!? for instance this is not
valid for me
because the IDE doesn't where is the file my-cool-header.h.. KDevelop works
just fine in this case. gccxml will fail. THIS IS NOT ACCETABLE!
> One possible approach I had in mind was to make parser restartable. First
> you run g++ parser on the code till the first token it cannot parse. As you
1) gcc takes about the 50% of your CPU. it is a bit too much for a
background parser(== you can't type in KDevelop and compile your project
with the "real" gcc at the same time)
2) it will not help the code completion.. in fact you will not be able to
perform any code completion. Because, the code is *UNFINISHED* (please read
it again IT IS UNFINISHED).. gcc will not produce any abstract syntax tree,
you will not populate the code model, and you will not have the code
3) import the source code of a project will take almost the same time to
compile it. So you have to wait about 1 hour before load the KDevelop
project, 2 hours for kdelibs/kdebase, and so on..
> type more tokens you feed them to the parser. If you go to the beginning of
> the file and start typing there, you rewind parser state and start parsing
I think I will stop here. This thread starts to be annoying. I'm sorry
Vladimir, but I don't think you know what you're talking about. Anyway, good
luck with your project. Maybe it is me that I don't see your point and maybe
you're right and gccxml and parse *only* valid source code is the right
solution for KDevelop.
More information about the KDevelop-devel