ComPiler200002:Growing a Compiler
http://www.cs.dartmouth.edu/~mckeeman/cs48/mxcom/gem/html/GrowingCompiler.html
by Bill McKeeman and Lu He
MathWorks and Dartmouth, May 2009
Contents
Abstract
Self-compiling compilers are common. The question is: How far can one go, bootstrapping a (very) small compiler-compiler into more capable compilers?
Context-free grammars are extended to accomodate output. A grammar executing machine (GEM) is introduced which accepts an input text and a grammar, and outputs another text. Both the input text and the output text can also be grammars, permitting the production of ever more powerful grammars. GEM itself can be extended to build-in the capabilities of the previous grammars. The rules of the game require that changing GEM does not add to its original capability -- it merely makes the implementation more robust or faster.
The grammars and the machine have some simple symmetries that lead to actions such as backtracking and decompiling. It is also possible to directly execute bit-strings in the Intel x86 hardware.
Chapters
- Base GEM
- statement of the problem
- executable grammars
- simple examples
- Robust GEM
- pre-entered character classes
- using nowhite, pretty, invert
- GEM with builtin nowhite and chars
- using multi-character input and output symbols
- left-associative arithmetic expressions
- X86 floating point stack
- GEM with builtin multichar symbols
- using Kleene * and + in executable grammars
- Running Intel X86 code
- X86 Assembler
- calculator
- atoi
- Plenty Phrase Names
- BNF
- self
- pretty
Notes
The origin of the idea is a undergraduate thesis (UC Santa Cruz, 1978) written by Doug Michels under the supervsion of Bill McKeeman.
The title is inspired by: Guy Steele's 1998 OOPSLA talk Growing a Language.
Thanks to Steve Johnson for critical advice in the preparation of this presentation.
The default font sizes in Firefox are uncomfortably large for this paper. Try [view][edit][zoom][text only][zoom out][zoom out].
References
- Bill McKeeman Compiler and Compiler Course
- Wikipedia Mealy Machine
- Guy Steele Growing a Language.
- Doug Michels A concise extensible metalanguage for translator implementation
Signatures
- Bill McKeeman , MathWorks Fellow
- Lu He, Computer Science Department, Dartmouth
An earlier version was presented to the Computer Science Colloquium, Stanford, March 4, 2009
ComPiler200002:Growing a Compiler的更多相关文章
- Eclipse编译Android项目时出现的问题:Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead.
Consle: Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead. Please use Andro ...
- Maven错误:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?的解决方法
错误: [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather tha ...
- myeclipse 报错:Set project compiler compliance settings to '1.5'
myeclipse 报错:Set project compiler compliance settings to '1.5' 解决方法:项目右击-->properties-->java c ...
- Thrift报错:Error: Thrift compiler: Failed to translate files. Error: Cannot run program thrift error=2
文章目录 报错: 原因: 解决: 报错: Error: Thrift compiler: Failed to translate files. Error: Cannot run program th ...
- 导入项目报错:Type Java compiler level does not match the version
1,导入项目报错一般是因为缺少jar包或者是jar包冲突 2,导入的jar包版本问题 3,环境需要重新修改,比如build path 中重新add libararies 遇到这种compiler环境问 ...
- 给阿里云主机添加swap分区,解决问题:c++: internal compiler error: Killed (program cc1plus)
前言 今天安装spdlog,一个快速得C++日志库,按照文档步骤,不料出现了一堆错误,像c++: internal compiler error: Killed (program cc1plus)等一 ...
- caffe-ssd编译runtest时候报错:g++: internal compiler error: Killed (program cc1plus)
大哥,你的内存不够了,删点儿东西吧
- Device Tree(二):基本概念
转自:http://www.wowotech.net/linux_kenrel/dt_basic_concept.html 一.前言 一些背景知识(例如:为何要引入Device Tree,这个机制是用 ...
- .NET跨平台:在Linux Ubuntu上编译coreclr/corefx/dnx(20150617)
编译时间:北京2015年6月17日上午 操作系统:Ubuntu 14.04.2 LTS Mono版本:Mono JIT compiler version 4.3.0 (master/3445ac5 T ...
- Java:Remote Debug
Java Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...
随机推荐
- N63050 第十一周运维作业
第十一周 就业和全程班小伙伴本周学习内容: 二十一.Mysql数据库二 1.MySQL的视图函数存储过程触发器和事件管理(64分钟) 2.MySQL用户和权限管理(40分钟) 3.MySQL架构和存储 ...
- 软件测试肖sir__多线程、多进程、多协程
Python并发编程有三种方式: 1.多线程Thread(threading)(读音:思来d,丁).多进程Process(multiprocessing).多协程Coroutine(asyncio) ...
- Nginx基础篇(一)
(一)介绍 Nginx 是开源.高性能.高可靠的 Web 和反向代理服务器,也可以作为邮件代理服务器.而且支持热部署,即几乎可以做到 7 * 24 小时不间断运行,即使运行几个月也不需要重新启动,还能 ...
- MySQL 增加timestamp 列都是000000的时间
问题: 在MySQL 用工具navicat 给表增加 类型为 timestamp 的列的时候 默认值没有具体设置 默认值使用当前时间 CURRENT_TIMESTAMP 函数 导致生成的默认是0000 ...
- 【Frida】启动手机上的Frida插件
运行以下命令可以保证Frida一直在手机上运行,不关机,Frida就不关 adb shell su -c "./data/local/frida-server-15.2.2-android- ...
- jquery 中上传的图片file文件,如果在html img元素中通过src展示 ,可以img的图片src属性直接去等于file文件吗,如果不可以的话,那么src怎么去展示file文件呢
bot回答: Answer: 不可以.文件不能直接设置为 img 元素的 src 属性值.要展示 file 文件,需要在 img 属性中使用 JavaScript 来实现,可以参考以下代码: < ...
- 1.markdown
markdown 使用学习 # +标题名字 选择标题 最多6级 一个#表示加一级 一级最大 字体 对字体加粗等操作 hello **hello** 粗体 hello *hello* 斜体 hello ...
- java 注解基础
java 内置注解 注解 作用 描述 @Override 将覆盖父类中的方法 作用在子类的方法上 @Deprecated 代码被弃用 使用了被@Deprecated注解的代码则编译器将发出警告 @Su ...
- vue3项目在页面退出时弹窗确认--用vant组件Dialog弹窗在路由改变的时候不生效问题
写vue3的H5项目的时候有个需求是回退时弹窗确认是否退出当前页面 一.第一个办法------使用onbeforeRouteLeave路由钩子 const formRouteAbi = localSt ...
- WPS中VB编辑器的安装
本来是因为要转换很多个文件的列的位置,他们格式一样,位置也一样,就是需要转换每个文件中列的位置,一个个操作又很麻烦,因此我在百度中发现了可以使用VBA进行操作,又由于excel里好像有VB编辑器,WP ...