From 431bbac5a99abbccf33500e22aa353ec792eff94 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 13 May 2009 15:29:51 +0200 Subject: * adding -Wno-long-long to all Makefiles * adding execute operator to cinstruction * added labels map for better performance --- ue3/mycpu/cprogram.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ue3/mycpu/cprogram.h') diff --git a/ue3/mycpu/cprogram.h b/ue3/mycpu/cprogram.h index bf161b8..c145832 100644 --- a/ue3/mycpu/cprogram.h +++ b/ue3/mycpu/cprogram.h @@ -10,6 +10,7 @@ #include #include +#include #include "cinstruction.h" /** @@ -43,6 +44,31 @@ class CProgram */ ~CProgram(); + /** + * @method getLabels + * @brief get reference to labels map + * @param - + * @return reference to labels map + * @globalvars none + * @exception none + * @conditions none + */ + const std::map& getLabels() const + { + return m_labels; + } + + /** + * @method findLabel + * @brief search for label + * @param label name of label to search for + * @return index of found label in program + * @globalvars none + * @exception std::runtime_error + * @conditions none + */ + unsigned findLabel(const std::string& label) const; + /** * @method compile * @brief create instructions from parsing stream @@ -71,6 +97,7 @@ class CProgram /* members */ /** set of known instructions */ std::set m_instrset; + std::map m_labels; }; #endif -- cgit v1.2.3