diff options
Diffstat (limited to 'ue4/mycpu/cprogram.h')
| -rw-r--r-- | ue4/mycpu/cprogram.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ue4/mycpu/cprogram.h b/ue4/mycpu/cprogram.h index 43193ac..d8f7d5e 100644 --- a/ue4/mycpu/cprogram.h +++ b/ue4/mycpu/cprogram.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #include "instructions.h" | 21 | #include "instructions.h" |
| 22 | 22 | ||
| 23 | /* forward declare CInstruction */ | 23 | /* forward declare CInstruction */ |
| 24 | template <class T> | 24 | template<class T=CDat<int>, int width=0> |
| 25 | class CInstruction; | 25 | class CInstruction; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| @@ -30,7 +30,7 @@ class CInstruction; | |||
| 30 | * CProgram extends std::vector and adds a method for parsing | 30 | * CProgram extends std::vector and adds a method for parsing |
| 31 | * programfile. This adds instances of CInstruction to CProgram itself. | 31 | * programfile. This adds instances of CInstruction to CProgram itself. |
| 32 | */ | 32 | */ |
| 33 | template <class T> | 33 | template<class T=CDat<int>, int width=0> |
| 34 | class CProgram | 34 | class CProgram |
| 35 | : public std::vector<CInstruction<T> *> | 35 | : public std::vector<CInstruction<T> *> |
| 36 | { | 36 | { |
| @@ -122,7 +122,7 @@ class CProgram | |||
| 122 | 122 | ||
| 123 | /*----------------------------------------------------------------------------*/ | 123 | /*----------------------------------------------------------------------------*/ |
| 124 | 124 | ||
| 125 | template <class T> | 125 | template<class T=CDat<int>, int width=0> |
| 126 | CProgram<T>::CProgram() | 126 | CProgram<T>::CProgram() |
| 127 | { | 127 | { |
| 128 | m_instrset.insert(new CInstructionInc<T>); | 128 | m_instrset.insert(new CInstructionInc<T>); |
| @@ -143,7 +143,7 @@ CProgram<T>::CProgram() | |||
| 143 | 143 | ||
| 144 | /*----------------------------------------------------------------------------*/ | 144 | /*----------------------------------------------------------------------------*/ |
| 145 | 145 | ||
| 146 | template <class T> | 146 | template<class T=CDat<int>, int width=0> |
| 147 | CProgram<T>::~CProgram() | 147 | CProgram<T>::~CProgram() |
| 148 | { | 148 | { |
| 149 | /* free instruction set */ | 149 | /* free instruction set */ |
| @@ -157,7 +157,7 @@ CProgram<T>::~CProgram() | |||
| 157 | 157 | ||
| 158 | /*----------------------------------------------------------------------------*/ | 158 | /*----------------------------------------------------------------------------*/ |
| 159 | 159 | ||
| 160 | template <class T> | 160 | template<class T=CDat<int>, int width=0> |
| 161 | void CProgram<T>::compile(std::istream& in) | 161 | void CProgram<T>::compile(std::istream& in) |
| 162 | { | 162 | { |
| 163 | if (!in.good()) | 163 | if (!in.good()) |
| @@ -241,7 +241,7 @@ void CProgram<T>::compile(std::istream& in) | |||
| 241 | 241 | ||
| 242 | /*----------------------------------------------------------------------------*/ | 242 | /*----------------------------------------------------------------------------*/ |
| 243 | 243 | ||
| 244 | template <class T> | 244 | template<class T=CDat<int>, int width=0> |
| 245 | unsigned CProgram<T>::findLabel(const std::string& label) const | 245 | unsigned CProgram<T>::findLabel(const std::string& label) const |
| 246 | { | 246 | { |
| 247 | std::map<std::string, unsigned>::const_iterator it; | 247 | std::map<std::string, unsigned>::const_iterator it; |
| @@ -254,7 +254,7 @@ unsigned CProgram<T>::findLabel(const std::string& label) const | |||
| 254 | /*----------------------------------------------------------------------------*/ | 254 | /*----------------------------------------------------------------------------*/ |
| 255 | 255 | ||
| 256 | #if DEBUG | 256 | #if DEBUG |
| 257 | template <class T> | 257 | template<class T=CDat<int>, int width=0> |
| 258 | void CProgram<T>::dump(std::ostream& out) | 258 | void CProgram<T>::dump(std::ostream& out) |
| 259 | { | 259 | { |
| 260 | out << "[PROGRAM DUMP]" << std::endl; | 260 | out << "[PROGRAM DUMP]" << std::endl; |
