• 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.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Based on kdevelop-3.0 languages/cpp/store_walker.cpp by Roberto Raggi *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * copyright (C) 2004-2013 *
10  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
11  ***************************************************************************/
12 
13 // own header
14 #include "cpptree2uml.h"
15 
16 // app includes
17 #include "debug_utils.h"
18 #include "ast_utils.h"
19 #include "codeimpthread.h"
20 #include "import_utils.h"
21 // FIXME: The sole reason for the next 2 includes is parseTypedef().
22 // Make capsule methods in ClassImport, and remove these includes.
23 #include "classifier.h"
24 // FIXME The next include is motivated by template params
25 #include "template.h"
26 
27 // qt includes
28 #include <QDir>
29 #include <QFileInfo>
30 #include <QList>
31 #include <QRegExp>
32 
33 CppTree2Uml::CppTree2Uml(const QString& fileName, CodeImpThread* thread)
34  : m_anon(0), m_nsCnt(0), m_clsCnt(0), m_thread(thread)
35 {
36  QDir dir(fileName);
37  m_fileName = dir.canonicalPath();
38 }
39 
40 CppTree2Uml::~CppTree2Uml()
41 {
42 }
43 
44 void CppTree2Uml::parseTranslationUnit(TranslationUnitAST* ast)
45 {
46  m_currentScope.clear();
47  m_currentNamespace[0] = NULL; // index 0 is reserved (always NULL)
48  m_currentClass[0] = NULL; // index 0 is reserved (always NULL)
49  m_nsCnt = 0;
50  m_clsCnt = 0;
51 
52  m_currentAccess = Uml::Visibility::Public;
53  m_inSlots = false;
54  m_inSignals = false;
55  m_inStorageSpec = false;
56  m_inTypedef = false;
57  m_currentDeclarator = 0;
58  m_anon = 0;
59 
60  TreeParser::parseTranslationUnit(ast);
61 }
62 
63 void CppTree2Uml::parseFile(FileAST* ast)
64 {
65  Import_Utils::createUMLObject(UMLObject::ot_Artifact, ast->fileName(),
66  0,
67  ast->comment());
68 }
69 
70 void CppTree2Uml::parseNamespace(NamespaceAST* ast)
71 {
72  if (m_clsCnt > 0) {
73  uDebug() << "error - cannot nest namespace inside class";
74  return;
75  }
76 
77  QString nsName;
78  if(!ast->namespaceName() || ast->namespaceName()->text().isEmpty()){
79  QFileInfo fileInfo(m_fileName);
80  QString shortFileName = fileInfo.baseName();
81 
82  nsName.sprintf("(%s_%d)", shortFileName.toLocal8Bit().constData(), m_anon++);
83  } else {
84  nsName = ast->namespaceName()->text();
85  }
86  uDebug() << nsName;
87  if (m_thread) {
88  m_thread->emitMessageToLog("", "namespace " + nsName);
89  }
90  UMLObject * o = Import_Utils::createUMLObject(UMLObject::ot_Package, nsName,
91  m_currentNamespace[m_nsCnt],
92  ast->comment());
93  UMLPackage *ns = (UMLPackage *)o;
94  m_currentScope.push_back(nsName);
95  if (++m_nsCnt > STACKSIZE) {
96  uError() << "excessive namespace nesting";
97  m_nsCnt = STACKSIZE;
98  }
99  m_currentNamespace[m_nsCnt] = ns;
100 
101  TreeParser::parseNamespace(ast);
102 
103  --m_nsCnt;
104  m_currentScope.pop_back();
105 }
106 
107 void CppTree2Uml::parseTypedef(TypedefAST* ast)
108 {
109  TypeSpecifierAST* typeSpec = ast->typeSpec();
110  InitDeclaratorListAST* declarators = ast->initDeclaratorList();
111 
112  if(typeSpec && declarators){
113  QString typeId;
114 
115  if(typeSpec->name())
116  typeId = typeSpec->name()->text();
117 
118  QList<InitDeclaratorAST*> l(declarators->initDeclaratorList());
119  InitDeclaratorAST* initDecl = 0;
120  for(int i = 0; i < l.size(); ++i) {
121  initDecl = l.at(i);
122  if (initDecl==0) break;
123  QString type, id;
124  if(initDecl->declarator()){
125  type = typeOfDeclaration(typeSpec, initDecl->declarator());
126 
127  DeclaratorAST* d = initDecl->declarator();
128  while(d->subDeclarator()){
129  d = d->subDeclarator();
130  }
131 
132  if(d->declaratorId())
133  id = d->declaratorId()->text();
134  }
135  /* @todo Trace typedefs back to their root type for deciding
136  whether to build a Datatype (for pointers.) */
137  /* check out if the ID type is a Datatype
138  ex: typedef unsigned int uint;
139  where unsigned int is a known datatype
140  I'm not sure if setIsReference() should be run
141  */
142  bool isDatatype = Import_Utils::isDatatype(typeId, m_currentNamespace[m_nsCnt]);
143 
144  if (type.contains('*') || isDatatype) {
145  UMLObject *inner =
146  Import_Utils::createUMLObject(UMLObject::ot_Class, typeId,
147  m_currentNamespace[m_nsCnt]);
148  UMLObject *typedefObj =
149  Import_Utils::createUMLObject(UMLObject::ot_Datatype, id,
150  m_currentNamespace[m_nsCnt]);
151  UMLClassifier *dt = static_cast<UMLClassifier*>(typedefObj);
152  dt->setIsReference();
153  dt->setOriginType(static_cast<UMLClassifier*>(inner));
154  } else {
155  Import_Utils::createUMLObject(UMLObject::ot_Class, id,
156  m_currentNamespace[m_nsCnt],
157  "" /* doc */,
158  "typedef" /* stereotype */);
159  }
160  }
161 
162  }
163 }
164 
165 void CppTree2Uml::parseTemplateDeclaration(TemplateDeclarationAST* ast)
166 {
167  TemplateParameterListAST* parmListAST = ast->templateParameterList();
168  if (parmListAST == NULL)
169  return;
170  QList<TemplateParameterAST*> parmList = parmListAST->templateParameterList();
171  for(int i = 0; i < parmList.size(); ++i) {
172  // The template is either a typeParameter or a typeValueParameter.
173  TemplateParameterAST* tmplParmNode = parmList.at(i);
174  TypeParameterAST* typeParmNode = tmplParmNode->typeParameter();
175  if (typeParmNode) {
176  NameAST* nameNode = typeParmNode->name();
177  if (nameNode) {
178  QString typeName = nameNode->unqualifiedName()->text();
179  Model_Utils::NameAndType nt(typeName, NULL);
180  m_templateParams.append(nt);
181  } else {
182  uError() << "nameNode is NULL";
183  }
184  }
185 
186  ParameterDeclarationAST* valueNode = tmplParmNode->typeValueParameter();
187  if (valueNode) {
188  TypeSpecifierAST* typeSpec = valueNode->typeSpec();
189  if (typeSpec == NULL) {
190  uError() << "typeSpec is NULL";
191  continue;
192  }
193  QString typeName = typeSpec->name()->text();
194  UMLObject *t = Import_Utils::createUMLObject(UMLObject::ot_UMLObject, typeName,
195  m_currentNamespace[m_nsCnt]);
196  DeclaratorAST* declNode = valueNode->declarator();
197  NameAST* nameNode = declNode->declaratorId();
198  if (nameNode == NULL) {
199  uError() << "CppTree2Uml::parseTemplateDeclaration(value):"
200  << " nameNode is NULL";
201  continue;
202  }
203  QString paramName = nameNode->unqualifiedName()->text();
204  Model_Utils::NameAndType nt(paramName, t);
205  m_templateParams.append(nt);
206  }
207  }
208 
209  if(ast->declaration())
210  TreeParser::parseDeclaration(ast->declaration());
211 }
212 
213 void CppTree2Uml::parseSimpleDeclaration(SimpleDeclarationAST* ast)
214 {
215  TypeSpecifierAST* typeSpec = ast->typeSpec();
216  InitDeclaratorListAST* declarators = ast->initDeclaratorList();
217 
218  m_comment = ast->comment();
219 
220  if(typeSpec)
221  parseTypeSpecifier(typeSpec);
222 
223  if(declarators){
224  QList<InitDeclaratorAST*> l = declarators->initDeclaratorList();
225  for(int i = 0; i < l.size(); ++i) {
226  parseDeclaration2(ast->functionSpecifier(), ast->storageSpecifier(), typeSpec, l.at(i));
227  }
228  }
229 }
230 
231 void CppTree2Uml::parseFunctionDefinition(FunctionDefinitionAST* ast)
232 {
233  TypeSpecifierAST* typeSpec = ast->typeSpec();
234  GroupAST* funSpec = ast->functionSpecifier();
235  GroupAST* storageSpec = ast->storageSpecifier();
236 
237  if(!ast->initDeclarator())
238  return;
239 
240  DeclaratorAST* d = ast->initDeclarator()->declarator();
241 
242  if(!d->declaratorId())
243  return;
244 
245  bool isFriend = false;
246 //:unused: bool isVirtual = false;
247  bool isStatic = false;
248 //:unused: bool isInline = false;
249  bool isConstructor = false;
250 
251  if(funSpec){
252 //:unused: QList<AST*> l = funSpec->nodeList();
253 //:unused: for(int i = 0; i < l.size(); ++i) {
254 //:unused: QString text = l.at(i)->text();
255 //:unused: if(text == "virtual") isVirtual = true;
256 //:unused: else if(text == "inline") isInline = true;
257 //:unused: }
258  }
259 
260  if(storageSpec){
261  QList<AST*> l = storageSpec->nodeList();
262  for(int i = 0; i < l.size(); ++i) {
263  QString text = l.at(i)->text();
264  if(text == "friend") isFriend = true;
265  else if(text == "static") isStatic = true;
266  }
267  }
268 
269  QString id = d->declaratorId()->unqualifiedName()->text().trimmed();
270  if (m_thread) {
271  m_thread->emitMessageToLog("", "method " + id);
272  }
273  uDebug() << id;
274 
275  UMLClassifier *c = m_currentClass[m_clsCnt];
276  if (c == NULL) {
277  uDebug() << id << ": need a surrounding class.";
278  return;
279  }
280 
281  QString returnType = typeOfDeclaration(typeSpec, d);
282  UMLOperation *m = Import_Utils::makeOperation(c, id);
283  // if a class has no return type, it could be a constructor or
284  // a destructor
285  if (d && returnType.isEmpty() && id.indexOf('~') == -1)
286  isConstructor = true;
287 
288  parseFunctionArguments(d, m);
289  Import_Utils::insertMethod(c, m, m_currentAccess, returnType,
290  isStatic, false /*isAbstract*/, isFriend, isConstructor, m_comment);
291  m_comment = "";
292 
293 /* For reference, Kdevelop does some more:
294  method->setFileName(m_fileName);
295  if(m_inSignals)
296  method->setSignal(true);
297  if(m_inSlots)
298  method->setSlot(true);
299  */
300 }
301 
302 void CppTree2Uml::parseClassSpecifier(ClassSpecifierAST* ast)
303 {
304  Uml::Visibility::Enum oldAccess = m_currentAccess;
305  bool oldInSlots = m_inSlots;
306  bool oldInSignals = m_inSignals;
307 
308  QString kind = ast->classKey()->text();
309  m_currentAccess = Uml::Visibility::fromString(kind);
310  m_inSlots = false;
311  m_inSignals = false;
312 
313  QString className;
314  if(!ast->name() && m_currentDeclarator && m_currentDeclarator->declaratorId()) {
315  className = m_currentDeclarator->declaratorId()->text().trimmed();
316  } else if(!ast->name()){
317  QFileInfo fileInfo(m_fileName);
318  QString shortFileName = fileInfo.baseName();
319  className.sprintf("(%s_%d)", shortFileName.toLocal8Bit().constData(), m_anon++);
320  } else {
321  className = ast->name()->unqualifiedName()->text().trimmed();
322  }
323  uDebug() << "name=" << className;
324  if (m_thread) {
325  m_thread->emitMessageToLog("", "class " + className);
326  }
327  if(!scopeOfName(ast->name(), QStringList()).isEmpty()){
328  uDebug() << "skip private class declarations";
329  return;
330  }
331 
332  if (className.isEmpty()) {
333  className = "anon_" + QString::number(m_anon);
334  m_anon++;
335  }
336  UMLObject * o = Import_Utils::createUMLObject(UMLObject::ot_Class, className,
337  m_currentNamespace[m_nsCnt],
338  ast->comment());
339  UMLClassifier *klass = static_cast<UMLClassifier*>(o);
340  flushTemplateParams(klass);
341  if (ast->baseClause())
342  parseBaseClause(ast->baseClause(), klass);
343 
344  m_currentScope.push_back(className);
345  if (++m_clsCnt > STACKSIZE) {
346  uError() << "excessive class nesting";
347  m_clsCnt = STACKSIZE;
348  }
349  m_currentClass[m_clsCnt] = klass;
350  if (++m_nsCnt > STACKSIZE) {
351  uError() << "excessive namespace nesting";
352  m_nsCnt = STACKSIZE;
353  }
354  m_currentNamespace[m_nsCnt] = (UMLPackage*)klass;
355 
356  TreeParser::parseClassSpecifier(ast);
357 
358  --m_nsCnt;
359  --m_clsCnt;
360 
361  m_currentScope.pop_back();
362 
363  m_currentAccess = oldAccess;
364  m_inSlots = oldInSlots;
365  m_inSignals = oldInSignals;
366 }
367 
368 void CppTree2Uml::parseEnumSpecifier(EnumSpecifierAST* ast)
369 {
370  NameAST *nameNode = ast->name();
371  if (nameNode == NULL)
372  return; // skip constants
373  QString typeName = nameNode->unqualifiedName()->text().trimmed();
374  if (typeName.isEmpty())
375  return; // skip constants
376  UMLObject *o = Import_Utils::createUMLObject(UMLObject::ot_Enum, typeName,
377  m_currentNamespace[m_nsCnt],
378  ast->comment());
379 
380  QList<EnumeratorAST*> l = ast->enumeratorList();
381  for(int i = 0; i < l.size(); ++i) {
382  QString enumLiteral = l.at(i)->id()->text();
383  Import_Utils::addEnumLiteral((UMLEnum*)o, enumLiteral);
384  }
385 }
386 
387 void CppTree2Uml::parseElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST* typeSpec)
388 {
389  // This is invoked for forward declarations.
393  QString text = typeSpec->text();
394  uDebug() << "forward declaration of " << text;
395  if (m_thread) {
396  m_thread->emitMessageToLog("", "forward declaration of " + text);
397  }
398  text.remove(QRegExp("^class\\s+"));
399 #if 0
400  if (m_thread) { //:TODO: for testing only
401  int answer;
402  m_thread->emitAskQuestion("Soll CppTree2Uml::parseElaboratedTypeSpecifier ausgeführt werden?");
403  uDebug() << "Antwort: " << answer;
404  }
405 #endif
406  UMLObject *o = Import_Utils::createUMLObject(UMLObject::ot_Class, text, m_currentNamespace[m_nsCnt]);
407 #if 0
408  if (m_thread) { //:TODO: for testing only
409  m_thread->emitAskQuestion("Soll nach CppTree2Uml::parseElaboratedTypeSpecifier weiter gemacht werden?");
410  }
411 #endif
412  flushTemplateParams(static_cast<UMLClassifier*>(o));
413 }
414 
415 void CppTree2Uml::parseDeclaration2(GroupAST* funSpec, GroupAST* storageSpec,
416  TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl)
417 {
418  if(m_inStorageSpec)
419  return;
420 
421  DeclaratorAST* d = decl->declarator();
422 
423  if(!d)
424  return;
425 
426  if(!d->subDeclarator() && d->parameterDeclarationClause())
427  return parseFunctionDeclaration(funSpec, storageSpec, typeSpec, decl);
428 
429  DeclaratorAST* t = d;
430  while(t && t->subDeclarator())
431  t = t->subDeclarator();
432 
433  QString id;
434  if(t && t->declaratorId() && t->declaratorId()->unqualifiedName())
435  id = t->declaratorId()->unqualifiedName()->text();
436 
437  if(!scopeOfDeclarator(d, QStringList()).isEmpty()){
438  uDebug() << id << ": skipping.";
439  return;
440  }
441 
442  UMLClassifier *c = m_currentClass[m_clsCnt];
443  if (c == NULL) {
444  uDebug() << id << ": need a surrounding class.";
445  return;
446  }
447 
448  QString typeName = typeOfDeclaration(typeSpec, d);
449 //:unused: bool isFriend = false;
450  bool isStatic = false;
451 //:unused: bool isInitialized = decl->initializer() != 0;
452 
453  if(storageSpec){
454  QList<AST*> l = storageSpec->nodeList();
455  for(int i = 0; i < l.size(); ++i) {
456  QString text = l.at(i)->text();
457  if(text == "static") isStatic = true;
458 //:unused: else if(text == "friend") isFriend = true;
459  }
460  }
461 
462  Import_Utils::insertAttribute(c, m_currentAccess, id, typeName,
463  m_comment, isStatic);
464  m_comment = "";
465 }
466 
467 void CppTree2Uml::parseAccessDeclaration(AccessDeclarationAST * access)
468 {
469  QList<AST*> l = access->accessList();
470 
471  QString accessStr = l.at(0)->text();
472 
473  m_currentAccess=Uml::Visibility::fromString(accessStr);
474 
475  m_inSlots = l.count() > 1 ? l.at(1)->text() == "slots" : false;
476  m_inSignals = l.count() >= 1 ? l.at(0)->text() == "signals" : false;
477 }
478 
479 void CppTree2Uml::parseFunctionDeclaration(GroupAST* funSpec, GroupAST* storageSpec,
480  TypeSpecifierAST * typeSpec, InitDeclaratorAST * decl)
481 {
482  bool isFriend = false;
483 //:unused: bool isVirtual = false;
484  bool isStatic = false;
485 //:unused: bool isInline = false;
486  bool isPure = decl->initializer() != 0;
487  bool isConstructor = false;
488 
489  if(funSpec){
490 //:unused: QList<AST*> l = funSpec->nodeList();
491 //:unused: for(int i = 0; i < l.size(); ++i) {
492 //:unused: QString text = l.at(i)->text();
493 //:unused: if(text == "virtual") isVirtual = true;
494 //:unused: else if(text == "inline") isInline = true;
495 //:unused: }
496  }
497 
498  if(storageSpec){
499  QList<AST*> l = storageSpec->nodeList();
500  for(int i = 0; i < l.size(); ++i) {
501  QString text = l.at(i)->text();
502  if(text == "friend") isFriend = true;
503  else if(text == "static") isStatic = true;
504  }
505  }
506 
507  DeclaratorAST* d = decl->declarator();
508  QString id = d->declaratorId()->unqualifiedName()->text();
509 
510  UMLClassifier *c = m_currentClass[m_clsCnt];
511  if (c == NULL) {
512  uDebug() << id << ": need a surrounding class.";
513  return;
514  }
515 
516  QString returnType = typeOfDeclaration(typeSpec, d);
517  UMLOperation *m = Import_Utils::makeOperation(c, id);
518  // if a class has no return type, it could de a constructor or
519  // a destructor
520  if (d && returnType.isEmpty() && id.indexOf('~') == -1)
521  isConstructor = true;
522 
523  parseFunctionArguments(d, m);
524  Import_Utils::insertMethod(c, m, m_currentAccess, returnType,
525  isStatic, isPure, isFriend, isConstructor, m_comment);
526  m_comment = "";
527 }
528 
529 void CppTree2Uml::parseFunctionArguments(DeclaratorAST* declarator,
530  UMLOperation* method)
531 {
532  ParameterDeclarationClauseAST* clause = declarator->parameterDeclarationClause();
533 
534  if(clause && clause->parameterDeclarationList()){
535  ParameterDeclarationListAST* params = clause->parameterDeclarationList();
536  QList<ParameterDeclarationAST*> l(params->parameterList());
537  for(int i = 0; i < l.size(); ++i) {
538  ParameterDeclarationAST* param = l.at(i);
539 
540  QString name;
541  if (param->declarator())
542  name = declaratorToString(param->declarator(), QString(), true);
543 
544  QString tp = typeOfDeclaration(param->typeSpec(), param->declarator());
545 
546  if (tp != "void")
547  Import_Utils::addMethodParameter(method, tp, name);
548  }
549  }
550 }
551 
552 QString CppTree2Uml::typeOfDeclaration(TypeSpecifierAST* typeSpec, DeclaratorAST* declarator)
553 {
554  if(!typeSpec || !declarator)
555  return QString();
556 
557  QString text;
558 
559  text += typeSpec->text();
560 
561  QList<AST*> ptrOpList = declarator->ptrOpList();
562  for(int i = 0; i < ptrOpList.size(); ++i) {
563  text += ptrOpList.at(i)->text();
564  }
565 
566  return text;
567 }
568 
569 void CppTree2Uml::parseBaseClause(BaseClauseAST * baseClause, UMLClassifier* klass)
570 {
571  QList<BaseSpecifierAST*> l = baseClause->baseSpecifierList();
572  for(int i = 0; i < l.size(); ++i) {
573  BaseSpecifierAST* baseSpecifier = l.at(i);
574 
575  if (baseSpecifier->name() == NULL) {
576  uDebug() << "baseSpecifier->name() is NULL";
577  continue;
578  }
579 
580  QString baseName = baseSpecifier->name()->text();
581  Import_Utils::createGeneralization(klass, baseName);
582  }
583 }
584 
585 QStringList CppTree2Uml::scopeOfName(NameAST* id, const QStringList& startScope)
586 {
587  QStringList scope = startScope;
588  if(id && id->classOrNamespaceNameList().count()){
589  if(id->isGlobal())
590  scope.clear();
591  QList<ClassOrNamespaceNameAST*> l = id->classOrNamespaceNameList();
592  for(int i = 0; i < l.size(); ++i) {
593  if(l.at(i)->name()){
594  scope << l.at(i)->name()->text();
595  }
596  }
597  }
598 
599  return scope;
600 }
601 
602 QStringList CppTree2Uml::scopeOfDeclarator(DeclaratorAST* d, const QStringList& startScope)
603 {
604  return scopeOfName(d->declaratorId(), startScope);
605 }
606 
610 void CppTree2Uml::flushTemplateParams(UMLClassifier *klass)
611 {
612  if (m_templateParams.count()) {
613  Model_Utils::NameAndType_ListIt it;
614  for (it = m_templateParams.begin(); it != m_templateParams.end(); ++it) {
615  const Model_Utils::NameAndType &nt = *it;
616  uDebug() << "adding template param: " << nt.m_name;
617  UMLTemplate *tmpl = klass->addTemplate(nt.m_name);
618  tmpl->setType(nt.m_type);
619  }
620  m_templateParams.clear();
621  }
622 }
NamespaceAST
Definition: ast.h:718
CppTree2Uml::parseTemplateDeclaration
virtual void parseTemplateDeclaration(TemplateDeclarationAST *)
Definition: cpptree2uml.cpp:165
UMLClassifier::addTemplate
UMLTemplate * addTemplate(const QString &name, Uml::ID::Type id=Uml::ID::None)
Adds an already created template.
Definition: classifier.cpp:1043
SimpleDeclarationAST::functionSpecifier
GroupAST * functionSpecifier()
Definition: ast.h:1117
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
AST::text
virtual QString text() const
Definition: ast.h:232
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
NameAST::text
virtual QString text() const
Definition: ast.cpp:203
codeimpthread.h
InitDeclaratorAST::declarator
DeclaratorAST * declarator()
Definition: ast.h:965
CppTree2Uml::parseFile
virtual void parseFile(FileAST *ast)
Definition: cpptree2uml.cpp:63
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
BaseClauseAST
Definition: ast.h:538
UMLClassifierListItem::setType
virtual void setType(UMLObject *type)
Sets the type of the UMLAttribute.
Definition: classifierlistitem.cpp:125
Import_Utils::insertAttribute
UMLObject * insertAttribute(UMLClassifier *owner, Uml::Visibility::Enum scope, const QString &name, UMLClassifier *attrType, const QString &comment, bool isStatic)
Create a UMLAttribute and insert it into the document.
Definition: import_utils.cpp:364
ClassOrNamespaceNameAST::text
virtual QString text() const
Definition: ast.cpp:445
CppTree2Uml::parseSimpleDeclaration
virtual void parseSimpleDeclaration(SimpleDeclarationAST *)
Definition: cpptree2uml.cpp:213
UMLObject::ot_Enum
Definition: umlobject.h:55
DeclaratorAST::ptrOpList
QList< AST * > ptrOpList()
Definition: ast.h:829
UMLClassifier::setIsReference
void setIsReference(bool isRef=true)
Set the m_isRef flag (true when dealing with a pointer type)
Definition: classifier.cpp:1281
ParameterDeclarationAST::typeSpec
TypeSpecifierAST * typeSpec()
Definition: ast.h:880
FunctionDefinitionAST::storageSpecifier
GroupAST * storageSpecifier()
Definition: ast.h:1412
NameAST::isGlobal
bool isGlobal() const
Definition: ast.h:355
DeclaratorAST::parameterDeclarationClause
class ParameterDeclarationClauseAST * parameterDeclarationClause()
Definition: ast.h:844
FileAST::fileName
QString fileName()
Definition: ast.h:437
TemplateParameterListAST
Definition: ast.h:1054
ElaboratedTypeSpecifierAST
Definition: ast.h:642
EnumSpecifierAST
Definition: ast.h:620
TemplateDeclarationAST::templateParameterList
TemplateParameterListAST * templateParameterList()
Definition: ast.h:1090
UMLTemplate
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
InitDeclaratorListAST::initDeclaratorList
QList< InitDeclaratorAST * > initDeclaratorList()
Definition: ast.h:991
ParameterDeclarationClauseAST::parameterDeclarationList
ParameterDeclarationListAST * parameterDeclarationList()
Definition: ast.h:936
TypedefAST
Definition: ast.h:1002
BaseSpecifierAST::name
NameAST * name()
Definition: ast.h:525
classifier.h
ParameterDeclarationListAST::parameterList
QList< ParameterDeclarationAST * > parameterList()
Definition: ast.h:912
CppTree2Uml::parseElaboratedTypeSpecifier
virtual void parseElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *)
Definition: cpptree2uml.cpp:387
debug_utils.h
TreeParser::parseNamespace
virtual void parseNamespace(NamespaceAST *)
Definition: tree_parser.cpp:111
CppTree2Uml::CppTree2Uml
CppTree2Uml(const QString &fileName, CodeImpThread *thread=0)
Definition: cpptree2uml.cpp:33
TemplateParameterAST
Definition: ast.h:1028
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
AST::comment
QString comment() const
Definition: ast.h:235
TreeParser::parseClassSpecifier
virtual void parseClassSpecifier(ClassSpecifierAST *)
Definition: tree_parser.cpp:188
SimpleDeclarationAST::typeSpec
TypeSpecifierAST * typeSpec()
Definition: ast.h:1123
FunctionDefinitionAST::initDeclarator
InitDeclaratorAST * initDeclarator()
Definition: ast.h:1418
CodeImpThread::emitAskQuestion
int emitAskQuestion(const QString &question)
Emit a signal to the main gui thread to show a question box.
Definition: codeimpthread.cpp:88
AccessDeclarationAST
Definition: ast.h:452
SimpleDeclarationAST
Definition: ast.h:1106
Model_Utils::NameAndType::m_name
QString m_name
< Data structure filled by parseAttribute().
Definition: model_utils.h:97
CppTree2Uml::parseFunctionDeclaration
virtual void parseFunctionDeclaration(GroupAST *funSpec, GroupAST *storageSpec, TypeSpecifierAST *typeSpec, InitDeclaratorAST *decl)
Definition: cpptree2uml.cpp:479
NameAST::classOrNamespaceNameList
QList< ClassOrNamespaceNameAST * > classOrNamespaceNameList()
Definition: ast.h:359
TemplateParameterAST::typeValueParameter
ParameterDeclarationAST * typeValueParameter()
Definition: ast.h:1042
CppTree2Uml::parseAccessDeclaration
virtual void parseAccessDeclaration(AccessDeclarationAST *)
Definition: cpptree2uml.cpp:467
FunctionDefinitionAST::functionSpecifier
GroupAST * functionSpecifier()
Definition: ast.h:1409
BaseSpecifierAST
Definition: ast.h:508
Import_Utils::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &inName, UMLPackage *parentPkg, const QString &comment, const QString &stereotype)
Find or create a document object.
Definition: import_utils.cpp:169
DeclaratorAST::subDeclarator
DeclaratorAST * subDeclarator()
Definition: ast.h:832
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
template.h
TypedefAST::initDeclaratorList
InitDeclaratorListAST * initDeclaratorList()
Definition: ast.h:1016
FunctionDefinitionAST
Definition: ast.h:1398
DeclaratorAST::declaratorId
NameAST * declaratorId()
Definition: ast.h:835
TypeParameterAST::name
NameAST * name()
Definition: ast.h:393
NameAST
Definition: ast.h:344
Import_Utils::insertMethod
void insertMethod(UMLClassifier *klass, UMLOperation *&op, Uml::Visibility::Enum scope, const QString &type, bool isStatic, bool isAbstract, bool isFriend, bool isConstructor, const QString &comment)
Insert the UMLOperation into the given classifier.
Definition: import_utils.cpp:435
NamespaceAST::namespaceName
AST * namespaceName()
Definition: ast.h:729
Import_Utils::addMethodParameter
UMLAttribute * addMethodParameter(UMLOperation *method, const QString &type, const QString &name)
Add an argument to a UMLOperation.
Definition: import_utils.cpp:507
ClassSpecifierAST::classKey
AST * classKey()
Definition: ast.h:574
TemplateDeclarationAST::declaration
DeclarationAST * declaration()
Definition: ast.h:1093
uDebug
#define uDebug()
Definition: debug_utils.h:95
declaratorToString
QString declaratorToString(DeclaratorAST *declarator, const QString &scope, bool skipPtrOp)
Definition: ast_utils.cpp:104
Import_Utils::isDatatype
bool isDatatype(const QString &name, UMLPackage *parentPkg)
Returns true if a type is an actual Datatype.
Definition: import_utils.cpp:596
TypedefAST::typeSpec
TypeSpecifierAST * typeSpec()
Definition: ast.h:1013
Model_Utils::NameAndType
Definition: model_utils.h:96
TranslationUnitAST
Definition: ast.h:1441
InitDeclaratorListAST
Definition: ast.h:980
cpptree2uml.h
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
TemplateParameterAST::typeParameter
TypeParameterAST * typeParameter()
Definition: ast.h:1039
FunctionDefinitionAST::typeSpec
TypeSpecifierAST * typeSpec()
Definition: ast.h:1415
Uml::Visibility::Public
Definition: basictypes.h:57
Model_Utils::NameAndType_ListIt
QLinkedList< NameAndType >::iterator NameAndType_ListIt
Auxiliary type for OpDescriptor.
Definition: model_utils.h:110
TreeParser::parseDeclaration
virtual void parseDeclaration(DeclarationAST *)
Definition: tree_parser.cpp:42
UMLEnum
This class contains the non-graphical information required for a UML Enum.
Definition: enum.h:28
TypeParameterAST
Definition: ast.h:376
UMLObject::ot_Artifact
Definition: umlobject.h:63
ParameterDeclarationAST
Definition: ast.h:869
ElaboratedTypeSpecifierAST::text
virtual QString text() const
Definition: ast.cpp:546
AccessDeclarationAST::accessList
QList< AST * > accessList()
Definition: ast.h:463
Import_Utils::makeOperation
UMLOperation * makeOperation(UMLClassifier *parent, const QString &name)
Create a UMLOperation.
Definition: import_utils.cpp:354
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
SimpleDeclarationAST::initDeclaratorList
InitDeclaratorListAST * initDeclaratorList()
Definition: ast.h:1126
CppTree2Uml::parseDeclaration2
virtual void parseDeclaration2(GroupAST *funSpec, GroupAST *storageSpec, TypeSpecifierAST *typeSpec, InitDeclaratorAST *decl)
Definition: cpptree2uml.cpp:415
UMLObject::ot_Class
Definition: umlobject.h:56
EnumSpecifierAST::enumeratorList
QList< EnumeratorAST * > enumeratorList()
Definition: ast.h:632
ClassSpecifierAST::baseClause
BaseClauseAST * baseClause()
Definition: ast.h:577
CppTree2Uml::parseBaseClause
virtual void parseBaseClause(BaseClauseAST *baseClause, UMLClassifier *klass)
Definition: cpptree2uml.cpp:569
ParameterDeclarationClauseAST
Definition: ast.h:925
CodeImpThread::emitMessageToLog
void emitMessageToLog(const QString &file, const QString &text)
Emit a signal to the main gui thread to write a log text to the log widget.
Definition: codeimpthread.cpp:102
import_utils.h
UMLObject::ot_UMLObject
Definition: umlobject.h:49
Model_Utils::NameAndType::m_type
UMLObject * m_type
Definition: model_utils.h:98
TreeParser::parseTypeSpecifier
virtual void parseTypeSpecifier(TypeSpecifierAST *)
Definition: tree_parser.cpp:170
GroupAST::nodeList
QList< AST * > nodeList()
Definition: ast.h:278
SimpleDeclarationAST::storageSpecifier
GroupAST * storageSpecifier()
Definition: ast.h:1120
uError
#define uError()
Definition: debug_utils.h:96
GroupAST
Definition: ast.h:267
TreeParser::parseTranslationUnit
virtual void parseTranslationUnit(TranslationUnitAST *)
Definition: tree_parser.cpp:34
TemplateParameterListAST::templateParameterList
QList< TemplateParameterAST * > templateParameterList()
Definition: ast.h:1065
InitDeclaratorAST::initializer
AST * initializer()
Definition: ast.h:968
UMLObject::ot_Package
Definition: umlobject.h:52
STACKSIZE
#define STACKSIZE
Definition: cpptree2uml.h:86
ClassSpecifierAST
Definition: ast.h:560
TypeSpecifierAST::text
virtual QString text() const
Definition: ast.cpp:475
BaseClauseAST::baseSpecifierList
QList< BaseSpecifierAST * > baseSpecifierList()
Definition: ast.h:550
Import_Utils::addEnumLiteral
void addEnumLiteral(UMLEnum *enumType, const QString &literal, const QString &comment)
Add an enum literal to an UMLEnum.
Definition: import_utils.cpp:528
TypeSpecifierAST::name
virtual NameAST * name()
Definition: ast.h:487
UMLClassifier::setOriginType
void setOriginType(UMLClassifier *origType)
Set the origin type (in case of e.g.
Definition: classifier.cpp:1263
ParameterDeclarationListAST
Definition: ast.h:901
ParameterDeclarationAST::declarator
DeclaratorAST * declarator()
Definition: ast.h:883
NameAST::unqualifiedName
ClassOrNamespaceNameAST * unqualifiedName()
Definition: ast.h:361
Import_Utils::createGeneralization
void createGeneralization(UMLClassifier *child, UMLClassifier *parent)
Create a generalization from the given child classifier to the given parent classifier.
Definition: import_utils.cpp:538
TemplateDeclarationAST
Definition: ast.h:1076
UMLObject::ot_Datatype
Definition: umlobject.h:54
CppTree2Uml::parseTranslationUnit
virtual void parseTranslationUnit(TranslationUnitAST *)
Definition: cpptree2uml.cpp:44
QList
Uml::Visibility::fromString
Enum fromString(const QString &item)
Convert a string item into Visibility representation.
Definition: basictypes.cpp:119
ast_utils.h
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