From: Andre B. <and...@gm...> - 2004-08-12 09:15:15
|
hello Baptiste, I'm not sure about the status of the two source trees at the moment. However I could not get the "src/*" tree compiled because of missing files. For that reason I continued to look through "example/cppparser/tests". Aspecially the refactoring tests were intressting for me "refactoring/test1.cpp - test6.cpp I found out that the symboltable generates two entries for the declarations "class C1;" and "class C1 { .... }". SymbolDeclarator::declareClass inserts: SymbolDeclarationPtr declaration = symbolTable_.declare( classSymbol ); SymbolDeclarator::declareForwardClass does the same: SymbolDeclarationPtr declaration = symbolTable_.declare( classSymbol ); Last but not least the member "symboltable.declare" does: SymbolTable::declare( const Symbol &symbol ) { SymbolDeclarationPtr declaration( new SymbolDeclaration( symbol ) ); references_[ declaration ].push_back( symbol.location() ); return declaration; } ====== this leads to a hashmap "references_" which has two entries. During refactoring tests the test code asks for the declaration at position 'x': Parser::SymbolDeclarationPtr declaration = table.findDeclarationAt( location ); This will only return a single declaration and it's references. However, all other forward declarations are missed. Possible solutions are: - model the declaration type differently, such that multiple locations of declarations are possible (sounds a little bit ugly) - make references between all forward-declarations and declarations, these need to be two way links, because the user could select the forward-declaration for rename-operation... any idea ? greetings from Berlin, André |