summaryrefslogtreecommitdiffstats
path: root/lib/interfaces/codemodel_treeparser.cpp
blob: b514a90e23319483f75e9e0c1b38f7fb3acc0ef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* This file is part of KDevelop
    Copyright (C) 2003 Roberto Raggi <[email protected]>

    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*/ )
{
}