diff options
Diffstat (limited to 'ue3/mycpu/cprogram.h')
| -rw-r--r-- | ue3/mycpu/cprogram.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/ue3/mycpu/cprogram.h b/ue3/mycpu/cprogram.h new file mode 100644 index 0000000..bf161b8 --- /dev/null +++ b/ue3/mycpu/cprogram.h | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | /** | ||
| 2 | * @module cprogram | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief TODO | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CPROGRAM_H | ||
| 9 | #define CPROGRAM_H 1 | ||
| 10 | |||
| 11 | #include <vector> | ||
| 12 | #include <set> | ||
| 13 | #include "cinstruction.h" | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @class CProgram | ||
| 17 | * | ||
| 18 | * TODO | ||
| 19 | */ | ||
| 20 | class CProgram | ||
| 21 | : public std::vector<CInstruction *> | ||
| 22 | { | ||
| 23 | public: | ||
| 24 | /** | ||
| 25 | * @method CProgram | ||
| 26 | * @brief Default ctor | ||
| 27 | * @param - | ||
| 28 | * @return - | ||
| 29 | * @globalvars none | ||
| 30 | * @exception none | ||
| 31 | * @conditions none | ||
| 32 | */ | ||
| 33 | CProgram(); | ||
| 34 | |||
| 35 | /** | ||
| 36 | * @method ~CProgram | ||
| 37 | * @brief Default dtor | ||
| 38 | * @param - | ||
| 39 | * @return - | ||
| 40 | * @globalvars none | ||
| 41 | * @exception none | ||
| 42 | * @conditions none | ||
| 43 | */ | ||
| 44 | ~CProgram(); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * @method compile | ||
| 48 | * @brief create instructions from parsing stream | ||
| 49 | * @param in inputstream to read from | ||
| 50 | * @return void | ||
| 51 | * @globalvars none | ||
| 52 | * @exception std::runtime_error | ||
| 53 | * @conditions none | ||
| 54 | */ | ||
| 55 | void compile(std::istream& in); | ||
| 56 | |||
| 57 | #if DEBUG | ||
| 58 | /** | ||
| 59 | * @method dump | ||
| 60 | * @brief dumps contents to outputstream | ||
| 61 | * @param out outputstream to write to | ||
| 62 | * @return void | ||
| 63 | * @globalvars none | ||
| 64 | * @exception none | ||
| 65 | * @conditions none | ||
| 66 | */ | ||
| 67 | void dump(std::ostream& out); | ||
| 68 | #endif | ||
| 69 | |||
| 70 | private: | ||
| 71 | /* members */ | ||
| 72 | /** set of known instructions */ | ||
| 73 | std::set<CInstruction *> m_instrset; | ||
| 74 | }; | ||
| 75 | |||
| 76 | #endif | ||
| 77 | |||
| 78 | /* vim: set et sw=2 ts=2: */ | ||
