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. TCP协议之四次挥手

    参考文章 这里 四次挥手过程 四次挥手的过程是全双工的,因此每个方向都必须要进行单独的关闭,这样原则是当一方完成数据发送后发送一个FIN信号给对方,对方收到FIN后就知道这个方向不会再有数据发送过来了 ...

  2. Python爬取亚马逊商品页面

    仍然利用Requests库来实现 1 import requests 2 r=requests.get('https://www.amazon.cn/gp/product/B01M8L5Z3Y') 3 ...

  3. 30分钟熟练使用最常用的ES6,还不学是等着被卷死?

    一. 关于ES6 了解一门技术或者语言,最好的方法就是知道它能做些什么 ES6 , 它是由 ECMA 国际标准化组织,制定的一项脚本语言的标准化规范 那么它为什么会出现呢? 每一次标准的诞生都意味着语 ...

  4. 关于pytest生成测试报告

    之前用pytest集成allure,记录的很清楚确实很好,但是我不知道怎么把生成的所有结果通过邮箱发送 可以使用pytest-html生成的html是这样的 也很清楚 但是!!!!!!!!!!!!!! ...

  5. 【力扣】:N字型

    1 class Solution { 2 public String convert(String s, int numRows) { 3 String resultS = ""; ...

  6. 将bat文件设置为开机启动

    设置该bat文件开机自启动 1.右键计算机–>管理,选择系统工具–>计划任务程序: 2.选择创建任务,在弹出窗口中,输入任务名称,并选择不管用户是否登录都要运行–>使用最高权限运行: ...

  7. filebeat+Elk实现日志收集并使用kibana展示

    工作流程图 通过Filegeat收集日志,将日志的数据推送到kafka然后通过logstash去消费发送到Es,再通过索引的方式将数据用kibana进行展示: 1.部署测试机器规划 ip       ...

  8. 错误提示“com.alibaba.fastjson.JSONException: exepct '[', but string, pos 4, json”解决

    1.错误提示信息如下: com.alibaba.fastjson.JSONException: exepct '[', but string, pos 4, json : "[{" ...

  9. Java基础学习:7、作用域

    1.在Java中,主要的变量就是属性(成员变量)和局部变量. 2.我们说的局部变量一般是指在成员方法中定义的变量. 3.Java作用域分类: 全局变量:作用域为整个类,该类中的方法可以使用. 局部变量 ...

  10. springMVC学习day02

    了解springMVC 1. 了解官网 1.  首先到spring地址去,然后选择项目下面的任何一个子项目,我选择spring framework https://spring.io/ 2.选择spr ...