lib
kformulacompatibility.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KFORMULACOMPATIBILITY_H
00021 #define KFORMULACOMPATIBILITY_H
00022
00023 #include <qdom.h>
00024 #include <qstring.h>
00025
00026 KFORMULA_NAMESPACE_BEGIN
00027
00032 class Compatibility {
00033 public:
00034
00035 Compatibility();
00036
00040 QDomDocument buildDOM(QString text);
00041
00042 private:
00043
00044 QDomElement readSequence(const QDomDocument& doc);
00045 QDomElement readMatrix(const QDomDocument& doc);
00046
00047 void appendToSequence(QDomElement sequence, QDomElement element, int leftIndexSeen);
00048
00049 void appendNextSequence(const QDomDocument& doc, QDomElement element);
00050 QDomElement getLastSequence(const QDomDocument& doc, QDomElement sequence);
00051
00052 QDomElement findIndexNode(const QDomDocument& doc, QDomElement sequence);
00053
00054 ushort nextToken() { return formulaString[pos++].unicode(); }
00055 ushort lookAhead(uint i) const { return formulaString[pos+i].unicode(); }
00056 void pushback() { pos--; }
00057
00058 bool hasNext() const { return pos < formulaString.length(); }
00059 uint tokenLeft() const { return formulaString.length()-pos; }
00060
00064 QString formulaString;
00065
00069 uint pos;
00070 };
00071
00072 KFORMULA_NAMESPACE_END
00073
00074 #endif // KFORMULACOMPATIBILITY_H
|