umbrello  2.34.3
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 
15 class UMLPackage;
16 class UMLClassifier;
17 
40 {
41 public:
42  explicit NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread* thread = 0);
43  virtual ~NativeImportBase();
44 
45 protected:
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 = QLatin1String(";"));
79  bool skipToClosing(QChar opener);
80 
81  QString current();
82  QString lookAhead();
83  virtual QString advance();
84 
85  void pushScope(UMLPackage *p);
88  int scopeIndex();
89 
91  QStringList m_source;
92  int m_srcIndex;
93  QList<UMLPackage *> m_scope;
96  QString m_comment;
97 
104 
111  static QStringList m_parsedFiles;
112 
115 
121 };
122 
123 #endif
124 
NativeImportBase::scopeIndex
int scopeIndex()
Definition: nativeimportbase.cpp:176
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:129
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:95
NativeImportBase::~NativeImportBase
virtual ~NativeImportBase()
Definition: nativeimportbase.cpp:47
NativeImportBase::preprocess
virtual bool preprocess(QString &line)
Definition: nativeimportbase.cpp:238
NativeImportBase::setMultiLineAltComment
void setMultiLineAltComment(const QString &intro, const QString &end)
Definition: nativeimportbase.cpp:70
logError1
#define logError1(s, a)
Definition: uml.h:543
ClassImport
Definition: classimport.h:20
NativeImportBase::m_multiLineAltCommentIntro
QString m_multiLineAltCommentIntro
Definition: nativeimportbase.h:119
NativeImportBase::m_klass
UMLClassifier * m_klass
class currently being processed
Definition: nativeimportbase.h:94
NativeImportBase::m_multiLineCommentIntro
QString m_multiLineCommentIntro
multi line comment delimiter intro
Definition: nativeimportbase.h:113
NativeImportBase::m_inComment
bool m_inComment
Definition: nativeimportbase.h:102
NativeImportBase::setMultiLineComment
void setMultiLineComment(const QString &intro, const QString &end)
Definition: nativeimportbase.cpp:58
import_utils.h
NativeImportBase::m_scope
QList< UMLPackage * > m_scope
stack of scopes for use by the specific importer
Definition: nativeimportbase.h:93
classimport.h
NativeImportBase::currentScope
UMLPackage * currentScope()
Definition: nativeimportbase.cpp:165
NativeImportBase::skipStmt
void skipStmt(const QString &until=QLatin1String(";"))
Definition: nativeimportbase.cpp:81
Uml::Visibility::Public
@ Public
Definition: basictypes.h:46
NativeImportBase::current
QString current()
Definition: nativeimportbase.cpp:186
NativeImportBase::skipToClosing
bool skipToClosing(QChar opener)
Definition: nativeimportbase.cpp:96
NativeImportBase::m_multiLineAltCommentEnd
QString m_multiLineAltCommentEnd
Definition: nativeimportbase.h:120
it
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Definition: GPL-2.0-only.txt:64
NativeImportBase::m_isAbstract
bool m_isAbstract
accumulator for abstractness
Definition: nativeimportbase.h:103
NativeImportBase::popScope
UMLPackage * popScope()
Definition: nativeimportbase.cpp:152
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Library General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: LGPL-2.0-only.txt:368
NativeImportBase::m_source
QStringList m_source
the scanned lexemes
Definition: nativeimportbase.h:91
NativeImportBase::scan
void scan(const QString &line)
Definition: nativeimportbase.cpp:386
logDebug2
#define logDebug2(s, a, b)
Definition: uml.h:545
Import_Utils::globalScope
UMLPackage * globalScope()
Definition: import_utils.cpp:842
basictypes.h
Import_Utils::addIncludePath
void addIncludePath(const QString &path)
Definition: import_utils.cpp:823
NativeImportBase::advance
virtual QString advance()
Definition: nativeimportbase.cpp:210
NativeImportBase::NativeImportBase
NativeImportBase(const QString &singleLineCommentIntro, CodeImpThread *thread=0)
Definition: nativeimportbase.cpp:33
NativeImportBase::m_comment
QString m_comment
intermediate accumulator for comment text
Definition: nativeimportbase.h:96
CodeImpThread
Definition: codeimpthread.h:21
c
type show c for details The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of the commands you use may be called something other than show w and show c
Definition: GPL-2.0-only.txt:301
NativeImportBase::m_multiLineCommentEnd
QString m_multiLineCommentEnd
multi line comment delimiter end
Definition: nativeimportbase.h:114
NativeImportBase
Base class for native implementations of language import.
Definition: nativeimportbase.h:39
Uml
Definition: basictypes.cpp:22
nativeimportbase.h
NativeImportBase::parseFile
virtual bool parseFile(const QString &filename)
Definition: nativeimportbase.cpp:429
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
NativeImportBase::parseStmt
virtual bool parseStmt()=0
NativeImportBase::fillSource
virtual void fillSource(const QString &word)=0
uml.h
NativeImportBase::initialize
void initialize()
Definition: nativeimportbase.cpp:513
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:34
debug_utils.h
NativeImportBase::initVars
virtual void initVars()
Definition: nativeimportbase.cpp:418
NativeImportBase::pushScope
void pushScope(UMLPackage *p)
Definition: nativeimportbase.cpp:142
NativeImportBase::split
virtual QStringList split(const QString &line)
Definition: nativeimportbase.cpp:336
NativeImportBase::lookAhead
QString lookAhead()
Definition: nativeimportbase.cpp:197
NativeImportBase::m_singleLineCommentIntro
QString m_singleLineCommentIntro
start token of a single line comment
Definition: nativeimportbase.h:90
NativeImportBase::m_srcIndex
int m_srcIndex
used for indexing m_source
Definition: nativeimportbase.h:92
Import_Utils::includePathList
QStringList includePathList()
Definition: import_utils.cpp:810
NativeImportBase::m_parsedFiles
static QStringList m_parsedFiles
Definition: nativeimportbase.h:111
codeimpthread.h
UMLPackage
Non-graphical information for a Package.
Definition: package.h:27