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

Oliver Kellogg okellogg at users.sourceforge.net
Tue Sep 13 09:50:18 UTC 2005


SVN commit 460377 by okellogg:

parseOperation(): Don't apply programming-language style syntax checking on
the name because UML also supports non programming-language oriented analyses
using narrative names.


 M  +11 -3     model_utils.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/model_utils.cpp #460376:460377
@@ -340,17 +340,25 @@
 Parse_Status parseOperation(QString m, OpDescriptor& desc, UMLClassifier *owningScope) {
     UMLDoc *pDoc = UMLApp::app()->getDocument();
 
-    m = m.stripWhiteSpace();
+    m = m.simplifyWhiteSpace();
     if (m.isEmpty())
         return PS_Empty;
+    /**
+     * We don't apply programming-language style syntax checking on the name
+     * because UML also permits non programming-language oriented designs
+     * using narrative names, for example "check water temperature".
     QRegExp pat( "^(\\w+)" );
     int pos = pat.search(m);
     if (pos == -1)
         return PS_Illegal_MethodName;
     desc.m_name = pat.cap(1);
+     */
+    // Remove possible empty parentheses ()
+    m.remove( QRegExp("\\s*\\(\\s*\\)") );
+    desc.m_name = m;
     desc.m_pReturnType = NULL;
-    pat = QRegExp( ":\\s*(\\w[\\w\\. ]*)$" );
-    pos = pat.search(m);
+    QRegExp pat( ":\\s*(\\w[\\w\\. ]*)$" );
+    int pos = pat.search(m);
     if (pos != -1) {  // return type is optional
         QString retType = pat.cap(1);
         if (retType != "void") {




More information about the umbrello-devel mailing list