KDev-PG-Qt and unions

Jonathan Schmidt-Dominé - Developer devel at the-user.org
Sat Apr 24 00:23:23 UTC 2010


Hi Milian!

I've now written a mediocre algorithm to compute an optimal layout for the 
ASTs. But of course a union is not enough, there should be some bits 
indicating which attributes are valid and which are not.
How should they be managed? We could use flags, we could generate inline-
functions like bool hasA() and bool hasB(), we could use one integer-value for 
every possible combination and a table or a switch statement to determine if a 
variable is available. And of course we have to explain the user that he 
should never use a goto-statement in the parser-rules. :D
There could even be an option to set the value indicating a combination 
manually...

Best regards
Jonathan




More information about the KDevelop-devel mailing list