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 ...
随机推荐
- Centos7 安装mysql 5.7 教程
安装 yum 源 需要在系统上启用 MySQL 5.7 Community Release YUM 存储库.用于 yum 存储库配置的 rpm 包可在 MySQL 的官方网站上找到. 首先将最新的My ...
- Linux开发C++
首先在windows上安装linux系统. VM简介 VMware Workstation中文版是一个"虚拟 PC"软件.它使你可以在一台机器上同时运行二个或更多 Windows. ...
- Linux中使用Makefile来运行QuestaSim
环境:Win7x64,VMware15.0,centOS7.0,QuestaSim10.7c 假设已经编辑好了一个全加器还有运行这个DUT的testbech,代码如下: 点击查看代码 // filen ...
- vue学习 第二天 CSS基础
CSS: 层叠样式表 ( Cascading Style Sheets ) 的简称 1.css简介 1)也是一种标记语言 2)主要用来设置html页面中,标签的样式. 3)css美化了html页面, ...
- datax在win10中的安装
datax安装需要的环境 JDK(1.8以上,推荐1.8) Python(推荐Python2.7.X) Apache Maven 3.x (Compile DataX) 这里只讲下python的安装和 ...
- spring 理念与项目构建
spring理念: 使现有的技术更容易使用,其本身是一个大杂烩,整合了现有的技术框架. ssh: struct2 spring hibernate ssm :springmvc spring myba ...
- SVN 提交失败 Unexpected HTTP status 200 'OK' on 'PUT' request to
提交SVN 时 提示 Commit Failed Unexpected HTTP status 200 'OK' on 'PUT' request to 旧的文件在SVN 上也无法删除,删除文件 ...
- idea字体的大小设置
idea字体大小设置 两个方法,滚轮.固定大小设置 固定字体大小 file--settings--editor--font--size 修改为需要大小字号,例如20,点击ok 菜单栏的大小设置也差不多 ...
- 【转载】C++标准库容器与C#容器对比
转载自栈他喵的又溢出了 我简单的整理一下,方便观看: C#容器 C++容器 备注 Array C array .net的Array可以是非0起始索引(鸡肋?查了一下,用Array.CreateInst ...
- Libusb测试USB device(2)
因为测试的比较混乱,我就按照我的问题导向来描述我的过程吧 一. 提示libusb_context对象为NULL的错误: 在简化的过程中,我没有加入dev_handler判断为空就进行了具体的工作: 1 ...