diff -r c2ffbc9b832d -r f867269ab8a1 parser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/parser.h Mon Mar 05 23:22:51 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