summaryrefslogtreecommitdiffstats
path: root/lib/interfaces/codemodel_treeparser.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /lib/interfaces/codemodel_treeparser.cpp
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/interfaces/codemodel_treeparser.cpp')
-rw-r--r--lib/interfaces/codemodel_treeparser.cpp108
1 files changed, 108 insertions, 0 deletions
diff --git a/lib/interfaces/codemodel_treeparser.cpp b/lib/interfaces/codemodel_treeparser.cpp
new file mode 100644
index 00000000..b514a90e
--- /dev/null
+++ b/lib/interfaces/codemodel_treeparser.cpp
@@ -0,0 +1,108 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "codemodel.h"
+#include "codemodel_treeparser.h"
+
+CodeModelTreeParser::CodeModelTreeParser( )
+{
+}
+
+CodeModelTreeParser::~CodeModelTreeParser( )
+{
+}
+
+void CodeModelTreeParser::parseCode( const CodeModel * model )
+{
+ const FileList fileList = model->fileList();
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ parseFile( *it );
+}
+
+void CodeModelTreeParser::parseFile( const FileModel * file )
+{
+ const NamespaceList namespaceList = file->namespaceList();
+ const ClassList classList = file->classList();
+ const FunctionList functionList = file->functionList();
+ const FunctionDefinitionList functionDefinitionList = file->functionDefinitionList();
+ const VariableList variableList = file->variableList();
+
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ parseNamespace( *it );
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseNamespace( const NamespaceModel * ns )
+{
+ const NamespaceList namespaceList = ns->namespaceList();
+ const ClassList classList = ns->classList();
+ const FunctionList functionList = ns->functionList();
+ const FunctionDefinitionList functionDefinitionList = ns->functionDefinitionList();
+ const VariableList variableList = ns->variableList();
+
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ parseNamespace( *it );
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseClass( const ClassModel * klass )
+{
+ const ClassList classList = klass->classList();
+ const FunctionList functionList = klass->functionList();
+ const FunctionDefinitionList functionDefinitionList = klass->functionDefinitionList();
+ const VariableList variableList = klass->variableList();
+
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseFunction( const FunctionModel * /*fun*/ )
+{
+}
+
+void CodeModelTreeParser::parseFunctionDefinition( const FunctionDefinitionModel * /*fun*/ )
+{
+}
+
+void CodeModelTreeParser::parseVariable( const VariableModel * /*var*/ )
+{
+}
+
+
+