Browse Subversion Repository
Contents of /trunk/compiler/QCompilerCntl.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: 1009 byte(s)
First commit
| 1 |
//---------------------------------------------------------------------------- |
| 2 |
// Compile intermediates into list of the calc units |
| 3 |
//---------------------------------------------------------------------------- |
| 4 |
#ifndef QCOMPILERCNTL_H |
| 5 |
#define QCOMPILERCNTL_H |
| 6 |
|
| 7 |
#include <iostream> |
| 8 |
#include <vector> |
| 9 |
#include "QCompiler.h" |
| 10 |
#include "QParseInfo.h" |
| 11 |
#include "QCalcUnit.h" |
| 12 |
|
| 13 |
class QCompilerCntl : public QCompiler { |
| 14 |
protected: |
| 15 |
int mNumOfQBits; |
| 16 |
|
| 17 |
public: |
| 18 |
QCompilerCntl(void); |
| 19 |
QCompilerCntl(std::istream &is); |
| 20 |
virtual ~QCompilerCntl(); |
| 21 |
int GetNumberOfControl(void) { |
| 22 |
return mQParseInfo.size(); |
| 23 |
} |
| 24 |
QCalcUnit *AllocateControl(const unsigned int index); |
| 25 |
void Clear(void) { |
| 26 |
mQParseInfo.clear(); |
| 27 |
} |
| 28 |
int GetNumberOfQBits(void) { |
| 29 |
return mNumOfQBits; |
| 30 |
} |
| 31 |
|
| 32 |
protected: |
| 33 |
std::vector<QParseInfo> mQParseInfo; |
| 34 |
virtual bool CompileOneLine(const QParseInfo &pinfo); |
| 35 |
virtual void CatchError(const QParseInfo &pinfo, const int at); |
| 36 |
}; |
| 37 |
|
| 38 |
#endif //QCOMPILERCNTL_H |
|