umbrello: umbrello/codeimport/nativeimportbase.h Source File

umbrello 25.08.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 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2005-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef NATIVEIMPORTBASE_H
7#define NATIVEIMPORTBASE_H
8
9#include "basictypes.h"
10#include "classimport.h"
11
12#include <QString>
13#include <QStringList>
14
15class UMLPackage;
16class UMLClassifier;
17
39 class NativeImportBase : public ClassImport
40{
41public:
42 explicit NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread *thread = nullptr);
43 virtual ~NativeImportBase();
44
45protected:
46 void initialize();
47
48 void setMultiLineComment(const QString &intro, const QString &end);
49 void setMultiLineAltComment(const QString &intro, const QString &end);
50
51 virtual bool parseFile(const QString& filename);
52
53 virtual void initVars();
54
55 void scan(const QString& line);
56
57 virtual bool preprocess(QString& line);
58
59 virtual QStringList split(const QString& line);
60
66 virtual void fillSource(const QString& word) = 0;
67
76 virtual bool parseStmt() = 0;
77
78 void skipStmt(const QString& until = QStringLiteral(";"));
79 bool skipToClosing(QChar opener);
80
81 QString current();
82 QString lookAhead();
83 virtual QString advance();
84
85 void pushScope(UMLPackage *p);
86 UMLPackage *popScope();
87 UMLPackage *currentScope();
88 int scopeIndex();
89
90 QString m_singleLineCommentIntro;
91 QStringList m_source;
92 int m_srcIndex;
93 QList<UMLPackage *> m_scope;
94 UMLClassifier *m_klass;
95 Uml::Visibility::Enum m_currentAccess;
96 QString m_comment;
97
102 bool m_inComment;
103 bool m_isAbstract;
104
111 static QStringList m_parsedFiles;
112
113 QString m_multiLineCommentIntro;
114 QString m_multiLineCommentEnd;
119 QString m_multiLineAltCommentIntro;
120 QString m_multiLineAltCommentEnd;
121};
122
123#endif
124
basictypes.h
ClassImport::ClassImport
ClassImport(CodeImpThread *thread=nullptr)
Definition classimport.cpp:69
CodeImpThread
Definition codeimpthread.h:22
NativeImportBase::m_currentAccess
Uml::Visibility::Enum m_currentAccess
current access (public/protected/private)
Definition nativeimportbase.h:95
NativeImportBase::skipToClosing
bool skipToClosing(QChar opener)
Definition nativeimportbase.cpp:96
NativeImportBase::m_parsedFiles
static QStringList m_parsedFiles
Definition nativeimportbase.h:111
NativeImportBase::m_scope
QList< UMLPackage * > m_scope
stack of scopes for use by the specific importer
Definition nativeimportbase.h:93
NativeImportBase::currentScope
UMLPackage * currentScope()
Definition nativeimportbase.cpp:165
NativeImportBase::lookAhead
QString lookAhead()
Definition nativeimportbase.cpp:197
NativeImportBase::m_inComment
bool m_inComment
Definition nativeimportbase.h:102
NativeImportBase::NativeImportBase
NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread *thread=nullptr)
Definition nativeimportbase.cpp:33
NativeImportBase::scan
void scan(const QString &line)
Definition nativeimportbase.cpp:386
NativeImportBase::m_source
QStringList m_source
the scanned lexemes
Definition nativeimportbase.h:91
NativeImportBase::m_srcIndex
int m_srcIndex
used for indexing m_source
Definition nativeimportbase.h:92
NativeImportBase::preprocess
virtual bool preprocess(QString &line)
Definition nativeimportbase.cpp:238
NativeImportBase::pushScope
void pushScope(UMLPackage *p)
Definition nativeimportbase.cpp:142
NativeImportBase::skipStmt
void skipStmt(const QString &until=QStringLiteral(";"))
Definition nativeimportbase.cpp:81
NativeImportBase::m_singleLineCommentIntro
QString m_singleLineCommentIntro
start token of a single line comment
Definition nativeimportbase.h:90
NativeImportBase::m_multiLineAltCommentEnd
QString m_multiLineAltCommentEnd
Definition nativeimportbase.h:120
NativeImportBase::split
virtual QStringList split(const QString &line)
Definition nativeimportbase.cpp:336
NativeImportBase::parseFile
virtual bool parseFile(const QString &filename)
Definition nativeimportbase.cpp:429
NativeImportBase::setMultiLineComment
void setMultiLineComment(const QString &intro, const QString &end)
Definition nativeimportbase.cpp:58
NativeImportBase::setMultiLineAltComment
void setMultiLineAltComment(const QString &intro, const QString &end)
Definition nativeimportbase.cpp:70
NativeImportBase::initVars
virtual void initVars()
Definition nativeimportbase.cpp:418
NativeImportBase::m_klass
UMLClassifier * m_klass
class currently being processed
Definition nativeimportbase.h:94
NativeImportBase::m_comment
QString m_comment
intermediate accumulator for comment text
Definition nativeimportbase.h:96
NativeImportBase::current
QString current()
Definition nativeimportbase.cpp:186
NativeImportBase::scopeIndex
int scopeIndex()
Definition nativeimportbase.cpp:176
NativeImportBase::initialize
void initialize()
Definition nativeimportbase.cpp:513
NativeImportBase::m_multiLineCommentEnd
QString m_multiLineCommentEnd
multi line comment delimiter end
Definition nativeimportbase.h:114
NativeImportBase::popScope
UMLPackage * popScope()
Definition nativeimportbase.cpp:152
NativeImportBase::parseStmt
virtual bool parseStmt()=0
NativeImportBase::m_multiLineCommentIntro
QString m_multiLineCommentIntro
multi line comment delimiter intro
Definition nativeimportbase.h:113
NativeImportBase::m_multiLineAltCommentIntro
QString m_multiLineAltCommentIntro
Definition nativeimportbase.h:119
NativeImportBase::m_isAbstract
bool m_isAbstract
accumulator for abstractness
Definition nativeimportbase.h:103
NativeImportBase::~NativeImportBase
virtual ~NativeImportBase()
Definition nativeimportbase.cpp:47
NativeImportBase::advance
virtual QString advance()
Definition nativeimportbase.cpp:210
NativeImportBase::fillSource
virtual void fillSource(const QString &word)=0
UMLClassifier
Information for a non-graphical Concept/Class.
Definition classifier.h:35
UMLPackage
Non-graphical information for a Package.
Definition package.h:28
classimport.h
Uml::Visibility::Enum
Enum
Definition basictypes.h:45