1 //----------------------------------------------------------------------------
\r
3 // Compile intermediate code into native C++ code
\r
4 // $Date: 2003/02/20 00:24:16 $
\r
6 //----------------------------------------------------------------------------
\r
7 #ifndef QCOMPILERCODE_H
\r
8 #define QCOMPILERCODE_H
\r
13 #include "QCompiler.h"
\r
14 #include "QParseInfo.h"
\r
16 class QCompilerCode : public QCompiler {
\r
18 QCompilerCode(const char * const = "qcpp_result.qdt");
\r
19 QCompilerCode(std::istream &is, const char * const = "qcpp_result.qdt");
\r
20 virtual ~QCompilerCode();
\r
21 void SaveToStream(std::ostream &os);
\r
22 void SaveToFile(const char * const filename);
\r
25 virtual bool CompileOneLine(const QParseInfo &pinfo);
\r
26 virtual void CatchError(const QParseInfo &pinfo, const int at);
\r
28 // Utility functions
\r
29 void WriteHeader(std::ostream &os);
\r
30 void WriteQBits(std::ostream &os, const int &t1);
\r
31 void WriteFooter(std::ostream &os);
\r
32 void WriteCNot (std::ostream &os, const int &t1, const int &c1);
\r
33 void WriteCCNot (std::ostream &os, const int &t1, const int &c1, const int &c2);
\r
34 void WriteCRot (std::ostream &os, const int &t1, const int &c1, const double rad);
\r
35 void WriteHadam (std::ostream &os, const int &t1);
\r
36 //TODO: additional controls
\r
39 std::string mTargetName;
\r
40 std::vector<QParseInfo> mQParseInfo;
\r
43 #endif //QCOMPILERCODE_H
\r