parser.h
author insilmaril
Wed, 20 Jun 2007 11:05:39 +0000
changeset 520 0ccc00c05a22
parent 514 497fab7d1404
child 539 7dde64ce0577
permissions -rw-r--r--
scripted exports (continued)
     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 parCount();
    18 	QString errorMessage();
    19 	QString errorDescription();
    20 	ErrorLevel errorLevel();
    21 	void setError (ErrorLevel level,const QString &description);
    22 	void resetError();
    23 	bool checkParCount (QList <int> plist);
    24 	bool checkParCount (const int &index);
    25 	bool checkParIsInt (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