How does parsing and duchainbuilding work?

Andreas Pakulat apaku at gmx.de
Thu Jul 26 02:30:39 UTC 2007


On 26.07.07 11:14:35, Hamish Rodda wrote:
> On Thursday 26 July 2007 08:32, Andreas Pakulat wrote:
> > Hi,
> >
> > maybe one of our C++ guys has already explained this, but I'm currently
> > missing information on what exactly happens (in which order) when a file
> > is parsed. I'd like to understand (without having to read all the stuff
> > in the C++ support):
> >
> > What happens after the parsing itself is done?
> 
> kdevplatform/language/duchain-design.dox

Hmm, I couldn't recall that there was any info other than how the
duchain itself works... 

> (btw, are these docs built + posted online somewhere?)

Yes, together with all other KDE modules the docs are on api.kde.org.

> > How does the editorintegrator fit into the picture - I first thought its
> > a singleton, but its not, so where does it get created (or better: Where
> > is a Contextbuilder created)?
> 
> It and contextbuilder are created in CPPInternalParseJob::run().  The editor 
> integrator makes it easy to create editor ranges etc. from AST nodes & token 
> values.

Ok, somehow missed that spot with my stupid greps :)

> > I think this is pretty vital information to get from a plain parser to a
> > language support plugin. I mean the "duchain-building" part is pretty
> > clear, an AST visitor that walks the AST and creates duchain-objects
> > during that. But how is the building triggered? What classes are needed
> > to build it?
> 
> Hope it's clearer now.

A slight bit, but as its 4:30 here (am) I can't think anyway. I'll have
a deeper look tomorrow...

Andreas

-- 
You will gain money by a fattening action.




More information about the KDevelop-devel mailing list