lib Library API Documentation

sequenceparser.h

00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org> 00003 Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 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
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 24 18:22:29 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003