[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Aug 12 12:56:17 UTC 2005


SVN commit 446201 by okellogg:

parseFile(): Implement "with".

 M  +22 -4     adaimport.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/adaimport.cpp #446200:446201
@@ -40,7 +40,7 @@
     const uint len = lexeme.length();
     for (uint i = 0; i < len; i++) {
         QChar c = lexeme[i];
-        if (c.isLetterOrNumber() || c == '_' || c == '.') {
+        if (c.isLetterOrNumber() || c == '_' || c == '.' || c == '#') {
             word += c;
         } else {
             if (!word.isEmpty()) {
@@ -107,6 +107,27 @@
             m_comment = keyword.mid(2);
             continue;
         }
+        if (keyword == "with") {
+            while (++m_srcIndex < srcLength && m_source[m_srcIndex] != ";") {
+                QString filename = m_source[m_srcIndex].lower();
+                QStringList components = QStringList::split(".", filename);
+                const QString& prefix = components.first();
+                if (prefix == "system" || prefix == "ada" || prefix == "gnat" ||
+                    prefix == "text_io" ||
+                    prefix == "unchecked_conversion" ||
+                    prefix == "unchecked_deallocation") {
+                    if (advance() != ",")
+                        break;
+                    continue;
+                }
+                filename.replace(".", "-");
+                filename.append(".ads");
+                parseFile(filename);
+                if (advance() != ",")
+                    break;
+            }
+            continue;
+        }
         if (keyword == "package") {
             const QString& name = advance();
             UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package,
@@ -274,9 +295,6 @@
             m_comment = QString::null;
             continue;
         }
-        if (keyword == "with") {
-            // To Be Done
-        }
         // Still lots To Be Done.......
         skipStmt();
         /* At this point we know it's some kind of attribute declaration.




More information about the umbrello-devel mailing list