Coder Social home page Coder Social logo

minidecaf's Introduction

MiniDecaf Python

依赖

  • Python >= 3.9
  • requirements.txt 里的 python 库,包括 ply 和 argparse。
  • RISC-V 运行环境

运行

python3 main.py --input <testcase.c> [--riscv/--tac/--parse]

各参数意义如下:

参数 含义
input 输入的 Minidecaf 代码位置
riscv 输出 RISC-V 汇编
tac 输出三地址码
parse 输出抽象语法树

代码结构

minidecaf/
    frontend/       前端(与中端)
        ast/        语法树定义
        lexer/      词法分析
        parser/     语法分析
        type/       类型定义
        symbol/     符号定义
        scope/      作用域定义
        typecheck/  语义分析(符号表构建、类型检查)
        tacgen/     中间代码 TAC 生成
    backend/        后端
        dataflow/   数据流分析
        reg/        寄存器分配
        riscv/      RISC-V 平台相关
    utils/          底层类
        label/      标签定义
        tac/        TAC 定义和基本类

minidecaf's People

Stargazers

Larry Xu 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.