[RFC] kdev-pg: AST improvements

Jakob Petsovits jpetso at gmx.at
Mon Jul 17 11:47:33 UTC 2006


I found a disadvantage!

On Monday, 17. July 2006 10:48, Jakob Petsovits wrote:
> Short summary:
>
> Advantages:
> - We can have a customized AST while still taking advantage of
> kdevelop-pg's automatic AST and default visitor generation.
> - We can selectively improve node structures in need, and can leave the
> other ones as they are, no need for duplicating them in a "tree parser"
> definition. - No additional concepts to learn: the generated AST follows
> exactly the same rules as before, only with those modest additions.
> - Custom member variables can be declared directly beneath the rule
> declaration instead of sitting at the top of the file, making for a better
> overview.
> - We can drop class-wide instance variables like ellipsis_occured (in the
> Java parser) and let the two concerning rules communicate directly by rule
> arguments.

Disadvantages:
- For every passed argument node, we need to check if its start_token index is 
lower than the currently processed token (which will usually be the case for 
one of the arguments), in consequence we essentially would do a
  min(passed_rule_ast->start_token, current_token_index)
which will decrease performance slightly.
(The end token index is not influenced in any case.)

Wishes,
  Jakob




More information about the KDevelop-devel mailing list