author | insilmaril |
Wed, 25 Apr 2007 16:02:54 +0000 | |
changeset 463 | 694f5e35e87c |
parent 447 | 72afe12da1c8 |
child 514 | 497fab7d1404 |
permissions | -rw-r--r-- |
insilmaril@432 | 1 |
#ifndef PARSER_H |
insilmaril@432 | 2 |
#define PARSER_H |
insilmaril@432 | 3 |
|
insilmaril@432 | 4 |
#include <QColor> |
insilmaril@432 | 5 |
#include <QStringList> |
insilmaril@432 | 6 |
|
insilmaril@432 | 7 |
enum ErrorLevel {NoError,Warning,Aborted}; |
insilmaril@432 | 8 |
|
insilmaril@432 | 9 |
class Parser |
insilmaril@432 | 10 |
{ |
insilmaril@432 | 11 |
public: |
insilmaril@432 | 12 |
Parser(); |
insilmaril@447 | 13 |
void parseAtom (QString input); |
insilmaril@447 | 14 |
QString getAtom(); |
insilmaril@447 | 15 |
QString getCommand(); |
insilmaril@447 | 16 |
QStringList getParameters(); |
insilmaril@432 | 17 |
int paramCount(); |
insilmaril@432 | 18 |
QString errorMessage(); |
insilmaril@432 | 19 |
QString errorDescription(); |
insilmaril@432 | 20 |
ErrorLevel errorLevel(); |
insilmaril@432 | 21 |
void setError (ErrorLevel level,const QString &description); |
insilmaril@432 | 22 |
void resetError(); |
insilmaril@432 | 23 |
bool checkParamCount (QList <int> plist); |
insilmaril@432 | 24 |
bool checkParamCount (const int &index); |
insilmaril@432 | 25 |
bool checkParamIsInt (const int &index); |
insilmaril@432 | 26 |
int parInt (bool &,const uint &index); |
insilmaril@432 | 27 |
QString parString(bool &ok,const int &index); |
insilmaril@432 | 28 |
bool parBool (bool &ok, const int &index); |
insilmaril@432 | 29 |
QColor parColor (bool &ok, const int &index); |
insilmaril@432 | 30 |
|
insilmaril@432 | 31 |
void setScript (const QString &); |
insilmaril@432 | 32 |
QString getScript(); |
insilmaril@445 | 33 |
void runScript(); |
insilmaril@447 | 34 |
bool next(); |
insilmaril@432 | 35 |
|
insilmaril@432 | 36 |
|
insilmaril@432 | 37 |
private: |
insilmaril@447 | 38 |
void initParser(); |
insilmaril@447 | 39 |
void initAtom(); |
insilmaril@432 | 40 |
|
insilmaril@432 | 41 |
QString input; |
insilmaril@447 | 42 |
QString atom; |
insilmaril@432 | 43 |
QString com; |
insilmaril@432 | 44 |
QStringList paramList; |
insilmaril@447 | 45 |
int current; |
insilmaril@432 | 46 |
QString script; |
insilmaril@432 | 47 |
|
insilmaril@432 | 48 |
QString errMessage; |
insilmaril@432 | 49 |
QString errDescription; |
insilmaril@432 | 50 |
ErrorLevel errLevel; |
insilmaril@432 | 51 |
}; |
insilmaril@432 | 52 |
|
insilmaril@432 | 53 |
#endif |