diff -r 000000000000 -r 658ad3bc0c8a parser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/parser.h Sat Mar 31 09:28:27 2007 +0000 @@ -0,0 +1,49 @@ +#ifndef PARSER_H +#define PARSER_H + +#include +#include + +enum ErrorLevel {NoError,Warning,Aborted}; + +class Parser +{ +public: + Parser(); + void parseAtom (const QString &input); + QString command(); + QStringList parameters(); + int paramCount(); + QString errorMessage(); + QString errorDescription(); + ErrorLevel errorLevel(); + void setError (ErrorLevel level,const QString &description); + void resetError(); + bool checkParamCount (QList plist); + bool checkParamCount (const int &index); + bool checkParamIsInt (const int &index); + int parInt (bool &,const uint &index); + QString parString(bool &ok,const int &index); + bool parBool (bool &ok, const int &index); + QColor parColor (bool &ok, const int &index); + + void setScript (const QString &); + QString getScript(); + void startScript(); + bool next(); + + +private: + void initCommand(); + + QString input; + QString com; + QStringList paramList; + QString script; + + QString errMessage; + QString errDescription; + ErrorLevel errLevel; +}; + +#endif