-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCodeGenContext_8h_source.html
242 lines (240 loc) · 41.1 KB
/
CodeGenContext_8h_source.html
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!-- HTML header for doxygen 1.8.7-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Elite: RedApple/includes/CodeGenContext.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygenextra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="topbanner"><a href="https://github.com/elite-lang/Elite" title="Elite GitHub Repository"><i class="githublogo"></i></a></div>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('CodeGenContext_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Macros</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">CodeGenContext.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="CodeGenContext_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">* @Author: sxf</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">* @Date: 2015-10-10 18:44:44</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">* @Last Modified by: sxf</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">* @Last Modified time: 2015-12-26 15:10:36</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">*</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">* 代码生成的上下文类, 是C实现宏的最核心功能类</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#ifndef CODE_GEN_CONTENT_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor"></span><span class="preprocessor">#define CODE_GEN_CONTENT_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include "<a class="code" href="ICodeGenContext_8h.html">ICodeGenContext.h</a>"</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classCodeGenContext.html"> 25</a></span> <span class="keyword">class </span><a class="code" href="classCodeGenContext.html">CodeGenContext</a> : <span class="keyword">public</span> <a class="code" href="classICodeGenContext.html">ICodeGenContext</a></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">public</span>:</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <a class="code" href="classCodeGenContext.html#a32763dbc3d42bffe9381e1935b4a5d42">CodeGenContext</a>(<a class="code" href="classNode.html">Node</a>* <a class="code" href="structnode.html">node</a>);</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="classCodeGenContext.html#a56fa41658d0563f5d50cc9b7e371c6e3">~CodeGenContext</a>();</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a90afc8d5f1b02af132bcffe2572d7ed7">PreMacro</a>();</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a3cf9d994f85b597e1dc14e41a4e03499">PreInit</a>();</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a6830113d646228d21b55bb5e1089f2b6">PreTypeInit</a>();</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#aec857fad5fa76210ffd741cec875c134">Init</a>();</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#a692a0fa38d81fd42262db75209bf929f">MacroMake</a>(<a class="code" href="classNode.html">Node</a>* node);</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#ae3d2c9c717635234504994e73c6bb35a"> 65</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#ae3d2c9c717635234504994e73c6bb35a">MacroMakeAll</a>(<a class="code" href="classNode.html">Node</a>* node) {</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classCodeGenContext.html#a692a0fa38d81fd42262db75209bf929f">MacroMake</a>(node);</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  }</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keyword">virtual</span> <a class="code" href="classICodeGenFunction.html">ICodeGenFunction</a>* <a class="code" href="classCodeGenContext.html#a4bbae074fa1f20a54d7e3f3c1b3720fb">getMacro</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& str);</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="comment">// C++注册宏</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="comment">// void AddMacros(const FuncReg* macro_funcs); // 为只添加不替换保留</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a16857666ad96e34b5f5f435ac229ed81">AddOrReplaceMacros</a>(<span class="keyword">const</span> <a class="code" href="struct__funcReg.html">FuncReg</a>* <a class="code" href="packages_2bgc_2src_2main_8cpp.html#a8ff335d4ad7f4dabd247f039b880cd00">macro_funcs</a>);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a16857666ad96e34b5f5f435ac229ed81">AddOrReplaceMacros</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& name, <a class="code" href="classICodeGenFunction.html">ICodeGenFunction</a>* func);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a997c5edde87e4b80b4e324cd615f0708">RemoveAllMacros</a>();</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">// 获取当前模块中已注册的函数</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#a723934127d7eba399b5f4fbba3b4fb43">getFunction</a>(<a class="code" href="classNode.html">Node</a>* node);</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#a723934127d7eba399b5f4fbba3b4fb43">getFunction</a>(<span class="keyword">const</span> std::string& name);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment">// 用户宏的查找与声明设置</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keyword">virtual</span> shared_ptr<MacroModel> <a class="code" href="classCodeGenContext.html#af25977e104f181d534232269f30c8f1f">getUserMacro</a>(<span class="keyword">const</span> std::string& name);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#aeada42f8b4562001cfe5d74f917af003">setUserMacro</a>(<span class="keyword">const</span> std::string& name, <a class="code" href="classNode.html">Node</a>* node);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keyword">virtual</span> shared_ptr<FunctionModel> <a class="code" href="classCodeGenContext.html#a9cc5764d93e9ee88b78bab36112e6954">getFunctionModel</a>(<span class="keyword">const</span> std::string& name);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">virtual</span> shared_ptr<StructModel> <a class="code" href="classCodeGenContext.html#a244f6d250b6bbe114552c44c3e61be1d">getStructModel</a>(<span class="keyword">const</span> std::string& name);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a344881dd13cc6c3f0495e2b873e29bc9">ScanOther</a>(<a class="code" href="classNode.html">Node</a>* node);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="comment">// 类型的定义和查找</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#aae32808c447d9f4dfedeee0f2455ffc0">DefType</a>(<span class="keywordtype">string</span> name, <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> t);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#af5be1c2f37a7918be6f6a004cc191c96">FindType</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& name);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#af5be1c2f37a7918be6f6a004cc191c96">FindType</a>(<a class="code" href="classNode.html">Node</a>*);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#ad95601ea83a1ebd9d0a9f53944b3b4bf">FindSrcType</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& name);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#ad95601ea83a1ebd9d0a9f53944b3b4bf">FindSrcType</a>(<a class="code" href="classNode.html">Node</a>*);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a1f88a32c47f2d2a471f321189e3a3251">DefVar</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& name, <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> addr);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">virtual</span> <a class="code" href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a> <a class="code" href="classCodeGenContext.html#a9ef8bd93b39bc917ba7d031d05b23170">FindVar</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& name);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a2a29b30e1152ae1d50b649998bf716e9">SaveMacros</a>();</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#ab9d36c25b49370f88bd9d8a7f60d7d04">RecoverMacros</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#aae97b254b8d465b11561606ce31ce630"> 139</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classCodeGenContext.html#aae97b254b8d465b11561606ce31ce630">isSave</a>() { <span class="keywordflow">return</span> <a class="code" href="classCodeGenContext.html#a0d822dbd185cb1cb2d2f4434fb109185">_save</a>; }</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a1cad661141d413bedf5d945980bcf6b9"> 140</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a1cad661141d413bedf5d945980bcf6b9">setIsSave</a>(<span class="keywordtype">bool</span> save) { <a class="code" href="classCodeGenContext.html#a0d822dbd185cb1cb2d2f4434fb109185">_save</a> = save; }</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keyword">virtual</span> <span class="keywordtype">id</span>* <a class="code" href="classCodeGenContext.html#a8f2f9344b59ea32fc1f20b9fceeaab83">FindST</a>(<a class="code" href="classNode.html">Node</a>* node) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keyword">virtual</span> <span class="keywordtype">id</span>* <a class="code" href="classCodeGenContext.html#a8f2f9344b59ea32fc1f20b9fceeaab83">FindST</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& str) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#af2a3c50c86076a42971ed4f8bda8a8a4"> 144</a></span>  <a class="code" href="classIDTable.html">IDTable</a>* <a class="code" href="classCodeGenContext.html#af2a3c50c86076a42971ed4f8bda8a8a4">st</a>;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a6b53503e08cf4d2b493d1fafd74e1710"> 150</a></span>  <span class="keyword">virtual</span> <a class="code" href="classllcg.html">llcg</a>* <a class="code" href="classCodeGenContext.html#a6b53503e08cf4d2b493d1fafd74e1710">getLLCG</a>() { <span class="keywordflow">return</span> <a class="code" href="classCodeGenContext.html#a625e90f37ea3b12d75e5501faac473bb">codeGenerator</a>; }</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">private</span>:</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a625e90f37ea3b12d75e5501faac473bb"> 154</a></span>  <a class="code" href="classllcg.html">llcg</a>* <a class="code" href="classCodeGenContext.html#a625e90f37ea3b12d75e5501faac473bb">codeGenerator</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a5f7523d8f52dc51a30dc4eccc23cd720"> 160</a></span>  <a class="code" href="classNode.html">Node</a>* <a class="code" href="classCodeGenContext.html#a5f7523d8f52dc51a30dc4eccc23cd720">root</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a41420fd366affb639a9dba7dc024b7f3"> 166</a></span>  map<string, ICodeGenFunction*> <a class="code" href="classCodeGenContext.html#a41420fd366affb639a9dba7dc024b7f3">macro_map</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a5b3f7e53a92f728853c922f51408f51d"> 172</a></span>  stack<map<string, ICodeGenFunction*> > <a class="code" href="classCodeGenContext.html#a5b3f7e53a92f728853c922f51408f51d">macro_save_stack</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> </div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordtype">void</span> <a class="code" href="classCodeGenContext.html#a393599f1078e115b938461605fad6ded">setNormalType</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classCodeGenContext.html#a0d822dbd185cb1cb2d2f4434fb109185"> 179</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classCodeGenContext.html#a0d822dbd185cb1cb2d2f4434fb109185">_save</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> };</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> </div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="preprocessor">#endif // CODE_GEN_CONTENT_H</span></div>
<div class="ttc" id="classCodeGenContext_html_a344881dd13cc6c3f0495e2b873e29bc9"><div class="ttname"><a href="classCodeGenContext.html#a344881dd13cc6c3f0495e2b873e29bc9">CodeGenContext::ScanOther</a></div><div class="ttdeci">virtual void ScanOther(Node *node)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:51</div></div>
<div class="ttc" id="classCodeGenContext_html_ae3d2c9c717635234504994e73c6bb35a"><div class="ttname"><a href="classCodeGenContext.html#ae3d2c9c717635234504994e73c6bb35a">CodeGenContext::MacroMakeAll</a></div><div class="ttdeci">virtual void MacroMakeAll(Node *node)</div><div class="ttdoc">递归翻译该节点下的所有宏 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:65</div></div>
<div class="ttc" id="structnode_html"><div class="ttname"><a href="structnode.html">node</a></div><div class="ttdoc">lex中正则表达式的节点结构体 </div><div class="ttdef"><b>Definition:</b> Regex.h:27</div></div>
<div class="ttc" id="classCodeGenContext_html_aae97b254b8d465b11561606ce31ce630"><div class="ttname"><a href="classCodeGenContext.html#aae97b254b8d465b11561606ce31ce630">CodeGenContext::isSave</a></div><div class="ttdeci">virtual bool isSave()</div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:139</div></div>
<div class="ttc" id="classCodeGenContext_html_a8f2f9344b59ea32fc1f20b9fceeaab83"><div class="ttname"><a href="classCodeGenContext.html#a8f2f9344b59ea32fc1f20b9fceeaab83">CodeGenContext::FindST</a></div><div class="ttdeci">virtual id * FindST(Node *node) const </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:89</div></div>
<div class="ttc" id="classCodeGenContext_html_a3cf9d994f85b597e1dc14e41a4e03499"><div class="ttname"><a href="classCodeGenContext.html#a3cf9d994f85b597e1dc14e41a4e03499">CodeGenContext::PreInit</a></div><div class="ttdeci">virtual void PreInit()</div><div class="ttdoc">预先扫描类型名称时的初始化,初始化第二趟扫描 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:251</div></div>
<div class="ttc" id="classNode_html"><div class="ttname"><a href="classNode.html">Node</a></div><div class="ttdoc">List的基本组成元素,表示一个代码中的基本节点 </div><div class="ttdef"><b>Definition:</b> Node.h:37</div></div>
<div class="ttc" id="classCodeGenContext_html_a1f88a32c47f2d2a471f321189e3a3251"><div class="ttname"><a href="classCodeGenContext.html#a1f88a32c47f2d2a471f321189e3a3251">CodeGenContext::DefVar</a></div><div class="ttdeci">virtual void DefVar(const string &name, LValue addr)</div><div class="ttdoc">定义一个变量 有可能是全局变量 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:198</div></div>
<div class="ttc" id="classICodeGenFunction_html"><div class="ttname"><a href="classICodeGenFunction.html">ICodeGenFunction</a></div><div class="ttdef"><b>Definition:</b> ICodeGenFunction.h:15</div></div>
<div class="ttc" id="classCodeGenContext_html_a2a29b30e1152ae1d50b649998bf716e9"><div class="ttname"><a href="classCodeGenContext.html#a2a29b30e1152ae1d50b649998bf716e9">CodeGenContext::SaveMacros</a></div><div class="ttdeci">virtual void SaveMacros()</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:235</div></div>
<div class="ttc" id="classCodeGenContext_html_a393599f1078e115b938461605fad6ded"><div class="ttname"><a href="classCodeGenContext.html#a393599f1078e115b938461605fad6ded">CodeGenContext::setNormalType</a></div><div class="ttdeci">void setNormalType()</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:212</div></div>
<div class="ttc" id="classCodeGenContext_html_a692a0fa38d81fd42262db75209bf929f"><div class="ttname"><a href="classCodeGenContext.html#a692a0fa38d81fd42262db75209bf929f">CodeGenContext::MacroMake</a></div><div class="ttdeci">virtual LValue MacroMake(Node *node)</div><div class="ttdoc">这个函数是用来一条条翻译Node宏的 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:17</div></div>
<div class="ttc" id="classCodeGenContext_html_a5f7523d8f52dc51a30dc4eccc23cd720"><div class="ttname"><a href="classCodeGenContext.html#a5f7523d8f52dc51a30dc4eccc23cd720">CodeGenContext::root</a></div><div class="ttdeci">Node * root</div><div class="ttdoc">语法树根节点 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:160</div></div>
<div class="ttc" id="classCodeGenContext_html_aae32808c447d9f4dfedeee0f2455ffc0"><div class="ttname"><a href="classCodeGenContext.html#aae32808c447d9f4dfedeee0f2455ffc0">CodeGenContext::DefType</a></div><div class="ttdeci">virtual void DefType(string name, LValue t)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:147</div></div>
<div class="ttc" id="lvalue_8h_html_a5cf798ba07bb6fdacc84cf8077774eb5"><div class="ttname"><a href="lvalue_8h.html#a5cf798ba07bb6fdacc84cf8077774eb5">LValue</a></div><div class="ttdeci">shared_ptr< lvalue > LValue</div><div class="ttdef"><b>Definition:</b> lvalue.h:17</div></div>
<div class="ttc" id="classCodeGenContext_html_af25977e104f181d534232269f30c8f1f"><div class="ttname"><a href="classCodeGenContext.html#af25977e104f181d534232269f30c8f1f">CodeGenContext::getUserMacro</a></div><div class="ttdeci">virtual shared_ptr< MacroModel > getUserMacro(const std::string &name)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:121</div></div>
<div class="ttc" id="classCodeGenContext_html_a0d822dbd185cb1cb2d2f4434fb109185"><div class="ttname"><a href="classCodeGenContext.html#a0d822dbd185cb1cb2d2f4434fb109185">CodeGenContext::_save</a></div><div class="ttdeci">bool _save</div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:179</div></div>
<div class="ttc" id="classCodeGenContext_html_a90afc8d5f1b02af132bcffe2572d7ed7"><div class="ttname"><a href="classCodeGenContext.html#a90afc8d5f1b02af132bcffe2572d7ed7">CodeGenContext::PreMacro</a></div><div class="ttdeci">virtual void PreMacro()</div><div class="ttdoc">预先扫描宏时的初始化,初始化第一趟扫描 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:261</div></div>
<div class="ttc" id="classCodeGenContext_html_a723934127d7eba399b5f4fbba3b4fb43"><div class="ttname"><a href="classCodeGenContext.html#a723934127d7eba399b5f4fbba3b4fb43">CodeGenContext::getFunction</a></div><div class="ttdeci">virtual LValue getFunction(Node *node)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:97</div></div>
<div class="ttc" id="classCodeGenContext_html_a6b53503e08cf4d2b493d1fafd74e1710"><div class="ttname"><a href="classCodeGenContext.html#a6b53503e08cf4d2b493d1fafd74e1710">CodeGenContext::getLLCG</a></div><div class="ttdeci">virtual llcg * getLLCG()</div><div class="ttdoc">获取低层次代码生成器,目前只有llvm </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:150</div></div>
<div class="ttc" id="classICodeGenContext_html"><div class="ttname"><a href="classICodeGenContext.html">ICodeGenContext</a></div><div class="ttdef"><b>Definition:</b> ICodeGenContext.h:19</div></div>
<div class="ttc" id="classCodeGenContext_html_af2a3c50c86076a42971ed4f8bda8a8a4"><div class="ttname"><a href="classCodeGenContext.html#af2a3c50c86076a42971ed4f8bda8a8a4">CodeGenContext::st</a></div><div class="ttdeci">IDTable * st</div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:144</div></div>
<div class="ttc" id="classCodeGenContext_html_a56fa41658d0563f5d50cc9b7e371c6e3"><div class="ttname"><a href="classCodeGenContext.html#a56fa41658d0563f5d50cc9b7e371c6e3">CodeGenContext::~CodeGenContext</a></div><div class="ttdeci">~CodeGenContext()</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:280</div></div>
<div class="ttc" id="classCodeGenContext_html_aeada42f8b4562001cfe5d74f917af003"><div class="ttname"><a href="classCodeGenContext.html#aeada42f8b4562001cfe5d74f917af003">CodeGenContext::setUserMacro</a></div><div class="ttdeci">virtual void setUserMacro(const std::string &name, Node *node)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:128</div></div>
<div class="ttc" id="classCodeGenContext_html_a997c5edde87e4b80b4e324cd615f0708"><div class="ttname"><a href="classCodeGenContext.html#a997c5edde87e4b80b4e324cd615f0708">CodeGenContext::RemoveAllMacros</a></div><div class="ttdeci">virtual void RemoveAllMacros()</div><div class="ttdoc">移除全部宏指令 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:84</div></div>
<div class="ttc" id="classIDTable_html"><div class="ttname"><a href="classIDTable.html">IDTable</a></div><div class="ttdoc">简易栈式符号表,需要在进入函数后手动压栈等操作 </div><div class="ttdef"><b>Definition:</b> idtable.h:8</div></div>
<div class="ttc" id="classCodeGenContext_html"><div class="ttname"><a href="classCodeGenContext.html">CodeGenContext</a></div><div class="ttdoc">代码生成上下文, 是代码生成中的关键信息存储类 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:25</div></div>
<div class="ttc" id="classllcg_html"><div class="ttname"><a href="classllcg.html">llcg</a></div><div class="ttdoc">核心接口类 底层代码生成器 Low-Level Code Generator 整个底层的聚合接口 </div><div class="ttdef"><b>Definition:</b> llcg.h:26</div></div>
<div class="ttc" id="classCodeGenContext_html_ab9d36c25b49370f88bd9d8a7f60d7d04"><div class="ttname"><a href="classCodeGenContext.html#ab9d36c25b49370f88bd9d8a7f60d7d04">CodeGenContext::RecoverMacros</a></div><div class="ttdeci">virtual void RecoverMacros()</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:239</div></div>
<div class="ttc" id="classCodeGenContext_html_a5b3f7e53a92f728853c922f51408f51d"><div class="ttname"><a href="classCodeGenContext.html#a5b3f7e53a92f728853c922f51408f51d">CodeGenContext::macro_save_stack</a></div><div class="ttdeci">stack< map< string, ICodeGenFunction * > > macro_save_stack</div><div class="ttdoc">这个栈是用来临时保存上面的查询表的 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:172</div></div>
<div class="ttc" id="classCodeGenContext_html_a16857666ad96e34b5f5f435ac229ed81"><div class="ttname"><a href="classCodeGenContext.html#a16857666ad96e34b5f5f435ac229ed81">CodeGenContext::AddOrReplaceMacros</a></div><div class="ttdeci">virtual void AddOrReplaceMacros(const FuncReg *macro_funcs)</div><div class="ttdoc">添加或替换一条宏 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:64</div></div>
<div class="ttc" id="packages_2bgc_2src_2main_8cpp_html_a8ff335d4ad7f4dabd247f039b880cd00"><div class="ttname"><a href="packages_2bgc_2src_2main_8cpp.html#a8ff335d4ad7f4dabd247f039b880cd00">macro_funcs</a></div><div class="ttdeci">static const FuncReg macro_funcs[]</div><div class="ttdef"><b>Definition:</b> main.cpp:42</div></div>
<div class="ttc" id="struct__funcReg_html"><div class="ttname"><a href="struct__funcReg.html">_funcReg</a></div><div class="ttdoc">宏翻译函数注册结构体 </div><div class="ttdef"><b>Definition:</b> CodeGenFunction.h:39</div></div>
<div class="ttc" id="classCodeGenContext_html_a41420fd366affb639a9dba7dc024b7f3"><div class="ttname"><a href="classCodeGenContext.html#a41420fd366affb639a9dba7dc024b7f3">CodeGenContext::macro_map</a></div><div class="ttdeci">map< string, ICodeGenFunction * > macro_map</div><div class="ttdoc">宏定义表,用来查找是否有该宏定义的 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:166</div></div>
<div class="ttc" id="classCodeGenContext_html_a1cad661141d413bedf5d945980bcf6b9"><div class="ttname"><a href="classCodeGenContext.html#a1cad661141d413bedf5d945980bcf6b9">CodeGenContext::setIsSave</a></div><div class="ttdeci">virtual void setIsSave(bool save)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:140</div></div>
<div class="ttc" id="classCodeGenContext_html_a9cc5764d93e9ee88b78bab36112e6954"><div class="ttname"><a href="classCodeGenContext.html#a9cc5764d93e9ee88b78bab36112e6954">CodeGenContext::getFunctionModel</a></div><div class="ttdeci">virtual shared_ptr< FunctionModel > getFunctionModel(const std::string &name)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:110</div></div>
<div class="ttc" id="classCodeGenContext_html_a244f6d250b6bbe114552c44c3e61be1d"><div class="ttname"><a href="classCodeGenContext.html#a244f6d250b6bbe114552c44c3e61be1d">CodeGenContext::getStructModel</a></div><div class="ttdeci">virtual shared_ptr< StructModel > getStructModel(const std::string &name)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:133</div></div>
<div class="ttc" id="ICodeGenContext_8h_html"><div class="ttname"><a href="ICodeGenContext_8h.html">ICodeGenContext.h</a></div></div>
<div class="ttc" id="classCodeGenContext_html_af5be1c2f37a7918be6f6a004cc191c96"><div class="ttname"><a href="classCodeGenContext.html#af5be1c2f37a7918be6f6a004cc191c96">CodeGenContext::FindType</a></div><div class="ttdeci">virtual LValue FindType(const string &name)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:172</div></div>
<div class="ttc" id="classCodeGenContext_html_ad95601ea83a1ebd9d0a9f53944b3b4bf"><div class="ttname"><a href="classCodeGenContext.html#ad95601ea83a1ebd9d0a9f53944b3b4bf">CodeGenContext::FindSrcType</a></div><div class="ttdeci">virtual LValue FindSrcType(const string &name)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:151</div></div>
<div class="ttc" id="classCodeGenContext_html_a9ef8bd93b39bc917ba7d031d05b23170"><div class="ttname"><a href="classCodeGenContext.html#a9ef8bd93b39bc917ba7d031d05b23170">CodeGenContext::FindVar</a></div><div class="ttdeci">virtual LValue FindVar(const string &name)</div><div class="ttdoc">在符号表中查找一个变量 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:202</div></div>
<div class="ttc" id="classCodeGenContext_html_aec857fad5fa76210ffd741cec875c134"><div class="ttname"><a href="classCodeGenContext.html#aec857fad5fa76210ffd741cec875c134">CodeGenContext::Init</a></div><div class="ttdeci">virtual void Init()</div><div class="ttdoc">正式扫描前的初始化 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:266</div></div>
<div class="ttc" id="classCodeGenContext_html_a4bbae074fa1f20a54d7e3f3c1b3720fb"><div class="ttname"><a href="classCodeGenContext.html#a4bbae074fa1f20a54d7e3f3c1b3720fb">CodeGenContext::getMacro</a></div><div class="ttdeci">virtual ICodeGenFunction * getMacro(const string &str)</div><div class="ttdoc">查找一个名称是否为一个C宏 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:45</div></div>
<div class="ttc" id="classCodeGenContext_html_a625e90f37ea3b12d75e5501faac473bb"><div class="ttname"><a href="classCodeGenContext.html#a625e90f37ea3b12d75e5501faac473bb">CodeGenContext::codeGenerator</a></div><div class="ttdeci">llcg * codeGenerator</div><div class="ttdef"><b>Definition:</b> CodeGenContext.h:154</div></div>
<div class="ttc" id="classCodeGenContext_html_a32763dbc3d42bffe9381e1935b4a5d42"><div class="ttname"><a href="classCodeGenContext.html#a32763dbc3d42bffe9381e1935b4a5d42">CodeGenContext::CodeGenContext</a></div><div class="ttdeci">CodeGenContext(Node *node)</div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:272</div></div>
<div class="ttc" id="classCodeGenContext_html_a6830113d646228d21b55bb5e1089f2b6"><div class="ttname"><a href="classCodeGenContext.html#a6830113d646228d21b55bb5e1089f2b6">CodeGenContext::PreTypeInit</a></div><div class="ttdeci">virtual void PreTypeInit()</div><div class="ttdoc">预先扫描类型和函数定义时的初始化,初始化第三趟扫描 </div><div class="ttdef"><b>Definition:</b> CodeGenContext.cpp:256</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.7-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_fb1dbf84419a0512642bc84350a32c62.html">RedApple</a></li><li class="navelem"><a class="el" href="dir_125373505b90ecc962e4090cea3a22c6.html">includes</a></li><li class="navelem"><a class="el" href="CodeGenContext_8h.html">CodeGenContext.h</a></li>
</ul>
</div>
</body>
</html>