umbrello API Documentation

Import_Rose Namespace Reference

Rose model import. More...


Typedefs

typedef QPtrList< PetalNodePetalNodeList

Functions

void methodName (const QString &m)
QString loc ()
 Auxiliary function for diagnostics: Return current location.
QStringList scan (const QString &lin)
 Split a line into lexemes.
QString shift (QStringList &l)
 Emulate perl shift().
bool checkClosing (QStringList &tokens)
 Check for closing of one or more scopes.
bool isImmediateValue (QString s)
 Immediate values are numbers or quoted strings.
QString extractImmediateValues (QStringList &l)
 Extract immediate values out of `l'.
QString collectVerbatimText (QTextStream &stream)
QString extractValue (QStringList &l, QTextStream &stream)
 Extract the stripped down value from a (value ...) element.
PetalNodereadAttributes (QStringList initialArgs, QTextStream &stream)
 Read attributes of a node.
bool loadFromMDL (QIODevice &file)
 Parse a file into the PetalNode internal tree representation and then create Umbrello objects by traversing the tree.
QString clean (const QString &s)
 Return the given string without surrounding quotation marks.
Uml::IDType quid (const PetalNode *node)
 Extract the quid attribute from a petal node and return it as a Uml::IDType.
QString quidu (const PetalNode *node)
 Extract the quidu attribute from a petal node.
Uml::Object_Type typeToCreate (const QString &name)
 Determine the model type corresponding to a name.
void transferVisibility (const PetalNode *from, UMLObject *to)
 Transfer the Rose attribute "exportControl" to the Umbrello object given.
bool umbrellify (PetalNode *node, UMLPackage *parentPkg=NULL)
 Create an Umbrello object from a PetalNode of the Logical View.
Uml::ListView_Type folderType (UMLListViewItem *parent)
bool umbrellify (PetalNode *node, const QString &modelsName, UMLListViewItem *parent)
 Create an Umbrello object from a PetalNode of the UseCase, Component, or Deployment View.
bool importView (PetalNode *root, const QString &rootName, const QString &modelsName, UMLListViewItem *lvParent)
 Auxiliary function for UseCase/Component/Deployment view import.
bool petalTree2Uml (PetalNode *root)
 This is really an auxiliary method for loadFromMDL() but is kept in a separate file to reflect that it is not coupled with the parser (other than by the PetalNode.).

Variables

uint nClosures
uint linum
QString g_methodName


Detailed Description

Rose model import.

Author:
Oliver Kellogg Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org


Function Documentation

QString loc  ) 
 

Auxiliary function for diagnostics: Return current location.

Definition at line 50 of file import_rose.cpp.

Referenced by extractValue(), and readAttributes().

QStringList scan const QString &  lin  ) 
 

Split a line into lexemes.

Definition at line 57 of file import_rose.cpp.

Referenced by loadFromMDL(), and readAttributes().

QString shift QStringList &  l  ) 
 

Emulate perl shift().

Definition at line 95 of file import_rose.cpp.

Referenced by extractImmediateValues(), extractValue(), and readAttributes().

bool checkClosing QStringList &  tokens  ) 
 

Check for closing of one or more scopes.

Definition at line 104 of file import_rose.cpp.

Referenced by readAttributes().

bool isImmediateValue QString  s  ) 
 

Immediate values are numbers or quoted strings.

Returns:
True if the given text is a natural or negative number or a quoted string.

Definition at line 126 of file import_rose.cpp.

Referenced by extractImmediateValues(), and readAttributes().

QString extractImmediateValues QStringList &  l  ) 
 

Extract immediate values out of `l'.

Examples of immediate value lists: number list: ( 123 , 456 ) string list: ( "SomeText" 888 ) Any enclosing parentheses are removed. All extracted items are also removed from `l'. For the example given above the following is returned: "123 456" or "\"SomeText\" 888"

Definition at line 142 of file import_rose.cpp.

References isImmediateValue(), and shift().

Referenced by readAttributes().

QString extractValue QStringList &  l,
QTextStream &  stream
 

Extract the stripped down value from a (value ...) element.

Example: for the input (value Text "This is some text") the following is extracted: "This is some text" Extracted elements and syntactic sugar of the value element are removed from the input list. The stream is passed into this method because it may be necessary to read new lines - in the case of verbatim text. The format of verbatim text in petal files is as follows:

(value Text |This is the first line of verbatim text. |This is another line of verbatim text. ) (The '|' character is supposed to be in the first column of the line) In this case the two lines are extracted without the leading '|'. The line ending '
' of each line is preserved.

Definition at line 220 of file import_rose.cpp.

References loc(), and shift().

Referenced by readAttributes().

PetalNode* readAttributes QStringList  initialArgs,
QTextStream &  stream
 

Read attributes of a node.

Parameters:
initialArgs Tokens on the line of the opening "(" of the node but with leading whitespace and the opening "(" removed.
stream The QTextStream from which to read following lines.
Returns:
Pointer to the created PetalNode or NULL on error.

Definition at line 257 of file import_rose.cpp.

References checkClosing(), extractImmediateValues(), extractValue(), isImmediateValue(), loc(), PetalNode::StringOrNode::node, scan(), PetalNode::setAttributes(), PetalNode::setInitialArgs(), shift(), and PetalNode::StringOrNode::string.

Referenced by loadFromMDL().

bool Import_Rose::loadFromMDL QIODevice &  file  ) 
 

Parse a file into the PetalNode internal tree representation and then create Umbrello objects by traversing the tree.

Returns:
True for success, false in case of error.

Definition at line 357 of file import_rose.cpp.

References petalTree2Uml(), readAttributes(), and scan().

Referenced by UMLDoc::openDocument().

QString clean const QString &  s  ) 
 

Return the given string without surrounding quotation marks.

Also remove a possible prefix "Logical View::", it is not modeled in Umbrello.

Definition at line 40 of file petaltree2uml.cpp.

Referenced by transferVisibility(), and umbrellify().

Uml::IDType quid const PetalNode node  ) 
 

Extract the quid attribute from a petal node and return it as a Uml::IDType.

Definition at line 52 of file petaltree2uml.cpp.

Referenced by umbrellify().

QString quidu const PetalNode node  ) 
 

Extract the quidu attribute from a petal node.

Definition at line 63 of file petaltree2uml.cpp.

Referenced by umbrellify().

Uml::Object_Type typeToCreate const QString &  name  ) 
 

Determine the model type corresponding to a name.

If the given name consists only of letters, digits, underscores, and scope separators, then return Uml::ot_Class, else return Uml::ot_Datatype.

Definition at line 76 of file petaltree2uml.cpp.

void transferVisibility const PetalNode from,
UMLObject to
 

Transfer the Rose attribute "exportControl" to the Umbrello object given.

Parameters:
from Pointer to PetalNode from which to read the "exportControl" attribute
to Pointer to UMLObject in which to set the Uml::Visibility

Definition at line 89 of file petaltree2uml.cpp.

References clean().

bool umbrellify PetalNode node,
UMLPackage parentPkg = NULL
 

Create an Umbrello object from a PetalNode of the Logical View.

Returns:
True for success. Given a PetalNode for which the mapping to Umbrello is not yet implemented umbrellify() is a no-op but also returns true.

Definition at line 313 of file petaltree2uml.cpp.

References UMLDoc::addAssociation(), PetalNode::attributes(), clean(), Import_Utils::createUMLObject(), PetalNode::findAttribute(), UMLApp::getDocument(), UMLObject::getName(), UMLAssociation::getUMLRole(), PetalNode::initialArgs(), PetalNode::name(), quid(), quidu(), UMLAssociation::setAssocType(), UMLClassifier::setBaseType(), UMLObject::setDoc(), UMLObject::setID(), UMLRole::setMultiplicity(), UMLObject::setName(), UMLObject::setSecondaryFallback(), UMLObject::setSecondaryId(), and UMLObject::setStereotype().

Referenced by importView(), petalTree2Uml(), and umbrellify().

bool umbrellify PetalNode node,
const QString &  modelsName,
UMLListViewItem parent
 

Create an Umbrello object from a PetalNode of the UseCase, Component, or Deployment View.

Returns:
True for success. Given a PetalNode for which the mapping to Umbrello is not yet implemented umbrellify() is a no-op but also returns true.

Definition at line 465 of file petaltree2uml.cpp.

References UMLDoc::addUMLObject(), PetalNode::attributes(), clean(), PetalNode::findAttribute(), UMLApp::getDocument(), quid(), UMLObject::setDoc(), UMLObject::setStereotype(), and umbrellify().

bool importView PetalNode root,
const QString &  rootName,
const QString &  modelsName,
UMLListViewItem lvParent
 

Auxiliary function for UseCase/Component/Deployment view import.

Definition at line 519 of file petaltree2uml.cpp.

References PetalNode::attributes(), PetalNode::findAttribute(), and umbrellify().

Referenced by petalTree2Uml().

bool Import_Rose::petalTree2Uml PetalNode root  ) 
 

This is really an auxiliary method for loadFromMDL() but is kept in a separate file to reflect that it is not coupled with the parser (other than by the PetalNode.).

Shorthand for UMLApp::app()->getListView() *

Definition at line 539 of file petaltree2uml.cpp.

References Import_Utils::assignUniqueIdOnCreation(), PetalNode::attributes(), PetalNode::findAttribute(), UMLApp::getDocument(), UMLApp::getListView(), importView(), PetalNode::name(), UMLDoc::resolveTypes(), UMLDoc::setCurrentRoot(), UMLListView::theComponentView(), UMLListView::theDeploymentView(), UMLListView::theUseCaseView(), and umbrellify().

Referenced by loadFromMDL().

KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:08 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003