summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codeimport/adaimport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/codeimport/adaimport.cpp')
-rw-r--r--umbrello/umbrello/codeimport/adaimport.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/umbrello/umbrello/codeimport/adaimport.cpp b/umbrello/umbrello/codeimport/adaimport.cpp
index 54ac3907..0cbd8d1c 100644
--- a/umbrello/umbrello/codeimport/adaimport.cpp
+++ b/umbrello/umbrello/codeimport/adaimport.cpp
@@ -14,7 +14,7 @@
#include <stdio.h>
// qt/kde includes
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kdebug.h>
// app includes
#include "import_utils.h"
@@ -43,15 +43,15 @@ void AdaImport::initVars() {
/// Split the line so that a string is returned as a single element of the list,
/// when not in a string then split at white space.
-QStringList AdaImport::split(const QString& lin) {
- QStringList list;
- QString listElement;
+TQStringList AdaImport::split(const TQString& lin) {
+ TQStringList list;
+ TQString listElement;
bool inString = false;
bool seenSpace = false;
- QString line = lin.stripWhiteSpace();
+ TQString line = lin.stripWhiteSpace();
uint len = line.length();
for (uint i = 0; i < len; i++) {
- const QChar& c = line[i];
+ const TQChar& c = line[i];
if (inString) {
listElement += c;
if (c == '"') {
@@ -60,14 +60,14 @@ QStringList AdaImport::split(const QString& lin) {
continue;
}
list.append(listElement);
- listElement = QString();
+ listElement = TQString();
inString = false;
}
} else if (c == '"') {
inString = true;
if (!listElement.isEmpty())
list.append(listElement);
- listElement = QString(c);
+ listElement = TQString(c);
seenSpace = false;
} else if (c == '\'') {
if (i < len - 2 && line[i + 2] == '\'') {
@@ -77,7 +77,7 @@ QStringList AdaImport::split(const QString& lin) {
listElement = line.mid(i, 3);
i += 2;
list.append(listElement);
- listElement = QString();
+ listElement = TQString();
continue;
}
listElement += c;
@@ -88,7 +88,7 @@ QStringList AdaImport::split(const QString& lin) {
seenSpace = true;
if (!listElement.isEmpty()) {
list.append(listElement);
- listElement = QString();
+ listElement = TQString();
}
} else {
listElement += c;
@@ -100,23 +100,23 @@ QStringList AdaImport::split(const QString& lin) {
return list;
}
-void AdaImport::fillSource(const QString& word) {
- QString lexeme;
+void AdaImport::fillSource(const TQString& word) {
+ TQString lexeme;
const uint len = word.length();
for (uint i = 0; i < len; i++) {
- QChar c = word[i];
+ TQChar c = word[i];
if (c.isLetterOrNumber() || c == '_' || c == '.' || c == '#') {
lexeme += c;
} else {
if (!lexeme.isEmpty()) {
m_source.append(lexeme);
- lexeme = QString();
+ lexeme = TQString();
}
if (c == ':' && word[i + 1] == '=') {
m_source.append(":=");
i++;
} else {
- m_source.append(QString(c));
+ m_source.append(TQString(c));
}
}
}
@@ -124,14 +124,14 @@ void AdaImport::fillSource(const QString& word) {
m_source.append(lexeme);
}
-QString AdaImport::expand(const QString& name) {
- QRegExp pfxRegExp("^(\\w+)\\.");
+TQString AdaImport::expand(const TQString& name) {
+ TQRegExp pfxRegExp("^(\\w+)\\.");
pfxRegExp.setCaseSensitive(false);
int pos = pfxRegExp.search(name);
if (pos == -1)
return name;
- QString result = name;
- QString pfx = pfxRegExp.cap(1);
+ TQString result = name;
+ TQString pfx = pfxRegExp.cap(1);
if (m_renaming.contains(pfx)) {
result.remove(pfxRegExp);
result.prepend(m_renaming[pfx] + '.');
@@ -139,16 +139,16 @@ QString AdaImport::expand(const QString& name) {
return result;
}
-void AdaImport::parseStems(const QStringList& stems) {
+void AdaImport::parseStems(const TQStringList& stems) {
if (stems.isEmpty())
return;
- QString base = stems.first();
+ TQString base = stems.first();
uint i = 0;
while (1) {
- QString filename = base + ".ads";
+ TQString filename = base + ".ads";
if (! m_parsedFiles.contains(filename)) {
// Save current m_source and m_srcIndex.
- QStringList source(m_source);
+ TQStringList source(m_source);
uint srcIndex = m_srcIndex;
m_source.clear();
parseFile(filename);
@@ -167,7 +167,7 @@ void AdaImport::parseStems(const QStringList& stems) {
bool AdaImport::parseStmt() {
const uint srcLength = m_source.count();
- QString keyword = m_source[m_srcIndex];
+ TQString keyword = m_source[m_srcIndex];
UMLDoc *umldoc = UMLApp::app()->getDocument();
//kDebug() << '"' << keyword << '"' << endl;
if (keyword == "with") {
@@ -176,8 +176,8 @@ bool AdaImport::parseStmt() {
return false;
}
while (++m_srcIndex < srcLength && m_source[m_srcIndex] != ";") {
- QStringList components = QStringList::split(".", m_source[m_srcIndex].lower());
- const QString& prefix = components.first();
+ TQStringList components = TQStringList::split(".", m_source[m_srcIndex].lower());
+ const TQString& prefix = components.first();
if (prefix == "system" || prefix == "ada" || prefix == "gnat" ||
prefix == "interfaces" || prefix == "text_io" ||
prefix == "unchecked_conversion" ||
@@ -197,8 +197,8 @@ bool AdaImport::parseStmt() {
return true;
}
if (keyword == "package") {
- const QString& name = advance();
- QStringList parentPkgs = QStringList::split(".", name.lower());
+ const TQString& name = advance();
+ TQStringList parentPkgs = TQStringList::split(".", name.lower());
parentPkgs.pop_back(); // exclude the current package
parseStems(parentPkgs);
UMLObject *ns = NULL;
@@ -207,7 +207,7 @@ bool AdaImport::parseStmt() {
m_scope[m_scopeIndex], m_comment);
if (m_source[m_srcIndex + 1] == "new") {
m_srcIndex++;
- QString pkgName = advance();
+ TQString pkgName = advance();
UMLObject *gp = Import_Utils::createUMLObject(Uml::ot_Package, pkgName,
m_scope[m_scopeIndex]);
gp->setStereotype("generic");
@@ -237,9 +237,9 @@ bool AdaImport::parseStmt() {
if (m_inGenericFormalPart)
return false; // skip generic formal parameter (not yet implemented)
if (keyword == "subtype") {
- QString name = advance();
+ TQString name = advance();
advance(); // "is"
- QString base = expand(advance());
+ TQString base = expand(advance());
base.remove("Standard.", false);
UMLObject *type = umldoc->findUMLObject(base, Uml::ot_UMLObject, m_scope[m_scopeIndex]);
if (type == NULL) {
@@ -257,8 +257,8 @@ bool AdaImport::parseStmt() {
return true;
}
if (keyword == "type") {
- QString name = advance();
- QString next = advance();
+ TQString name = advance();
+ TQString next = advance();
if (next == "(") {
kDebug() << "AdaImport::parseStmt(" << name << "): "
<< "discriminant handling is not yet implemented" << endl;
@@ -290,7 +290,7 @@ bool AdaImport::parseStmt() {
UMLEnum *enumType = static_cast<UMLEnum*>(ns);
while ((next = advance()) != ")") {
Import_Utils::addEnumLiteral(enumType, next, m_comment);
- m_comment = QString();
+ m_comment = TQString();
if (advance() != ",")
break;
}
@@ -322,7 +322,7 @@ bool AdaImport::parseStmt() {
if (t == Uml::ot_Interface) {
while ((next = advance()) == "and") {
UMLClassifier *klass = static_cast<UMLClassifier*>(ns);
- QString base = expand(advance());
+ TQString base = expand(advance());
UMLObject *p = Import_Utils::createUMLObject(Uml::ot_Interface, base, m_scope[m_scopeIndex]);
UMLClassifier *parent = static_cast<UMLClassifier*>(p);
Import_Utils::createGeneralization(klass, parent);
@@ -344,8 +344,8 @@ bool AdaImport::parseStmt() {
return true;
}
if (next == "new") {
- QString base = expand(advance());
- QStringList baseInterfaces;
+ TQString base = expand(advance());
+ TQStringList baseInterfaces;
while ((next = advance()) == "and") {
baseInterfaces.append(expand(advance()));
}
@@ -372,8 +372,8 @@ bool AdaImport::parseStmt() {
}
if (baseInterfaces.count()) {
t = Uml::ot_Interface;
- QStringList::Iterator end(baseInterfaces.end());
- for (QStringList::Iterator bi(baseInterfaces.begin()); bi != end; ++bi) {
+ TQStringList::Iterator end(baseInterfaces.end());
+ for (TQStringList::Iterator bi(baseInterfaces.begin()); bi != end; ++bi) {
ns = Import_Utils::createUMLObject(t, *bi, m_scope[m_scopeIndex]);
parent = static_cast<UMLClassifier*>(ns);
Import_Utils::createGeneralization(klass, parent);
@@ -400,7 +400,7 @@ bool AdaImport::parseStmt() {
m_klass = NULL;
} else if (m_scopeIndex) {
if (advance() != ";") {
- QString scopeName = m_scope[m_scopeIndex]->getFullyQualifiedName();
+ TQString scopeName = m_scope[m_scopeIndex]->getFullyQualifiedName();
if (scopeName.lower() != m_source[m_srcIndex].lower())
kError() << "end: expecting " << scopeName << ", found "
<< m_source[m_srcIndex] << endl;
@@ -419,8 +419,8 @@ bool AdaImport::parseStmt() {
if (keyword == "overriding")
keyword = advance();
if (keyword == "function" || keyword == "procedure") {
- const QString& name = advance();
- QString returnType;
+ const TQString& name = advance();
+ TQString returnType;
if (advance() != "(") {
// Unlike an Ada package, a UML package does not support
// subprograms.
@@ -434,7 +434,7 @@ bool AdaImport::parseStmt() {
UMLOperation *op = NULL;
const uint MAX_PARNAMES = 16;
while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") {
- QString parName[MAX_PARNAMES];
+ TQString parName[MAX_PARNAMES];
uint parNameCount = 0;
do {
if (parNameCount >= MAX_PARNAMES) {
@@ -448,8 +448,8 @@ bool AdaImport::parseStmt() {
skipStmt();
break;
}
- const QString &direction = advance();
- QString typeName;
+ const TQString &direction = advance();
+ TQString typeName;
Uml::Parameter_Direction dir = Uml::pd_In;
if (direction == "access") {
// Oops, we have to improvise here because there
@@ -521,12 +521,12 @@ bool AdaImport::parseStmt() {
if (keyword == "task" || keyword == "protected") {
// Can task and protected objects/types be mapped to UML?
bool isType = false;
- QString name = advance();
+ TQString name = advance();
if (name == "type") {
isType = true;
name = advance();
}
- QString next = advance();
+ TQString next = advance();
if (next == "(") {
skipStmt(")"); // skip discriminant
next = advance();
@@ -537,8 +537,8 @@ bool AdaImport::parseStmt() {
return true;
}
if (keyword == "for") { // rep spec
- QString typeName = advance();
- QString next = advance();
+ TQString typeName = advance();
+ TQString next = advance();
if (next == "'") {
advance(); // skip qualifier
next = advance();
@@ -558,21 +558,21 @@ bool AdaImport::parseStmt() {
skipStmt();
return true;
}
- const QString& name = keyword;
+ const TQString& name = keyword;
if (advance() != ":") {
kError() << "adaImport: expecting \":\" at " << name << " "
<< m_source[m_srcIndex] << endl;
skipStmt();
return true;
}
- QString nextToken = advance();
+ TQString nextToken = advance();
if (nextToken == "aliased")
nextToken = advance();
- QString typeName = expand(nextToken);
- QString initialValue;
+ TQString typeName = expand(nextToken);
+ TQString initialValue;
if (advance() == ":=") {
initialValue = advance();
- QString token;
+ TQString token;
while ((token = advance()) != ";") {
initialValue.append(' ' + token);
}