blob: dfd39a80266bdf8433c8cc657a8910f69c0ce8ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>mycpu: mycpu/cprogram.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>mycpu/cprogram.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CPROGRAM_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CPROGRAM_H 1</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <vector></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include <set></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include <map></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include "cinstruction.h"</span>
<a name="l00015"></a>00015
<a name="l00022"></a><a class="code" href="classCProgram.html">00022</a> <span class="keyword">class </span><a class="code" href="classCProgram.html">CProgram</a>
<a name="l00023"></a>00023 : <span class="keyword">public</span> std::vector<CInstruction *>
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 <span class="keyword">public</span>:
<a name="l00035"></a>00035 <a class="code" href="classCProgram.html#74d3ca01d5e8b892f37684254ae546ed" title="Default ctor.">CProgram</a>();
<a name="l00036"></a>00036
<a name="l00046"></a>00046 <a class="code" href="classCProgram.html#7dfeb30706e7af06114fdf18262d7926" title="Default dtor.">~CProgram</a>();
<a name="l00047"></a>00047
<a name="l00057"></a><a class="code" href="classCProgram.html#8d5dc184872d4616d327c87ffa665804">00057</a> <span class="keyword">const</span> std::map<std::string, unsigned>& <a class="code" href="classCProgram.html#8d5dc184872d4616d327c87ffa665804" title="get reference to labels map">getLabels</a>()<span class="keyword"> const</span>
<a name="l00058"></a>00058 <span class="keyword"> </span>{
<a name="l00059"></a>00059 <span class="keywordflow">return</span> m_labels;
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061
<a name="l00071"></a>00071 <span class="keywordtype">unsigned</span> <a class="code" href="classCProgram.html#4c29c5c7932174242c50fd9d1c5bc1ec" title="search for label">findLabel</a>(<span class="keyword">const</span> std::string& label) <span class="keyword">const</span>;
<a name="l00072"></a>00072
<a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classCProgram.html#e75e8a7709afcebc7f1537db247f9671" title="create instructions from parsing stream">compile</a>(std::istream& in);
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="preprocessor">#if DEBUG</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="keywordtype">void</span> dump(std::ostream& out);
<a name="l00095"></a>00095 <span class="preprocessor">#endif</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>
<a name="l00097"></a>00097 <span class="keyword">private</span>:
<a name="l00098"></a>00098 <span class="comment">/* members */</span>
<a name="l00100"></a>00100 std::set<CInstruction *> m_instrset;
<a name="l00101"></a>00101 std::map<std::string, unsigned> m_labels;
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="preprocessor">#endif</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span>
<a name="l00106"></a>00106 <span class="comment">/* vim: set et sw=2 ts=2: */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu May 14 18:19:16 2009 for mycpu by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
|