예제 #1
0
WrapperStr UmlItem::readConstraint(FileIn & in, Token & token)
{
    WrapperStr constraint;

    if (! token.closed()) {
        WrapperStr k = token.what();
        const char * kstr = k;

        while (in.read(), !token.close(kstr)) {
            WrapperStr s = token.what();

            if ((s == "specification") && (token.xmiType() == "uml:OpaqueExpression")) {
                constraint = token.valueOf("body");

                if (! token.closed()) {
                    while (in.read(), !token.close("specification")) {
                        s = token.what();

                        if (s == "body")
                            constraint = in.body("body");
                        else if (! token.closed())
                            in.finish(s);
                    }
                }
            }
            else
                in.bypass(token);
        }
    }

    return constraint;
}
예제 #2
0
void UmlPackage::applyStereotype(FileIn & in, Token & token)
{
    WrapperStr prof_st;
    Q3ValueList<WrapperStr> base_v;
    WrapperStr s;

    if (UmlClass::isAppliedStereotype(token, prof_st, base_v)) {
        WrapperStr s;
        Q3ValueList<WrapperStr>::Iterator it_ext;

        for (it_ext = base_v.begin(); it_ext != base_v.end(); ++it_ext) {
            WrapperStr s2;

            if (token.valueOf(*it_ext, s2)) {
                if (s.isEmpty())
                    s = s2;
                else if (s != s2)
                    in.warning("doesn't refer to the same element ('" + s + "' != '" + s2 + "')");
            }
        }

        if (s.isEmpty())
            in.warning("value of 'base_...' is missing");
        else {
            UmlItem * elt = All[s];

            if (elt == 0) {
                if (!FileIn::isBypassedId(s))
                    in.warning("unknown reference '" + s + "'");
            }
            else {
                elt->set_Stereotype(prof_st);
                elt->UmlItem::applyStereotype();	// set properties

                Q3Dict<WrapperStr> props = elt->properties();
                Q3DictIterator<WrapperStr> it(props);

                while (it.current()) {
                    WrapperStr k = it.currentKey().latin1();

                    if (token.valueOf(k.mid(k.findRev(':') + 1).lower(), s))
                        elt->set_PropertyValue(k, s);

                    ++it;
                }
            }
        }

        if (! token.closed())
            in.finish(token.what());
    }
    else
        in.bypass(token);

}
예제 #3
0
void UmlItem::import(FileIn & in, Token & tk)
{
    WrapperStr key = tk.what() + " " + tk.xmiType();

    PFunc pf = Functions[key];

    if (pf != 0)
        pf(in, tk, this);
    else
        in.bypass(tk);

}