Java language support

David Nolden david.nolden.kdevelop at art-master.de
Thu Jul 30 05:56:15 UTC 2009


Am Donnerstag 30 Juli 2009 05:37:23 schrieb Hamish Rodda:
> At the moment the biggest thing is to make it parse files in the required
> order, so that declaration <==> use relationships across files are created
> properly.  Currently, void JavaLanguageSupport::scheduleInternalSources()
> sets up parse jobs for each java source file.  However, many of these files
> depend on others being parsed beforehand (some cyclicly), so in order to
> resolve all identifiers properly, we need to take care of parsing them in
> the right order.
I thought it didn't have an expression-visitor yet, which prevents it from 
building proper uses?

> The current plan was to create and execute new parse jobs in a recursive
> fashion as needed in  void ParseJob::run(), probably in the if
> (builder.identifiersRemainUnresolved()) { bracket.
I think that plan is not ideal. As many languages have this problem, for 
example also php, we should solve it once and for all, by looking how those 
languages themselves do it, and replicate that behavior.

My initial guess: Use 3 passes over the complete project.
Pass 1: Only put declarations into the symbol table
Pass 2: Build types (requires full declaration info)
Pass 3: Build uses (requires full type info)

Pass 2 and 3 can probably be merged in some way, as one could also build type-
uses while resolving the types in pass 2, and thereby have a kind of 
inheritance chain. Anyway that should be secondary, primary goal should be 
first getting it working properly.

Greetings, David





More information about the KDevelop-devel mailing list