parser.h
author insilmaril
Wed Apr 25 16:02:54 2007 +0000 (2007-04-25)
changeset 472 83a3be747ad9
parent 445 0796c5592f00
child 514 497fab7d1404
permissions -rw-r--r--
started doxygen documentation
     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 (QString input);
    14 	QString getAtom();
    15 	QString getCommand();
    16 	QStringList getParameters();
    17 	int paramCount();
    18 	QString errorMessage();
    19 	QString errorDescription();
    20 	ErrorLevel errorLevel();
    21 	void setError (ErrorLevel level,const QString &description);
    22 	void resetError();
    23 	bool checkParamCount (QList <int> plist);
    24 	bool checkParamCount (const int &index);
    25 	bool checkParamIsInt (const int &index);
    26 	int parInt (bool &,const uint &index);
    27 	QString parString(bool &ok,const int &index);
    28 	bool parBool (bool &ok, const int &index);
    29 	QColor parColor (bool &ok, const int &index);
    30 
    31 	void setScript (const QString &);
    32 	QString getScript();
    33 	void runScript();
    34 	bool next();
    35 
    36 
    37 private:
    38 	void initParser();
    39 	void initAtom();
    40 
    41 	QString input;
    42 	QString atom;
    43 	QString com;
    44 	QStringList paramList;
    45 	int current;
    46 	QString script;
    47 
    48 	QString errMessage;
    49 	QString errDescription;
    50 	ErrorLevel errLevel;
    51 };
    52 
    53 #endif