[RFC] Using duchain in QMake support

Andreas Pakulat apaku at gmx.de
Sat Mar 8 09:19:08 UTC 2008


I've started to think what I want to do during hackathon and one thing
that really needs love is the QMake support. 

By now I've got some basic idea how duchain works and what it might
enable to do in a quite easy way. So I'm thinking that instead of
further writing the code that exists to walk the AST and collect
variable names and values just building a duchain for the QMake files
and then using that to dynamically lookup variable values and similar

Another thing is that duchain hopefully makes it easier to provide full
project support - adding/removing and renaming/moving files - as thats
basically "just" refactoring.

To make sure I don't expect too much from duchain, I'd like to get some
answers for the following questions:

- Is "Foo = Bar\n...\nFoo = A B C" only a definition or also a use of 
  the Variable Foo? i.e. Foo is re-defined to a different value.

- Can I find the last occurence of a variable assignment within a
  certain context?

- qmake supports config scopes, i.e. "win32 { ... } unix { ...}"
  can I map that with the environment stuff? How do I later on access
  all the different config-parts (so I can enable a switch in the ui
  "show files from all platform-configs")

- I guess the include-file stuff in C++ still works properly when having
  a #include in the middle of the file right? (In qmake its not uncommon
  to do a include(somefile.pri) in the middle of a file, especially with
  the config scopes)

- Does expression evaluation in C++ support function calls? I guess not,
  but I probably need this for QMake. Is it feasible to calculate this
  during duchain building, or should I just note a use of the function
  and later on calculate it "on the fly"?

I guess thats enough for now :)


You possess a mind not merely twisted, but actually sprained.

More information about the KDevelop-devel mailing list