parser.h
changeset 432 f867269ab8a1
child 445 0796c5592f00
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser.h	Mon Mar 05 23:22:51 2007 +0000
     1.3 @@ -0,0 +1,49 @@
     1.4 +#ifndef PARSER_H
     1.5 +#define PARSER_H
     1.6 +
     1.7 +#include <QColor>
     1.8 +#include <QStringList>
     1.9 +
    1.10 +enum ErrorLevel {NoError,Warning,Aborted};
    1.11 +
    1.12 +class Parser
    1.13 +{
    1.14 +public:
    1.15 +	Parser();
    1.16 +	void parseAtom (const QString &input);
    1.17 +	QString command();
    1.18 +	QStringList parameters();
    1.19 +	int paramCount();
    1.20 +	QString errorMessage();
    1.21 +	QString errorDescription();
    1.22 +	ErrorLevel errorLevel();
    1.23 +	void setError (ErrorLevel level,const QString &description);
    1.24 +	void resetError();
    1.25 +	bool checkParamCount (QList <int> plist);
    1.26 +	bool checkParamCount (const int &index);
    1.27 +	bool checkParamIsInt (const int &index);
    1.28 +	int parInt (bool &,const uint &index);
    1.29 +	QString parString(bool &ok,const int &index);
    1.30 +	bool parBool (bool &ok, const int &index);
    1.31 +	QColor parColor (bool &ok, const int &index);
    1.32 +
    1.33 +	void setScript (const QString &);
    1.34 +	QString getScript();
    1.35 +	void startScript();
    1.36 +	bool next();
    1.37 +
    1.38 +
    1.39 +private:
    1.40 +	void initCommand();
    1.41 +
    1.42 +	QString input;
    1.43 +	QString com;
    1.44 +	QStringList paramList;
    1.45 +	QString script;
    1.46 +
    1.47 +	QString errMessage;
    1.48 +	QString errDescription;
    1.49 +	ErrorLevel errLevel;
    1.50 +};
    1.51 +
    1.52 +#endif