Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT-2.1 breaking API changes

> 
> Being heavily focused on the AST at the moment, I am definitely interested 
> in your thoughts on structure definition vs structure declaration. From an 
> AST perspective, there is no such thing as a structure definition. You 
> declare a structure as a type and then use that type in other 
> declarations.
> 
> However, I haven't looked at the CModel in a long time and can't recall 
> how things were done there. What were you planning for this?
> 

It should not affect the AST generation nor API.
The Core Model has a number of inconsistencies, IStruture is one.

1) Declaration of structure foo:
	struct foo;

2) Definition && declaration of structure foo
	Struct foo {
		int bar;
	};

3) Definition/declaration of structure foo, declaration/definition of variable foobar
	Struct foo {
		int bar;
	} foobar;


In the model, now for 1, 2 everything is an IStructure.

Modules lile OpenType view, Class hierachy view, C++ browsing perpspective need
to see distinction in IStructure.

So for (2)
  IStructureDefinition extends IStructureDeclaration, IMember {
  }


The IStructure we have now is actually an IStructureDeclaration, rename
IStructureDeclartion should minimize the confusion.




Back to the top