Ejemplo n.º 1
0
// static functions for initializing the operator dictionary
void
MMLmo::makedict() {
    madedict = true;
    for (int i=0; i<351; ++i) {
        const char *end;
        const char *start = rawopdict[i];
        const char *send = start+strlen(start);
        end = strchr(start, ' ');
        DOMString op;
        for (const char *j=start; j!=end; ++j) {
            op += *j;
        }
        const MMLAttribute **a
            = new const MMLAttribute*[MML::moNumAtts];
        for (uint j=0; j<MML::moNumAtts; ++j) {
            a[j] = 0;
        }
        while (*end != '\0') {
            std::string name;
            start = end+1;
            end = strchr(start, '=');
            for (const char *j=start; j!=end; ++j) {
                name += *j;
            }
            start = end+1;
            end = strchr(start, ' ');
            if (!end) end = send;
            DOMString value;
            for (const char *j=start; j!=end; ++j) {
                value += *j;
            }
            setAttribute(op.utf8(), name, value, a);
        }
//        dict.insert(pair<DOMString, MMLAttribute **>(op, a));
//        DOMString uni = op;
        op.resolveEntities();
//        if (uni != op) {
            dict.insert(pair<DOMString, const MMLAttribute **>
                (op, a));
//        }
    }
}