lib
sequenceparser.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SEQUENCEPARSER_H
00022 #define SEQUENCEPARSER_H
00023
00024 #include <qptrlist.h>
00025 #include <qstring.h>
00026
00027 #include "kformuladefs.h"
00028
00029 KFORMULA_NAMESPACE_BEGIN
00030
00031 class BasicElement;
00032 class ElementType;
00033 class SymbolTable;
00034
00035
00039 class SequenceParser {
00040 public:
00041 SequenceParser(const SymbolTable& table);
00042
00046 ElementType* parse(QPtrList<BasicElement>& elements);
00047
00051 void nextToken();
00052
00053 uint getStart() const { return tokenStart; }
00054 uint getEnd() const { return tokenEnd; }
00055 TokenType getTokenType() const { return type; }
00056
00063 void setElementType(uint pos, ElementType* type);
00064
00068 ElementType* getPrimitive();
00069
00073 QString text();
00074
00075 private:
00076
00080 void readNumber();
00081
00085 void readDigits();
00086
00090 void readText();
00091
00095 QChar getEndChar();
00096
00101 QPtrList<BasicElement> list;
00102
00107 uint tokenStart;
00108
00112 uint tokenEnd;
00113
00117 TokenType type;
00118
00122 bool binOpAllowed;
00123
00127 const SymbolTable& table;
00128 };
00129
00130 KFORMULA_NAMESPACE_END
00131
00132 #endif // SEQUENCEPARSER_H
|