Browse Subversion Repository
Contents of /trunk/compiler/QParseInfo.h
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Wed Aug 3 10:14:23 2011 UTC
(12 years, 8 months ago)
by kaityo
File MIME type: text/x-chdr
File size: 1759 byte(s)
First commit
| 1 |
//---------------------------------------------------------------------------- |
| 2 |
// Parse information |
| 3 |
//---------------------------------------------------------------------------- |
| 4 |
#ifndef QPARSEINFO_H |
| 5 |
#define QPARSEINFO_H |
| 6 |
|
| 7 |
#include <iostream> |
| 8 |
#include <string> |
| 9 |
#include <vector> |
| 10 |
|
| 11 |
// --------------------------------------------------------------------------- |
| 12 |
class QParseInfo { |
| 13 |
friend std::ostream &operator<<(std::ostream &os, const QParseInfo &pinfo); |
| 14 |
public: |
| 15 |
static const int er_no_error = 0; |
| 16 |
static const int er_syntax_error = 1; |
| 17 |
static const int er_unknown_operation = 2; |
| 18 |
static const int er_lack_of_arguments = 3; |
| 19 |
static const int er_too_many_arguments = 4; |
| 20 |
static const int er_invalid_arguments = 5; |
| 21 |
|
| 22 |
QParseInfo(const QParseInfo &pinfo); |
| 23 |
QParseInfo(const int _error); |
| 24 |
QParseInfo(const int _operator, |
| 25 |
const std::vector<int> &_targets, |
| 26 |
const double _rotation = 0, |
| 27 |
const bool _result = true, |
| 28 |
const int _error = 0); |
| 29 |
|
| 30 |
~QParseInfo() {} |
| 31 |
|
| 32 |
int getOperator(void) const { |
| 33 |
return mOperator; |
| 34 |
} |
| 35 |
const std::vector<int> &getTargetIndices(void) const { |
| 36 |
return mTargetIndices; |
| 37 |
} |
| 38 |
double getRotation(void) const { |
| 39 |
return mRotation; |
| 40 |
} |
| 41 |
bool getParseResult(void) const { |
| 42 |
return mParseResult; |
| 43 |
} |
| 44 |
int getErrorNo(void) const { |
| 45 |
return mErrorNo; |
| 46 |
} |
| 47 |
private: |
| 48 |
int mOperator; |
| 49 |
std::vector<int> mTargetIndices; |
| 50 |
double mRotation; |
| 51 |
bool mParseResult; |
| 52 |
int mErrorNo; |
| 53 |
}; |
| 54 |
|
| 55 |
std::ostream &operator<<(std::ostream &os, const QParseInfo &pinfo); |
| 56 |
|
| 57 |
#endif //QPARSEINFO_H |
|