[PATCH] Make language type support more generic

Hamish Rodda rodda at kde.org
Wed Aug 13 06:30:29 UTC 2008


Hi,

(Resending as my last email was too large apparently)

The following patches make the type support more generic, such that most 
languages will not need to create custom types, and others can dramatically 
reduce the amount of code duplication.

The only issue I see with it currently is that StructureType::toString  can't 
access Cpp::IndexedInstantiationInformation; either it should also be made 
generic, or alternatively I could bring back Cpp::ClassType, just for this 
functionality if it is truly c++ specific.

Cheers,
Hamish.

KDevPlatform:
- Remove CVSpecs from Declaration (replaced by AbstractType::CommonModifiers::
{ConstModifier|VolatileModifier}

Type System
- Change all equals operators so that A != B when B is a subclass of A 
(before, A == B but B != A)
  This is achieved by comparing the typeClassId within AbstractType::equals, 
and negates the need for fast cast.
- Re-enabled fastCasts. BTW, fastCast would be faster if we just compared 
typeClassIds.
- Remove all operator== and operator!=, just use equals() instead
- Ported all changes to c++ types since this patch set started

- Structure Type
  - Now an IdentifiedType subclass
  - Only remaining issue with this patch: currently we can't get to 
Cpp::IndexedInstantiationInformation, should that be made generic too somehow?  
Alternatively I could bring back Cpp::ClassType, just for this functionality 
if it is truly c++ specific.

- Integral Type
  - remove name() / setName() (not used, doesn't make sense)

- Enumerator Type, Enumeration Type
  - moved from c++

KDevelop
- Ported to new api
- Removed custom c++ types where their functionality is 100% implemented by 
the generic types


Still TODO:
- Clarify which AbstractType::CommonModifiers should stay and which should be 
moved to Declaration
- Introduce same flag system to Declaration?
- Better support custom types, modifiers by providing an interface which 
language supports can implement to return the string translation of each 
custom type/modifier

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdevelop-generictypes-20080813.patch.bz2
Type: application/x-bzip
Size: 25733 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20080813/bd81c4a3/attachment.bz2>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdevplatform-generictypes-20080813.patch.bz2
Type: application/x-bzip
Size: 7424 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20080813/bd81c4a3/attachment-0001.bz2>


More information about the KDevelop-devel mailing list