博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
好好学习
bilbo.cublog.cn
管理博客
发表文章
留言
收藏夹
· Compiler
· Unix_Linux
博客圈
音乐
相册
文章
· AutoHotKey
· C/C++
· Caml
· Perl
· Tcl & Expect
· 其他编程语言
· Visual Language
· Compiler Engineering
· Embedded System
· Formal methods
· FieldBus
· Networking
· Hardware Desing
· Safety System
· Unix_Linux
· Software Engineering
· GSM/GSM-R
· 技术幽默
· 读书时间
· Good Resource
· 关注社会
· 胡言乱语
首页
关于作者
姓名:你知道 职业:IT 年龄:每年大一岁 位置:地球 个性介绍:挺笨 Email: bilbo0214@163.com
||
<<
>>
||
我的分类
文章列表 - Compiler Engineering
two good tutorials on compiler construction
<table style="border-collapse: collapse;" width="360" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0"> <tbody><tr height="60"><td width="60" align="center"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody><tr height="20"><td width="40" align="center">文件:</td><td>compiler.rar</td></tr> <tr height="20"><td width="40" align="center">大小:</td><td>749KB</td></tr> <tr height="20"><td width="40" align="center">下载:</td><td><a href="http://blogimg.chinaunix.net/blog/upfile2/080917194730.rar">下载</a></td></tr> </tbody></table> </td></tr> </tbody></table><table style="border-collapse: collapse;" width="360" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0"> <tbody><tr height="60"><td width="60" align="center"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> <table style="border-collapse: collap……
查看全文
发表于:2008-09-17 ┆
阅读(76)
┆
评论(0)
(转)RTL
<DIV> <P align=center><FONT face="Verdana, Arial, Helvetica, sans-serif"><B><FONT size=+2>The Register Transfer Language</FONT></B></FONT></P> <P><FONT face="Verdana, Arial, Helvetica, sans-serif"><B>Why is an intermediate representation necessary?</B><BR>It is of course possible to write a compiler that creates an abstract syntax tree and generates machine code directly from the tree. A compiler like GCC that supports many front- and back-ends would require geometrically many code generators, one for every combination of AST (for each source input langauge) and target machine. When portability and flexibility are paramount, then, it makes sense to translate all ASTs into some intermediate format that can then be used uniformly to generate code for any number of targets.</FONT></P> <P><FONT face="Verdana, Arial, Helvetica, sans-serif">Furthermore, many compiler optimizations are dependent neither on the specifics of a particular abstract syntax nor on a specific type of hardware, bu……
查看全文
发表于:2008-06-11 ┆
阅读(188)
┆
评论(0)
(转)A good article on Stack Machine
<DIV> <P>In this lecture, we will explore the implementation of a variety of stack-based interpreters. The simple architecture described here is sufficient to implement most imperative programming languages.</P> <H2><A name=Stackmachines-Stackmachinearchitecture></A>Stack machine architecture</H2> <P>A generic Von Neumann architecture computer has a processor and memory; a few special-purpose registers are used to implement a stack for function calls and to track the current instruction. A simulator for this architecture might look like the following Java declarations:</P> <DIV class=code> <DIV class=codeContent><PRE class=code-java><SPAN class=code-object>byte</SPAN>[] memory; <SPAN class=code-object>int</SPAN>[] stack; /** Stack pointer */ <SPAN class=code-object>int</SPAN> sp; /** Frame pointer <SPAN class=code-keyword>for</SPAN> function call activation records */ <SPAN class=code-object>int</SPAN> fp; /** Instruction pointer register */ <SPAN class=code-object>……
查看全文
发表于:2008-02-26 ┆
阅读(440)
┆
评论(0)
(转)How to use C++ with Bison
<center> <table class="page_title" border="1" cellpadding="0" cellspacing="0" width="70%"> <tbody><tr> <td> <h1 class="heading" align="center">How to use C++ with Bison, V 1.0.2</h1> </td> </tr> </tbody></table> </center> <p> </p> <h2><span class="heading">Introduction</span></h2> This is a mini-tutorial that describes how to use C++ with Bison. It was done in reply to a thread in comp.compilers that questioned how <i>%union</i> declarations would interfere with C++ strong type checking. <p>I assume that you already know C++ and how to use Bison, so I will talk just about the important parts.</p> <h2><span class="heading">Grammar</span></h2> For the example lets use the following BNF grammar. It's too simple and has ambiguity (it will be solved later on) but it will serve our purposes well enough. <table class="code_sample" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> <td> <pre cl……
查看全文
发表于:2008-02-13 ┆
阅读(707)
┆
评论(3)
(转)Compilers Programming
<br><u><b>Lexer and Parser Generators</b></u><br>- <a href="http://www.cbel.com/Compilers_Programming/index.html?w=9&p=6380&s=9&l=56" target="_blank" onmouseover="f('www.sand-stone.com/'); return t">Visual Parse++ 4.0</a><br>- <a href="http://www.cbel.com/Compilers_Programming/index.html?w=9&p=6380&s=9&l=29" target="_blank" onmouseover="f('www.monmouth.com/~wstr'); return t">Lex/YACC (actually Flex and Bison)</a><br>- <a href="http://www.cbel.com/Compilers_Programming/index.html?w=9&p=6380&s=9&l=49" target="_blank" onmouseover="f('dinosaur.compilertools'); return t">The LEX & YACC Page</a><br>- <a href="http://www.cbel.com/Compilers_Programming/index.html?w=9&p=6380&s=9&l=58" target="_blank" title="Yacc++(R) and the Language Objects Library" onmouseover="f('world.std.com/~compres'); return t">Yacc++(R) and the Language Objects...</a><br>- <a href="http://www.cbel.com/Compilers_Programming/index.html?w=9&p=6380&s=9&l=45……
查看全文
发表于:2008-02-04 ┆
阅读(807)
┆
评论(5)
Dragon Book(2nd edition) Chapter1 Exercise
<div style="text-align: left;"><img src="http://blogimg.chinaunix.net/blog/upfile2/071126003950.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><br><span style="font-weight: bold;">Exercise 1.6.1 </span>: For the block-structured C code of Fig. 1.13(a), indicate the<br>values assigned to w, x, y, and z.<br><span style="font-weight: bold;">Ans.</span><br>w = 13, x = 11, y = 13, z = 11<br><br><span style="font-weight: bold;">Exercise 1.6.2 </span>: Repeat Exercise 1.6.1 for the code of Fig. 1.13(b).<br><span style="font-weight: bold;">Ans.</span><br>w = 9, x = 7, y = 13, z = 11<br><br><div style="text-align: left;"><img src="http://blogimg.chinaunix.net/blog/upfile2/071126004006.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><br><span style="font-weight: bold;">Exercise 1.6.3 </span>: For the block-structured code of Fig. 1.14, assuming the usual<br>static scoping of declarations, give the scope for each of the twelve declarati……
查看全文
发表于:2007-11-26 ┆
阅读(557)
┆
评论(3)
龙书第二版下载地址
http://rapidshare.com/files/63724105/compiler-aho.rar<br><br>搞了几天在明白怎么下载,文件较大而且不能使用下载工具,不过下载后效果不错。<br>
查看全文
发表于:2007-10-25 ┆
阅读(843)
┆
评论(1)
compiler网络资源收集(6)-其它
<BR><U><B>Lexer and Parser Generators</B></U><BR>- <A onmouseover="f('www.monmouth.com/~wstr'); return t" href="http://www.cbel.com/Compilers_Programming/index.html?w=44&p=6380&s=9&l=27" target=_blank><FONT color=#800080>Lex/YACC (actually Flex and Bison)</FONT></A><BR>- <A onmouseover="f('grammatica.percederber'); return t" href="http://www.cbel.com/Compilers_Programming/index.html?w=44&p=6380&s=9&l=17" target=_blank><FONT color=#0000ff>Grammatica</FONT></A><BR>- <A onmouseover="f('haskell.cs.yale.edu/ha'); return t" href="http://www.cbel.com/Compilers_Programming/index.html?w=44&p=6380&s=9&l=18" target=_blank><FONT color=#0000ff>Happy</FONT></A><BR>- <A onmouseover="f('www.is.titech.ac.jp/~s'); return t" href="http://www.cbel.com/Compilers_Programming/index.html?w=44&p=6380&s=9&l=39" target=_blank><FONT color=#0000ff>Rie</FONT></A><BR>- <A onmouseover="f('www.languagesemantics.'); return t" href="http://www.cbel.com/Compilers_Programmin……
查看全文
发表于:2007-10-09 ┆
阅读(910)
┆
评论(0)
编译器领域学者介绍- ALFRED V. AHO
<div align="center"><img src="http://blogimg.chinaunix.net/blog/upfile/070715222329.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><br><br><h3><a name="introduction">简介</a></h3> <p>Aho,哥伦比亚大学的教授,”龙书”的作者,在编译器领域作出了很大的贡献。</p> <font size="2"><a href="file:///E:/Bilbo/06.Compiler%20%20Technique/%E6%95%99%E6%8E%88%28%E7%BC%96%E8%AF%91%E9%A2%86%E5%9F%9F%29/Dick%20Grune.htm#top"><br></a></font> <hr> <h3><a name="address">网站地址</a></h3>http://www1.cs.columbia.edu/~aho/<br><br> <hr> <h3><a name="publication">英文出版物</a></h3>最经典的当然是<br><div align="center"><img src="http://blogimg.chinaunix.net/blog/upfile/070715223202.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><br><br><br><font size="2"><a href="file:///E:/Bilbo/06.Compiler%20%20Technique/%E6%95%99%E6%8E%88%28%E7%BC%96%E8%AF%91%E9%A2%86%E5%9F%9F%29/Dick%20Grune.htm#top"></a></font> <hr> <h3><a name="email">电子邮件</a></h3><font……
查看全文
发表于:2007-07-15 ┆
阅读(891)
┆
评论(0)
compiler网络资源收集(5)-经典书籍
<DIV> <H1>Compiler Construction Textbooks</H1> <HR> <UL> <LI><A href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/a/Aho:Alfred_V=.html" name=AhoSU86><FONT color=#0000ff>Alfred V. Aho</FONT></A>, <A href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/s/Sethi:Ravi.html"><FONT color=#0000ff>Ravi Sethi</FONT></A>, <A href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/u/Ullman:Jeffrey_D=.html"><FONT color=#0000ff>Jeffrey D. Ullman</FONT></A>: Compilers: Princiles, Techniques, and Tools. Addison-Wesley 1986, ISBN 0-201-10088-6<BR> <LI><A href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/a/Allen:Randy.html" name=AllenK2001><FONT color=#0000ff>Randy Allen</FONT></A>, <A href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/k/Kennedy:Ken.html"><FONT color=#0000ff>Ken Kennedy</FONT></A>: Optimizing Compilers for Modern Architectures: A Dependence-based Approach. <A href="http://www.informatik.uni-trier.de/~ley/db/publishers/mk……
查看全文
发表于:2007-07-10 ┆
阅读(1335)
┆
评论(0)
编译器领域学者介绍-Andrew W. Appel
<h3><a name="introduction"></a></h3><div align="center"><img src="http://blogimg.chinaunix.net/blog/upfile/070624210927.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><h3><a name="introduction">简介</a></h3> <p>普林斯顿大学计算机系教授。主要研究领域包括计算机安全、编译器、程序设计语言、类型理论和函数程序设计。最有名的是写了3本编译器方面的教科书。</p> <font size="2"><a href="file:///E:/Bilbo/06.Compiler%20%20Technique/%E6%95%99%E6%8E%88%28%E7%BC%96%E8%AF%91%E9%A2%86%E5%9F%9F%29/Dick%20Grune.htm#top"><br></a></font> <hr> <h3><a name="address">网站地址</a></h3>http://www.cs.princeton.edu/~appel<br><br><font size="2"><a href="file:///E:/Bilbo/06.Compiler%20%20Technique/%E6%95%99%E6%8E%88%28%E7%BC%96%E8%AF%91%E9%A2%86%E5%9F%9F%29/Dick%20Grune.htm#top"></a></font> <hr> <h3><a name="publication">英文出版物</a></h3><ol><li>``Garbage Collection,'' in <i>Topics in Advanced Language Implementation, </i> Peter Lee, ed. MIT Press, 1991. </li><li><a href="http:/……
查看全文
发表于:2007-06-24 ┆
阅读(778)
┆
评论(0)
编译器领域学者介绍-Dick Grune
<h3><a name="introduction"></a></h3><div align="center"><img src="http://blogimg.chinaunix.net/blog/upfile/070624000944.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div><h3><a name="introduction">简介</a></h3> <p>荷兰<a href="http://www.vu.nl/">Vrije</a>大学程序设计语言和编译器构造讲师(注:英文称为 lecturer,按照Dick Grune的在编译领域和程序设计语言领域的水平横向比较,应当比国内的博导水平还要高,评个院士也应该没有问题),精通编译理论和技术,精通程序设计语 言理论,对多种欧洲语言也有广泛的研究,论文数量不多,但质量很高,特别是3本著作都比较有名。对计算机各个领域的几乎都做过深入研究,特别是对论文的注 释很值得一读(能写出注释,说明对论文的内容读的很深,不仅仅是读一遍),是真正的做研究的人。忘记了一个重要的信息,Dick是CVS的创始人,他写了 CVS的shell脚本,也由于其在CVS上的杰出工作,被授予STUG2003年度奖(注:Software Tools User Group,缩写<a href="http://www.usenix.org/about/stug.html">STUG</a>)。</p> <font size="2"><a href="file:///E:/Bilbo/06.Compiler%2……
查看全文
发表于:2007-06-24 ┆
阅读(827)
┆
评论(0)
compiler网络资源收集(4)
<dl><dt>这一部分是我以前搜索过程中积累的资源。</dt><dd><br></dd><dt><a href="http://codeworker.free.fr/" add_date="1149298645" last_visit="1167062400" last_modified="1113562092" id="rdf:#$WBsPR2">CodeWorker- a parsing tool and a source code generator</a> </dt><dt><a href="http://www2-data.informatik.unibw-muenchen.de/DiaGen/" add_date="1149298645" last_visit="1167062400" last_modified="1113562556" id="rdf:#$XBsPR2">DiaGen</a> </dt><dt><a href="http://compilers.iecc.com/" add_date="1149298645" last_visit="1167062400" last_modified="1114401930" id="rdf:#$YBsPR2">The comp.compilers newsgroup</a> </dt><dt><a href="http://fabrice.bellard.free.fr/tcc/" add_date="1149298645" last_visit="1167062400" last_modified="1113911012" id="rdf:#$ZBsPR2">TCC - Tiny C Compiler</a> </dt><dt><a href="http://cm.bell-labs.com/cm/cs/who/dmr/primevalC.html" add_date="1149298645" last_visit="1167062400" last_modified="1113911224" id="rdf:#$.BsPR2">Primeval C- t……
查看全文
发表于:2007-06-04 ┆
阅读(843)
┆
评论(0)
compiler网络资源收集(3)-大学课程
<dl><dt><a href="http://www.cs.tau.ac.il/%7Eyahave/compilation.htm" add_date="1149298642" last_visit="1167062400" last_modified="1112786932" id="rdf:#$hvsPR2">Tel Aviv大学Compilation Course</a> </dt><dt><a href="http://www.cs.bath.ac.uk/%7Ejap/CM30171/" add_date="1149298642" last_visit="1167062400" last_modified="1112786230" id="rdf:#$ivsPR2">BATH大学CM30171-Advanced Compilers</a> </dt><dt><a href="http://www.cs.cornell.edu/courses/cs412/2004sp/" add_date="1149298642" last_visit="1167062400" last_modified="1112849086" id="rdf:#$jvsPR2">Cornell大学CS 412 Introduction to Compilers</a> </dt><dt><a href="http://inst.cs.berkeley.edu/%7Ecs164/f2004/" add_date="1149298642" last_visit="1169869650" last_modified="1112788712" last_charset="ISO-8859-1" id="rdf:#$kvsPR2">Berkeley大学CS164 Programming Languages and Compilers(Fall 2004)</a> </dt><dt><a href="http://www.cs.um.edu.mt/%7Ehzarb/CSM201/main.html" add_date="1149298642" last_visit="116706……
查看全文
发表于:2007-06-04 ┆
阅读(858)
┆
评论(0)
compiler网络资源收集(2)-测试部分
<h4>Compiler Testing</h4> <ol><li>Bailey, Mark W. and Davidson, Jack W., “Automatic Detection and Diagnosis of Faults in Generated Code for Procedure Calls”, IEEE Transactions on Software Engineering, volume 29, issue 11, 2003. An abstract is available online, at <a href="http://csdl.computer.org/comp/trans/ts/2003/11/e1031abs.htm">http://csdl.computer.org/comp/trans/ts/2003/11/e1031abs.htm</a>, as is an earlier version of the full paper, <a href="http://big-oh.cs.hamilton.edu/%7Ebailey/pubs/techreps/TR-2001-1.pdf">http://big-oh.cs.hamilton.edu/~bailey/pubs/techreps/TR-2001-1.pdf</a> </li><li>Bhattacharya, Soumyabrata “ANSI C Test suites,” comp.compilers, <a href="http://compilers.iecc.com/comparch/article/94-10-060">http://compilers.iecc.com/comparch/article/94-10-060</a>, 1994. </li><li>Burgess, C.J. , “Bibliography for Automatic Test Data Generation for Compilers,” comp.compilers, <a href="http://compilers.iecc.com/comparch/article/93-12-06……
查看全文
发表于:2007-06-04 ┆
阅读(1095)
┆
评论(0)
compiler网络资源收集(1)
<h2>Compiler Technology:</h2> <ul><li><strong>Abstract Interpretation</strong> <ul><li><a href="http://www.di.ens.fr/%7Ecousot/aiintro.shtml"><font color="#0000ff">Introduction to AI</font></a> by P. Cousot (<a href="http://www.di.ens.fr/%7Ecousot/COUSOTpapers/"><font color="#0000ff">publications</font></a>) </li><li><a href="http://www.informatik.uni-trier.de/%7Eruttgers/Lexicon/absint/absint.html"><font color="#0000ff">AI of logic programs</font></a> (Universität Trier, Dirk Rüttgers) </li><li><a href="http://www.sics.se/%7Ealf/analysis.shtml"><font color="#0000ff">Program Analysis by AI</font></a> by Sjösland (links!) </li><li><a href="http://www.cl.cam.ac.uk/%7Eam/"><font color="#0000ff">Mycroft Alan</font></a> (Cambridge Univ.) (<a href="http://www.cl.cam.ac.uk/%7Eam/papers/"><font color="#0000ff">publications</font></a>) </li><li><a href="http://www.dat.ruc.dk/%7Emadsr/"><font color="#0000ff">Rosendahl Mads</font></a> (Univ. of Roskilde) (<a href="http://www……
查看全文
发表于:2007-06-03 ┆
阅读(798)
┆
评论(0)
用flex识别注释和字符串的注意事项
今天发现了原来写的一个flex程序的bug,本来是想区分数字和字符串,但是却错误的把字符串中的数字返回了。检查发现是因为模式写的有问题。<br>实际上对于注释和字符串这种模式,正确的方法是发现起始标记的时候让分析程序进入一个新的起始状态,发现结束标记的时候再回到初始的状态,在过程中不匹配其他模式。<br><br>下面是匹配单行注释(以分号开始)和单行字符串的模式。<br>%{<br><br>%}<br><br>%x comment<br>%x string<br><br>%%<br><span style="color: rgb(0, 1, 255);">";" { BEGIN(comment); }</span><br style="color: rgb(0, 1, 255);"><span style="color: rgb(0, 1, 255);"><comment>[^\n]*/\n { BEGIN(INITIAL); }</span><br style="color: rgb(0, 1, 255);"><span style="color: rgb(0, 1, 255);">\" &nbs……
查看全文
发表于:2007-05-24 ┆
阅读(910)
┆
评论(0)
C Mini-preprocessor(转)
一个只支持#define语句的C预处理程序,非常小,但比较经典。<br>来源:《compiler design and construction: tools and techniques(with C and Pascal)》, second Edition, Arthur B. Pyster, Van Nostrand Reinhold Company Inc.,1988.<br><table style="border-collapse: collapse;" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0" width="360"> <tbody><tr height="60"><td align="center" width="60"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr height="20"><td align="center" width="40">文件:</td><td>ginevra.rar</td></tr> <tr height="20"><td align="center" width="40">大小:</td><td>15KB</td></tr> <tr height="20"><td align="center" width="40">下载:</td><td><a href="http://blogimg.chinaunix.net/blog/upfile/070323205241.rar">下载</a></td></tr> </tbody></table> </td></tr> </tbody></table>
查看全文
发表于:2007-03-23 ┆
阅读(822)
┆
评论(0)
DFA最简算法
<DIV>DFA algorithm:<BR> <BR> s <- s0<BR> c <- nextchar;<BR> while c != eof do<BR> s <- move(s,c);<BR> c <- nextchar;<BR> end;<BR> if s is in F then return 'yes'<BR> else return 'no'<BR></DIV> <DIV></DIV>
查看全文
发表于:2007-01-18 ┆
阅读(895)
┆
评论(0)
Flex使用两个小提示
<DIV><STRONG>Flex识别中文的问题</STRONG></DIV> <DIV>用Flex生成的程序默认是识别7位字符的,对于8位字符,在运行过程中可能挂起或崩溃。如果需要支持中文,需要在生成Flex程序时使用-8选项。</DIV> <DIV>>flex++ -CF -8 [文件名]</DIV> <DIV>使用 -CF和-8选项,生成的目标代码将比默认选项要大一些,因为状态转换表要变大。<BR></DIV> <DIV><STRONG>Flex生成程序的改名</STRONG></DIV> <DIV>使用-o选项修改默认的输出文件名lex.yy.c</DIV> <DIV>>flex++ -o[输出文件名] [文件名]<BR></DIV> <DIV></DIV>
查看全文
发表于:2007-01-12 ┆
阅读(930)
┆
评论(0)