DUchain query
Hamish Rodda
rodda at kde.org
Wed Jul 25 07:02:04 UTC 2007
On Wednesday 25 July 2007 05:50, Piyush Verma wrote:
> While Building the DUChain, is the editointegrator kind of necessary?
> This might be Obvious Otherwise, but i had some trouble in it.
> Working according to Cpp making a new editorintegrator was taking quite
> some time+effort than usual, can the info regarding the current document be
> passed with the url?
> like the url being passed to contextbuilder here...is this of any real
> use...OR the only solution is to write a editorintegrator?
An editor integrator specific to a language makes it convenient to translate
between lexer token positions and line,column positions; ditto for AST nodes.
You really need to make one for python, to save from repeating code very
frequently. Since the python parser seems to be created by kdevelop-pg,
creating a Python editor integrator is simple - pretty much just copy the C++
editor integrator. The reason why there is a specific editor integrator
subclass for each language is so that languages which don't use kdevelop-pg
can still be made to work with the base editor integrator class, and so the
base class doesn't have to link to each parser library.
Note however that the c++ code combines the TokenStream and LocationTable into
one object called the ParseSession; if python doesn't have this already,
you'd either need to create a parse session object for python, or pass the
objects around manually.
Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20070725/f8b89866/attachment.sig>
More information about the KDevelop-devel
mailing list