﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-lwch-随笔分类-CMinus</title><link>http://www.cppblog.com/lwch/category/14813.html</link><description>【QQ:510134884】【Email:lwch4@163.com】</description><language>zh-cn</language><lastBuildDate>Wed, 01 Sep 2010 11:23:52 GMT</lastBuildDate><pubDate>Wed, 01 Sep 2010 11:23:52 GMT</pubDate><ttl>60</ttl><item><title>已完成CMinus部分虚拟机代码生成</title><link>http://www.cppblog.com/lwch/archive/2010/09/01/125522.html</link><dc:creator>lwch</dc:creator><author>lwch</author><pubDate>Wed, 01 Sep 2010 08:09:00 GMT</pubDate><guid>http://www.cppblog.com/lwch/archive/2010/09/01/125522.html</guid><wfw:comment>http://www.cppblog.com/lwch/comments/125522.html</wfw:comment><comments>http://www.cppblog.com/lwch/archive/2010/09/01/125522.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lwch/comments/commentRss/125522.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lwch/services/trackbacks/125522.html</trackback:ping><description><![CDATA[输入文件:
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">&nbsp;1</span>&nbsp;<span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;abc,def;<br></span><span style="COLOR: #008080">&nbsp;2</span>&nbsp;<span style="COLOR: #000000"><br></span><span style="COLOR: #008080">&nbsp;3</span>&nbsp;<span style="COLOR: #000000"></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;main()<br></span><span style="COLOR: #008080">&nbsp;4</span>&nbsp;<span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">&nbsp;5</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;abc,def;<br></span><span style="COLOR: #008080">&nbsp;6</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;read(abc);<br></span><span style="COLOR: #008080">&nbsp;7</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;write(abc);<br></span><span style="COLOR: #008080">&nbsp;8</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;write(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aaa</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">&nbsp;9</span>&nbsp;<span style="COLOR: #000000">}<br></span><span style="COLOR: #008080">10</span>&nbsp;<span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span>&nbsp;<span style="COLOR: #000000"></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;aaa()<br></span><span style="COLOR: #008080">12</span>&nbsp;<span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">13</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;abc;<br></span><span style="COLOR: #008080">14</span>&nbsp;<span style="COLOR: #000000">}<br></span><span style="COLOR: #008080">15</span>&nbsp;<span style="COLOR: #000000"><br></span><span style="COLOR: #008080">16</span>&nbsp;<span style="COLOR: #000000"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;ddd,fff;</span></div>
<br>生成虚拟机代码为:<br><img height=431 alt="" src="http://www.cppblog.com/images/cppblog_com/lwch/CMinus002.PNG" width=668 border=0><br><br>赋值语句逻辑比较复杂还未完成..
<img src ="http://www.cppblog.com/lwch/aggbug/125522.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lwch/" target="_blank">lwch</a> 2010-09-01 16:09 <a href="http://www.cppblog.com/lwch/archive/2010/09/01/125522.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>已完成CMinus语法分析部分</title><link>http://www.cppblog.com/lwch/archive/2010/08/31/125466.html</link><dc:creator>lwch</dc:creator><author>lwch</author><pubDate>Tue, 31 Aug 2010 15:27:00 GMT</pubDate><guid>http://www.cppblog.com/lwch/archive/2010/08/31/125466.html</guid><wfw:comment>http://www.cppblog.com/lwch/comments/125466.html</wfw:comment><comments>http://www.cppblog.com/lwch/archive/2010/08/31/125466.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lwch/comments/commentRss/125466.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lwch/services/trackbacks/125466.html</trackback:ping><description><![CDATA[<p>分析文件:</p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">&nbsp;1</span>&nbsp;<span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;abc;<br></span><span style="COLOR: #008080">&nbsp;2</span>&nbsp;<span style="COLOR: #000000"><br></span><span style="COLOR: #008080">&nbsp;3</span>&nbsp;<span style="COLOR: #000000"></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;main()<br></span><span style="COLOR: #008080">&nbsp;4</span>&nbsp;<span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">&nbsp;5</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;a,b,c;<br></span><span style="COLOR: #008080">&nbsp;6</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;read(a);<br></span><span style="COLOR: #008080">&nbsp;7</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;write(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aaa</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">&nbsp;8</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;write(a);<br></span><span style="COLOR: #008080">&nbsp;9</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">10</span>&nbsp;<span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">100</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">11</span>&nbsp;<span style="COLOR: #000000">}<br></span><span style="COLOR: #008080">12</span>&nbsp;<span style="COLOR: #000000"><br></span><span style="COLOR: #008080">13</span>&nbsp;<span style="COLOR: #000000"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;cc()<br></span><span style="COLOR: #008080">14</span>&nbsp;<span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">15</span>&nbsp;<span style="COLOR: #000000">}</span></div>
<br>结果:<br><img height=431 alt="" src="http://www.cppblog.com/images/cppblog_com/lwch/CMinus001.PNG" width=668 border=0><br><br>下面的工作则是大量的语义处理... 
<img src ="http://www.cppblog.com/lwch/aggbug/125466.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lwch/" target="_blank">lwch</a> 2010-08-31 23:27 <a href="http://www.cppblog.com/lwch/archive/2010/08/31/125466.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>