• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • TDevelop Interfaces Library
 

TDevelop Interfaces Library

  • lib
  • interfaces
codemodel_treeparser.cpp
1/* This file is part of TDevelop
2 Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#include "codemodel.h"
21#include "codemodel_treeparser.h"
22
23CodeModelTreeParser::CodeModelTreeParser( )
24{
25}
26
27CodeModelTreeParser::~CodeModelTreeParser( )
28{
29}
30
31void CodeModelTreeParser::parseCode( const CodeModel * model )
32{
33 const FileList fileList = model->fileList();
34 for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
35 parseFile( *it );
36}
37
38void CodeModelTreeParser::parseFile( const FileModel * file )
39{
40 const NamespaceList namespaceList = file->namespaceList();
41 const ClassList classList = file->classList();
42 const FunctionList functionList = file->functionList();
43 const FunctionDefinitionList functionDefinitionList = file->functionDefinitionList();
44 const VariableList variableList = file->variableList();
45
46 for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
47 parseNamespace( *it );
48 for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
49 parseClass( *it );
50 for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
51 parseFunction( *it );
52 for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
53 parseFunctionDefinition( *it );
54 for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
55 parseVariable( *it );
56}
57
58void CodeModelTreeParser::parseNamespace( const NamespaceModel * ns )
59{
60 const NamespaceList namespaceList = ns->namespaceList();
61 const ClassList classList = ns->classList();
62 const FunctionList functionList = ns->functionList();
63 const FunctionDefinitionList functionDefinitionList = ns->functionDefinitionList();
64 const VariableList variableList = ns->variableList();
65
66 for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
67 parseNamespace( *it );
68 for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
69 parseClass( *it );
70 for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
71 parseFunction( *it );
72 for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
73 parseFunctionDefinition( *it );
74 for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
75 parseVariable( *it );
76}
77
78void CodeModelTreeParser::parseClass( const ClassModel * klass )
79{
80 const ClassList classList = klass->classList();
81 const FunctionList functionList = klass->functionList();
82 const FunctionDefinitionList functionDefinitionList = klass->functionDefinitionList();
83 const VariableList variableList = klass->variableList();
84
85 for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
86 parseClass( *it );
87 for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
88 parseFunction( *it );
89 for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
90 parseFunctionDefinition( *it );
91 for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
92 parseVariable( *it );
93}
94
95void CodeModelTreeParser::parseFunction( const FunctionModel * /*fun*/ )
96{
97}
98
99void CodeModelTreeParser::parseFunctionDefinition( const FunctionDefinitionModel * /*fun*/ )
100{
101}
102
103void CodeModelTreeParser::parseVariable( const VariableModel * /*var*/ )
104{
105}
106
107
108
ClassList
The list of code model classes.
ClassModel
Class model.
Definition codemodel.h:697
ClassModel::functionList
FunctionList functionList()
Definition codemodel.cpp:793
ClassModel::variableList
VariableList variableList()
Definition codemodel.cpp:905
ClassModel::classList
ClassList classList()
Definition codemodel.cpp:737
ClassModel::functionDefinitionList
FunctionDefinitionList functionDefinitionList()
Definition codemodel.cpp:849
CodeModelTreeParser::parseFile
virtual void parseFile(const FileModel *file)
Parses recursively all code in the file.
Definition codemodel_treeparser.cpp:38
CodeModelTreeParser::parseClass
virtual void parseClass(const ClassModel *klass)
Parses recursively all code in the class klass.
Definition codemodel_treeparser.cpp:78
CodeModelTreeParser::parseNamespace
virtual void parseNamespace(const NamespaceModel *ns)
Parses recursively all code in the namespace ns.
Definition codemodel_treeparser.cpp:58
CodeModelTreeParser::parseFunction
virtual void parseFunction(const FunctionModel *fun)
Parses function (function declaration) fun.
Definition codemodel_treeparser.cpp:95
CodeModelTreeParser::parseCode
virtual void parseCode(const CodeModel *model)
Parses recursively all code in the model.
Definition codemodel_treeparser.cpp:31
CodeModelTreeParser::parseFunctionDefinition
virtual void parseFunctionDefinition(const FunctionDefinitionModel *fun)
Parses function definition fun.
Definition codemodel_treeparser.cpp:99
CodeModelTreeParser::~CodeModelTreeParser
virtual ~CodeModelTreeParser()
Destructor.
Definition codemodel_treeparser.cpp:27
CodeModelTreeParser::CodeModelTreeParser
CodeModelTreeParser()
Constructor.
Definition codemodel_treeparser.cpp:23
CodeModelTreeParser::parseVariable
virtual void parseVariable(const VariableModel *var)
Parses variable var.
Definition codemodel_treeparser.cpp:103
CodeModel
Code Model - a memory symbol store.
Definition codemodel.h:325
CodeModel::fileList
FileList fileList()
Gets the list of files in the store.
Definition codemodel.cpp:371
FileList
The list of code model files.
FileModel
File model.
Definition codemodel.h:1139
FunctionDefinitionList
The list of code model function definitions.
FunctionDefinitionModel
Function model.
Definition codemodel.h:1384
FunctionList
The list of code model functions.
FunctionModel
Function model.
Definition codemodel.h:1246
NamespaceList
The list of code model namespaces.
NamespaceModel
Namespace model.
Definition codemodel.h:1040
NamespaceModel::namespaceList
NamespaceList namespaceList()
Definition codemodel.cpp:670
VariableList
The list of code model variables.
VariableModel
Variable model.
Definition codemodel.h:1410
codemodel.h
Code Model - a memory symbol store.
codemodel_treeparser.h
Tree parser for a code model.

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for TDevelop Interfaces Library by doxygen 1.15.0
This website is maintained by Timothy Pearson.