parser.h
author insilmaril
Tue, 10 Apr 2007 13:22:51 +0000
changeset 446 c56ce5d81cc3
parent 445 0796c5592f00
child 447 72afe12da1c8
permissions -rw-r--r--
1.8.71 Basic support for macros
     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 runScript();
    33 	bool scriptNextAtom();
    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