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

Oliver Kellogg okellogg at users.sourceforge.net
Fri Aug 12 03:58:26 UTC 2005


SVN commit 446026 by okellogg:

m_isAbstract: Move to NativeImportBase.

 M  +37 -0     adaimport.cpp  
 M  +1 -1      idlimport.cpp  
 M  +1 -1      idlimport.h  
 M  +1 -0      nativeimportbase.cpp  
 M  +4 -0      nativeimportbase.h  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/adaimport.cpp #446025:446026
@@ -88,6 +88,7 @@
         return;
     }
     // Scan the input file into the QStringList m_source.
+    m_srcIndex = 0;
     QTextStream stream(&file);
     while (! stream.atEnd()) {
         QString line = stream.readLine();
@@ -95,7 +96,9 @@
     }
     file.close();
     // Parse the QStringList m_source.
+    m_klass = NULL;
     m_currentAccess = Uml::Public;
+    m_isAbstract = false;
     const uint srcLength = m_source.count();
     for (m_srcIndex = 0; m_srcIndex < srcLength; m_srcIndex++) {
         const QString& keyword = m_source[m_srcIndex];
@@ -147,6 +150,40 @@
                 m_comment = QString::null;
                 continue;
             }
+            if (m_source[m_srcIndex] == "abstract") {
+                m_isAbstract = true;
+                m_srcIndex++;
+            }
+            if (m_source[m_srcIndex] == "tagged") {
+                UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class,
+                                name, m_scope[m_scopeIndex], m_comment);
+                m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
+                m_klass->setAbstract(m_isAbstract);
+            }
+            if (m_source[m_srcIndex] == "limited") {
+                m_srcIndex++;  // we can't (yet?) represent that
+            }
+            if (m_source[m_srcIndex] == "private" ||
+                (m_source[m_srcIndex] == "null" &&
+                 m_source[m_srcIndex+1] == "record")) {
+                skipStmt();
+                continue;
+            }
+            if (m_source[m_srcIndex] == "record") {
+                UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class,
+                                name, m_scope[m_scopeIndex], m_comment);
+                m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
+                if (keyword == "struct")
+                    m_klass->setStereotype("CORBAStruct");
+                else
+                    m_klass->setStereotype("CORBAException");
+                if (advance() != "{") {
+                    kdError() << "importIDL: expecting '{' at " << name << endl;
+                    skipStmt("{");
+                }
+                m_comment = QString::null;
+                continue;
+            }
             if (m_source[m_srcIndex] == "new") {
                 QString ancestor = advance();
                 // Handle ancestor: To Be Done
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/idlimport.cpp #446025:446026
@@ -31,7 +31,7 @@
 #include "attribute.h"
 
 IDLImport::IDLImport() : NativeImportBase("//") {
-    m_isAbstract = m_isOneway = m_isReadonly = m_isAttribute = false;
+    m_isOneway = m_isReadonly = m_isAttribute = false;
     m_inComment = false;
 }
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/idlimport.h #446025:446026
@@ -41,7 +41,7 @@
 
 protected:
     QString joinTypename();
-    bool m_isAbstract, m_isOneway, m_isReadonly, m_isAttribute;
+    bool m_isOneway, m_isReadonly, m_isAttribute;
     bool m_inComment;
 };
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/nativeimportbase.cpp #446025:446026
@@ -27,6 +27,7 @@
     m_scopeIndex = 0;  // index 0 is reserved for global scope
     m_klass = NULL;
     m_currentAccess = Uml::Public;
+    m_isAbstract = false;
 }
 
 NativeImportBase::~NativeImportBase() {
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/nativeimportbase.h #446025:446026
@@ -128,6 +128,10 @@
      * Intermediate accumulator for comment text.
      */
     QString m_comment;
+    /**
+     * Accumulator for abstractness
+     */
+    bool m_isAbstract;
 
 };
 




More information about the umbrello-devel mailing list