Update of /cvsroot/cpptool/CppParser/examples/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31922/examples/parser
Modified Files:
symboltable.cpp symboltable.h
Log Message:
-- added function to find sibling declarations
Index: symboltable.cpp
===================================================================
RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltable.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** symboltable.cpp 20 Jun 2004 11:00:38 -0000 1.2
--- symboltable.cpp 16 Aug 2004 20:56:11 -0000 1.3
***************
*** 2,6 ****
#include "scope.h"
-
namespace Parser {
--- 2,5 ----
***************
*** 28,31 ****
--- 27,43 ----
}
+ SymbolDeclarationPtrEnum
+ SymbolTable::enumSiblingDeclaration( const SymbolDeclarationPtr& declaration) const
+ {
+ std::deque<SymbolDeclarationPtr> * list = new std::deque<SymbolDeclarationPtr>();
+ SymbolsReferences::const_iterator itSymbol = references_.begin();
+ for ( ; itSymbol != references_.end(); ++itSymbol )
+ {
+ if (itSymbol->first->equals(*declaration))
+ list->push_back(itSymbol->first);
+ }
+ return CppUT::enumStl(*list);
+ }
+
SymbolDeclarationPtr
Index: symboltable.h
===================================================================
RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltable.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** symboltable.h 20 Jun 2004 11:00:38 -0000 1.2
--- symboltable.h 16 Aug 2004 20:56:11 -0000 1.3
***************
*** 23,26 ****
--- 23,28 ----
SymbolDeclarationPtr findDeclarationAt( const Location &location ) const;
+ Parser::SymbolDeclarationPtrEnum enumSiblingDeclaration( const SymbolDeclarationPtr& declaration) const;
+
SymbolDeclarationPtr declare( const Symbol &symbol );
|