Giter Site home page Giter Site logo

tiger-compiler's Introduction

Tiger Compiler

构造编译器环境

Linux 4.10 GCC 5.4 Bison 3.0 Flex 2.6 Make 4.1

生成可执行文件环境

在以下环境正常工作:

Linux debian-mips 3.2.0-4-4kc-malta

文件清单

  • LJZ_TC/
    • include/
      • env.h 值环境和类型环境接口
      • escape.h 逃逸分析接口
      • flowgraph.h 数据流图生成接口
      • frame.h 栈帧相关接口
      • graph.h 基本的图结构接口
      • liveness.h 活跃分析接口
      • semant.h 语义分析接口 涉及类型检查和中间代码树
      • symbol.h 符号表接口
      • table.h 基础hash表接口
      • temp.h 临时变量接口
      • translate.h 中间代码翻译接口,由semant调用
      • tree.h 中间代码树数据结构
      • types.h 类型接口
      • canon.h 基本块生成、线性化、trace生成相关接口
      • color.h 寄存器着色接口
      • regalloc.h 寄存器分配相关接口
      • absyn.h 抽象语法树接口
      • assem.h汇编代码接口
      • codegen.h指令选择接口
      • errormsg.h报错接口
      • util.h使用函数接口
    • src/
      • env.c 值环境和类型环境实现
      • escape.c 逃逸分析实现
      • flowgraph.c 数据流图生成实现
      • frame_mips.c 栈帧相关实现
      • graph.c 基本的图结构实现
      • liveness.c 活跃分析实现
      • semant.c 语义分析实现
      • symbol.c 符号表实现
      • table.c 基础hash表实现
      • temp.c 临时变量实现
      • translate.c 中间代码翻译实现
      • tree.c 中间代码树构造函数
      • types.c 类型实现
      • tiger.lex lex词法分析
      • canon.c 基本块生成、线性化、trace生成相关实现
      • color.c 寄存器着色相关实现
      • regalloc.c 寄存器分配相关实现,包含对活性分析的调用
      • tiger.yyacc语法分析
      • absyn.c抽象语法树实现
      • assem.c汇编代码结构实现
      • codegen_mips.c指令选择实现
      • errormsg.c报错函数实现
      • main.c程序入口
      • util.c实用函数实现
    • lib/
      • libtiger.c , libtiger.s TIGER外部函数
      • tigerMain.c, tigerMain.s TIGER程序编译结果示例
    • visualization/ 可视化中间代码树
      • index.html 中间代码树呈现文件
      • ir_vis.txt 生成的原始数据文件
      • index.js 可视化相关处理
      • main.css 可视化处理相关样式
      • Treant.js 可视化用到的库文件
      • Treant.css 可视化用到的库文件
      • vendor 可视化用到的Treant依赖
    • makefile
    • CMakeLists.txt
    • customtests/ 测试用例
    • testcases/ 书本测试用例

构造编译器指南

  • make all

    生成可执行文件LJZ_TC

    注意: 第一次生成时显示没有那个文件或目录为正常现象

  • make clean

    清除依赖文件、目标文件、可执行文件

编译器使用指南

  • LJZ_TC <input file> 如:LJZ_TC customtests/merge.tig 默认输出为a.s 其余选项使用help 查看

  • gcc libtiger.s <assemble file> 连接外部库libtiger.s,生成可执行文件

tiger-compiler's People

Contributors

brickmaker avatar shihaol avatar ssssseason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.