Coder Social home page Coder Social logo

tiny-compiler's Introduction

Build Your Own Tiny Compiler

就像标题说的,就只是一个很简单很迷你的编译器。

事情的起因就是我看到了一篇博客,Write your own compiler,于是就有了这个项目。

这个项目分成 3 个部分:

  • #1 词法分析器 tokenizer
  • #2 语法分析器 parser
  • #3 代码生成器 emitter

这个仓库一共有 7 个分支:

  • master: 所有代码
  • tokenizer: 词法分析器的任务说明
  • tokenizer-ans: 完成的词法分析器代码
  • parser: 语法分析器的任务说明
  • parser-ans: 完成的语法分析器代码
  • emitter: 代码生成器的任务说明
  • emitter-ans: 完成的代码生成器代码

建议食用指南:

  • 切换到 tokenizer 分支,阅读 README.md 的内容
  • 补充完成 src/index.ts 的代码
  • 运行 npm t 测试你的代码
  • 切换到 tokenizer-ans 查看参考代码

由于我本人 TypeScript 的水平非常有限,所以大家 be critical。如果有路过的大神希望能指点一二。

tiny-compiler's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.