moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kturtle / src / lexer.h
blobb50669edd315c40b305857b3d7766316dcd5b94b
1 /*
2 Copyright (C) 2003 by Walter Schreppers
3 Copyright (C) 2004 by Cies Breijs
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of version 2 of the GNU General Public
7 License as published by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef _LEXER_H_
21 #define _LEXER_H_
23 #include <qmap.h>
24 #include <qstring.h>
25 #include <qtextstream.h>
27 #include "token.h"
28 #include "translate.h"
29 #include "value.h"
32 class Lexer
34 public:
35 Lexer(QTextIStream&);
36 ~Lexer() {}
38 Token lex(); // returns the next Token, skipping spaces
41 private:
42 QChar getChar();
43 void ungetChar(QChar);
44 int getWord(QString&);
45 void skipSpaces();
46 void setTokenType(Token&);
47 int getNumber(Value&, QString&);
48 void getString(Token&);
50 QTextIStream *inputStream;
51 Translate *translate;
52 uint row, col, prevCol;
53 QChar putBackChar;
57 #endif // _LEXER_H_