Java language support

Hamish Rodda rodda at kde.org
Thu Jul 30 14:27:19 UTC 2009


On Thu, 30 Jul 2009 03:56:15 pm David Nolden wrote:
> 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?

Ah, yes, forgot about that one.  I got pretty lost trying to figure out how 
the c++ one works.

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

Sure, that would be a good plan too.  Can the background parser figure out 
when a job didn't complete the required parsing flags, and reschedule the url 
for parsing again?

Cheers,
Hamish.




More information about the KDevelop-devel mailing list