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

  1. Base GEM

    • statement of the problem
    • executable grammars
    • simple examples
  2. Robust GEM
    • pre-entered character classes
    • using nowhite, pretty, invert
  3. GEM with builtin nowhite and chars
    • using multi-character input and output symbols
    • left-associative arithmetic expressions
    • X86 floating point stack
  4. GEM with builtin multichar symbols
    • using Kleene * and + in executable grammars
  5. Running Intel X86 code
    • X86 Assembler
    • calculator
    • atoi
  6. 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

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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. myeclipse 报错:Set project compiler compliance settings to '1.5'

    myeclipse 报错:Set project compiler compliance settings to '1.5' 解决方法:项目右击-->properties-->java c ...

  4. 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 ...

  5. 导入项目报错:Type Java compiler level does not match the version

    1,导入项目报错一般是因为缺少jar包或者是jar包冲突 2,导入的jar包版本问题 3,环境需要重新修改,比如build path 中重新add libararies 遇到这种compiler环境问 ...

  6. 给阿里云主机添加swap分区,解决问题:c++: internal compiler error: Killed (program cc1plus)

    前言 今天安装spdlog,一个快速得C++日志库,按照文档步骤,不料出现了一堆错误,像c++: internal compiler error: Killed (program cc1plus)等一 ...

  7. caffe-ssd编译runtest时候报错:g++: internal compiler error: Killed (program cc1plus)

    大哥,你的内存不够了,删点儿东西吧

  8. Device Tree(二):基本概念

    转自:http://www.wowotech.net/linux_kenrel/dt_basic_concept.html 一.前言 一些背景知识(例如:为何要引入Device Tree,这个机制是用 ...

  9. .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 ...

  10. Java:Remote Debug

    Java  Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...

随机推荐

  1. 时间序列分析 2.X 单位根检验

    单位根检验 (基于模型检验序列是否平稳) 趋势平稳序列 \(X_{t}=\beta_{0}+\beta_{1} t+Y_{t}\) \(Y_t\) 为平稳序列, 则称 \(X_t\) 为趋势平稳序列 ...

  2. python实现PDF指定页面旋转

    下面示例代码,是将横向纸张旋转为纵向(根据纸张大小判断纸张方向) 方法一:使用PyPDF2库 from PyPDF2 import PdfFileWriter, PdfFileReader def p ...

  3. JMeter压力测试之环境搭建、脚本调试及报错解决方法(Linux版)

    一.环境部署 后续往服务器上传文件,本文中使用的是xftp,因其不是本文所要讲述的重点,这里不做详解. 第一步:安装所需要版本的JDK,本次使用的是JDK 1.8 下载地址:http://www.or ...

  4. 【Frida】打印方法的调用堆栈

    function printstack() { console.log(Java.use("android.util.Log").getStackTraceString(Java. ...

  5. Unity模型剖切

    效果展示 1.首先先下载一个模型剖切插件Cross-Section插件 没有的下方链接自取 插件下载链接 2.下载之后导入到项目  导入之后的样子如下图 因项目需求需要剖切模型,要使用滑动条进行剖切, ...

  6. mysql正则替换 正宗!

    先看个官方例子 mysql> SELECT REGEXP_REPLACE('a b c', 'b', 'X'); +-----------------------------------+ | ...

  7. 「postOI」Lost Array

    题意 有一个序列 \(A=\{a_1, a_2, ..., a_n\}\),按如下方式构造一个 \((n + 1) \times (n + 1)\) 的矩阵 \(B\): \(B_{i0}=0\)(\ ...

  8. kali修改root用户和密码,以及更新源,超详细教学。

    大家好! 又是你们那个傻傻的河东, 今天来讲修改root用户和更新源. 打开上期的kali虚拟机 开启虚拟机 使出吃奶的劲按"e"键:) 进入下面的界面 然后往下找到 Linux ...

  9. 前后端分离 基于session的验证码功能实现

    前后端分离 基于session的验证码功能实现 1.后端代码 1.1 SessionContextUtils 用于获取session import javax.servlet.http.HttpSes ...

  10. drf Serializer基本使用

    drf序列化 在前后端不分离的项目中,可以使用Django自带的forms组件进行数据验证,也可以使用Django自带的序列化组件对模型表数据进行序列化. 那么在前后端分离的项目中,drf也提供了数据 ...