Giter VIP home page Giter VIP logo

simple_compiler's Introduction

Simple_Compiler

这是一个简单的minic编译器,minic语法可以参见说明文档。

编译器中间经过了三次变化,第一次从minic转为eeyore三地址码,第二次从eeyore转为tigger(实质上是分配了寄存器),第三次从tigger转为riscv汇编语言。

第一个部分最为麻烦,需要将繁杂的minic语句转为三地址码,具体可以在最里层的文件夹查看;第二部分需要进行活性分析并分配寄存器,可以在中层的文件夹查看;第三次只用做简单的一对一翻译工作,没有什么难度,可以在最外层的文件夹查看。

要使用该编译器,可以直接运行最外层文件夹的compile文件,将会在最外层生成三个可执行文件(eeyore、tigger和riscv),实际使用时可以把三者连接起来直接将minic一步翻译到汇编;当然也可以分开使用获得中间代码。

simple_compiler's People

Contributors

hugozhl avatar

Stargazers

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