New parser branch (Was: Dumping the source DOM?)

Roberto Raggi roberto.raggi at trolltech.com
Wed Jul 13 18:05:53 UTC 2005


Hi!

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

#include <my-cool-header.h>

int main()
{
  my_cool_function("ciao\n");
}

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

wrong!

  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 
completion

 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
> again.

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. 

ciao robe





More information about the KDevelop-devel mailing list