• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codeimport
  • kdevcppparser
cpptree2uml.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2005-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef CPPTREE2UML_H
12 #define CPPTREE2UML_H
13 
14 #include "tree_parser.h"
15 #include "model_utils.h"
16 
17 #include <QStringList>
18 
19 // fwd decls
20 class CodeImpThread;
21 class UMLClassifier;
22 class UMLOperation;
23 class UMLPackage;
24 
25 class CppTree2Uml: public TreeParser
26 {
27 public:
28  explicit CppTree2Uml(const QString& fileName, CodeImpThread* thread = 0);
29  virtual ~CppTree2Uml();
30 
31  //FileDom file() { return m_file; }
32 
33  // translation-unit
34  virtual void parseTranslationUnit(TranslationUnitAST*);
35 
36  // declarations
37  //virtual void parseDeclaration(DeclarationAST*); // use parent method
38  //virtual void parseLinkageSpecification(LinkageSpecificationAST*); // use parent method
39  virtual void parseFile(FileAST* ast);
40  virtual void parseNamespace(NamespaceAST*);
41  //virtual void parseNamespaceAlias(NamespaceAliasAST*); // use parent method
42  //virtual void parseUsing(UsingAST*); // use parent method
43  //virtual void parseUsingDirective(UsingDirectiveAST*); // use parent method
44  virtual void parseTypedef(TypedefAST*);
45  virtual void parseTemplateDeclaration(TemplateDeclarationAST*);
46  virtual void parseSimpleDeclaration(SimpleDeclarationAST*);
47  virtual void parseFunctionDefinition(FunctionDefinitionAST*);
48  //virtual void parseLinkageBody(LinkageBodyAST*); // use parent method
49  virtual void parseAccessDeclaration(AccessDeclarationAST*);
50 
51  // type-specifier
52  //virtual void parseTypeSpecifier(TypeSpecifierAST*); // use parent method
53  virtual void parseClassSpecifier(ClassSpecifierAST*);
54  virtual void parseEnumSpecifier(EnumSpecifierAST*);
55  virtual void parseElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST*);
56 
57  // non-overriding (locally added) methods
58 
59  virtual void parseDeclaration2(GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl);
60  virtual void parseFunctionDeclaration(GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl);
61  void parseFunctionArguments(DeclaratorAST* declarator, UMLOperation* method);
62  virtual void parseBaseClause(BaseClauseAST* baseClause, UMLClassifier* klass);
63 
64 private:
65  //NamespaceDom findOrInsertNamespace(NamespaceAST* ast, const QString& name);
66 
67  QString typeOfDeclaration(TypeSpecifierAST* typeSpec, DeclaratorAST* declarator);
68  QStringList scopeOfName(NameAST* id, const QStringList& scope);
69  QStringList scopeOfDeclarator(DeclaratorAST* d, const QStringList& scope);
70  void flushTemplateParams(UMLClassifier *klass);
71 
72 private:
73  //FileDom m_file;
74  QString m_fileName;
75  QStringList m_currentScope;
76  Uml::Visibility::Enum m_currentAccess;
77  bool m_inSlots;
78  bool m_inSignals;
79  int m_anon;
80  bool m_inStorageSpec;
81  bool m_inTypedef;
82  QString m_comment;
83  Model_Utils::NameAndType_List m_templateParams;
84 
85  DeclaratorAST* m_currentDeclarator;
86 # define STACKSIZE 30
87  UMLPackage* m_currentNamespace[STACKSIZE+1];
88  UMLClassifier* m_currentClass[STACKSIZE+1];
89  int m_nsCnt;
90  int m_clsCnt;
91  CodeImpThread* m_thread;
92 
93 private:
94  CppTree2Uml(const CppTree2Uml& source);
95  void operator = (const CppTree2Uml& source);
96 };
97 
98 #endif // CPPTREE2UML
NamespaceAST
Definition: ast.h:718
CppTree2Uml::parseTemplateDeclaration
virtual void parseTemplateDeclaration(TemplateDeclarationAST *)
Definition: cpptree2uml.cpp:165
UMLPackage
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
CppTree2Uml::parseTypedef
virtual void parseTypedef(TypedefAST *)
Definition: cpptree2uml.cpp:107
CppTree2Uml::~CppTree2Uml
virtual ~CppTree2Uml()
Definition: cpptree2uml.cpp:40
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
InitDeclaratorAST
Definition: ast.h:954
CppTree2Uml::parseFile
virtual void parseFile(FileAST *ast)
Definition: cpptree2uml.cpp:63
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
BaseClauseAST
Definition: ast.h:538
CppTree2Uml::parseSimpleDeclaration
virtual void parseSimpleDeclaration(SimpleDeclarationAST *)
Definition: cpptree2uml.cpp:213
CppTree2Uml
Definition: cpptree2uml.h:25
Model_Utils::NameAndType_List
QLinkedList< NameAndType > NameAndType_List
Auxiliary type for OpDescriptor.
Definition: model_utils.h:109
ElaboratedTypeSpecifierAST
Definition: ast.h:642
EnumSpecifierAST
Definition: ast.h:620
TypedefAST
Definition: ast.h:1002
CppTree2Uml::parseElaboratedTypeSpecifier
virtual void parseElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *)
Definition: cpptree2uml.cpp:387
model_utils.h
CppTree2Uml::CppTree2Uml
CppTree2Uml(const QString &fileName, CodeImpThread *thread=0)
Definition: cpptree2uml.cpp:33
AccessDeclarationAST
Definition: ast.h:452
SimpleDeclarationAST
Definition: ast.h:1106
CppTree2Uml::parseFunctionDeclaration
virtual void parseFunctionDeclaration(GroupAST *funSpec, GroupAST *storageSpec, TypeSpecifierAST *typeSpec, InitDeclaratorAST *decl)
Definition: cpptree2uml.cpp:479
CppTree2Uml::parseAccessDeclaration
virtual void parseAccessDeclaration(AccessDeclarationAST *)
Definition: cpptree2uml.cpp:467
CppTree2Uml::parseClassSpecifier
virtual void parseClassSpecifier(ClassSpecifierAST *)
Definition: cpptree2uml.cpp:302
CppTree2Uml::parseNamespace
virtual void parseNamespace(NamespaceAST *)
Definition: cpptree2uml.cpp:70
FileAST
Definition: ast.h:426
FunctionDefinitionAST
Definition: ast.h:1398
NameAST
Definition: ast.h:344
TranslationUnitAST
Definition: ast.h:1441
CppTree2Uml::parseEnumSpecifier
virtual void parseEnumSpecifier(EnumSpecifierAST *)
Definition: cpptree2uml.cpp:368
CodeImpThread
Thread class that does the code import work for one file.
Definition: codeimpthread.h:35
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
CppTree2Uml::parseDeclaration2
virtual void parseDeclaration2(GroupAST *funSpec, GroupAST *storageSpec, TypeSpecifierAST *typeSpec, InitDeclaratorAST *decl)
Definition: cpptree2uml.cpp:415
CppTree2Uml::parseBaseClause
virtual void parseBaseClause(BaseClauseAST *baseClause, UMLClassifier *klass)
Definition: cpptree2uml.cpp:569
GroupAST
Definition: ast.h:267
STACKSIZE
#define STACKSIZE
Definition: cpptree2uml.h:86
ClassSpecifierAST
Definition: ast.h:560
tree_parser.h
TreeParser
Definition: tree_parser.h:25
TemplateDeclarationAST
Definition: ast.h:1076
CppTree2Uml::parseTranslationUnit
virtual void parseTranslationUnit(TranslationUnitAST *)
Definition: cpptree2uml.cpp:44
CppTree2Uml::parseFunctionArguments
void parseFunctionArguments(DeclaratorAST *declarator, UMLOperation *method)
Definition: cpptree2uml.cpp:529
DeclaratorAST
Definition: ast.h:818
TypeSpecifierAST
Definition: ast.h:476
CppTree2Uml::parseFunctionDefinition
virtual void parseFunctionDefinition(FunctionDefinitionAST *)
Definition: cpptree2uml.cpp:231
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal