Code Monkey home page Code Monkey logo

compilingproject's Introduction

编译工程课程实验

1.lab1 词法分析

利用 felx 对 Decaf 词法分析

$ cd lab1
$ flex lexical_analysis/scanner.l
$ gcc lexical_analysis/lex.yy.c  -o lexical_analysis/scanner
$ ./lexical_analysis/scanner < lexical_analysis/test.c

2.lab2 语法分析

利用 bison 对 Decaf 词法分析

$ cd lab2
$ flex scanner.l
$ bison parser.y
$ gcc y.tab.h lex.yy.c parser.tab.c -o parser
$ ./parser < test/test

3.lab3 语义分析

利用 bison 对 Decaf 语义分析

$ cd lab3
$ flex scanner.l
$ bison parser.y
$ g++ symbols.cc ast_symbols.cc ast.cc ast_print.cc lex.yy.c parser.tab.c -o parser -std=c++11
$ ./parser < test/test

4.lab4 汇编代码生成

利用 mips 生成汇编代码

$ cd lab4
$ make
$ ./main < test/array1.decaf

compilingproject's People

Contributors

libaoquan95 avatar

Stargazers

 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.