[cedet-semantic] [PATCH] c++ template + '->' operator support
Brought to you by:
zappo
From: Raf <ra...@fr...> - 2008-12-03 15:59:48
|
I eric, here is the patch for template and -> operator support I'm working on. the interface of semantic-analyze-dereference-metatype is changed : it take one more argument the TYPE-DECLARATION. And now it return a tuple (TYPE TYPE-DECLARATION) instead of just TYPE. It impact only semantic-analyze-debug.el this interface change can be avoided (I can use the TYPE-DECLARATION variable used in semantic-analyze-tag-type), I'don't know if it's a better way. the -> operator autocast can be disabled by semantic-c-member-of-autocast custom variable. brief changes list: * semantic-analyze-fcn: -- mainly the changes on the interface of semantic-analyze-dereference-metatype so i can acces/modify the TYPE-DECLARATION semantic-analyze-dereference-metatype (TYPE SCOPE) => semantic-analyze-dereference-metatype (TYPE SCOPE &optional TYPE-DECLARATION) the old function return TYPE, the new return (TYPE TYPE-DECLARATION) -- semantic-analyze-dereference-metatype-1 is now unconditionaly called on the return result of semantic-analyze-dereference-metatype. * semantic-analyze-debug: -- made compatible with the new interface of semantic-analyze-dereference-metatype * semantic-c.el: -- new custom variable: semantic-c-member-of-autocast (enable/disable '->' operator handling). -- semantic-analyze-dereference-metatype now try a list of dereferencers if one change TYPE return TYPE: (semantic-c-dereference-typedef semantic-c-dereference-template semantic-c-dereference-member-of -- semantic-c-dereference-typedef: is the old semantic-analyze-dereference-metatype modified to respect the new interface. -- semantic-c-dereference-template: instanciate template ie: TYPE=(template class Foo<T>) + TYPE-DECLARATION=(Foo<Bar>) => TYPE=(class Foo<Bar>) in short it make a deep copy of TYPE, replacing each occurence of T by Bar, then rename the new Type to 'Foo<Bar>' the new type is marked as 'faux', I hope this is sufficient for preventing the new type to be writen in semanticdb. -- semantic-c-dereference-member-of: '->' operator handling if TYPE containt a '->' operator, set TYPE to the one returned by the '->' operator. * semantic-tag.el: -- new supports functions: semantic-tag-set-name, semantic-tag-deep-copy-* * semantic-ia-utest: -- added a new unittest: testtemplates.cpp What do you think about this patch ? raf. |