/** * @module ccpu * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) * @brief class for parsing simple scriptfiles * @date 17.04.2009 */ #ifndef CCPU_H #define CCPU_H #include #include #include #include "cprogram.h" #include "cmem.h" #include "cinstruction.h" /** * @class CCPU * * Parses a simple line based scriptfile with some limitations: * first function (starting a block) must be a read-command, * last must be a write-command (ending this block). * * read- and write-commands have hard coded parameters, number#1 being a filetype. * Classes handling certain filetypes must be of type CFile. * Custom functions will be passed to CFile::callFunc(). * * On error ParserError will be thrown. */ class CCPU { public: /** * @method CScriptparser * @brief Default ctor * @param scriptfile filename of script to parse * @return - * @globalvars none * @exception bad_alloc * @conditions none */ CCPU(const std::string& progfile, const std::string& memfile); /** * @method ~CScriptparser * @brief Default dtor * @param - * @return - * @globalvars none * @exception none * @conditions none */ ~CCPU() {} void proceed(); void execInstruction( CInstruction& instr, std::vector& i_list); private: /* members */ CProgram m_program; CMem m_memory; std::map m_instrtype; bool f_zero, f_sign; // std::string m_memfiler; }; #endif /* vim: set et sw=2 ts=2: */