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 ...
随机推荐
- js中常用Math对象
js中常用Math对象 Math.round()四舍五入 Math.ceil() ->ceil 天花板--->向上取整 Math.floor() 向下取整 Math.floor(-11.1 ...
- VUE学习-过渡 & 动画
过渡 & 动画 Vue 在插入.更新或者移除 DOM 时,提供多种不同方式的应用过渡效果.包括以下工具: 在 CSS 过渡和动画中自动应用 class 在过渡钩子函数中使用 JavaScrip ...
- Mybatis-plus中sql语句各查询条件含义
lt:less than 小于le:less than or equal to 小于等于eq:equal to 等于ne:not equal to 不等于ge:greater than or equa ...
- 【Frida】打印方法的调用堆栈
function printstack() { console.log(Java.use("android.util.Log").getStackTraceString(Java. ...
- Hello,Golang
Hello,Golang 一.开发环境搭建 1. 下载 SDK 1 // Go官网下载地址 2 https://golang.org/dl/ 3 4 // Go官方镜像站(推荐) 5 https: ...
- getClassLoader
类加载器(class loader)用来加载 Java 类到 Java 虚拟机中.一般来说,Java 虚拟机使用 Java 类的方式如下:Java 源程序(.java 文件)在经过 Java 编译器编 ...
- StunServer
Stun 服务器 npm下载stun包 npm i stun -s google stun服务器 google的stun的服务器一般国内访问较慢,所以一般自己搭建一个服务器 const stun = ...
- js 俄罗斯方块 canvas
俄罗斯方块背景- canvans 第一次写不知道说些什么好,直接上代码了@_@... jquery引入 <script src="https://cdn.bootcdn.net/aja ...
- 实现接口开启线程(实现Runnable接口)
步骤 定义类实现Runnable接口 重写run()方法 在测试类创建子类对象 创建线程对象把子类对象作为参数传入构造方法 用线程对象调用start()方法开启线程 //1.类实现Runnable接口 ...
- 使用 docker-compose 安装 es、kibana、mysql、redis、kafka
由于经常的安装虚拟机,每次都要重装环境比较麻烦. 这次写了一个 docker-compose 文件,一次性搞定安装问题. 目录结果如下: --- version: "3.1" ne ...