[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Oct 8 20:02:17 UTC 2006
SVN commit 593713 by okellogg:
1. Remove a possible prefix "Standard." from type names.
2. Be permissive about the Uml::Object_Type on seeking the typeName of an
operation's first parameter in the document.
M +6 -2 adaimport.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/adaimport.cpp #593712:593713
@@ -189,7 +189,7 @@
return true;
}
if (keyword == "type") {
- const QString& name = advance();
+ QString name = advance();
if (advance() == "(") {
kDebug() << "AdaImport::parseFile(" << name << "): "
<< "discriminant handling is not yet implemented" << endl;
@@ -266,6 +266,8 @@
const bool isExtension = (advance() == "with");
Uml::Object_Type t = (isExtension || m_isAbstract ? Uml::ot_Class
: Uml::ot_Datatype);
+ if (t == Uml::ot_Datatype)
+ name.remove("Standard.", false);
UMLObject *ns = Import_Utils::createUMLObject(t, base, NULL);
UMLClassifier *parent = static_cast<UMLClassifier*>(ns);
ns = Import_Utils::createUMLObject(t, name, m_scope[m_scopeIndex], m_comment);
@@ -364,10 +366,11 @@
} else {
typeName = direction; // In Ada, the default direction is "in"
}
+ typeName.remove("Standard.", false);
if (op == NULL) {
// In Ada, the first parameter indicates the class.
UMLDoc *umldoc = UMLApp::app()->getDocument();
- UMLObject *type = umldoc->findUMLObject(typeName, Uml::ot_Class, m_scope[m_scopeIndex]);
+ UMLObject *type = umldoc->findUMLObject(typeName, Uml::ot_UMLObject, m_scope[m_scopeIndex]);
if (type == NULL) {
kError() << "importAda: cannot find UML object for " << typeName << endl;
skipStmt();
@@ -412,6 +415,7 @@
return false;
}
returnType = advance();
+ returnType.remove("Standard.", false);
}
bool isAbstract = false;
if (advance() == "is" && advance() == "abstract")
More information about the umbrello-devel
mailing list