parser.h
author insilmaril
Sat Mar 31 09:28:27 2007 +0000 (2007-03-31)
changeset 442 dfbc371b7280
child 445 0796c5592f00
permissions -rw-r--r--
1.8.70 Fixes in property window
     1 #ifndef PARSER_H
     2 #define PARSER_H
     3 
     4 #include <QColor>
     5 #include <QStringList>
     6 
     7 enum ErrorLevel {NoError,Warning,Aborted};
     8 
     9 class Parser
    10 {
    11 public:
    12 	Parser();
    13 	void parseAtom (const QString &input);
    14 	QString command();
    15 	QStringList parameters();
    16 	int paramCount();
    17 	QString errorMessage();
    18 	QString errorDescription();
    19 	ErrorLevel errorLevel();
    20 	void setError (ErrorLevel level,const QString &description);
    21 	void resetError();
    22 	bool checkParamCount (QList <int> plist);
    23 	bool checkParamCount (const int &index);
    24 	bool checkParamIsInt (const int &index);
    25 	int parInt (bool &,const uint &index);
    26 	QString parString(bool &ok,const int &index);
    27 	bool parBool (bool &ok, const int &index);
    28 	QColor parColor (bool &ok, const int &index);
    29 
    30 	void setScript (const QString &);
    31 	QString getScript();
    32 	void startScript();
    33 	bool next();
    34 
    35 
    36 private:
    37 	void initCommand();
    38 
    39 	QString input;
    40 	QString com;
    41 	QStringList paramList;
    42 	QString script;
    43 
    44 	QString errMessage;
    45 	QString errDescription;
    46 	ErrorLevel errLevel;
    47 };
    48 
    49 #endif