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 ...
随机推荐
- windows的lib与dll
mingw编译出来的动态库的导入库可以直接在vc中直接使用 静态库 lib .a 动态库 dll动态库导入库 lib .dll.a 静态链接库a) 静态链接库的类和函数不需要导出,就能够被其他库调用. ...
- shiyansi
#include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { i ...
- ABAP 委外采购收货调用过账bapi
相关的表: ekko:采购凭证抬头表 用于判断是否委外 ekpo:采购凭证行项目表 用于判断是否委外以及委外采购的数量 resb:获取委外采购单中bom的相应预留 mseg:获取已经委外原材料出库给供 ...
- js 判断条件分支优化
优化前: 1.简单分支优化: 2.复杂分支优化: 3.抽离分支:
- Vue基础之v-if与v-show
Show Time! 说再多不如直接上效果: (一)v-if <div id="app"> <div v-if="flag" class=&q ...
- oracle通过计划任务备份表
1.先手动创建表 create table user01_backup_20210204 select * from user01 commit; 2.清空表 truncate table user0 ...
- 前端框架大比拼:2022年的Vue与React谁更胜一筹?
携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第 18 天,点击查看活动详情 前端框架经历了十多年的争奇斗艳百花齐放,经历了 JSP.jQuery.Ember.Angular.R ...
- QT 连接SQLIte数据库
1.新建一个qt应用程序 2.在.pro文件中添加 sql (下图,可以查看使用方法) 添加结构查看: 3.开始连接数据库 4.运行结果查看: 5.查看数据库文件: 6.使用可视化工具创建一个 ...
- 安全测试-WEB安全渗透测试基础知识(三)
1.3. 域名系统 1.3.1. 域名系统工作原理 DNS解析过程是递归查询的,具体过程如下: 用户要访问域名www.example.com时,先查看本机hosts是否有记录或者本机是否有DNS缓存, ...
- 【Python】【算法】【排序】用Python实现排序的三种算法
class SortTest: def __init__(self): pass # 冒泡排序 def BubbleSort(self, value): if isinstance(value, li ...