mycpu/cprogram.h

00001 
00008 #ifndef CPROGRAM_H
00009 #define CPROGRAM_H 1
00010 
00011 #include <vector>
00012 #include <set>
00013 #include <map>
00014 #include "cinstruction.h"
00015 
00022 class CProgram
00023   : public std::vector<CInstruction *>
00024 {
00025   public:
00035     CProgram();
00036 
00046     ~CProgram();
00047 
00057     const std::map<std::string, unsigned>& getLabels() const
00058     {
00059       return m_labels;
00060     }
00061 
00071     unsigned findLabel(const std::string& label) const;
00072 
00082     void compile(std::istream& in);
00083 
00084 #if DEBUG
00085 
00094     void dump(std::ostream& out);
00095 #endif
00096 
00097   private:
00098     /* members */
00100     std::set<CInstruction *> m_instrset;
00101     std::map<std::string, unsigned> m_labels;
00102 };
00103 
00104 #endif
00105 
00106 /* vim: set et sw=2 ts=2: */

Generated on Thu May 14 18:19:16 2009 for mycpu by  doxygen 1.5.3