OSDN Git Service

Automatically align underspecified tasks boundaries on project boundaries when possible.
[tjqt4port/tj2qt4.git] / taskjuggler / Tokenizer.h
1 /*
2  * Tokenizer.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
5  * Chris Schlaeger <cs@kde.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of version 2 of the GNU General Public License as
9  * published by the Free Software Foundation.
10  *
11  * $Id$
12  */
13 #ifndef _Tokenizer_h_
14 #define _Tokenizer_h_
15
16 #include "FileToken.h"
17
18 class ProjectFile;
19
20 /**
21  * @short A fairly generic tokenizer class that breaks QTextStreams into small
22  * pieces.
23  * @author Chris Schlaeger <cs@kde.org>
24  */
25 class Tokenizer : public FileToken
26 {
27 public:
28     Tokenizer(const QString& file, MacroTable* mt_, const QString& tp);
29     Tokenizer(const QString& text);
30     virtual ~Tokenizer() { }
31
32     bool open();
33     bool close();
34
35     virtual QChar getC(bool expandMacros = true);
36     void ungetC(QChar c);
37
38     virtual TokenType nextToken(QString& buf);
39
40     virtual void setLocation(const QString& df, int dl);
41     virtual QString resolve(const QStringList* argList);
42     virtual Macro* getMacro(const QString& name) const;
43
44     virtual void errorMessage(const QString& msg);
45
46 private:
47     /**
48      * A pointer to the ProjectFile class that stores all read-in
49      * data.
50      */
51     MacroTable* mt;
52
53     // The text buffer to read.
54     QString textBuffer;
55 };
56
57 #endif
58