umbrello: umbrello/codeimport/nativeimportbase.h Source File

umbrello 2.31.0 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

nativeimportbase.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-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef NATIVEIMPORTBASE_H
12 #define NATIVEIMPORTBASE_H
13
14 #include "basictypes.h"
15 #include "classimport.h"
16
17 #include <QString>
18 #include <QStringList>
19
20 class UMLPackage;
21 class UMLClassifier;
22
44 class NativeImportBase : public ClassImport
45 {
46 public:
47 explicit NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread* thread = 0);
48 virtual ~NativeImportBase();
49
50 protected:
51 void initialize();
52
53 void setMultiLineComment(const QString &intro, const QString &end);
54 void setMultiLineAltComment(const QString &intro, const QString &end);
55
56 virtual bool parseFile(const QString& filename);
57
58 virtual void initVars();
59
60 void scan(const QString& line);
61
62 virtual bool preprocess(QString& line);
63
64 virtual QStringList split(const QString& line);
65
71 virtual void fillSource(const QString& word) = 0;
72
81 virtual bool parseStmt() = 0;
82
83 void skipStmt(const QString& until = QLatin1String(";"));
84 bool skipToClosing(QChar opener);
85
86 QString lookAhead();
87 virtual QString advance();
88
89 void pushScope(UMLPackage *p);
90 UMLPackage *popScope();
91 UMLPackage *currentScope();
92 int scopeIndex();
93
94 QString m_singleLineCommentIntro;
95 QStringList m_source;
96 int m_srcIndex;
97 QList<UMLPackage *> m_scope;
98 UMLClassifier *m_klass;
99 Uml::Visibility::Enum m_currentAccess;
100 QString m_comment;
101
106 bool m_inComment;
107 bool m_isAbstract;
108
115 static QStringList m_parsedFiles;
116
117 QString m_multiLineCommentIntro;
118 QString m_multiLineCommentEnd;
119
123 QString m_multiLineAltCommentIntro;
124 QString m_multiLineAltCommentEnd;
125 };
126
127 #endif
128
NativeImportBase::scopeIndex
int scopeIndex()
Definition: nativeimportbase.cpp:176
ClassImport::log
void log(const QString &file, const QString &text)
Definition: classimport.cpp:133
NativeImportBase::m_currentAccess
Uml::Visibility::Enum m_currentAccess
current access (public/protected/private)
Definition: nativeimportbase.h:99
NativeImportBase::~NativeImportBase
virtual ~NativeImportBase()
Definition: nativeimportbase.cpp:48
NativeImportBase::preprocess
virtual bool preprocess(QString &line)
Definition: nativeimportbase.cpp:226
NativeImportBase::setMultiLineAltComment
void setMultiLineAltComment(const QString &intro, const QString &end)
Definition: nativeimportbase.cpp:71
ClassImport
Definition: classimport.h:25
NativeImportBase::m_multiLineAltCommentIntro
QString m_multiLineAltCommentIntro
Definition: nativeimportbase.h:123
NativeImportBase::m_klass
UMLClassifier * m_klass
class currently being processed
Definition: nativeimportbase.h:98
NativeImportBase::m_multiLineCommentIntro
QString m_multiLineCommentIntro
multi line comment delimiter intro
Definition: nativeimportbase.h:117
NativeImportBase::m_inComment
bool m_inComment
Definition: nativeimportbase.h:106
NativeImportBase::setMultiLineComment
void setMultiLineComment(const QString &intro, const QString &end)
Definition: nativeimportbase.cpp:59
import_utils.h
NativeImportBase::m_scope
QList< UMLPackage * > m_scope
stack of scopes for use by the specific importer
Definition: nativeimportbase.h:97
classimport.h
NativeImportBase::currentScope
UMLPackage * currentScope()
Definition: nativeimportbase.cpp:165
NativeImportBase::skipStmt
void skipStmt(const QString &until=QLatin1String(";"))
Definition: nativeimportbase.cpp:82
Uml::Visibility::Public
@ Public
Definition: basictypes.h:77
NativeImportBase::skipToClosing
bool skipToClosing(QChar opener)
Definition: nativeimportbase.cpp:97
NativeImportBase::m_multiLineAltCommentEnd
QString m_multiLineAltCommentEnd
Definition: nativeimportbase.h:124
NativeImportBase::m_isAbstract
bool m_isAbstract
accumulator for abstractness
Definition: nativeimportbase.h:107
NativeImportBase::popScope
UMLPackage * popScope()
Definition: nativeimportbase.cpp:153
NativeImportBase::m_source
QStringList m_source
the scanned lexemes
Definition: nativeimportbase.h:95
NativeImportBase::scan
void scan(const QString &line)
Definition: nativeimportbase.cpp:374
Import_Utils::globalScope
UMLPackage * globalScope()
Definition: import_utils.cpp:803
basictypes.h
uDebug
#define uDebug()
Definition: debug_utils.h:122
Import_Utils::addIncludePath
void addIncludePath(const QString &path)
Definition: import_utils.cpp:784
NativeImportBase::advance
virtual QString advance()
Definition: nativeimportbase.cpp:198
NativeImportBase::NativeImportBase
NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread *thread=0)
Definition: nativeimportbase.cpp:34
NativeImportBase::m_comment
QString m_comment
intermediate accumulator for comment text
Definition: nativeimportbase.h:100
CodeImpThread
Definition: codeimpthread.h:35
NativeImportBase::m_multiLineCommentEnd
QString m_multiLineCommentEnd
multi line comment delimiter end
Definition: nativeimportbase.h:118
NativeImportBase
Base class for native implementations of language import.
Definition: nativeimportbase.h:44
Uml
Definition: basictypes.cpp:36
nativeimportbase.h
NativeImportBase::parseFile
virtual bool parseFile(const QString &filename)
Definition: nativeimportbase.cpp:417
Uml::Visibility::Enum
Enum
Definition: basictypes.h:76
uError
#define uError()
Definition: debug_utils.h:123
NativeImportBase::parseStmt
virtual bool parseStmt()=0
NativeImportBase::fillSource
virtual void fillSource(const QString &word)=0
NativeImportBase::initialize
void initialize()
Definition: nativeimportbase.cpp:501
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:39
debug_utils.h
NativeImportBase::initVars
virtual void initVars()
Definition: nativeimportbase.cpp:406
NativeImportBase::pushScope
void pushScope(UMLPackage *p)
Definition: nativeimportbase.cpp:143
NativeImportBase::split
virtual QStringList split(const QString &line)
Definition: nativeimportbase.cpp:324
NativeImportBase::lookAhead
QString lookAhead()
Definition: nativeimportbase.cpp:185
NativeImportBase::m_singleLineCommentIntro
QString m_singleLineCommentIntro
start token of a single line comment
Definition: nativeimportbase.h:94
NativeImportBase::m_srcIndex
int m_srcIndex
used for indexing m_source
Definition: nativeimportbase.h:96
Import_Utils::includePathList
QStringList includePathList()
Definition: import_utils.cpp:771
NativeImportBase::m_parsedFiles
static QStringList m_parsedFiles
Definition: nativeimportbase.h:115
codeimpthread.h
UMLPackage
Non-graphical information for a Package.
Definition: package.h:32